1#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6 storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9 #[inline]
10 pub const fn new(storage: Storage) -> Self {
11 Self { storage }
12 }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16 Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18 #[inline]
19 fn extract_bit(byte: u8, index: usize) -> bool {
20 let bit_index = if cfg!(target_endian = "big") {
21 7 - (index % 8)
22 } else {
23 index % 8
24 };
25 let mask = 1 << bit_index;
26 byte & mask == mask
27 }
28 #[inline]
29 pub fn get_bit(&self, index: usize) -> bool {
30 debug_assert!(index / 8 < self.storage.as_ref().len());
31 let byte_index = index / 8;
32 let byte = self.storage.as_ref()[byte_index];
33 Self::extract_bit(byte, index)
34 }
35 #[inline]
36 pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
37 debug_assert!(index / 8 < core::mem::size_of::<Storage>());
38 let byte_index = index / 8;
39 let byte = unsafe {
40 *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
41 };
42 Self::extract_bit(byte, index)
43 }
44 #[inline]
45 fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
46 let bit_index = if cfg!(target_endian = "big") {
47 7 - (index % 8)
48 } else {
49 index % 8
50 };
51 let mask = 1 << bit_index;
52 if val { byte | mask } else { byte & !mask }
53 }
54 #[inline]
55 pub fn set_bit(&mut self, index: usize, val: bool) {
56 debug_assert!(index / 8 < self.storage.as_ref().len());
57 let byte_index = index / 8;
58 let byte = &mut self.storage.as_mut()[byte_index];
59 *byte = Self::change_bit(*byte, index, val);
60 }
61 #[inline]
62 pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
63 debug_assert!(index / 8 < core::mem::size_of::<Storage>());
64 let byte_index = index / 8;
65 let byte = unsafe {
66 (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
67 };
68 unsafe { *byte = Self::change_bit(*byte, index, val) };
69 }
70 #[inline]
71 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
72 debug_assert!(bit_width <= 64);
73 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
74 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
75 let mut val = 0;
76 for i in 0..(bit_width as usize) {
77 if self.get_bit(i + bit_offset) {
78 let index = if cfg!(target_endian = "big") {
79 bit_width as usize - 1 - i
80 } else {
81 i
82 };
83 val |= 1 << index;
84 }
85 }
86 val
87 }
88 #[inline]
89 pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
90 debug_assert!(bit_width <= 64);
91 debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
92 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
93 let mut val = 0;
94 for i in 0..(bit_width as usize) {
95 if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
96 let index = if cfg!(target_endian = "big") {
97 bit_width as usize - 1 - i
98 } else {
99 i
100 };
101 val |= 1 << index;
102 }
103 }
104 val
105 }
106 #[inline]
107 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
108 debug_assert!(bit_width <= 64);
109 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
110 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
111 for i in 0..(bit_width as usize) {
112 let mask = 1 << i;
113 let val_bit_is_set = val & mask == mask;
114 let index = if cfg!(target_endian = "big") {
115 bit_width as usize - 1 - i
116 } else {
117 i
118 };
119 self.set_bit(index + bit_offset, val_bit_is_set);
120 }
121 }
122 #[inline]
123 pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
124 debug_assert!(bit_width <= 64);
125 debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
126 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
127 for i in 0..(bit_width as usize) {
128 let mask = 1 << i;
129 let val_bit_is_set = val & mask == mask;
130 let index = if cfg!(target_endian = "big") {
131 bit_width as usize - 1 - i
132 } else {
133 i
134 };
135 unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
136 }
137 }
138}
139#[repr(C)]
140#[derive(Default)]
141pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
142impl<T> __IncompleteArrayField<T> {
143 #[inline]
144 pub const fn new() -> Self {
145 __IncompleteArrayField(::core::marker::PhantomData, [])
146 }
147 #[inline]
148 pub fn as_ptr(&self) -> *const T {
149 self as *const _ as *const T
150 }
151 #[inline]
152 pub fn as_mut_ptr(&mut self) -> *mut T {
153 self as *mut _ as *mut T
154 }
155 #[inline]
156 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
157 unsafe { ::core::slice::from_raw_parts(self.as_ptr(), len) }
158 }
159 #[inline]
160 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
161 unsafe { ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) }
162 }
163}
164impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
165 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
166 fmt.write_str("__IncompleteArrayField")
167 }
168}
169pub const API_VERSION: u32 = 5701633;
170pub const LFRFID_T5577_BLOCK_COUNT: u32 = 8;
171pub const LFRFID_T5577_POR_DELAY: u32 = 1;
172pub const LFRFID_T5577_ST_TERMINATOR: u32 = 8;
173pub const LFRFID_T5577_PWD: u32 = 16;
174pub const LFRFID_T5577_MAXBLOCK_SHIFT: u32 = 5;
175pub const LFRFID_T5577_AOR: u32 = 512;
176pub const LFRFID_T5577_PSKCF_RF_2: u32 = 0;
177pub const LFRFID_T5577_PSKCF_RF_4: u32 = 1024;
178pub const LFRFID_T5577_PSKCF_RF_8: u32 = 2048;
179pub const LFRFID_T5577_MODULATION_DIRECT: u32 = 0;
180pub const LFRFID_T5577_MODULATION_PSK1: u32 = 4096;
181pub const LFRFID_T5577_MODULATION_PSK2: u32 = 8192;
182pub const LFRFID_T5577_MODULATION_PSK3: u32 = 12288;
183pub const LFRFID_T5577_MODULATION_FSK1: u32 = 16384;
184pub const LFRFID_T5577_MODULATION_FSK2: u32 = 20480;
185pub const LFRFID_T5577_MODULATION_FSK1a: u32 = 24576;
186pub const LFRFID_T5577_MODULATION_FSK2a: u32 = 28672;
187pub const LFRFID_T5577_MODULATION_MANCHESTER: u32 = 32768;
188pub const LFRFID_T5577_MODULATION_BIPHASE: u32 = 65536;
189pub const LFRFID_T5577_MODULATION_DIPHASE: u32 = 98304;
190pub const LFRFID_T5577_X_MODE: u32 = 131072;
191pub const LFRFID_T5577_BITRATE_RF_8: u32 = 0;
192pub const LFRFID_T5577_BITRATE_RF_16: u32 = 262144;
193pub const LFRFID_T5577_BITRATE_RF_32: u32 = 524288;
194pub const LFRFID_T5577_BITRATE_RF_40: u32 = 786432;
195pub const LFRFID_T5577_BITRATE_RF_50: u32 = 1048576;
196pub const LFRFID_T5577_BITRATE_RF_64: u32 = 1310720;
197pub const LFRFID_T5577_BITRATE_RF_100: u32 = 1572864;
198pub const LFRFID_T5577_BITRATE_RF_128: u32 = 1835008;
199pub const LFRFID_T5577_TESTMODE_DISABLED: u32 = 1610612736;
200pub type wint_t = core::ffi::c_int;
201pub type __uint_least8_t = core::ffi::c_uchar;
202pub type __int_least16_t = core::ffi::c_short;
203pub type __uint_least16_t = core::ffi::c_ushort;
204pub type _off_t = core::ffi::c_long;
205pub type _fpos_t = core::ffi::c_long;
206#[repr(C)]
207#[derive(Copy, Clone)]
208pub struct _mbstate_t {
209 pub __count: core::ffi::c_int,
210 pub __value: _mbstate_t__bindgen_ty_1,
211}
212#[repr(C)]
213#[derive(Copy, Clone)]
214pub union _mbstate_t__bindgen_ty_1 {
215 pub __wch: wint_t,
216 pub __wchb: [core::ffi::c_uchar; 4usize],
217}
218#[allow(clippy::unnecessary_operation, clippy::identity_op)]
219const _: () = {
220 ["Size of _mbstate_t__bindgen_ty_1"]
221 [::core::mem::size_of::<_mbstate_t__bindgen_ty_1>() - 4usize];
222 ["Alignment of _mbstate_t__bindgen_ty_1"]
223 [::core::mem::align_of::<_mbstate_t__bindgen_ty_1>() - 4usize];
224 ["Offset of field: _mbstate_t__bindgen_ty_1::__wch"]
225 [::core::mem::offset_of!(_mbstate_t__bindgen_ty_1, __wch) - 0usize];
226 ["Offset of field: _mbstate_t__bindgen_ty_1::__wchb"]
227 [::core::mem::offset_of!(_mbstate_t__bindgen_ty_1, __wchb) - 0usize];
228};
229#[allow(clippy::unnecessary_operation, clippy::identity_op)]
230const _: () = {
231 ["Size of _mbstate_t"][::core::mem::size_of::<_mbstate_t>() - 8usize];
232 ["Alignment of _mbstate_t"][::core::mem::align_of::<_mbstate_t>() - 4usize];
233 ["Offset of field: _mbstate_t::__count"][::core::mem::offset_of!(_mbstate_t, __count) - 0usize];
234 ["Offset of field: _mbstate_t::__value"][::core::mem::offset_of!(_mbstate_t, __value) - 4usize];
235};
236pub type __ULong = core::ffi::c_ulong;
237#[repr(C)]
238#[derive(Debug, Copy, Clone)]
239pub struct __lock {
240 _unused: [u8; 0],
241}
242pub type _LOCK_T = *mut __lock;
243unsafe extern "C" {
244 pub fn __retarget_lock_init_recursive(lock: *mut _LOCK_T);
245}
246unsafe extern "C" {
247 pub fn __retarget_lock_close_recursive(lock: _LOCK_T);
248}
249unsafe extern "C" {
250 pub fn __retarget_lock_acquire(lock: _LOCK_T);
251}
252unsafe extern "C" {
253 pub fn __retarget_lock_acquire_recursive(lock: _LOCK_T);
254}
255unsafe extern "C" {
256 pub fn __retarget_lock_release(lock: _LOCK_T);
257}
258unsafe extern "C" {
259 pub fn __retarget_lock_release_recursive(lock: _LOCK_T);
260}
261pub type _flock_t = _LOCK_T;
262#[repr(C)]
263#[derive(Debug, Copy, Clone)]
264pub struct __locale_t {
265 _unused: [u8; 0],
266}
267#[repr(C)]
268#[derive(Debug, Copy, Clone)]
269pub struct _Bigint {
270 pub _next: *mut _Bigint,
271 pub _k: core::ffi::c_int,
272 pub _maxwds: core::ffi::c_int,
273 pub _sign: core::ffi::c_int,
274 pub _wds: core::ffi::c_int,
275 pub _x: [__ULong; 1usize],
276}
277#[allow(clippy::unnecessary_operation, clippy::identity_op)]
278const _: () = {
279 ["Size of _Bigint"][::core::mem::size_of::<_Bigint>() - 24usize];
280 ["Alignment of _Bigint"][::core::mem::align_of::<_Bigint>() - 4usize];
281 ["Offset of field: _Bigint::_next"][::core::mem::offset_of!(_Bigint, _next) - 0usize];
282 ["Offset of field: _Bigint::_k"][::core::mem::offset_of!(_Bigint, _k) - 4usize];
283 ["Offset of field: _Bigint::_maxwds"][::core::mem::offset_of!(_Bigint, _maxwds) - 8usize];
284 ["Offset of field: _Bigint::_sign"][::core::mem::offset_of!(_Bigint, _sign) - 12usize];
285 ["Offset of field: _Bigint::_wds"][::core::mem::offset_of!(_Bigint, _wds) - 16usize];
286 ["Offset of field: _Bigint::_x"][::core::mem::offset_of!(_Bigint, _x) - 20usize];
287};
288#[repr(C)]
289#[derive(Debug, Copy, Clone)]
290pub struct __tm {
291 pub __tm_sec: core::ffi::c_int,
292 pub __tm_min: core::ffi::c_int,
293 pub __tm_hour: core::ffi::c_int,
294 pub __tm_mday: core::ffi::c_int,
295 pub __tm_mon: core::ffi::c_int,
296 pub __tm_year: core::ffi::c_int,
297 pub __tm_wday: core::ffi::c_int,
298 pub __tm_yday: core::ffi::c_int,
299 pub __tm_isdst: core::ffi::c_int,
300}
301#[allow(clippy::unnecessary_operation, clippy::identity_op)]
302const _: () = {
303 ["Size of __tm"][::core::mem::size_of::<__tm>() - 36usize];
304 ["Alignment of __tm"][::core::mem::align_of::<__tm>() - 4usize];
305 ["Offset of field: __tm::__tm_sec"][::core::mem::offset_of!(__tm, __tm_sec) - 0usize];
306 ["Offset of field: __tm::__tm_min"][::core::mem::offset_of!(__tm, __tm_min) - 4usize];
307 ["Offset of field: __tm::__tm_hour"][::core::mem::offset_of!(__tm, __tm_hour) - 8usize];
308 ["Offset of field: __tm::__tm_mday"][::core::mem::offset_of!(__tm, __tm_mday) - 12usize];
309 ["Offset of field: __tm::__tm_mon"][::core::mem::offset_of!(__tm, __tm_mon) - 16usize];
310 ["Offset of field: __tm::__tm_year"][::core::mem::offset_of!(__tm, __tm_year) - 20usize];
311 ["Offset of field: __tm::__tm_wday"][::core::mem::offset_of!(__tm, __tm_wday) - 24usize];
312 ["Offset of field: __tm::__tm_yday"][::core::mem::offset_of!(__tm, __tm_yday) - 28usize];
313 ["Offset of field: __tm::__tm_isdst"][::core::mem::offset_of!(__tm, __tm_isdst) - 32usize];
314};
315#[repr(C)]
316#[derive(Debug, Copy, Clone)]
317pub struct __sbuf {
318 pub _base: *mut core::ffi::c_uchar,
319 pub _size: core::ffi::c_int,
320}
321#[allow(clippy::unnecessary_operation, clippy::identity_op)]
322const _: () = {
323 ["Size of __sbuf"][::core::mem::size_of::<__sbuf>() - 8usize];
324 ["Alignment of __sbuf"][::core::mem::align_of::<__sbuf>() - 4usize];
325 ["Offset of field: __sbuf::_base"][::core::mem::offset_of!(__sbuf, _base) - 0usize];
326 ["Offset of field: __sbuf::_size"][::core::mem::offset_of!(__sbuf, _size) - 4usize];
327};
328#[repr(C)]
329#[derive(Copy, Clone)]
330pub struct __sFILE {
331 pub _p: *mut core::ffi::c_uchar,
332 pub _r: core::ffi::c_int,
333 pub _w: core::ffi::c_int,
334 pub _flags: core::ffi::c_short,
335 pub _file: core::ffi::c_short,
336 pub _bf: __sbuf,
337 pub _lbfsize: core::ffi::c_int,
338 pub _cookie: *mut core::ffi::c_void,
339 pub _read: ::core::option::Option<
340 unsafe extern "C" fn(
341 arg1: *mut _reent,
342 arg2: *mut core::ffi::c_void,
343 arg3: *mut core::ffi::c_char,
344 arg4: core::ffi::c_int,
345 ) -> core::ffi::c_int,
346 >,
347 pub _write: ::core::option::Option<
348 unsafe extern "C" fn(
349 arg1: *mut _reent,
350 arg2: *mut core::ffi::c_void,
351 arg3: *const core::ffi::c_char,
352 arg4: core::ffi::c_int,
353 ) -> core::ffi::c_int,
354 >,
355 pub _seek: ::core::option::Option<
356 unsafe extern "C" fn(
357 arg1: *mut _reent,
358 arg2: *mut core::ffi::c_void,
359 arg3: _fpos_t,
360 arg4: core::ffi::c_int,
361 ) -> _fpos_t,
362 >,
363 pub _close: ::core::option::Option<
364 unsafe extern "C" fn(arg1: *mut _reent, arg2: *mut core::ffi::c_void) -> core::ffi::c_int,
365 >,
366 pub _ub: __sbuf,
367 pub _up: *mut core::ffi::c_uchar,
368 pub _ur: core::ffi::c_int,
369 pub _ubuf: [core::ffi::c_uchar; 3usize],
370 pub _nbuf: [core::ffi::c_uchar; 1usize],
371 pub _lb: __sbuf,
372 pub _blksize: core::ffi::c_int,
373 pub _offset: _off_t,
374 pub _data: *mut _reent,
375 pub _lock: _flock_t,
376 pub _mbstate: _mbstate_t,
377 pub _flags2: core::ffi::c_int,
378}
379#[allow(clippy::unnecessary_operation, clippy::identity_op)]
380const _: () = {
381 ["Size of __sFILE"][::core::mem::size_of::<__sFILE>() - 104usize];
382 ["Alignment of __sFILE"][::core::mem::align_of::<__sFILE>() - 4usize];
383 ["Offset of field: __sFILE::_p"][::core::mem::offset_of!(__sFILE, _p) - 0usize];
384 ["Offset of field: __sFILE::_r"][::core::mem::offset_of!(__sFILE, _r) - 4usize];
385 ["Offset of field: __sFILE::_w"][::core::mem::offset_of!(__sFILE, _w) - 8usize];
386 ["Offset of field: __sFILE::_flags"][::core::mem::offset_of!(__sFILE, _flags) - 12usize];
387 ["Offset of field: __sFILE::_file"][::core::mem::offset_of!(__sFILE, _file) - 14usize];
388 ["Offset of field: __sFILE::_bf"][::core::mem::offset_of!(__sFILE, _bf) - 16usize];
389 ["Offset of field: __sFILE::_lbfsize"][::core::mem::offset_of!(__sFILE, _lbfsize) - 24usize];
390 ["Offset of field: __sFILE::_cookie"][::core::mem::offset_of!(__sFILE, _cookie) - 28usize];
391 ["Offset of field: __sFILE::_read"][::core::mem::offset_of!(__sFILE, _read) - 32usize];
392 ["Offset of field: __sFILE::_write"][::core::mem::offset_of!(__sFILE, _write) - 36usize];
393 ["Offset of field: __sFILE::_seek"][::core::mem::offset_of!(__sFILE, _seek) - 40usize];
394 ["Offset of field: __sFILE::_close"][::core::mem::offset_of!(__sFILE, _close) - 44usize];
395 ["Offset of field: __sFILE::_ub"][::core::mem::offset_of!(__sFILE, _ub) - 48usize];
396 ["Offset of field: __sFILE::_up"][::core::mem::offset_of!(__sFILE, _up) - 56usize];
397 ["Offset of field: __sFILE::_ur"][::core::mem::offset_of!(__sFILE, _ur) - 60usize];
398 ["Offset of field: __sFILE::_ubuf"][::core::mem::offset_of!(__sFILE, _ubuf) - 64usize];
399 ["Offset of field: __sFILE::_nbuf"][::core::mem::offset_of!(__sFILE, _nbuf) - 67usize];
400 ["Offset of field: __sFILE::_lb"][::core::mem::offset_of!(__sFILE, _lb) - 68usize];
401 ["Offset of field: __sFILE::_blksize"][::core::mem::offset_of!(__sFILE, _blksize) - 76usize];
402 ["Offset of field: __sFILE::_offset"][::core::mem::offset_of!(__sFILE, _offset) - 80usize];
403 ["Offset of field: __sFILE::_data"][::core::mem::offset_of!(__sFILE, _data) - 84usize];
404 ["Offset of field: __sFILE::_lock"][::core::mem::offset_of!(__sFILE, _lock) - 88usize];
405 ["Offset of field: __sFILE::_mbstate"][::core::mem::offset_of!(__sFILE, _mbstate) - 92usize];
406 ["Offset of field: __sFILE::_flags2"][::core::mem::offset_of!(__sFILE, _flags2) - 100usize];
407};
408pub type __FILE = __sFILE;
409#[repr(C)]
410#[derive(Debug, Copy, Clone)]
411pub struct _rand48 {
412 pub _seed: [core::ffi::c_ushort; 3usize],
413 pub _mult: [core::ffi::c_ushort; 3usize],
414 pub _add: core::ffi::c_ushort,
415}
416#[allow(clippy::unnecessary_operation, clippy::identity_op)]
417const _: () = {
418 ["Size of _rand48"][::core::mem::size_of::<_rand48>() - 14usize];
419 ["Alignment of _rand48"][::core::mem::align_of::<_rand48>() - 2usize];
420 ["Offset of field: _rand48::_seed"][::core::mem::offset_of!(_rand48, _seed) - 0usize];
421 ["Offset of field: _rand48::_mult"][::core::mem::offset_of!(_rand48, _mult) - 6usize];
422 ["Offset of field: _rand48::_add"][::core::mem::offset_of!(_rand48, _add) - 12usize];
423};
424#[repr(C)]
425#[derive(Copy, Clone)]
426pub struct _reent {
427 pub _errno: core::ffi::c_int,
428 pub _stdin: *mut __FILE,
429 pub _stdout: *mut __FILE,
430 pub _stderr: *mut __FILE,
431 pub _inc: core::ffi::c_int,
432 pub _emergency: [core::ffi::c_char; 25usize],
433 pub _locale: *mut __locale_t,
434 pub __cleanup: ::core::option::Option<unsafe extern "C" fn(arg1: *mut _reent)>,
435 pub _result: *mut _Bigint,
436 pub _result_k: core::ffi::c_int,
437 pub _p5s: *mut _Bigint,
438 pub _freelist: *mut *mut _Bigint,
439 pub _cvtlen: core::ffi::c_int,
440 pub _cvtbuf: *mut core::ffi::c_char,
441 pub _new: _reent__bindgen_ty_1,
442 pub _sig_func: *mut ::core::option::Option<unsafe extern "C" fn(arg1: core::ffi::c_int)>,
443}
444#[repr(C)]
445#[derive(Copy, Clone)]
446pub union _reent__bindgen_ty_1 {
447 pub _reent: _reent__bindgen_ty_1__bindgen_ty_1,
448}
449#[repr(C)]
450#[derive(Copy, Clone)]
451pub struct _reent__bindgen_ty_1__bindgen_ty_1 {
452 pub _strtok_last: *mut core::ffi::c_char,
453 pub _asctime_buf: [core::ffi::c_char; 26usize],
454 pub _localtime_buf: __tm,
455 pub _gamma_signgam: core::ffi::c_int,
456 pub _rand_next: core::ffi::c_ulonglong,
457 pub _r48: _rand48,
458 pub _mblen_state: _mbstate_t,
459 pub _mbtowc_state: _mbstate_t,
460 pub _wctomb_state: _mbstate_t,
461 pub _l64a_buf: [core::ffi::c_char; 8usize],
462 pub _signal_buf: [core::ffi::c_char; 24usize],
463 pub _getdate_err: core::ffi::c_int,
464 pub _mbrlen_state: _mbstate_t,
465 pub _mbrtowc_state: _mbstate_t,
466 pub _mbsrtowcs_state: _mbstate_t,
467 pub _wcrtomb_state: _mbstate_t,
468 pub _wcsrtombs_state: _mbstate_t,
469 pub _h_errno: core::ffi::c_int,
470}
471#[allow(clippy::unnecessary_operation, clippy::identity_op)]
472const _: () = {
473 ["Size of _reent__bindgen_ty_1__bindgen_ty_1"]
474 [::core::mem::size_of::<_reent__bindgen_ty_1__bindgen_ty_1>() - 200usize];
475 ["Alignment of _reent__bindgen_ty_1__bindgen_ty_1"]
476 [::core::mem::align_of::<_reent__bindgen_ty_1__bindgen_ty_1>() - 8usize];
477 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_strtok_last"]
478 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _strtok_last) - 0usize];
479 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_asctime_buf"]
480 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _asctime_buf) - 4usize];
481 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_localtime_buf"]
482 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _localtime_buf) - 32usize];
483 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_gamma_signgam"]
484 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _gamma_signgam) - 68usize];
485 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_rand_next"]
486 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _rand_next) - 72usize];
487 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_r48"]
488 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _r48) - 80usize];
489 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_mblen_state"]
490 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _mblen_state) - 96usize];
491 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_mbtowc_state"]
492 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _mbtowc_state) - 104usize];
493 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_wctomb_state"]
494 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _wctomb_state) - 112usize];
495 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_l64a_buf"]
496 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _l64a_buf) - 120usize];
497 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_signal_buf"]
498 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _signal_buf) - 128usize];
499 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_getdate_err"]
500 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _getdate_err) - 152usize];
501 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_mbrlen_state"]
502 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _mbrlen_state) - 156usize];
503 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_mbrtowc_state"]
504 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _mbrtowc_state) - 164usize];
505 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_mbsrtowcs_state"]
506 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _mbsrtowcs_state) - 172usize];
507 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_wcrtomb_state"]
508 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _wcrtomb_state) - 180usize];
509 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_wcsrtombs_state"]
510 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _wcsrtombs_state) - 188usize];
511 ["Offset of field: _reent__bindgen_ty_1__bindgen_ty_1::_h_errno"]
512 [::core::mem::offset_of!(_reent__bindgen_ty_1__bindgen_ty_1, _h_errno) - 196usize];
513};
514#[allow(clippy::unnecessary_operation, clippy::identity_op)]
515const _: () = {
516 ["Size of _reent__bindgen_ty_1"][::core::mem::size_of::<_reent__bindgen_ty_1>() - 200usize];
517 ["Alignment of _reent__bindgen_ty_1"][::core::mem::align_of::<_reent__bindgen_ty_1>() - 8usize];
518 ["Offset of field: _reent__bindgen_ty_1::_reent"]
519 [::core::mem::offset_of!(_reent__bindgen_ty_1, _reent) - 0usize];
520};
521#[allow(clippy::unnecessary_operation, clippy::identity_op)]
522const _: () = {
523 ["Size of _reent"][::core::mem::size_of::<_reent>() - 288usize];
524 ["Alignment of _reent"][::core::mem::align_of::<_reent>() - 8usize];
525 ["Offset of field: _reent::_errno"][::core::mem::offset_of!(_reent, _errno) - 0usize];
526 ["Offset of field: _reent::_stdin"][::core::mem::offset_of!(_reent, _stdin) - 4usize];
527 ["Offset of field: _reent::_stdout"][::core::mem::offset_of!(_reent, _stdout) - 8usize];
528 ["Offset of field: _reent::_stderr"][::core::mem::offset_of!(_reent, _stderr) - 12usize];
529 ["Offset of field: _reent::_inc"][::core::mem::offset_of!(_reent, _inc) - 16usize];
530 ["Offset of field: _reent::_emergency"][::core::mem::offset_of!(_reent, _emergency) - 20usize];
531 ["Offset of field: _reent::_locale"][::core::mem::offset_of!(_reent, _locale) - 48usize];
532 ["Offset of field: _reent::__cleanup"][::core::mem::offset_of!(_reent, __cleanup) - 52usize];
533 ["Offset of field: _reent::_result"][::core::mem::offset_of!(_reent, _result) - 56usize];
534 ["Offset of field: _reent::_result_k"][::core::mem::offset_of!(_reent, _result_k) - 60usize];
535 ["Offset of field: _reent::_p5s"][::core::mem::offset_of!(_reent, _p5s) - 64usize];
536 ["Offset of field: _reent::_freelist"][::core::mem::offset_of!(_reent, _freelist) - 68usize];
537 ["Offset of field: _reent::_cvtlen"][::core::mem::offset_of!(_reent, _cvtlen) - 72usize];
538 ["Offset of field: _reent::_cvtbuf"][::core::mem::offset_of!(_reent, _cvtbuf) - 76usize];
539 ["Offset of field: _reent::_new"][::core::mem::offset_of!(_reent, _new) - 80usize];
540 ["Offset of field: _reent::_sig_func"][::core::mem::offset_of!(_reent, _sig_func) - 280usize];
541};
542unsafe extern "C" {
543 pub static mut _impure_ptr: *mut _reent;
544}
545unsafe extern "C" {
546 pub static mut _impure_data: _reent;
547}
548unsafe extern "C" {
549 pub fn abort() -> !;
550}
551unsafe extern "C" {
552 pub fn atoi(__nptr: *const core::ffi::c_char) -> core::ffi::c_int;
553}
554unsafe extern "C" {
555 pub fn calloc(arg1: core::ffi::c_uint, arg2: core::ffi::c_uint) -> *mut core::ffi::c_void;
556}
557unsafe extern "C" {
558 pub fn free(arg1: *mut core::ffi::c_void);
559}
560unsafe extern "C" {
561 pub fn malloc(arg1: core::ffi::c_uint) -> *mut core::ffi::c_void;
562}
563unsafe extern "C" {
564 pub fn rand() -> core::ffi::c_int;
565}
566unsafe extern "C" {
567 pub fn realloc(arg1: *mut core::ffi::c_void, arg2: core::ffi::c_uint)
568 -> *mut core::ffi::c_void;
569}
570unsafe extern "C" {
571 pub fn srand(__seed: core::ffi::c_uint);
572}
573unsafe extern "C" {
574 pub fn strtod(__n: *const core::ffi::c_char, __end_PTR: *mut *mut core::ffi::c_char) -> f64;
575}
576unsafe extern "C" {
577 pub fn strtof(__n: *const core::ffi::c_char, __end_PTR: *mut *mut core::ffi::c_char) -> f32;
578}
579unsafe extern "C" {
580 pub fn strtol(
581 __n: *const core::ffi::c_char,
582 __end_PTR: *mut *mut core::ffi::c_char,
583 __base: core::ffi::c_int,
584 ) -> core::ffi::c_long;
585}
586unsafe extern "C" {
587 pub fn strtoul(
588 __n: *const core::ffi::c_char,
589 __end_PTR: *mut *mut core::ffi::c_char,
590 __base: core::ffi::c_int,
591 ) -> core::ffi::c_ulong;
592}
593unsafe extern "C" {
594 pub fn itoa(
595 arg1: core::ffi::c_int,
596 arg2: *mut core::ffi::c_char,
597 arg3: core::ffi::c_int,
598 ) -> *mut core::ffi::c_char;
599}
600unsafe extern "C" {
601 pub fn random() -> core::ffi::c_long;
602}
603unsafe extern "C" {
604 pub fn strtoull(
605 __n: *const core::ffi::c_char,
606 __end_PTR: *mut *mut core::ffi::c_char,
607 __base: core::ffi::c_int,
608 ) -> core::ffi::c_ulonglong;
609}
610pub type uint_least8_t = __uint_least8_t;
611pub type int_least16_t = __int_least16_t;
612pub type uint_least16_t = __uint_least16_t;
613#[repr(C)]
614#[derive(Debug, Copy, Clone)]
615pub struct __FuriCriticalInfo {
616 pub isrm: u32,
617 pub from_isr: bool,
618 pub kernel_running: bool,
619}
620#[allow(clippy::unnecessary_operation, clippy::identity_op)]
621const _: () = {
622 ["Size of __FuriCriticalInfo"][::core::mem::size_of::<__FuriCriticalInfo>() - 8usize];
623 ["Alignment of __FuriCriticalInfo"][::core::mem::align_of::<__FuriCriticalInfo>() - 4usize];
624 ["Offset of field: __FuriCriticalInfo::isrm"]
625 [::core::mem::offset_of!(__FuriCriticalInfo, isrm) - 0usize];
626 ["Offset of field: __FuriCriticalInfo::from_isr"]
627 [::core::mem::offset_of!(__FuriCriticalInfo, from_isr) - 4usize];
628 ["Offset of field: __FuriCriticalInfo::kernel_running"]
629 [::core::mem::offset_of!(__FuriCriticalInfo, kernel_running) - 5usize];
630};
631unsafe extern "C" {
632 pub fn __furi_critical_enter() -> __FuriCriticalInfo;
633}
634unsafe extern "C" {
635 pub fn __furi_critical_exit(info: __FuriCriticalInfo);
636}
637unsafe extern "C" {
638 pub fn strcasecmp(
639 arg1: *const core::ffi::c_char,
640 arg2: *const core::ffi::c_char,
641 ) -> core::ffi::c_int;
642}
643unsafe extern "C" {
644 pub fn strncasecmp(
645 arg1: *const core::ffi::c_char,
646 arg2: *const core::ffi::c_char,
647 arg3: core::ffi::c_uint,
648 ) -> core::ffi::c_int;
649}
650unsafe extern "C" {
651 pub fn memchr(
652 arg1: *const core::ffi::c_void,
653 arg2: core::ffi::c_int,
654 arg3: core::ffi::c_uint,
655 ) -> *mut core::ffi::c_void;
656}
657unsafe extern "C" {
658 pub fn memcmp(
659 arg1: *const core::ffi::c_void,
660 arg2: *const core::ffi::c_void,
661 arg3: core::ffi::c_uint,
662 ) -> core::ffi::c_int;
663}
664unsafe extern "C" {
665 pub fn memcpy(
666 arg1: *mut core::ffi::c_void,
667 arg2: *const core::ffi::c_void,
668 arg3: core::ffi::c_uint,
669 ) -> *mut core::ffi::c_void;
670}
671unsafe extern "C" {
672 pub fn memmove(
673 arg1: *mut core::ffi::c_void,
674 arg2: *const core::ffi::c_void,
675 arg3: core::ffi::c_uint,
676 ) -> *mut core::ffi::c_void;
677}
678unsafe extern "C" {
679 pub fn memset(
680 arg1: *mut core::ffi::c_void,
681 arg2: core::ffi::c_int,
682 arg3: core::ffi::c_uint,
683 ) -> *mut core::ffi::c_void;
684}
685unsafe extern "C" {
686 pub fn strchr(arg1: *const core::ffi::c_char, arg2: core::ffi::c_int)
687 -> *mut core::ffi::c_char;
688}
689unsafe extern "C" {
690 pub fn strcmp(
691 arg1: *const core::ffi::c_char,
692 arg2: *const core::ffi::c_char,
693 ) -> core::ffi::c_int;
694}
695unsafe extern "C" {
696 pub fn strcpy(
697 arg1: *mut core::ffi::c_char,
698 arg2: *const core::ffi::c_char,
699 ) -> *mut core::ffi::c_char;
700}
701unsafe extern "C" {
702 pub fn strcspn(
703 arg1: *const core::ffi::c_char,
704 arg2: *const core::ffi::c_char,
705 ) -> core::ffi::c_uint;
706}
707unsafe extern "C" {
708 pub fn strlen(arg1: *const core::ffi::c_char) -> core::ffi::c_uint;
709}
710unsafe extern "C" {
711 pub fn strncmp(
712 arg1: *const core::ffi::c_char,
713 arg2: *const core::ffi::c_char,
714 arg3: core::ffi::c_uint,
715 ) -> core::ffi::c_int;
716}
717unsafe extern "C" {
718 pub fn strncpy(
719 arg1: *mut core::ffi::c_char,
720 arg2: *const core::ffi::c_char,
721 arg3: core::ffi::c_uint,
722 ) -> *mut core::ffi::c_char;
723}
724unsafe extern "C" {
725 pub fn strrchr(
726 arg1: *const core::ffi::c_char,
727 arg2: core::ffi::c_int,
728 ) -> *mut core::ffi::c_char;
729}
730unsafe extern "C" {
731 pub fn strspn(
732 arg1: *const core::ffi::c_char,
733 arg2: *const core::ffi::c_char,
734 ) -> core::ffi::c_uint;
735}
736unsafe extern "C" {
737 pub fn strstr(
738 arg1: *const core::ffi::c_char,
739 arg2: *const core::ffi::c_char,
740 ) -> *mut core::ffi::c_char;
741}
742unsafe extern "C" {
743 pub fn strcasestr(
744 arg1: *const core::ffi::c_char,
745 arg2: *const core::ffi::c_char,
746 ) -> *mut core::ffi::c_char;
747}
748unsafe extern "C" {
749 pub fn strdup(arg1: *const core::ffi::c_char) -> *mut core::ffi::c_char;
750}
751unsafe extern "C" {
752 pub fn strlcat(
753 arg1: *mut core::ffi::c_char,
754 arg2: *const core::ffi::c_char,
755 arg3: core::ffi::c_uint,
756 ) -> core::ffi::c_uint;
757}
758unsafe extern "C" {
759 pub fn strlcpy(
760 arg1: *mut core::ffi::c_char,
761 arg2: *const core::ffi::c_char,
762 arg3: core::ffi::c_uint,
763 ) -> core::ffi::c_uint;
764}
765unsafe extern "C" {
766 pub static _ctype_: [core::ffi::c_char; 0usize];
767}
768unsafe extern "C" {
769 pub fn __assert_func(
770 arg1: *const core::ffi::c_char,
771 arg2: core::ffi::c_int,
772 arg3: *const core::ffi::c_char,
773 arg4: *const core::ffi::c_char,
774 ) -> !;
775}
776pub type __gnuc_va_list = u32;
777pub type va_list = __gnuc_va_list;
778pub type FILE = __FILE;
779unsafe extern "C" {
780 pub fn sscanf(
781 arg1: *const core::ffi::c_char,
782 arg2: *const core::ffi::c_char,
783 ...
784 ) -> core::ffi::c_int;
785}
786unsafe extern "C" {
787 pub fn snprintf(
788 arg1: *mut core::ffi::c_char,
789 arg2: core::ffi::c_uint,
790 arg3: *const core::ffi::c_char,
791 ...
792 ) -> core::ffi::c_int;
793}
794unsafe extern "C" {
795 #[doc = "Crash system"]
796 pub fn __furi_crash_implementation();
797}
798unsafe extern "C" {
799 #[doc = "Halt system"]
800 pub fn __furi_halt_implementation();
801}
802pub const FuriWaitForever: FuriWait = FuriWait(4294967295);
803#[repr(transparent)]
804#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
805pub struct FuriWait(pub core::ffi::c_uint);
806#[doc = "< Wait for any flag (default)."]
807pub const FuriFlagWaitAny: FuriFlag = FuriFlag(0);
808#[doc = "< Wait for all flags."]
809pub const FuriFlagWaitAll: FuriFlag = FuriFlag(1);
810#[doc = "< Do not clear flags which have been specified to wait for."]
811pub const FuriFlagNoClear: FuriFlag = FuriFlag(2);
812#[doc = "< Error indicator."]
813pub const FuriFlagError: FuriFlag = FuriFlag(2147483648);
814#[doc = "< FuriStatusError (-1)."]
815pub const FuriFlagErrorUnknown: FuriFlag = FuriFlag(4294967295);
816#[doc = "< FuriStatusErrorTimeout (-2)."]
817pub const FuriFlagErrorTimeout: FuriFlag = FuriFlag(4294967294);
818#[doc = "< FuriStatusErrorResource (-3)."]
819pub const FuriFlagErrorResource: FuriFlag = FuriFlag(4294967293);
820#[doc = "< FuriStatusErrorParameter (-4)."]
821pub const FuriFlagErrorParameter: FuriFlag = FuriFlag(4294967292);
822#[doc = "< FuriStatusErrorISR (-6)."]
823pub const FuriFlagErrorISR: FuriFlag = FuriFlag(4294967290);
824#[repr(transparent)]
825#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
826pub struct FuriFlag(pub core::ffi::c_uint);
827#[doc = "< Operation completed successfully."]
828pub const FuriStatusOk: FuriStatus = FuriStatus(0);
829pub const FuriStatusError: FuriStatus = FuriStatus(-1);
830#[doc = "< Operation not completed within the timeout period."]
831pub const FuriStatusErrorTimeout: FuriStatus = FuriStatus(-2);
832#[doc = "< Resource not available."]
833pub const FuriStatusErrorResource: FuriStatus = FuriStatus(-3);
834#[doc = "< Parameter error."]
835pub const FuriStatusErrorParameter: FuriStatus = FuriStatus(-4);
836pub const FuriStatusErrorNoMemory: FuriStatus = FuriStatus(-5);
837pub const FuriStatusErrorISR: FuriStatus = FuriStatus(-6);
838#[doc = "< Prevents enum down-size compiler optimization."]
839pub const FuriStatusReserved: FuriStatus = FuriStatus(2147483647);
840#[repr(transparent)]
841#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
842pub struct FuriStatus(pub core::ffi::c_int);
843#[doc = "< Request (graceful) exit."]
844pub const FuriSignalExit: FuriSignal = FuriSignal(0);
845#[doc = "< Custom signal values start from here."]
846pub const FuriSignalCustom: FuriSignal = FuriSignal(100);
847#[repr(transparent)]
848#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
849pub struct FuriSignal(pub core::ffi::c_uchar);
850#[doc = "Subscribe to In events.\n\n In events occur on the following conditions:\n - One or more items were inserted into a FuriMessageQueue,\n - Enough data has been written to a FuriStreamBuffer,\n - A FuriSemaphore has been released at least once,\n - A FuriMutex has been released."]
851pub const FuriEventLoopEventIn: FuriEventLoopEvent = FuriEventLoopEvent(1);
852#[doc = "Subscribe to Out events.\n\n Out events occur on the following conditions:\n - One or more items were removed from a FuriMessageQueue,\n - Any amount of data has been read out of a FuriStreamBuffer,\n - A FuriSemaphore has been acquired at least once,\n - A FuriMutex has been acquired."]
853pub const FuriEventLoopEventOut: FuriEventLoopEvent = FuriEventLoopEvent(2);
854#[doc = "Special value containing the event direction bits, used internally."]
855pub const FuriEventLoopEventMask: FuriEventLoopEvent = FuriEventLoopEvent(3);
856#[doc = "Use edge triggered events.\n\n By default, level triggered events are used. A level above zero\n is reported based on the following conditions:\n\n In events:\n - a FuriMessageQueue contains one or more items,\n - a FuriStreamBuffer contains one or more bytes,\n - a FuriSemaphore can be acquired at least once,\n - a FuriMutex can be acquired.\n\n Out events:\n - a FuriMessageQueue has at least one item of free space,\n - a FuriStreamBuffer has at least one byte of free space,\n - a FuriSemaphore has been acquired at least once,\n - a FuriMutex has been acquired.\n\n If this flag is NOT set, the event will be generated repeatedly until\n the level becomes zero (e.g. all items have been removed from\n a FuriMessageQueue in case of the \"In\" event, etc.)\n\n If this flag IS set, then the above check is skipped and the event\n is generated ONLY when a change occurs, with the event direction\n (In or Out) taken into account."]
857pub const FuriEventLoopEventFlagEdge: FuriEventLoopEvent = FuriEventLoopEvent(4);
858#[doc = "Automatically unsubscribe from events after one time.\n\n By default, events will be generated each time the specified conditions\n have been met. If this flag IS set, the event subscription will be cancelled\n upon the first occurred event and no further events will be generated."]
859pub const FuriEventLoopEventFlagOnce: FuriEventLoopEvent = FuriEventLoopEvent(8);
860#[doc = "Special value containing the event flag bits, used internally."]
861pub const FuriEventLoopEventFlagMask: FuriEventLoopEvent = FuriEventLoopEvent(4294967292);
862#[doc = "Special value to force the enum to 32-bit values."]
863pub const FuriEventLoopEventReserved: FuriEventLoopEvent = FuriEventLoopEvent(4294967295);
864#[repr(transparent)]
865#[doc = "Enumeration of event types, flags and masks.\n\n Only one event direction (In or Out) can be used per subscription.\n An object can have no more than one subscription for each direction.\n\n Additional flags that modify the behaviour can be\n set using the bitwise OR operation (see flag description)."]
866#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
867pub struct FuriEventLoopEvent(pub core::ffi::c_uint);
868#[repr(C)]
869#[derive(Debug, Copy, Clone)]
870pub struct FuriEventLoop {
871 _unused: [u8; 0],
872}
873unsafe extern "C" {
874 #[doc = "Allocate Event Loop instance\n\n Couple things to keep in mind:\n - You can have 1 event_loop per 1 thread\n - You can not use event_loop instance in the other thread\n - Do not use blocking API to query object delegated to Event Loop\n\n # Returns\n\nThe Event Loop instance"]
875 pub fn furi_event_loop_alloc() -> *mut FuriEventLoop;
876}
877unsafe extern "C" {
878 #[doc = "Free Event Loop instance\n\n # Arguments\n\n* `instance` - The Event Loop instance"]
879 pub fn furi_event_loop_free(instance: *mut FuriEventLoop);
880}
881unsafe extern "C" {
882 #[doc = "Continuously poll for events\n\n Can be stopped with `furi_event_loop_stop`\n\n # Arguments\n\n* `instance` - The Event Loop instance"]
883 pub fn furi_event_loop_run(instance: *mut FuriEventLoop);
884}
885unsafe extern "C" {
886 #[doc = "Stop Event Loop instance\n\n # Arguments\n\n* `instance` - The Event Loop instance"]
887 pub fn furi_event_loop_stop(instance: *mut FuriEventLoop);
888}
889#[doc = "Tick callback type\n\n # Arguments\n\n* `context` - The context for callback"]
890pub type FuriEventLoopTickCallback =
891 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
892unsafe extern "C" {
893 #[doc = "Set Event Loop tick callback\n\n Tick callback is called periodically after specified inactivity time.\n It acts like a low-priority timer: it will only fire if there is time\n left after processing the synchronization primitives and the regular timers.\n Therefore, it is not monotonic: ticks will be skipped if the event loop is busy.\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `interval` (direction in) - The tick interval\n * `callback` (direction in) - The callback to call\n * `context` - The context for callback"]
894 pub fn furi_event_loop_tick_set(
895 instance: *mut FuriEventLoop,
896 interval: u32,
897 callback: FuriEventLoopTickCallback,
898 context: *mut core::ffi::c_void,
899 );
900}
901#[doc = "Timer callback type for functions to be called in a deferred manner.\n\n # Arguments\n\n* `context` (direction in, out) - pointer to a user-specific object that was provided during\n furi_event_loop_pend_callback() call"]
902pub type FuriEventLoopPendingCallback =
903 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
904unsafe extern "C" {
905 #[doc = "Call a function when all preceding timer commands are processed\n\n This function may be useful to call another function when the event loop has been started.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the current FuriEventLoop instance\n * `callback` (direction in) - pointer to the callback to be executed when previous commands have been processed\n * `context` (direction in, out) - pointer to a user-specific object (will be passed to the callback)"]
906 pub fn furi_event_loop_pend_callback(
907 instance: *mut FuriEventLoop,
908 callback: FuriEventLoopPendingCallback,
909 context: *mut core::ffi::c_void,
910 );
911}
912pub type FuriEventLoopObject = core::ffi::c_void;
913#[doc = "Callback type for event loop events\n\n # Arguments\n\n* `object` - The object that triggered the event\n * `context` - The context that was provided upon subscription"]
914pub type FuriEventLoopEventCallback = ::core::option::Option<
915 unsafe extern "C" fn(object: *mut FuriEventLoopObject, context: *mut core::ffi::c_void),
916>;
917#[doc = "Callback type for event loop thread flag events\n\n # Arguments\n\n* `context` - The context that was provided upon subscription"]
918pub type FuriEventLoopThreadFlagsCallback =
919 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
920#[repr(C)]
921#[derive(Debug, Copy, Clone)]
922pub struct FuriEventFlag {
923 _unused: [u8; 0],
924}
925unsafe extern "C" {
926 #[doc = "Subscribe to event flag events\n\n you can only have one subscription for one event type.\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `event_flag` - The event flag to add\n * `event` (direction in) - The Event Loop event to trigger on\n * `callback` (direction in) - The callback to call on event\n * `context` - The context for callback"]
927 pub fn furi_event_loop_subscribe_event_flag(
928 instance: *mut FuriEventLoop,
929 event_flag: *mut FuriEventFlag,
930 event: FuriEventLoopEvent,
931 callback: FuriEventLoopEventCallback,
932 context: *mut core::ffi::c_void,
933 );
934}
935#[repr(C)]
936#[derive(Debug, Copy, Clone)]
937pub struct FuriMessageQueue {
938 _unused: [u8; 0],
939}
940unsafe extern "C" {
941 #[doc = "Subscribe to message queue events\n\n you can only have one subscription for one event type.\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `message_queue` - The message queue to add\n * `event` (direction in) - The Event Loop event to trigger on\n * `callback` (direction in) - The callback to call on event\n * `context` - The context for callback"]
942 pub fn furi_event_loop_subscribe_message_queue(
943 instance: *mut FuriEventLoop,
944 message_queue: *mut FuriMessageQueue,
945 event: FuriEventLoopEvent,
946 callback: FuriEventLoopEventCallback,
947 context: *mut core::ffi::c_void,
948 );
949}
950#[repr(C)]
951#[derive(Debug, Copy, Clone)]
952pub struct FuriStreamBuffer {
953 _unused: [u8; 0],
954}
955unsafe extern "C" {
956 #[doc = "Subscribe to stream buffer events\n\n you can only have one subscription for one event type.\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `stream_buffer` - The stream buffer to add\n * `event` (direction in) - The Event Loop event to trigger on\n * `callback` (direction in) - The callback to call on event\n * `context` - The context for callback"]
957 pub fn furi_event_loop_subscribe_stream_buffer(
958 instance: *mut FuriEventLoop,
959 stream_buffer: *mut FuriStreamBuffer,
960 event: FuriEventLoopEvent,
961 callback: FuriEventLoopEventCallback,
962 context: *mut core::ffi::c_void,
963 );
964}
965#[repr(C)]
966#[derive(Debug, Copy, Clone)]
967pub struct FuriSemaphore {
968 _unused: [u8; 0],
969}
970unsafe extern "C" {
971 #[doc = "Subscribe to semaphore events\n\n you can only have one subscription for one event type.\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `semaphore` - The semaphore to add\n * `event` (direction in) - The Event Loop event to trigger on\n * `callback` (direction in) - The callback to call on event\n * `context` - The context for callback"]
972 pub fn furi_event_loop_subscribe_semaphore(
973 instance: *mut FuriEventLoop,
974 semaphore: *mut FuriSemaphore,
975 event: FuriEventLoopEvent,
976 callback: FuriEventLoopEventCallback,
977 context: *mut core::ffi::c_void,
978 );
979}
980#[repr(C)]
981#[derive(Debug, Copy, Clone)]
982pub struct FuriMutex {
983 _unused: [u8; 0],
984}
985unsafe extern "C" {
986 #[doc = "Subscribe to mutex events\n\n you can only have one subscription for one event type.\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `mutex` - The mutex to add\n * `event` (direction in) - The Event Loop event to trigger on\n * `callback` (direction in) - The callback to call on event\n * `context` - The context for callback"]
987 pub fn furi_event_loop_subscribe_mutex(
988 instance: *mut FuriEventLoop,
989 mutex: *mut FuriMutex,
990 event: FuriEventLoopEvent,
991 callback: FuriEventLoopEventCallback,
992 context: *mut core::ffi::c_void,
993 );
994}
995unsafe extern "C" {
996 #[doc = "Subscribe to thread flag events of the current thread\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `callback` - The callback to call when a flag has been set\n * `context` - The context for callback"]
997 pub fn furi_event_loop_subscribe_thread_flags(
998 instance: *mut FuriEventLoop,
999 callback: FuriEventLoopThreadFlagsCallback,
1000 context: *mut core::ffi::c_void,
1001 );
1002}
1003unsafe extern "C" {
1004 #[doc = "Unsubscribe from thread flag events of the current thread\n\n # Arguments\n\n* `instance` - The Event Loop instance"]
1005 pub fn furi_event_loop_unsubscribe_thread_flags(instance: *mut FuriEventLoop);
1006}
1007unsafe extern "C" {
1008 #[doc = "Unsubscribe from events (common)\n\n # Arguments\n\n* `instance` - The Event Loop instance\n * `object` - The object to unsubscribe from"]
1009 pub fn furi_event_loop_unsubscribe(
1010 instance: *mut FuriEventLoop,
1011 object: *mut FuriEventLoopObject,
1012 );
1013}
1014unsafe extern "C" {
1015 #[doc = "Checks if the loop is subscribed to an object of any kind\n\n # Arguments\n\n* `instance` - Event Loop instance\n * `object` - Object to check"]
1016 pub fn furi_event_loop_is_subscribed(
1017 instance: *mut FuriEventLoop,
1018 object: *mut FuriEventLoopObject,
1019 ) -> bool;
1020}
1021#[doc = "< One-shot timer."]
1022pub const FuriEventLoopTimerTypeOnce: FuriEventLoopTimerType = FuriEventLoopTimerType(0);
1023#[doc = "< Repeating timer."]
1024pub const FuriEventLoopTimerTypePeriodic: FuriEventLoopTimerType = FuriEventLoopTimerType(1);
1025#[repr(transparent)]
1026#[doc = "Enumeration of possible timer types."]
1027#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1028pub struct FuriEventLoopTimerType(pub core::ffi::c_uchar);
1029#[doc = "Timer callback type for functions to be called when a timer expires.\n\n In the timer callback, it is ALLOWED:\n - To start, stop, or restart an existing timer,\n - To create new timers using furi_event_loop_timer_alloc(),\n - To delete timers using furi_event_loop_timer_free().\n\n # Arguments\n\n* `context` (direction in, out) - pointer to a user-specific object that was provided during timer creation"]
1030pub type FuriEventLoopTimerCallback =
1031 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
1032#[repr(C)]
1033#[derive(Debug, Copy, Clone)]
1034pub struct FuriEventLoopTimer {
1035 _unused: [u8; 0],
1036}
1037unsafe extern "C" {
1038 #[doc = "Create a new event loop timer instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the current FuriEventLoop instance\n * `callback` (direction in) - pointer to the callback function to be executed upon timer timeout\n * `type` (direction in) - timer type value to determine its behavior (single-shot or periodic)\n * `context` (direction in, out) - pointer to a user-specific object (will be passed to the callback)\n # Returns\n\npointer to the created timer instance"]
1039 pub fn furi_event_loop_timer_alloc(
1040 instance: *mut FuriEventLoop,
1041 callback: FuriEventLoopTimerCallback,
1042 type_: FuriEventLoopTimerType,
1043 context: *mut core::ffi::c_void,
1044 ) -> *mut FuriEventLoopTimer;
1045}
1046unsafe extern "C" {
1047 #[doc = "Delete an event loop timer instance.\n\n The user code MUST call furi_event_loop_timer_free() on ALL instances\n associated with the current event loop BEFORE calling furi_event_loop_free().\n The event loop may EITHER be running OR stopped when the timers are being deleted.\n\n # Arguments\n\n* `timer` (direction in, out) - pointer to the timer instance to be deleted"]
1048 pub fn furi_event_loop_timer_free(timer: *mut FuriEventLoopTimer);
1049}
1050unsafe extern "C" {
1051 #[doc = "Start a timer or restart it with a new interval.\n\n # Arguments\n\n* `timer` (direction in, out) - pointer to the timer instance to be (re)started\n * `interval` (direction in) - timer interval in ticks"]
1052 pub fn furi_event_loop_timer_start(timer: *mut FuriEventLoopTimer, interval: u32);
1053}
1054unsafe extern "C" {
1055 #[doc = "Restart a timer with the previously set interval.\n\n # Arguments\n\n* `timer` (direction in, out) - pointer to the timer instance to be restarted"]
1056 pub fn furi_event_loop_timer_restart(timer: *mut FuriEventLoopTimer);
1057}
1058unsafe extern "C" {
1059 #[doc = "Stop a timer without firing its callback.\n\n It is safe to call this function on an already stopped timer (it will do nothing).\n\n # Arguments\n\n* `timer` (direction in, out) - pointer to the timer instance to be stopped"]
1060 pub fn furi_event_loop_timer_stop(timer: *mut FuriEventLoopTimer);
1061}
1062unsafe extern "C" {
1063 #[doc = "Get the time remaining before the timer becomes expires.\n\n For stopped or expired timers, this function returns 0.\n\n # Arguments\n\n* `timer` (direction in) - pointer to the timer to be queried\n # Returns\n\nremaining time in ticks"]
1064 pub fn furi_event_loop_timer_get_remaining_time(timer: *const FuriEventLoopTimer) -> u32;
1065}
1066unsafe extern "C" {
1067 #[doc = "Get the timer interval.\n\n # Arguments\n\n* `timer` (direction in) - pointer to the timer to be queried\n # Returns\n\ntimer interval in ticks"]
1068 pub fn furi_event_loop_timer_get_interval(timer: *const FuriEventLoopTimer) -> u32;
1069}
1070unsafe extern "C" {
1071 #[doc = "Check if the timer is currently running.\n\n A timer is considered running if it has not expired yet.\n # Arguments\n\n* `timer` (direction in) - pointer to the timer to be queried\n # Returns\n\ntrue if the timer is running, false otherwise"]
1072 pub fn furi_event_loop_timer_is_running(timer: *const FuriEventLoopTimer) -> bool;
1073}
1074unsafe extern "C" {
1075 #[doc = "Allocate FuriEventFlag\n\n # Returns\n\npointer to FuriEventFlag"]
1076 pub fn furi_event_flag_alloc() -> *mut FuriEventFlag;
1077}
1078unsafe extern "C" {
1079 #[doc = "Deallocate FuriEventFlag\n\n # Arguments\n\n* `instance` - pointer to FuriEventFlag"]
1080 pub fn furi_event_flag_free(instance: *mut FuriEventFlag);
1081}
1082unsafe extern "C" {
1083 #[doc = "Set flags\n\n result of this function can be flags that you've just asked to\n set or not if someone was waiting for them and asked to clear it.\n It is highly recommended to read this function and\n xEventGroupSetBits source code.\n\n # Arguments\n\n* `instance` - pointer to FuriEventFlag\n * `flags` (direction in) - The flags to set\n\n # Returns\n\nResulting flags(see warning) or error (FuriStatus)"]
1084 pub fn furi_event_flag_set(instance: *mut FuriEventFlag, flags: u32) -> u32;
1085}
1086unsafe extern "C" {
1087 #[doc = "Clear flags\n\n # Arguments\n\n* `instance` - pointer to FuriEventFlag\n * `flags` (direction in) - The flags\n\n # Returns\n\nResulting flags or error (FuriStatus)"]
1088 pub fn furi_event_flag_clear(instance: *mut FuriEventFlag, flags: u32) -> u32;
1089}
1090unsafe extern "C" {
1091 #[doc = "Get flags\n\n # Arguments\n\n* `instance` - pointer to FuriEventFlag\n\n # Returns\n\nResulting flags"]
1092 pub fn furi_event_flag_get(instance: *mut FuriEventFlag) -> u32;
1093}
1094unsafe extern "C" {
1095 #[doc = "Wait flags\n\n # Arguments\n\n* `instance` - pointer to FuriEventFlag\n * `flags` (direction in) - The flags\n * `options` (direction in) - The option flags\n * `timeout` (direction in) - The timeout\n\n # Returns\n\nResulting flags or error (FuriStatus)"]
1096 pub fn furi_event_flag_wait(
1097 instance: *mut FuriEventFlag,
1098 flags: u32,
1099 options: u32,
1100 timeout: u32,
1101 ) -> u32;
1102}
1103unsafe extern "C" {
1104 #[doc = "Check if CPU is in IRQ or kernel running and IRQ is masked\n\n Originally this primitive was born as a workaround for FreeRTOS kernel primitives shenanigans with PRIMASK.\n\n Meaningful use cases are:\n\n - When kernel is started and you want to ensure that you are not in IRQ or IRQ is not masked(like in critical section)\n - When kernel is not started and you want to make sure that you are not in IRQ mode, ignoring PRIMASK.\n\n As you can see there will be edge case when kernel is not started and PRIMASK is not 0 that may cause some funky behavior.\n Most likely it will happen after kernel primitives being used, but control not yet passed to kernel.\n It's up to you to figure out if it is safe for your code or not.\n\n # Returns\n\ntrue if CPU is in IRQ or kernel running and IRQ is masked"]
1105 pub fn furi_kernel_is_irq_or_masked() -> bool;
1106}
1107unsafe extern "C" {
1108 #[doc = "Check if kernel is running\n\n # Returns\n\ntrue if running, false otherwise"]
1109 pub fn furi_kernel_is_running() -> bool;
1110}
1111unsafe extern "C" {
1112 #[doc = "Lock kernel, pause process scheduling\n\n This should never be called in interrupt request context.\n\n # Returns\n\nprevious lock state(0 - unlocked, 1 - locked)"]
1113 pub fn furi_kernel_lock() -> i32;
1114}
1115unsafe extern "C" {
1116 #[doc = "Unlock kernel, resume process scheduling\n\n This should never be called in interrupt request context.\n\n # Returns\n\nprevious lock state(0 - unlocked, 1 - locked)"]
1117 pub fn furi_kernel_unlock() -> i32;
1118}
1119unsafe extern "C" {
1120 #[doc = "Restore kernel lock state\n\n This should never be called in interrupt request context.\n\n # Arguments\n\n* `lock` (direction in) - The lock state\n\n # Returns\n\nnew lock state or error"]
1121 pub fn furi_kernel_restore_lock(lock: i32) -> i32;
1122}
1123unsafe extern "C" {
1124 #[doc = "Get kernel systick frequency\n\n # Returns\n\nsystick counts per second"]
1125 pub fn furi_kernel_get_tick_frequency() -> u32;
1126}
1127unsafe extern "C" {
1128 #[doc = "Delay execution\n\n This should never be called in interrupt request context.\n\n Also keep in mind delay is aliased to scheduler timer intervals.\n\n # Arguments\n\n* `ticks` (direction in) - The ticks count to pause"]
1129 pub fn furi_delay_tick(ticks: u32);
1130}
1131unsafe extern "C" {
1132 #[doc = "Delay until tick\n\n This should never be called in interrupt request context.\n\n # Arguments\n\n* `tick` (direction in) - The tick until which kernel should delay task execution\n\n # Returns\n\nThe furi status."]
1133 pub fn furi_delay_until_tick(tick: u32) -> FuriStatus;
1134}
1135unsafe extern "C" {
1136 #[doc = "Get current tick counter\n\n System uptime, may overflow.\n\n # Returns\n\nCurrent ticks in milliseconds"]
1137 pub fn furi_get_tick() -> u32;
1138}
1139unsafe extern "C" {
1140 #[doc = "Convert milliseconds to ticks\n\n # Arguments\n\n* `milliseconds` (direction in) - time in milliseconds\n # Returns\n\ntime in ticks"]
1141 pub fn furi_ms_to_ticks(milliseconds: u32) -> u32;
1142}
1143unsafe extern "C" {
1144 #[doc = "Delay in milliseconds\n\n This method uses kernel ticks on the inside, which causes delay to be aliased to scheduler timer intervals.\n Real wait time will be between X+ milliseconds.\n Special value: 0, will cause task yield.\n Also if used when kernel is not running will fall back to `furi_delay_us`.\n\n Cannot be used from ISR\n\n # Arguments\n\n* `milliseconds` (direction in) - milliseconds to wait"]
1145 pub fn furi_delay_ms(milliseconds: u32);
1146}
1147unsafe extern "C" {
1148 #[doc = "Delay in microseconds\n\n Implemented using Cortex DWT counter. Blocking and non aliased.\n\n # Arguments\n\n* `microseconds` (direction in) - microseconds to wait"]
1149 pub fn furi_delay_us(microseconds: u32);
1150}
1151pub const FuriLogLevelDefault: FuriLogLevel = FuriLogLevel(0);
1152pub const FuriLogLevelNone: FuriLogLevel = FuriLogLevel(1);
1153pub const FuriLogLevelError: FuriLogLevel = FuriLogLevel(2);
1154pub const FuriLogLevelWarn: FuriLogLevel = FuriLogLevel(3);
1155pub const FuriLogLevelInfo: FuriLogLevel = FuriLogLevel(4);
1156pub const FuriLogLevelDebug: FuriLogLevel = FuriLogLevel(5);
1157pub const FuriLogLevelTrace: FuriLogLevel = FuriLogLevel(6);
1158#[repr(transparent)]
1159#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1160pub struct FuriLogLevel(pub core::ffi::c_uchar);
1161pub type FuriLogHandlerCallback = ::core::option::Option<
1162 unsafe extern "C" fn(data: *const u8, size: usize, context: *mut core::ffi::c_void),
1163>;
1164#[repr(C)]
1165#[derive(Debug, Copy, Clone)]
1166pub struct FuriLogHandler {
1167 pub callback: FuriLogHandlerCallback,
1168 pub context: *mut core::ffi::c_void,
1169}
1170#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1171const _: () = {
1172 ["Size of FuriLogHandler"][::core::mem::size_of::<FuriLogHandler>() - 8usize];
1173 ["Alignment of FuriLogHandler"][::core::mem::align_of::<FuriLogHandler>() - 4usize];
1174 ["Offset of field: FuriLogHandler::callback"]
1175 [::core::mem::offset_of!(FuriLogHandler, callback) - 0usize];
1176 ["Offset of field: FuriLogHandler::context"]
1177 [::core::mem::offset_of!(FuriLogHandler, context) - 4usize];
1178};
1179unsafe extern "C" {
1180 #[doc = "Add log TX callback\n\n # Arguments\n\n* `handler` (direction in) - The callback and its context\n\n # Returns\n\ntrue on success, false otherwise"]
1181 pub fn furi_log_add_handler(handler: FuriLogHandler) -> bool;
1182}
1183unsafe extern "C" {
1184 #[doc = "Remove log TX callback\n\n # Arguments\n\n* `handler` (direction in) - The callback and its context\n\n # Returns\n\ntrue on success, false otherwise"]
1185 pub fn furi_log_remove_handler(handler: FuriLogHandler) -> bool;
1186}
1187unsafe extern "C" {
1188 #[doc = "Transmit data through log IO callbacks\n\n # Arguments\n\n* `data` (direction in) - The data\n * `size` (direction in) - The size"]
1189 pub fn furi_log_tx(data: *const u8, size: usize);
1190}
1191unsafe extern "C" {
1192 #[doc = "Transmit data through log IO callbacks\n\n # Arguments\n\n* `data` (direction in) - The data, null-terminated C-string"]
1193 pub fn furi_log_puts(data: *const core::ffi::c_char);
1194}
1195unsafe extern "C" {
1196 #[doc = "Print log record\n\n # Arguments\n\n* `level` -\n * `tag` -\n * `format` -\n * `...` -"]
1197 pub fn furi_log_print_format(
1198 level: FuriLogLevel,
1199 tag: *const core::ffi::c_char,
1200 format: *const core::ffi::c_char,
1201 ...
1202 );
1203}
1204unsafe extern "C" {
1205 #[doc = "Print log record\n\n # Arguments\n\n* `level` -\n * `format` -\n * `...` -"]
1206 pub fn furi_log_print_raw_format(level: FuriLogLevel, format: *const core::ffi::c_char, ...);
1207}
1208unsafe extern "C" {
1209 #[doc = "Set log level\n\n # Arguments\n\n* `level` (direction in) - The level"]
1210 pub fn furi_log_set_level(level: FuriLogLevel);
1211}
1212unsafe extern "C" {
1213 #[doc = "Get log level\n\n # Returns\n\nThe furi log level."]
1214 pub fn furi_log_get_level() -> FuriLogLevel;
1215}
1216unsafe extern "C" {
1217 #[doc = "Log level to string\n\n # Arguments\n\n* `level` (direction in) - The level\n * `str` (direction out) - String representation of the level\n\n # Returns\n\nTrue if success, False otherwise"]
1218 pub fn furi_log_level_to_string(
1219 level: FuriLogLevel,
1220 str_: *mut *const core::ffi::c_char,
1221 ) -> bool;
1222}
1223unsafe extern "C" {
1224 #[doc = "Log level from string\n\n # Arguments\n\n* `str` (direction in) - The string\n * `level` (direction out) - The level\n\n # Returns\n\nTrue if success, False otherwise"]
1225 pub fn furi_log_level_from_string(
1226 str_: *const core::ffi::c_char,
1227 level: *mut FuriLogLevel,
1228 ) -> bool;
1229}
1230unsafe extern "C" {
1231 #[doc = "Get free heap size\n\n # Returns\n\nfree heap size in bytes"]
1232 pub fn memmgr_get_free_heap() -> usize;
1233}
1234unsafe extern "C" {
1235 #[doc = "Get total heap size\n\n # Returns\n\ntotal heap size in bytes"]
1236 pub fn memmgr_get_total_heap() -> usize;
1237}
1238unsafe extern "C" {
1239 #[doc = "Get heap watermark\n\n # Returns\n\nminimum heap in bytes"]
1240 pub fn memmgr_get_minimum_free_heap() -> usize;
1241}
1242unsafe extern "C" {
1243 #[doc = "An aligned version of malloc, used when you need to get the aligned space on the heap\n Freeing the received address is performed ONLY through the aligned_free function\n # Arguments\n\n* `size` -\n * `alignment` -\n # Returns\n\nvoid*"]
1244 pub fn aligned_malloc(size: usize, alignment: usize) -> *mut core::ffi::c_void;
1245}
1246unsafe extern "C" {
1247 #[doc = "Freed space obtained through the aligned_malloc function\n # Arguments\n\n* `p` - pointer to result of aligned_malloc"]
1248 pub fn aligned_free(p: *mut core::ffi::c_void);
1249}
1250#[doc = "< Thread is stopped and is safe to release. Event delivered from system init thread(TCB cleanup routine). It is safe to release thread instance."]
1251pub const FuriThreadStateStopped: FuriThreadState = FuriThreadState(0);
1252#[doc = "< Thread is stopping. Event delivered from child thread."]
1253pub const FuriThreadStateStopping: FuriThreadState = FuriThreadState(1);
1254#[doc = "< Thread is starting. Event delivered from parent(self) thread."]
1255pub const FuriThreadStateStarting: FuriThreadState = FuriThreadState(2);
1256#[doc = "< Thread is running. Event delivered from child thread."]
1257pub const FuriThreadStateRunning: FuriThreadState = FuriThreadState(3);
1258#[repr(transparent)]
1259#[doc = "Enumeration of possible FuriThread states.\n\n Many of the FuriThread functions MUST ONLY be called when the thread is STOPPED."]
1260#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1261pub struct FuriThreadState(pub core::ffi::c_uchar);
1262#[doc = "< Idle priority"]
1263pub const FuriThreadPriorityIdle: FuriThreadPriority = FuriThreadPriority(0);
1264#[doc = "< Init System Thread Priority"]
1265pub const FuriThreadPriorityInit: FuriThreadPriority = FuriThreadPriority(4);
1266#[doc = "< Lowest"]
1267pub const FuriThreadPriorityLowest: FuriThreadPriority = FuriThreadPriority(14);
1268#[doc = "< Low"]
1269pub const FuriThreadPriorityLow: FuriThreadPriority = FuriThreadPriority(15);
1270#[doc = "< Normal, system default"]
1271pub const FuriThreadPriorityNormal: FuriThreadPriority = FuriThreadPriority(16);
1272#[doc = "< High"]
1273pub const FuriThreadPriorityHigh: FuriThreadPriority = FuriThreadPriority(17);
1274#[doc = "< Highest"]
1275pub const FuriThreadPriorityHighest: FuriThreadPriority = FuriThreadPriority(18);
1276pub const FuriThreadPriorityIsr: FuriThreadPriority = FuriThreadPriority(31);
1277#[repr(transparent)]
1278#[doc = "Enumeration of possible FuriThread priorities."]
1279#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1280pub struct FuriThreadPriority(pub core::ffi::c_uchar);
1281#[repr(C)]
1282#[derive(Debug, Copy, Clone)]
1283pub struct FuriThread {
1284 _unused: [u8; 0],
1285}
1286#[repr(C)]
1287#[derive(Debug, Copy, Clone)]
1288pub struct FuriThreadList {
1289 _unused: [u8; 0],
1290}
1291#[doc = "Unique thread identifier type (used by the OS kernel)."]
1292pub type FuriThreadId = *mut core::ffi::c_void;
1293#[doc = "Thread callback function pointer type.\n\n The function to be used as a thread callback MUST follow this signature.\n\n # Arguments\n\n* `context` (direction in, out) - pointer to a user-specified object\n # Returns\n\nvalue to be used as the thread return code"]
1294pub type FuriThreadCallback =
1295 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> i32>;
1296#[doc = "Standard output callback function pointer type.\n\n The function to be used as a standard output callback MUST follow this signature.\n\n The handler MUST process ALL of the provided data before returning.\n\n # Arguments\n\n* `data` (direction in) - pointer to the data to be written to the standard out\n * `size` (direction in) - size of the data in bytes\n * `context` (direction in) - optional context"]
1297pub type FuriThreadStdoutWriteCallback = ::core::option::Option<
1298 unsafe extern "C" fn(
1299 data: *const core::ffi::c_char,
1300 size: usize,
1301 context: *mut core::ffi::c_void,
1302 ),
1303>;
1304#[doc = "Standard input callback function pointer type\n\n The function to be used as a standard input callback MUST follow this signature.\n\n # Arguments\n\n* `buffer` (direction out) - buffer to read data into\n * `size` (direction in) - maximum number of bytes to read into the buffer\n * `timeout` (direction in) - how long to wait for (in ticks) before giving up\n * `context` (direction in) - optional context\n # Returns\n\nnumber of bytes that was actually read into the buffer"]
1305pub type FuriThreadStdinReadCallback = ::core::option::Option<
1306 unsafe extern "C" fn(
1307 buffer: *mut core::ffi::c_char,
1308 size: usize,
1309 timeout: FuriWait,
1310 context: *mut core::ffi::c_void,
1311 ) -> usize,
1312>;
1313#[doc = "State change callback function pointer type.\n\n The function to be used as a state callback MUST follow this\n signature.\n\n # Arguments\n\n* `thread` (direction in) - to the FuriThread instance that changed the state\n * `state` (direction in) - identifier of the state the thread has transitioned\n to\n * `context` (direction in, out) - pointer to a user-specified object"]
1314pub type FuriThreadStateCallback = ::core::option::Option<
1315 unsafe extern "C" fn(
1316 thread: *mut FuriThread,
1317 state: FuriThreadState,
1318 context: *mut core::ffi::c_void,
1319 ),
1320>;
1321#[doc = "Signal handler callback function pointer type.\n\n The function to be used as a signal handler callback MUS follow this signature.\n\n # Arguments\n\n* `signal` (direction in) - value of the signal to be handled by the recipient\n * `arg` (direction in, out) - optional argument (can be of any value, including NULL)\n * `context` (direction in, out) - pointer to a user-specified object\n # Returns\n\ntrue if the signal was handled, false otherwise"]
1322pub type FuriThreadSignalCallback = ::core::option::Option<
1323 unsafe extern "C" fn(
1324 signal: u32,
1325 arg: *mut core::ffi::c_void,
1326 context: *mut core::ffi::c_void,
1327 ) -> bool,
1328>;
1329unsafe extern "C" {
1330 #[doc = "Create a FuriThread instance.\n\n # Returns\n\npointer to the created FuriThread instance"]
1331 pub fn furi_thread_alloc() -> *mut FuriThread;
1332}
1333unsafe extern "C" {
1334 #[doc = "Create a FuriThread instance w/ extra parameters.\n\n # Arguments\n\n* `name` (direction in) - human-readable thread name (can be NULL)\n * `stack_size` (direction in) - stack size in bytes (can be changed later)\n * `callback` (direction in) - pointer to a function to be executed in this thread\n * `context` (direction in) - pointer to a user-specified object (will be passed to the callback)\n # Returns\n\npointer to the created FuriThread instance"]
1335 pub fn furi_thread_alloc_ex(
1336 name: *const core::ffi::c_char,
1337 stack_size: u32,
1338 callback: FuriThreadCallback,
1339 context: *mut core::ffi::c_void,
1340 ) -> *mut FuriThread;
1341}
1342unsafe extern "C" {
1343 #[doc = "Delete a FuriThread instance.\n\n The thread MUST be stopped when calling this function.\n\n see furi_thread_join for caveats on stopping a thread.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be deleted"]
1344 pub fn furi_thread_free(thread: *mut FuriThread);
1345}
1346unsafe extern "C" {
1347 #[doc = "Set the name of a FuriThread instance.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `name` (direction in) - human-readable thread name (can be NULL)"]
1348 pub fn furi_thread_set_name(thread: *mut FuriThread, name: *const core::ffi::c_char);
1349}
1350unsafe extern "C" {
1351 #[doc = "Set the application ID of a FuriThread instance.\n\n The thread MUST be stopped when calling this function.\n\n Technically, it is like a \"process id\", but it is not a system-wide unique identifier.\n All threads spawned by the same app will have the same appid.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `appid` (direction in) - thread application ID (can be NULL)"]
1352 pub fn furi_thread_set_appid(thread: *mut FuriThread, appid: *const core::ffi::c_char);
1353}
1354unsafe extern "C" {
1355 #[doc = "Set the stack size of a FuriThread instance.\n\n The thread MUST be stopped when calling this function. Additionally, it is NOT possible\n to change the stack size of a service thread under any circumstances.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `stack_size` (direction in) - stack size in bytes"]
1356 pub fn furi_thread_set_stack_size(thread: *mut FuriThread, stack_size: usize);
1357}
1358unsafe extern "C" {
1359 #[doc = "Set the user callback function to be executed in a FuriThread.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `callback` (direction in) - pointer to a user-specified function to be executed in this thread"]
1360 pub fn furi_thread_set_callback(thread: *mut FuriThread, callback: FuriThreadCallback);
1361}
1362unsafe extern "C" {
1363 #[doc = "Set the callback function context.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `context` (direction in) - pointer to a user-specified object (will be passed to the callback, can be NULL)"]
1364 pub fn furi_thread_set_context(thread: *mut FuriThread, context: *mut core::ffi::c_void);
1365}
1366unsafe extern "C" {
1367 #[doc = "Set the priority of a FuriThread.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `priority` (direction in) - priority level value"]
1368 pub fn furi_thread_set_priority(thread: *mut FuriThread, priority: FuriThreadPriority);
1369}
1370unsafe extern "C" {
1371 #[doc = "Get the priority of a FuriThread.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be queried\n # Returns\n\npriority level value"]
1372 pub fn furi_thread_get_priority(thread: *mut FuriThread) -> FuriThreadPriority;
1373}
1374unsafe extern "C" {
1375 #[doc = "Set the priority of the current FuriThread.\n\n # Arguments\n\n* `priority` - priority level value"]
1376 pub fn furi_thread_set_current_priority(priority: FuriThreadPriority);
1377}
1378unsafe extern "C" {
1379 #[doc = "Get the priority of the current FuriThread.\n\n # Returns\n\npriority level value"]
1380 pub fn furi_thread_get_current_priority() -> FuriThreadPriority;
1381}
1382unsafe extern "C" {
1383 #[doc = "Set the callback function to be executed upon a state thransition of a FuriThread.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `callback` (direction in) - pointer to a user-specified callback function"]
1384 pub fn furi_thread_set_state_callback(
1385 thread: *mut FuriThread,
1386 callback: FuriThreadStateCallback,
1387 );
1388}
1389unsafe extern "C" {
1390 #[doc = "Set the state change callback context.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `context` (direction in) - pointer to a user-specified object (will be passed to the callback, can be NULL)"]
1391 pub fn furi_thread_set_state_context(thread: *mut FuriThread, context: *mut core::ffi::c_void);
1392}
1393unsafe extern "C" {
1394 #[doc = "Get the state of a FuriThread isntance.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be queried\n # Returns\n\nthread state value"]
1395 pub fn furi_thread_get_state(thread: *mut FuriThread) -> FuriThreadState;
1396}
1397unsafe extern "C" {
1398 #[doc = "Set a signal handler callback for a FuriThread instance.\n\n The thread MUST be stopped when calling this function if calling it from another thread.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified\n * `callback` (direction in) - pointer to a user-specified callback function\n * `context` (direction in) - pointer to a user-specified object (will be passed to the callback, can be NULL)"]
1399 pub fn furi_thread_set_signal_callback(
1400 thread: *mut FuriThread,
1401 callback: FuriThreadSignalCallback,
1402 context: *mut core::ffi::c_void,
1403 );
1404}
1405unsafe extern "C" {
1406 #[doc = "Get a signal callback for a FuriThread instance.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be queried\n # Returns\n\npointer to the callback function or NULL if none has been set"]
1407 pub fn furi_thread_get_signal_callback(thread: *const FuriThread) -> FuriThreadSignalCallback;
1408}
1409unsafe extern "C" {
1410 #[doc = "Send a signal to a FuriThread instance.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be signaled\n * `signal` (direction in) - signal value to be sent\n * `arg` (direction in, out) - optional argument (can be of any value, including NULL)"]
1411 pub fn furi_thread_signal(
1412 thread: *const FuriThread,
1413 signal: u32,
1414 arg: *mut core::ffi::c_void,
1415 ) -> bool;
1416}
1417unsafe extern "C" {
1418 #[doc = "Start a FuriThread instance.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be started"]
1419 pub fn furi_thread_start(thread: *mut FuriThread);
1420}
1421unsafe extern "C" {
1422 #[doc = "Wait for a FuriThread to exit.\n\n The thread callback function must return in order for the FuriThread instance to become joinable.\n\n Use this method only when the CPU is not busy (i.e. when the\n Idle task receives control), otherwise it will wait forever.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be joined\n # Returns\n\nalways true"]
1423 pub fn furi_thread_join(thread: *mut FuriThread) -> bool;
1424}
1425unsafe extern "C" {
1426 #[doc = "Get the unique identifier of a FuriThread instance.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be queried\n # Returns\n\nunique identifier value or NULL if thread is not running"]
1427 pub fn furi_thread_get_id(thread: *mut FuriThread) -> FuriThreadId;
1428}
1429unsafe extern "C" {
1430 #[doc = "Enable heap usage tracing for a FuriThread.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in, out) - pointer to the FuriThread instance to be modified"]
1431 pub fn furi_thread_enable_heap_trace(thread: *mut FuriThread);
1432}
1433unsafe extern "C" {
1434 #[doc = "Get heap usage by a FuriThread instance.\n\n The heap trace MUST be enabled before callgin this function.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be queried\n # Returns\n\nheap usage in bytes"]
1435 pub fn furi_thread_get_heap_size(thread: *mut FuriThread) -> usize;
1436}
1437unsafe extern "C" {
1438 #[doc = "Get the return code of a FuriThread instance.\n\n This value is equal to the return value of the thread callback function.\n\n The thread MUST be stopped when calling this function.\n\n # Arguments\n\n* `thread` (direction in) - pointer to the FuriThread instance to be queried\n # Returns\n\nreturn code value"]
1439 pub fn furi_thread_get_return_code(thread: *mut FuriThread) -> i32;
1440}
1441unsafe extern "C" {
1442 #[doc = "Get the unique identifier of the current FuriThread.\n\n # Returns\n\nunique identifier value"]
1443 pub fn furi_thread_get_current_id() -> FuriThreadId;
1444}
1445unsafe extern "C" {
1446 #[doc = "Get the FuriThread instance associated with the current thread.\n\n # Returns\n\npointer to a FuriThread instance or NULL if this thread does not belong to Furi"]
1447 pub fn furi_thread_get_current() -> *mut FuriThread;
1448}
1449unsafe extern "C" {
1450 #[doc = "Return control to the scheduler."]
1451 pub fn furi_thread_yield();
1452}
1453unsafe extern "C" {
1454 #[doc = "Set the thread flags of a FuriThread.\n\n Can be used as a simple inter-thread communication mechanism.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be notified\n * `flags` (direction in) - bitmask of thread flags to set\n # Returns\n\nbitmask combination of previous and newly set flags"]
1455 pub fn furi_thread_flags_set(thread_id: FuriThreadId, flags: u32) -> u32;
1456}
1457unsafe extern "C" {
1458 #[doc = "Clear the thread flags of the current FuriThread.\n\n # Arguments\n\n* `flags` (direction in) - bitmask of thread flags to clear\n # Returns\n\nbitmask of thread flags before clearing"]
1459 pub fn furi_thread_flags_clear(flags: u32) -> u32;
1460}
1461unsafe extern "C" {
1462 #[doc = "Get the thread flags of the current FuriThread.\n # Returns\n\ncurrent bitmask of thread flags"]
1463 pub fn furi_thread_flags_get() -> u32;
1464}
1465unsafe extern "C" {
1466 #[doc = "Wait for some thread flags to be set.\n\n [`FuriFlag`] for option and error flags.\n\n # Arguments\n\n* `flags` (direction in) - bitmask of thread flags to wait for\n * `options` (direction in) - combination of option flags determining the behavior of the function\n * `timeout` (direction in) - maximum time to wait in milliseconds (use FuriWaitForever to wait forever)\n # Returns\n\nbitmask combination of received thread and error flags"]
1467 pub fn furi_thread_flags_wait(flags: u32, options: u32, timeout: u32) -> u32;
1468}
1469unsafe extern "C" {
1470 #[doc = "Enumerate all threads.\n\n # Arguments\n\n* `thread_list` (direction out) - pointer to the FuriThreadList container\n\n # Returns\n\ntrue on success, false otherwise"]
1471 pub fn furi_thread_enumerate(thread_list: *mut FuriThreadList) -> bool;
1472}
1473unsafe extern "C" {
1474 #[doc = "Get the name of a thread based on its unique identifier.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be queried\n # Returns\n\npointer to a zero-terminated string or NULL"]
1475 pub fn furi_thread_get_name(thread_id: FuriThreadId) -> *const core::ffi::c_char;
1476}
1477unsafe extern "C" {
1478 #[doc = "Get the application id of a thread based on its unique identifier.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be queried\n # Returns\n\npointer to a zero-terminated string"]
1479 pub fn furi_thread_get_appid(thread_id: FuriThreadId) -> *const core::ffi::c_char;
1480}
1481unsafe extern "C" {
1482 #[doc = "Get thread stack watermark.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be queried\n # Returns\n\nstack watermark value"]
1483 pub fn furi_thread_get_stack_space(thread_id: FuriThreadId) -> u32;
1484}
1485unsafe extern "C" {
1486 #[doc = "Get the standard output callback for the current thead.\n\n # Arguments\n\n* `callback` (direction out) - where to store the stdout callback\n * `context` (direction out) - where to store the context"]
1487 pub fn furi_thread_get_stdout_callback(
1488 callback: *mut FuriThreadStdoutWriteCallback,
1489 context: *mut *mut core::ffi::c_void,
1490 );
1491}
1492unsafe extern "C" {
1493 #[doc = "Get the standard input callback for the current thead.\n\n # Arguments\n\n* `callback` (direction out) - where to store the stdin callback\n * `context` (direction out) - where to store the context"]
1494 pub fn furi_thread_get_stdin_callback(
1495 callback: *mut FuriThreadStdinReadCallback,
1496 context: *mut *mut core::ffi::c_void,
1497 );
1498}
1499unsafe extern "C" {
1500 #[doc = "Set standard output callback for the current thread.\n\n # Arguments\n\n* `callback` (direction in) - pointer to the callback function or NULL to clear\n * `context` (direction in) - context to be passed to the callback"]
1501 pub fn furi_thread_set_stdout_callback(
1502 callback: FuriThreadStdoutWriteCallback,
1503 context: *mut core::ffi::c_void,
1504 );
1505}
1506unsafe extern "C" {
1507 #[doc = "Set standard input callback for the current thread.\n\n # Arguments\n\n* `callback` (direction in) - pointer to the callback function or NULL to clear\n * `context` (direction in) - context to be passed to the callback"]
1508 pub fn furi_thread_set_stdin_callback(
1509 callback: FuriThreadStdinReadCallback,
1510 context: *mut core::ffi::c_void,
1511 );
1512}
1513unsafe extern "C" {
1514 #[doc = "Write data to buffered standard output.\n\n > **Note:** You can also use the standard C `putc`, `puts`, `printf` and friends.\n\n # Arguments\n\n* `data` (direction in) - pointer to the data to be written\n * `size` (direction in) - data size in bytes\n # Returns\n\nnumber of bytes that was actually written"]
1515 pub fn furi_thread_stdout_write(data: *const core::ffi::c_char, size: usize) -> usize;
1516}
1517unsafe extern "C" {
1518 #[doc = "Flush buffered data to standard output.\n\n # Returns\n\nerror code value"]
1519 pub fn furi_thread_stdout_flush() -> i32;
1520}
1521unsafe extern "C" {
1522 #[doc = "Read data from the standard input\n\n > **Note:** You can also use the standard C `getc`, `gets` and friends.\n\n # Arguments\n\n* `buffer` (direction in) - pointer to the buffer to read data into\n * `size` (direction in) - how many bytes to read into the buffer\n * `timeout` (direction in) - how long to wait for (in ticks) before giving up\n # Returns\n\nnumber of bytes that was actually read"]
1523 pub fn furi_thread_stdin_read(
1524 buffer: *mut core::ffi::c_char,
1525 size: usize,
1526 timeout: FuriWait,
1527 ) -> usize;
1528}
1529unsafe extern "C" {
1530 #[doc = "Puts data back into the standard input buffer\n\n `furi_thread_stdin_read` will return the bytes in the same order that they\n were supplied to this function.\n\n > **Note:** You can also use the standard C `ungetc`.\n\n # Arguments\n\n* `buffer` (direction in) - pointer to the buffer to get data from\n * `size` (direction in) - how many bytes to read from the buffer"]
1531 pub fn furi_thread_stdin_unread(buffer: *mut core::ffi::c_char, size: usize);
1532}
1533unsafe extern "C" {
1534 #[doc = "Suspend a thread.\n\n Suspended threads are no more receiving any of the processor time.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be suspended"]
1535 pub fn furi_thread_suspend(thread_id: FuriThreadId);
1536}
1537unsafe extern "C" {
1538 #[doc = "Resume a thread.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be resumed"]
1539 pub fn furi_thread_resume(thread_id: FuriThreadId);
1540}
1541unsafe extern "C" {
1542 #[doc = "Test if a thread is suspended.\n\n # Arguments\n\n* `thread_id` (direction in) - unique identifier of the thread to be queried\n # Returns\n\ntrue if thread is suspended, false otherwise"]
1543 pub fn furi_thread_is_suspended(thread_id: FuriThreadId) -> bool;
1544}
1545unsafe extern "C" {
1546 #[doc = "Memmgr heap enable thread allocation tracking\n\n # Arguments\n\n* `thread_id` - - thread id to track"]
1547 pub fn memmgr_heap_enable_thread_trace(thread_id: FuriThreadId);
1548}
1549unsafe extern "C" {
1550 #[doc = "Memmgr heap disable thread allocation tracking\n\n # Arguments\n\n* `thread_id` - - thread id to track"]
1551 pub fn memmgr_heap_disable_thread_trace(thread_id: FuriThreadId);
1552}
1553unsafe extern "C" {
1554 #[doc = "Memmgr heap get allocatred thread memory\n\n # Arguments\n\n* `thread_id` - - thread id to track\n\n # Returns\n\nbytes allocated right now"]
1555 pub fn memmgr_heap_get_thread_memory(thread_id: FuriThreadId) -> usize;
1556}
1557unsafe extern "C" {
1558 #[doc = "Memmgr heap get the max contiguous block size on the heap\n\n # Returns\n\nsize_t max contiguous block size"]
1559 pub fn memmgr_heap_get_max_free_block() -> usize;
1560}
1561unsafe extern "C" {
1562 #[doc = "Print the address and size of all free blocks to stdout"]
1563 pub fn memmgr_heap_printf_free_blocks();
1564}
1565unsafe extern "C" {
1566 #[doc = "Allocate furi message queue\n\n # Arguments\n\n* `msg_count` (direction in) - The message count\n * `msg_size` (direction in) - The message size\n\n # Returns\n\npointer to FuriMessageQueue instance"]
1567 pub fn furi_message_queue_alloc(msg_count: u32, msg_size: u32) -> *mut FuriMessageQueue;
1568}
1569unsafe extern "C" {
1570 #[doc = "Free queue\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance"]
1571 pub fn furi_message_queue_free(instance: *mut FuriMessageQueue);
1572}
1573unsafe extern "C" {
1574 #[doc = "Put message into queue\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n * `msg_ptr` (direction in) - The message pointer\n * `timeout` (direction in) - The timeout\n\n # Returns\n\nThe furi status."]
1575 pub fn furi_message_queue_put(
1576 instance: *mut FuriMessageQueue,
1577 msg_ptr: *const core::ffi::c_void,
1578 timeout: u32,
1579 ) -> FuriStatus;
1580}
1581unsafe extern "C" {
1582 #[doc = "Get message from queue\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n * `msg_ptr` - The message pointer\n * `timeout` (direction in) - The timeout\n\n # Returns\n\nThe furi status."]
1583 pub fn furi_message_queue_get(
1584 instance: *mut FuriMessageQueue,
1585 msg_ptr: *mut core::ffi::c_void,
1586 timeout: u32,
1587 ) -> FuriStatus;
1588}
1589unsafe extern "C" {
1590 #[doc = "Get queue capacity\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n\n # Returns\n\ncapacity in object count"]
1591 pub fn furi_message_queue_get_capacity(instance: *mut FuriMessageQueue) -> u32;
1592}
1593unsafe extern "C" {
1594 #[doc = "Get message size\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n\n # Returns\n\nMessage size in bytes"]
1595 pub fn furi_message_queue_get_message_size(instance: *mut FuriMessageQueue) -> u32;
1596}
1597unsafe extern "C" {
1598 #[doc = "Get message count in queue\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n\n # Returns\n\nMessage count"]
1599 pub fn furi_message_queue_get_count(instance: *mut FuriMessageQueue) -> u32;
1600}
1601unsafe extern "C" {
1602 #[doc = "Get queue available space\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n\n # Returns\n\nMessage count"]
1603 pub fn furi_message_queue_get_space(instance: *mut FuriMessageQueue) -> u32;
1604}
1605unsafe extern "C" {
1606 #[doc = "Reset queue\n\n # Arguments\n\n* `instance` - pointer to FuriMessageQueue instance\n\n # Returns\n\nThe furi status."]
1607 pub fn furi_message_queue_reset(instance: *mut FuriMessageQueue) -> FuriStatus;
1608}
1609pub const FuriMutexTypeNormal: FuriMutexType = FuriMutexType(0);
1610pub const FuriMutexTypeRecursive: FuriMutexType = FuriMutexType(1);
1611#[repr(transparent)]
1612#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1613pub struct FuriMutexType(pub core::ffi::c_uchar);
1614unsafe extern "C" {
1615 #[doc = "Allocate FuriMutex\n\n # Arguments\n\n* `type` (direction in) - The mutex type\n\n # Returns\n\npointer to FuriMutex instance"]
1616 pub fn furi_mutex_alloc(type_: FuriMutexType) -> *mut FuriMutex;
1617}
1618unsafe extern "C" {
1619 #[doc = "Free FuriMutex\n\n # Arguments\n\n* `instance` - The pointer to FuriMutex instance"]
1620 pub fn furi_mutex_free(instance: *mut FuriMutex);
1621}
1622unsafe extern "C" {
1623 #[doc = "Acquire mutex\n\n # Arguments\n\n* `instance` - The pointer to FuriMutex instance\n * `timeout` (direction in) - The timeout\n\n # Returns\n\nThe furi status."]
1624 pub fn furi_mutex_acquire(instance: *mut FuriMutex, timeout: u32) -> FuriStatus;
1625}
1626unsafe extern "C" {
1627 #[doc = "Release mutex\n\n # Arguments\n\n* `instance` - The pointer to FuriMutex instance\n\n # Returns\n\nThe furi status."]
1628 pub fn furi_mutex_release(instance: *mut FuriMutex) -> FuriStatus;
1629}
1630unsafe extern "C" {
1631 #[doc = "Get mutex owner thread id\n\n # Arguments\n\n* `instance` - The pointer to FuriMutex instance\n\n # Returns\n\nThe furi thread identifier."]
1632 pub fn furi_mutex_get_owner(instance: *mut FuriMutex) -> FuriThreadId;
1633}
1634#[doc = "FuriPubSub Callback type"]
1635pub type FuriPubSubCallback = ::core::option::Option<
1636 unsafe extern "C" fn(message: *const core::ffi::c_void, context: *mut core::ffi::c_void),
1637>;
1638#[repr(C)]
1639#[derive(Debug, Copy, Clone)]
1640pub struct FuriPubSub {
1641 _unused: [u8; 0],
1642}
1643#[repr(C)]
1644#[derive(Debug, Copy, Clone)]
1645pub struct FuriPubSubSubscription {
1646 _unused: [u8; 0],
1647}
1648unsafe extern "C" {
1649 #[doc = "Allocate FuriPubSub\n\n Reentrable, Not threadsafe, one owner\n\n # Returns\n\npointer to FuriPubSub instance"]
1650 pub fn furi_pubsub_alloc() -> *mut FuriPubSub;
1651}
1652unsafe extern "C" {
1653 #[doc = "Free FuriPubSub\n\n # Arguments\n\n* `pubsub` - FuriPubSub instance"]
1654 pub fn furi_pubsub_free(pubsub: *mut FuriPubSub);
1655}
1656unsafe extern "C" {
1657 #[doc = "Subscribe to FuriPubSub\n\n Threadsafe, Reentrable\n\n # Arguments\n\n* `pubsub` - pointer to FuriPubSub instance\n * `callback` (direction in) - The callback\n * `callback_context` - The callback context\n\n # Returns\n\npointer to FuriPubSubSubscription instance"]
1658 pub fn furi_pubsub_subscribe(
1659 pubsub: *mut FuriPubSub,
1660 callback: FuriPubSubCallback,
1661 callback_context: *mut core::ffi::c_void,
1662 ) -> *mut FuriPubSubSubscription;
1663}
1664unsafe extern "C" {
1665 #[doc = "Unsubscribe from FuriPubSub\n\n No use of `pubsub_subscription` allowed after call of this method\n Threadsafe, Reentrable.\n\n # Arguments\n\n* `pubsub` - pointer to FuriPubSub instance\n * `pubsub_subscription` - pointer to FuriPubSubSubscription instance"]
1666 pub fn furi_pubsub_unsubscribe(
1667 pubsub: *mut FuriPubSub,
1668 pubsub_subscription: *mut FuriPubSubSubscription,
1669 );
1670}
1671unsafe extern "C" {
1672 #[doc = "Publish message to FuriPubSub\n\n Threadsafe, Reentrable.\n\n # Arguments\n\n* `pubsub` - pointer to FuriPubSub instance\n * `message` - message pointer to publish"]
1673 pub fn furi_pubsub_publish(pubsub: *mut FuriPubSub, message: *mut core::ffi::c_void);
1674}
1675unsafe extern "C" {
1676 #[doc = "Check if record exists\n\n # Arguments\n\n* `name` - record name\n > **Note:** Thread safe. Create and destroy must be executed from the same\n thread."]
1677 pub fn furi_record_exists(name: *const core::ffi::c_char) -> bool;
1678}
1679unsafe extern "C" {
1680 #[doc = "Create record\n\n # Arguments\n\n* `name` - record name\n * `data` - data pointer (not NULL)\n > **Note:** Thread safe. Create and destroy must be executed from the same\n thread."]
1681 pub fn furi_record_create(name: *const core::ffi::c_char, data: *mut core::ffi::c_void);
1682}
1683unsafe extern "C" {
1684 #[doc = "Destroy record\n\n # Arguments\n\n* `name` - record name\n\n # Returns\n\ntrue if successful, false if still have holders or thread is not\n owner.\n > **Note:** Thread safe. Create and destroy must be executed from the same\n thread."]
1685 pub fn furi_record_destroy(name: *const core::ffi::c_char) -> bool;
1686}
1687unsafe extern "C" {
1688 #[doc = "Open record\n\n # Arguments\n\n* `name` - record name\n\n # Returns\n\npointer to the record\n > **Note:** Thread safe. Open and close must be executed from the same\n thread. Suspends caller thread till record is available"]
1689 pub fn furi_record_open(name: *const core::ffi::c_char) -> *mut core::ffi::c_void;
1690}
1691unsafe extern "C" {
1692 #[doc = "Close record\n\n # Arguments\n\n* `name` - record name\n > **Note:** Thread safe. Open and close must be executed from the same\n thread."]
1693 pub fn furi_record_close(name: *const core::ffi::c_char);
1694}
1695unsafe extern "C" {
1696 #[doc = "Allocate semaphore\n\n # Arguments\n\n* `max_count` (direction in) - The maximum count\n * `initial_count` (direction in) - The initial count\n\n # Returns\n\npointer to FuriSemaphore instance"]
1697 pub fn furi_semaphore_alloc(max_count: u32, initial_count: u32) -> *mut FuriSemaphore;
1698}
1699unsafe extern "C" {
1700 #[doc = "Free semaphore\n\n # Arguments\n\n* `instance` - The pointer to FuriSemaphore instance"]
1701 pub fn furi_semaphore_free(instance: *mut FuriSemaphore);
1702}
1703unsafe extern "C" {
1704 #[doc = "Acquire semaphore\n\n # Arguments\n\n* `instance` - The pointer to FuriSemaphore instance\n * `timeout` (direction in) - The timeout\n\n # Returns\n\nThe furi status."]
1705 pub fn furi_semaphore_acquire(instance: *mut FuriSemaphore, timeout: u32) -> FuriStatus;
1706}
1707unsafe extern "C" {
1708 #[doc = "Release semaphore\n\n # Arguments\n\n* `instance` - The pointer to FuriSemaphore instance\n\n # Returns\n\nThe furi status."]
1709 pub fn furi_semaphore_release(instance: *mut FuriSemaphore) -> FuriStatus;
1710}
1711unsafe extern "C" {
1712 #[doc = "Get semaphore count\n\n # Arguments\n\n* `instance` - The pointer to FuriSemaphore instance\n\n # Returns\n\nSemaphore count"]
1713 pub fn furi_semaphore_get_count(instance: *mut FuriSemaphore) -> u32;
1714}
1715unsafe extern "C" {
1716 #[doc = "Get available space\n\n # Arguments\n\n* `instance` - The pointer to FuriSemaphore instance\n\n # Returns\n\nSemaphore available space"]
1717 pub fn furi_semaphore_get_space(instance: *mut FuriSemaphore) -> u32;
1718}
1719#[repr(C)]
1720#[derive(Debug, Copy, Clone)]
1721pub struct FuriThreadListItem {
1722 #[doc = "< Pointer to FuriThread, valid while it is running"]
1723 pub thread: *mut FuriThread,
1724 #[doc = "< Thread application id, valid while it is running"]
1725 pub app_id: *const core::ffi::c_char,
1726 #[doc = "< Thread name, valid while it is running"]
1727 pub name: *const core::ffi::c_char,
1728 #[doc = "< Thread priority"]
1729 pub priority: FuriThreadPriority,
1730 #[doc = "< Thread stack address"]
1731 pub stack_address: u32,
1732 #[doc = "< Thread heap size if tracking enabled, 0 - otherwise"]
1733 pub heap: usize,
1734 #[doc = "< Thread stack size"]
1735 pub stack_size: u32,
1736 #[doc = "< Thread minimum of the stack size ever reached"]
1737 pub stack_min_free: u32,
1738 #[doc = "< Thread state, can be: \"Running\", \"Ready\", \"Blocked\", \"Suspended\", \"Deleted\", \"Invalid\""]
1739 pub state: *const core::ffi::c_char,
1740 #[doc = "< Thread CPU usage time in percents (including interrupts happened while running)"]
1741 pub cpu: f32,
1742 #[doc = "< Thread previous runtime counter"]
1743 pub counter_previous: u32,
1744 #[doc = "< Thread current runtime counter"]
1745 pub counter_current: u32,
1746 #[doc = "< Thread last seen tick"]
1747 pub tick: u32,
1748}
1749#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1750const _: () = {
1751 ["Size of FuriThreadListItem"][::core::mem::size_of::<FuriThreadListItem>() - 52usize];
1752 ["Alignment of FuriThreadListItem"][::core::mem::align_of::<FuriThreadListItem>() - 4usize];
1753 ["Offset of field: FuriThreadListItem::thread"]
1754 [::core::mem::offset_of!(FuriThreadListItem, thread) - 0usize];
1755 ["Offset of field: FuriThreadListItem::app_id"]
1756 [::core::mem::offset_of!(FuriThreadListItem, app_id) - 4usize];
1757 ["Offset of field: FuriThreadListItem::name"]
1758 [::core::mem::offset_of!(FuriThreadListItem, name) - 8usize];
1759 ["Offset of field: FuriThreadListItem::priority"]
1760 [::core::mem::offset_of!(FuriThreadListItem, priority) - 12usize];
1761 ["Offset of field: FuriThreadListItem::stack_address"]
1762 [::core::mem::offset_of!(FuriThreadListItem, stack_address) - 16usize];
1763 ["Offset of field: FuriThreadListItem::heap"]
1764 [::core::mem::offset_of!(FuriThreadListItem, heap) - 20usize];
1765 ["Offset of field: FuriThreadListItem::stack_size"]
1766 [::core::mem::offset_of!(FuriThreadListItem, stack_size) - 24usize];
1767 ["Offset of field: FuriThreadListItem::stack_min_free"]
1768 [::core::mem::offset_of!(FuriThreadListItem, stack_min_free) - 28usize];
1769 ["Offset of field: FuriThreadListItem::state"]
1770 [::core::mem::offset_of!(FuriThreadListItem, state) - 32usize];
1771 ["Offset of field: FuriThreadListItem::cpu"]
1772 [::core::mem::offset_of!(FuriThreadListItem, cpu) - 36usize];
1773 ["Offset of field: FuriThreadListItem::counter_previous"]
1774 [::core::mem::offset_of!(FuriThreadListItem, counter_previous) - 40usize];
1775 ["Offset of field: FuriThreadListItem::counter_current"]
1776 [::core::mem::offset_of!(FuriThreadListItem, counter_current) - 44usize];
1777 ["Offset of field: FuriThreadListItem::tick"]
1778 [::core::mem::offset_of!(FuriThreadListItem, tick) - 48usize];
1779};
1780unsafe extern "C" {
1781 #[doc = "Allocate FuriThreadList instance\n\n # Returns\n\nFuriThreadList instance"]
1782 pub fn furi_thread_list_alloc() -> *mut FuriThreadList;
1783}
1784unsafe extern "C" {
1785 #[doc = "Free FuriThreadList instance\n\n # Arguments\n\n* `instance` - The FuriThreadList instance to free"]
1786 pub fn furi_thread_list_free(instance: *mut FuriThreadList);
1787}
1788unsafe extern "C" {
1789 #[doc = "Get FuriThreadList instance size\n\n # Arguments\n\n* `instance` - The instance\n\n # Returns\n\nItem count"]
1790 pub fn furi_thread_list_size(instance: *mut FuriThreadList) -> usize;
1791}
1792unsafe extern "C" {
1793 #[doc = "Get item at position\n\n # Arguments\n\n* `instance` - The FuriThreadList instance\n * `position` (direction in) - The position of the item\n\n # Returns\n\nThe FuriThreadListItem instance"]
1794 pub fn furi_thread_list_get_at(
1795 instance: *mut FuriThreadList,
1796 position: usize,
1797 ) -> *mut FuriThreadListItem;
1798}
1799unsafe extern "C" {
1800 #[doc = "Get item by thread FuriThread pointer\n\n # Arguments\n\n* `instance` - The FuriThreadList instance\n * `thread` - The FuriThread pointer\n\n # Returns\n\nThe FuriThreadListItem instance"]
1801 pub fn furi_thread_list_get_or_insert(
1802 instance: *mut FuriThreadList,
1803 thread: *mut FuriThread,
1804 ) -> *mut FuriThreadListItem;
1805}
1806unsafe extern "C" {
1807 #[doc = "Get percent of time spent in ISR\n\n # Arguments\n\n* `instance` - The instance\n\n # Returns\n\npercent of time spent in ISR"]
1808 pub fn furi_thread_list_get_isr_time(instance: *mut FuriThreadList) -> f32;
1809}
1810pub type FuriTimerCallback =
1811 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
1812#[doc = "< One-shot timer."]
1813pub const FuriTimerTypeOnce: FuriTimerType = FuriTimerType(0);
1814#[doc = "< Repeating timer."]
1815pub const FuriTimerTypePeriodic: FuriTimerType = FuriTimerType(1);
1816#[repr(transparent)]
1817#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1818pub struct FuriTimerType(pub core::ffi::c_uchar);
1819#[repr(C)]
1820#[derive(Debug, Copy, Clone)]
1821pub struct FuriTimer {
1822 _unused: [u8; 0],
1823}
1824unsafe extern "C" {
1825 #[doc = "Allocate timer\n\n # Arguments\n\n* `func` (direction in) - The callback function\n * `type` (direction in) - The timer type\n * `context` - The callback context\n\n # Returns\n\nThe pointer to FuriTimer instance"]
1826 pub fn furi_timer_alloc(
1827 func: FuriTimerCallback,
1828 type_: FuriTimerType,
1829 context: *mut core::ffi::c_void,
1830 ) -> *mut FuriTimer;
1831}
1832unsafe extern "C" {
1833 #[doc = "Free timer\n\n # Arguments\n\n* `instance` - The pointer to FuriTimer instance"]
1834 pub fn furi_timer_free(instance: *mut FuriTimer);
1835}
1836unsafe extern "C" {
1837 #[doc = "Flush timer task control message queue\n\n Ensures that all commands before this point was processed."]
1838 pub fn furi_timer_flush();
1839}
1840unsafe extern "C" {
1841 #[doc = "Start timer\n\n This is asynchronous call, real operation will happen as soon as\n timer service process this request.\n\n # Arguments\n\n* `instance` - The pointer to FuriTimer instance\n * `ticks` (direction in) - The interval in ticks\n\n # Returns\n\nThe furi status."]
1842 pub fn furi_timer_start(instance: *mut FuriTimer, ticks: u32) -> FuriStatus;
1843}
1844unsafe extern "C" {
1845 #[doc = "Restart timer with previous timeout value\n\n This is asynchronous call, real operation will happen as soon as\n timer service process this request.\n\n # Arguments\n\n* `instance` - The pointer to FuriTimer instance\n * `ticks` (direction in) - The interval in ticks\n\n # Returns\n\nThe furi status."]
1846 pub fn furi_timer_restart(instance: *mut FuriTimer, ticks: u32) -> FuriStatus;
1847}
1848unsafe extern "C" {
1849 #[doc = "Stop timer\n\n This is synchronous call that will be blocked till timer queue processed.\n\n # Arguments\n\n* `instance` - The pointer to FuriTimer instance\n\n # Returns\n\nThe furi status."]
1850 pub fn furi_timer_stop(instance: *mut FuriTimer) -> FuriStatus;
1851}
1852unsafe extern "C" {
1853 #[doc = "Is timer running\n\n This cal may and will return obsolete timer state if timer\n commands are still in the queue. Please read FreeRTOS timer\n documentation first.\n\n # Arguments\n\n* `instance` - The pointer to FuriTimer instance\n\n # Returns\n\n0: not running, 1: running"]
1854 pub fn furi_timer_is_running(instance: *mut FuriTimer) -> u32;
1855}
1856unsafe extern "C" {
1857 #[doc = "Get timer expire time\n\n # Arguments\n\n* `instance` - The Timer instance\n\n # Returns\n\nexpire tick"]
1858 pub fn furi_timer_get_expire_time(instance: *mut FuriTimer) -> u32;
1859}
1860pub type FuriTimerPendigCallback =
1861 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, arg: u32)>;
1862unsafe extern "C" {
1863 pub fn furi_timer_pending_callback(
1864 callback: FuriTimerPendigCallback,
1865 context: *mut core::ffi::c_void,
1866 arg: u32,
1867 );
1868}
1869#[doc = "< Lower then other threads"]
1870pub const FuriTimerThreadPriorityNormal: FuriTimerThreadPriority = FuriTimerThreadPriority(0);
1871#[doc = "< Same as other threads"]
1872pub const FuriTimerThreadPriorityElevated: FuriTimerThreadPriority = FuriTimerThreadPriority(1);
1873#[repr(transparent)]
1874#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1875pub struct FuriTimerThreadPriority(pub core::ffi::c_uchar);
1876unsafe extern "C" {
1877 #[doc = "Set Timer thread priority\n\n # Arguments\n\n* `priority` (direction in) - The priority"]
1878 pub fn furi_timer_set_thread_priority(priority: FuriTimerThreadPriority);
1879}
1880#[repr(C)]
1881#[derive(Debug, Copy, Clone)]
1882pub struct FuriString {
1883 _unused: [u8; 0],
1884}
1885unsafe extern "C" {
1886 #[doc = "Allocate new FuriString.\n\n # Returns\n\npointer to the instance of FuriString"]
1887 pub fn furi_string_alloc() -> *mut FuriString;
1888}
1889unsafe extern "C" {
1890 #[doc = "Allocate new FuriString and set it to string.\n\n Allocate & Set the string a to the string.\n\n # Arguments\n\n* `source` - The source FuriString instance\n\n # Returns\n\npointer to the new instance of FuriString"]
1891 pub fn furi_string_alloc_set(source: *const FuriString) -> *mut FuriString;
1892}
1893unsafe extern "C" {
1894 #[doc = "Allocate new FuriString and set it to C string.\n\n Allocate & Set the string a to the C string.\n\n # Arguments\n\n* `cstr_source` - The C-string instance\n\n # Returns\n\npointer to the new instance of FuriString"]
1895 pub fn furi_string_alloc_set_str(cstr_source: *const core::ffi::c_char) -> *mut FuriString;
1896}
1897unsafe extern "C" {
1898 #[doc = "Allocate new FuriString and printf to it.\n\n Initialize and set a string to the given formatted value.\n\n # Arguments\n\n* `format` - The printf format\n * `...` (direction in) - args to format\n\n # Returns\n\npointer to the new instance of FuriString"]
1899 pub fn furi_string_alloc_printf(format: *const core::ffi::c_char, ...) -> *mut FuriString;
1900}
1901unsafe extern "C" {
1902 #[doc = "Allocate new FuriString and printf to it.\n\n Initialize and set a string to the given formatted value.\n\n # Arguments\n\n* `format` - The printf format\n * `args` - The format arguments\n\n # Returns\n\npointer to the new instance of FuriString"]
1903 pub fn furi_string_alloc_vprintf(
1904 format: *const core::ffi::c_char,
1905 args: va_list,
1906 ) -> *mut FuriString;
1907}
1908unsafe extern "C" {
1909 #[doc = "Allocate new FuriString and move source string content to it.\n\n Allocate the string, set it to the other one, and destroy the other one.\n\n # Arguments\n\n* `source` - The source FuriString instance\n\n # Returns\n\npointer to the new instance of FuriString"]
1910 pub fn furi_string_alloc_move(source: *mut FuriString) -> *mut FuriString;
1911}
1912unsafe extern "C" {
1913 #[doc = "Free FuriString.\n\n # Arguments\n\n* `string` - The FuriString instance to free"]
1914 pub fn furi_string_free(string: *mut FuriString);
1915}
1916unsafe extern "C" {
1917 #[doc = "Reserve memory for string.\n\n Modify the string capacity to be able to handle at least 'alloc' characters\n (including final null char).\n\n # Arguments\n\n* `string` - The FuriString instance\n * `size` - The size to reserve"]
1918 pub fn furi_string_reserve(string: *mut FuriString, size: usize);
1919}
1920unsafe extern "C" {
1921 #[doc = "Reset string.\n\n Make the string empty.\n\n # Arguments\n\n* `string` - The FuriString instance"]
1922 pub fn furi_string_reset(string: *mut FuriString);
1923}
1924unsafe extern "C" {
1925 #[doc = "Swap two strings.\n\n Swap the two strings string_1 and string_2.\n\n # Arguments\n\n* `string_1` - The FuriString instance 1\n * `string_2` - The FuriString instance 2"]
1926 pub fn furi_string_swap(string_1: *mut FuriString, string_2: *mut FuriString);
1927}
1928unsafe extern "C" {
1929 #[doc = "Move string_2 content to string_1.\n\n Copy data from one string to another and destroy the source.\n\n # Arguments\n\n* `destination` - The destination FuriString\n * `source` - The source FuriString"]
1930 pub fn furi_string_move(destination: *mut FuriString, source: *mut FuriString);
1931}
1932unsafe extern "C" {
1933 #[doc = "Compute a hash for the string.\n\n # Arguments\n\n* `string` - The FuriString instance\n\n # Returns\n\nhash value"]
1934 pub fn furi_string_hash(string: *const FuriString) -> usize;
1935}
1936unsafe extern "C" {
1937 #[doc = "Get string size (usually length, but not for UTF-8)\n\n # Arguments\n\n* `string` - The FuriString instance\n\n # Returns\n\nsize of the string"]
1938 pub fn furi_string_size(string: *const FuriString) -> usize;
1939}
1940unsafe extern "C" {
1941 #[doc = "Check that string is empty or not\n\n # Arguments\n\n* `string` - The FuriString instance\n\n # Returns\n\ntrue if empty otherwise false"]
1942 pub fn furi_string_empty(string: *const FuriString) -> bool;
1943}
1944unsafe extern "C" {
1945 #[doc = "Get the character at the given index.\n\n Return the selected character of the string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `index` - The index\n\n # Returns\n\ncharacter at index"]
1946 pub fn furi_string_get_char(string: *const FuriString, index: usize) -> core::ffi::c_char;
1947}
1948unsafe extern "C" {
1949 #[doc = "Return the string view a classic C string.\n\n # Arguments\n\n* `string` - The FuriString instance\n\n # Returns\n\nconst C-string, usable till first container change"]
1950 pub fn furi_string_get_cstr(string: *const FuriString) -> *const core::ffi::c_char;
1951}
1952unsafe extern "C" {
1953 #[doc = "Set the string to the other string.\n\n Set the string to the source string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `source` - The source"]
1954 pub fn furi_string_set(string: *mut FuriString, source: *mut FuriString);
1955}
1956unsafe extern "C" {
1957 #[doc = "Set the string to the other C string.\n\n Set the string to the source C string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `source` - The source"]
1958 pub fn furi_string_set_str(string: *mut FuriString, source: *const core::ffi::c_char);
1959}
1960unsafe extern "C" {
1961 #[doc = "Set the string to the n first characters of the C string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `source` - The source\n * `length` - The length"]
1962 pub fn furi_string_set_strn(
1963 string: *mut FuriString,
1964 source: *const core::ffi::c_char,
1965 length: usize,
1966 );
1967}
1968unsafe extern "C" {
1969 #[doc = "Set the character at the given index.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `index` - The index\n * `c` - The character"]
1970 pub fn furi_string_set_char(string: *mut FuriString, index: usize, c: core::ffi::c_char);
1971}
1972unsafe extern "C" {
1973 #[doc = "Set the string to the n first characters of other one.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `source` - The source\n * `offset` - The offset\n * `length` - The length"]
1974 pub fn furi_string_set_n(
1975 string: *mut FuriString,
1976 source: *const FuriString,
1977 offset: usize,
1978 length: usize,
1979 );
1980}
1981unsafe extern "C" {
1982 #[doc = "Format in the string the given printf format\n\n # Arguments\n\n* `string` - The string\n * `format` - The format\n * `...` (direction in) - The args\n\n # Returns\n\nnumber of characters printed or negative value on error"]
1983 pub fn furi_string_printf(
1984 string: *mut FuriString,
1985 format: *const core::ffi::c_char,
1986 ...
1987 ) -> core::ffi::c_int;
1988}
1989unsafe extern "C" {
1990 #[doc = "Format in the string the given printf format\n\n # Arguments\n\n* `string` - The FuriString instance\n * `format` - The format\n * `args` - The arguments\n\n # Returns\n\nnumber of characters printed or negative value on error"]
1991 pub fn furi_string_vprintf(
1992 string: *mut FuriString,
1993 format: *const core::ffi::c_char,
1994 args: va_list,
1995 ) -> core::ffi::c_int;
1996}
1997unsafe extern "C" {
1998 #[doc = "Append a character to the string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `c` - The character"]
1999 pub fn furi_string_push_back(string: *mut FuriString, c: core::ffi::c_char);
2000}
2001unsafe extern "C" {
2002 #[doc = "Append a string to the string.\n\n Concatenate the string with the other string.\n\n # Arguments\n\n* `string_1` - The string 1\n * `string_2` - The string 2"]
2003 pub fn furi_string_cat(string_1: *mut FuriString, string_2: *const FuriString);
2004}
2005unsafe extern "C" {
2006 #[doc = "Append a C string to the string.\n\n Concatenate the string with the C string.\n\n # Arguments\n\n* `string_1` - The string 1\n * `cstring_2` - The cstring 2"]
2007 pub fn furi_string_cat_str(string_1: *mut FuriString, cstring_2: *const core::ffi::c_char);
2008}
2009unsafe extern "C" {
2010 #[doc = "Append to the string the formatted string of the given printf format.\n\n # Arguments\n\n* `string` - The string\n * `format` - The format\n * `...` (direction in) - The args\n\n # Returns\n\nnumber of characters printed or negative value on error"]
2011 pub fn furi_string_cat_printf(
2012 string: *mut FuriString,
2013 format: *const core::ffi::c_char,
2014 ...
2015 ) -> core::ffi::c_int;
2016}
2017unsafe extern "C" {
2018 #[doc = "Append to the string the formatted string of the given printf format.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `format` - The format\n * `args` - The arguments\n\n # Returns\n\nnumber of characters printed or negative value on error"]
2019 pub fn furi_string_cat_vprintf(
2020 string: *mut FuriString,
2021 format: *const core::ffi::c_char,
2022 args: va_list,
2023 ) -> core::ffi::c_int;
2024}
2025unsafe extern "C" {
2026 #[doc = "Compare two strings and return the sort order.\n\n # Arguments\n\n* `string_1` - The string 1\n * `string_2` - The string 2\n\n # Returns\n\nzero if equal"]
2027 pub fn furi_string_cmp(
2028 string_1: *const FuriString,
2029 string_2: *const FuriString,
2030 ) -> core::ffi::c_int;
2031}
2032unsafe extern "C" {
2033 #[doc = "Compare string with C string and return the sort order.\n\n # Arguments\n\n* `string_1` - The string 1\n * `cstring_2` - The cstring 2\n\n # Returns\n\nzero if equal"]
2034 pub fn furi_string_cmp_str(
2035 string_1: *const FuriString,
2036 cstring_2: *const core::ffi::c_char,
2037 ) -> core::ffi::c_int;
2038}
2039unsafe extern "C" {
2040 #[doc = "Compare two strings (case insensitive according to the current locale) and\n return the sort order.\n\n Note: doesn't work with UTF-8 strings.\n\n # Arguments\n\n* `string_1` - The string 1\n * `string_2` - The string 2\n\n # Returns\n\nzero if equal"]
2041 pub fn furi_string_cmpi(
2042 string_1: *const FuriString,
2043 string_2: *const FuriString,
2044 ) -> core::ffi::c_int;
2045}
2046unsafe extern "C" {
2047 #[doc = "Compare string with C string (case insensitive according to the current\n locale) and return the sort order.\n\n Note: doesn't work with UTF-8 strings.\n\n # Arguments\n\n* `string_1` - The string 1\n * `cstring_2` - The cstring 2\n\n # Returns\n\nzero if equal"]
2048 pub fn furi_string_cmpi_str(
2049 string_1: *const FuriString,
2050 cstring_2: *const core::ffi::c_char,
2051 ) -> core::ffi::c_int;
2052}
2053unsafe extern "C" {
2054 #[doc = "Search the first occurrence of the needle in the string from the position\n start.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `needle` - The needle\n * `start` - The start (By default, start is zero)\n\n # Returns\n\nposition or FURI_STRING_FAILURE if not found"]
2055 pub fn furi_string_search(
2056 string: *const FuriString,
2057 needle: *const FuriString,
2058 start: usize,
2059 ) -> usize;
2060}
2061unsafe extern "C" {
2062 #[doc = "Search the first occurrence of the needle in the string from the position\n start.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `needle` - The needle\n * `start` - The start (By default, start is zero)\n\n # Returns\n\nposition or FURI_STRING_FAILURE if not found"]
2063 pub fn furi_string_search_str(
2064 string: *const FuriString,
2065 needle: *const core::ffi::c_char,
2066 start: usize,
2067 ) -> usize;
2068}
2069unsafe extern "C" {
2070 #[doc = "Search for the position of the character c from the position start (include)\n in the string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `c` - The character\n * `start` - The start (By default, start is zero)\n\n # Returns\n\nposition or FURI_STRING_FAILURE if not found"]
2071 pub fn furi_string_search_char(
2072 string: *const FuriString,
2073 c: core::ffi::c_char,
2074 start: usize,
2075 ) -> usize;
2076}
2077unsafe extern "C" {
2078 #[doc = "Reverse search for the position of the character c from the position start\n (include) in the string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `c` - The character\n * `start` - The start (By default, start is zero)\n\n # Returns\n\nposition or FURI_STRING_FAILURE if not found"]
2079 pub fn furi_string_search_rchar(
2080 string: *const FuriString,
2081 c: core::ffi::c_char,
2082 start: usize,
2083 ) -> usize;
2084}
2085unsafe extern "C" {
2086 #[doc = "Test if two strings are equal.\n\n # Arguments\n\n* `string_1` - The string 1\n * `string_2` - The string 2\n\n # Returns\n\ntrue if equal false otherwise"]
2087 pub fn furi_string_equal(string_1: *const FuriString, string_2: *const FuriString) -> bool;
2088}
2089unsafe extern "C" {
2090 #[doc = "Test if the string is equal to the C string.\n\n # Arguments\n\n* `string_1` - The string 1\n * `cstring_2` - The cstring 2\n\n # Returns\n\ntrue if equal false otherwise"]
2091 pub fn furi_string_equal_str(
2092 string_1: *const FuriString,
2093 cstring_2: *const core::ffi::c_char,
2094 ) -> bool;
2095}
2096unsafe extern "C" {
2097 #[doc = "Replace in the string the sub-string at position 'pos' for 'len' bytes into\n the C string 'replace'.\n\n # Arguments\n\n* `string` - The string\n * `pos` - The position\n * `len` - The length\n * `replace` - The replace"]
2098 pub fn furi_string_replace_at(
2099 string: *mut FuriString,
2100 pos: usize,
2101 len: usize,
2102 replace: *const core::ffi::c_char,
2103 );
2104}
2105unsafe extern "C" {
2106 #[doc = "Replace a string 'needle' to string 'replace' in a string from 'start'\n position.\n\n # Arguments\n\n* `string` - The string\n * `needle` - The needle\n * `replace` - The replace\n * `start` - The start (By default, start is zero)\n\n # Returns\n\nReturn FURI_STRING_FAILURE if 'needle' not found or replace position."]
2107 pub fn furi_string_replace(
2108 string: *mut FuriString,
2109 needle: *mut FuriString,
2110 replace: *mut FuriString,
2111 start: usize,
2112 ) -> usize;
2113}
2114unsafe extern "C" {
2115 #[doc = "Replace a C string 'needle' to C string 'replace' in a string from 'start'\n position.\n\n # Arguments\n\n* `string` - The string\n * `needle` - The needle\n * `replace` - The replace\n * `start` - The start (By default, start is zero)\n\n # Returns\n\nReturn FURI_STRING_FAILURE if 'needle' not found or replace position."]
2116 pub fn furi_string_replace_str(
2117 string: *mut FuriString,
2118 needle: *const core::ffi::c_char,
2119 replace: *const core::ffi::c_char,
2120 start: usize,
2121 ) -> usize;
2122}
2123unsafe extern "C" {
2124 #[doc = "Replace all occurrences of 'needle' string into 'replace' string.\n\n # Arguments\n\n* `string` - The string\n * `needle` - The needle\n * `replace` - The replace"]
2125 pub fn furi_string_replace_all(
2126 string: *mut FuriString,
2127 needle: *const FuriString,
2128 replace: *const FuriString,
2129 );
2130}
2131unsafe extern "C" {
2132 #[doc = "Replace all occurrences of 'needle' C string into 'replace' C string.\n\n # Arguments\n\n* `string` - The string\n * `needle` - The needle\n * `replace` - The replace"]
2133 pub fn furi_string_replace_all_str(
2134 string: *mut FuriString,
2135 needle: *const core::ffi::c_char,
2136 replace: *const core::ffi::c_char,
2137 );
2138}
2139unsafe extern "C" {
2140 #[doc = "Test if the string starts with the given string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `start` - The FuriString instance\n\n # Returns\n\ntrue if string starts with"]
2141 pub fn furi_string_start_with(string: *const FuriString, start: *const FuriString) -> bool;
2142}
2143unsafe extern "C" {
2144 #[doc = "Test if the string starts with the given C string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `start` - The start\n\n # Returns\n\ntrue if string starts with"]
2145 pub fn furi_string_start_with_str(
2146 string: *const FuriString,
2147 start: *const core::ffi::c_char,
2148 ) -> bool;
2149}
2150unsafe extern "C" {
2151 #[doc = "Test if the string ends with the given string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `end` - The end\n\n # Returns\n\ntrue if string ends with"]
2152 pub fn furi_string_end_with(string: *const FuriString, end: *const FuriString) -> bool;
2153}
2154unsafe extern "C" {
2155 #[doc = "Test if the string ends with the given string (case insensitive according to the current locale).\n\n # Arguments\n\n* `string` - The FuriString instance\n * `end` - The end\n\n # Returns\n\ntrue if string ends with"]
2156 pub fn furi_string_end_withi(string: *const FuriString, end: *const FuriString) -> bool;
2157}
2158unsafe extern "C" {
2159 #[doc = "Test if the string ends with the given C string.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `end` - The end\n\n # Returns\n\ntrue if string ends with"]
2160 pub fn furi_string_end_with_str(
2161 string: *const FuriString,
2162 end: *const core::ffi::c_char,
2163 ) -> bool;
2164}
2165unsafe extern "C" {
2166 #[doc = "Test if the string ends with the given C string (case insensitive according to the current locale).\n\n # Arguments\n\n* `string` - The FuriString instance\n * `end` - The end\n\n # Returns\n\ntrue if string ends with"]
2167 pub fn furi_string_end_withi_str(
2168 string: *const FuriString,
2169 end: *const core::ffi::c_char,
2170 ) -> bool;
2171}
2172unsafe extern "C" {
2173 #[doc = "Trim the string left to the first 'index' bytes.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `index` - The index"]
2174 pub fn furi_string_left(string: *mut FuriString, index: usize);
2175}
2176unsafe extern "C" {
2177 #[doc = "Trim the string right from the 'index' position to the last position.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `index` - The index"]
2178 pub fn furi_string_right(string: *mut FuriString, index: usize);
2179}
2180unsafe extern "C" {
2181 #[doc = "Trim the string from position index to size bytes.\n\n See also furi_string_set_n.\n\n # Arguments\n\n* `string` - The FuriString instance\n * `index` - The index\n * `size` - The size"]
2182 pub fn furi_string_mid(string: *mut FuriString, index: usize, size: usize);
2183}
2184unsafe extern "C" {
2185 #[doc = "Trim a string from the given set of characters (default is \" # Arguments\n\n* `string` - The FuriString instance\n * `chars` - The characters"]
2186 pub fn furi_string_trim(string: *mut FuriString, chars: *const core::ffi::c_char);
2187}
2188#[doc = "An unicode value"]
2189pub type FuriStringUnicodeValue = core::ffi::c_uint;
2190unsafe extern "C" {
2191 #[doc = "Compute the length in UTF8 characters in the string.\n\n # Arguments\n\n* `string` - The FuriString instance\n\n # Returns\n\nstrings size"]
2192 pub fn furi_string_utf8_length(string: *mut FuriString) -> usize;
2193}
2194unsafe extern "C" {
2195 #[doc = "Push unicode into string, encoding it in UTF8.\n\n # Arguments\n\n* `string` - The string\n * `unicode` - The unicode"]
2196 pub fn furi_string_utf8_push(string: *mut FuriString, unicode: FuriStringUnicodeValue);
2197}
2198pub const FuriStringUTF8StateStarting: FuriStringUTF8State = FuriStringUTF8State(0);
2199pub const FuriStringUTF8StateDecoding1: FuriStringUTF8State = FuriStringUTF8State(1);
2200pub const FuriStringUTF8StateDecoding2: FuriStringUTF8State = FuriStringUTF8State(2);
2201pub const FuriStringUTF8StateDecoding3: FuriStringUTF8State = FuriStringUTF8State(3);
2202pub const FuriStringUTF8StateError: FuriStringUTF8State = FuriStringUTF8State(4);
2203#[repr(transparent)]
2204#[doc = "State of the UTF8 decoding machine state"]
2205#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2206pub struct FuriStringUTF8State(pub core::ffi::c_uchar);
2207unsafe extern "C" {
2208 #[doc = "Main generic UTF8 decoder\n\n It takes a character, and the previous state and the previous value of the\n unicode value. It updates the state and the decoded unicode value. A decoded\n unicode encoded value is valid only when the state is\n FuriStringUTF8StateStarting.\n\n # Arguments\n\n* `c` - The character\n * `state` - The state\n * `unicode` - The unicode"]
2209 pub fn furi_string_utf8_decode(
2210 c: core::ffi::c_char,
2211 state: *mut FuriStringUTF8State,
2212 unicode: *mut FuriStringUnicodeValue,
2213 );
2214}
2215unsafe extern "C" {
2216 #[doc = "Allocate stream buffer instance.\n Stream buffer implementation assumes there is only one task or\n interrupt that will write to the buffer (the writer), and only one task or\n interrupt that will read from the buffer (the reader).\n\n # Arguments\n\n* `size` - The total number of bytes the stream buffer will be able to hold at any one time.\n * `trigger_level` - The number of bytes that must be in the stream buffer\n before a task that is blocked on the stream buffer to wait for data is moved out of the blocked state.\n # Returns\n\nThe stream buffer instance."]
2217 pub fn furi_stream_buffer_alloc(size: usize, trigger_level: usize) -> *mut FuriStreamBuffer;
2218}
2219unsafe extern "C" {
2220 #[doc = "Free stream buffer instance\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance."]
2221 pub fn furi_stream_buffer_free(stream_buffer: *mut FuriStreamBuffer);
2222}
2223unsafe extern "C" {
2224 #[doc = "Set trigger level for stream buffer.\n A stream buffer's trigger level is the number of bytes that must be in the\n stream buffer before a task that is blocked on the stream buffer to\n wait for data is moved out of the blocked state.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance\n * `trigger_level` - The new trigger level for the stream buffer.\n # Returns\n\ntrue if trigger level can be be updated (new trigger level was less than or equal to the stream buffer's length).\n false if trigger level can't be be updated (new trigger level was greater than the stream buffer's length)."]
2225 pub fn furi_stream_set_trigger_level(
2226 stream_buffer: *mut FuriStreamBuffer,
2227 trigger_level: usize,
2228 ) -> bool;
2229}
2230unsafe extern "C" {
2231 #[doc = "Get trigger level for stream buffer.\n A stream buffer's trigger level is the number of bytes that must be in the\n stream buffer before a task that is blocked on the stream buffer to\n wait for data is moved out of the blocked state.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance\n # Returns\n\nThe trigger level for the stream buffer"]
2232 pub fn furi_stream_get_trigger_level(stream_buffer: *mut FuriStreamBuffer) -> usize;
2233}
2234unsafe extern "C" {
2235 #[doc = "Sends bytes to a stream buffer. The bytes are copied into the stream buffer.\n Wakes up task waiting for data to become available if called from ISR.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance.\n * `data` - A pointer to the data that is to be copied into the stream buffer.\n * `length` - The maximum number of bytes to copy from data into the stream buffer.\n * `timeout` - The maximum amount of time the task should remain in the\n Blocked state to wait for space to become available if the stream buffer is full.\n Will return immediately if timeout is zero.\n Setting timeout to FuriWaitForever will cause the task to wait indefinitely.\n Ignored if called from ISR.\n # Returns\n\nThe number of bytes actually written to the stream buffer."]
2236 pub fn furi_stream_buffer_send(
2237 stream_buffer: *mut FuriStreamBuffer,
2238 data: *const core::ffi::c_void,
2239 length: usize,
2240 timeout: u32,
2241 ) -> usize;
2242}
2243unsafe extern "C" {
2244 #[doc = "Receives bytes from a stream buffer.\n Wakes up task waiting for space to become available if called from ISR.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance.\n * `data` - A pointer to the buffer into which the received bytes will be\n copied.\n * `length` - The length of the buffer pointed to by the data parameter.\n * `timeout` - The maximum amount of time the task should remain in the\n Blocked state to wait for data to become available if the stream buffer is empty.\n Will return immediately if timeout is zero.\n Setting timeout to FuriWaitForever will cause the task to wait indefinitely.\n Ignored if called from ISR.\n # Returns\n\nThe number of bytes read from the stream buffer, if any."]
2245 pub fn furi_stream_buffer_receive(
2246 stream_buffer: *mut FuriStreamBuffer,
2247 data: *mut core::ffi::c_void,
2248 length: usize,
2249 timeout: u32,
2250 ) -> usize;
2251}
2252unsafe extern "C" {
2253 #[doc = "Queries a stream buffer to see how much data it contains, which is equal to\n the number of bytes that can be read from the stream buffer before the stream\n buffer would be empty.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance.\n # Returns\n\nThe number of bytes that can be read from the stream buffer before\n the stream buffer would be empty."]
2254 pub fn furi_stream_buffer_bytes_available(stream_buffer: *mut FuriStreamBuffer) -> usize;
2255}
2256unsafe extern "C" {
2257 #[doc = "Queries a stream buffer to see how much free space it contains, which is\n equal to the amount of data that can be sent to the stream buffer before it\n is full.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance.\n # Returns\n\nThe number of bytes that can be written to the stream buffer before\n the stream buffer would be full."]
2258 pub fn furi_stream_buffer_spaces_available(stream_buffer: *mut FuriStreamBuffer) -> usize;
2259}
2260unsafe extern "C" {
2261 #[doc = "Queries a stream buffer to see if it is full.\n\n # Arguments\n\n* `stream_buffer` - stream buffer instance.\n # Returns\n\ntrue if the stream buffer is full.\n false if the stream buffer is not full."]
2262 pub fn furi_stream_buffer_is_full(stream_buffer: *mut FuriStreamBuffer) -> bool;
2263}
2264unsafe extern "C" {
2265 #[doc = "Queries a stream buffer to see if it is empty.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance.\n # Returns\n\ntrue if the stream buffer is empty.\n false if the stream buffer is not empty."]
2266 pub fn furi_stream_buffer_is_empty(stream_buffer: *mut FuriStreamBuffer) -> bool;
2267}
2268unsafe extern "C" {
2269 #[doc = "Resets a stream buffer to its initial, empty, state. Any data that was\n in the stream buffer is discarded. A stream buffer can only be reset if there\n are no tasks blocked waiting to either send to or receive from the stream buffer.\n\n # Arguments\n\n* `stream_buffer` - The stream buffer instance.\n # Returns\n\nFuriStatusOk if the stream buffer is reset.\n FuriStatusError if there was a task blocked waiting to send to or read\n from the stream buffer then the stream buffer is not reset."]
2270 pub fn furi_stream_buffer_reset(stream_buffer: *mut FuriStreamBuffer) -> FuriStatus;
2271}
2272unsafe extern "C" {
2273 #[doc = "< System Clock Frequency"]
2274 pub static mut SystemCoreClock: u32;
2275}
2276#[doc = "Comparator"]
2277#[repr(C)]
2278#[derive(Debug, Copy, Clone)]
2279pub struct COMP_TypeDef {
2280 #[doc = "< COMP control and status register, Address offset: 0x00"]
2281 pub CSR: u32,
2282}
2283#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2284const _: () = {
2285 ["Size of COMP_TypeDef"][::core::mem::size_of::<COMP_TypeDef>() - 4usize];
2286 ["Alignment of COMP_TypeDef"][::core::mem::align_of::<COMP_TypeDef>() - 4usize];
2287 ["Offset of field: COMP_TypeDef::CSR"][::core::mem::offset_of!(COMP_TypeDef, CSR) - 0usize];
2288};
2289#[repr(C)]
2290#[derive(Debug, Copy, Clone)]
2291pub struct DMA_TypeDef {
2292 #[doc = "< DMA interrupt status register, Address offset: 0x00"]
2293 pub ISR: u32,
2294 #[doc = "< DMA interrupt flag clear register, Address offset: 0x04"]
2295 pub IFCR: u32,
2296}
2297#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2298const _: () = {
2299 ["Size of DMA_TypeDef"][::core::mem::size_of::<DMA_TypeDef>() - 8usize];
2300 ["Alignment of DMA_TypeDef"][::core::mem::align_of::<DMA_TypeDef>() - 4usize];
2301 ["Offset of field: DMA_TypeDef::ISR"][::core::mem::offset_of!(DMA_TypeDef, ISR) - 0usize];
2302 ["Offset of field: DMA_TypeDef::IFCR"][::core::mem::offset_of!(DMA_TypeDef, IFCR) - 4usize];
2303};
2304#[doc = "General Purpose I/O"]
2305#[repr(C)]
2306#[derive(Debug, Copy, Clone)]
2307pub struct GPIO_TypeDef {
2308 #[doc = "< GPIO port mode register, Address offset: 0x00"]
2309 pub MODER: u32,
2310 #[doc = "< GPIO port output type register, Address offset: 0x04"]
2311 pub OTYPER: u32,
2312 #[doc = "< GPIO port output speed register, Address offset: 0x08"]
2313 pub OSPEEDR: u32,
2314 #[doc = "< GPIO port pull-up/pull-down register, Address offset: 0x0C"]
2315 pub PUPDR: u32,
2316 #[doc = "< GPIO port input data register, Address offset: 0x10"]
2317 pub IDR: u32,
2318 #[doc = "< GPIO port output data register, Address offset: 0x14"]
2319 pub ODR: u32,
2320 #[doc = "< GPIO port bit set/reset register, Address offset: 0x18"]
2321 pub BSRR: u32,
2322 #[doc = "< GPIO port configuration lock register, Address offset: 0x1C"]
2323 pub LCKR: u32,
2324 #[doc = "< GPIO alternate function registers, Address offset: 0x20-0x24"]
2325 pub AFR: [u32; 2usize],
2326 #[doc = "< GPIO Bit Reset register, Address offset: 0x28"]
2327 pub BRR: u32,
2328}
2329#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2330const _: () = {
2331 ["Size of GPIO_TypeDef"][::core::mem::size_of::<GPIO_TypeDef>() - 44usize];
2332 ["Alignment of GPIO_TypeDef"][::core::mem::align_of::<GPIO_TypeDef>() - 4usize];
2333 ["Offset of field: GPIO_TypeDef::MODER"][::core::mem::offset_of!(GPIO_TypeDef, MODER) - 0usize];
2334 ["Offset of field: GPIO_TypeDef::OTYPER"]
2335 [::core::mem::offset_of!(GPIO_TypeDef, OTYPER) - 4usize];
2336 ["Offset of field: GPIO_TypeDef::OSPEEDR"]
2337 [::core::mem::offset_of!(GPIO_TypeDef, OSPEEDR) - 8usize];
2338 ["Offset of field: GPIO_TypeDef::PUPDR"]
2339 [::core::mem::offset_of!(GPIO_TypeDef, PUPDR) - 12usize];
2340 ["Offset of field: GPIO_TypeDef::IDR"][::core::mem::offset_of!(GPIO_TypeDef, IDR) - 16usize];
2341 ["Offset of field: GPIO_TypeDef::ODR"][::core::mem::offset_of!(GPIO_TypeDef, ODR) - 20usize];
2342 ["Offset of field: GPIO_TypeDef::BSRR"][::core::mem::offset_of!(GPIO_TypeDef, BSRR) - 24usize];
2343 ["Offset of field: GPIO_TypeDef::LCKR"][::core::mem::offset_of!(GPIO_TypeDef, LCKR) - 28usize];
2344 ["Offset of field: GPIO_TypeDef::AFR"][::core::mem::offset_of!(GPIO_TypeDef, AFR) - 32usize];
2345 ["Offset of field: GPIO_TypeDef::BRR"][::core::mem::offset_of!(GPIO_TypeDef, BRR) - 40usize];
2346};
2347#[doc = "Inter-integrated Circuit Interface"]
2348#[repr(C)]
2349#[derive(Debug, Copy, Clone)]
2350pub struct I2C_TypeDef {
2351 #[doc = "< I2C Control register 1, Address offset: 0x00"]
2352 pub CR1: u32,
2353 #[doc = "< I2C Control register 2, Address offset: 0x04"]
2354 pub CR2: u32,
2355 #[doc = "< I2C Own address 1 register, Address offset: 0x08"]
2356 pub OAR1: u32,
2357 #[doc = "< I2C Own address 2 register, Address offset: 0x0C"]
2358 pub OAR2: u32,
2359 #[doc = "< I2C Timing register, Address offset: 0x10"]
2360 pub TIMINGR: u32,
2361 #[doc = "< I2C Timeout register, Address offset: 0x14"]
2362 pub TIMEOUTR: u32,
2363 #[doc = "< I2C Interrupt and status register, Address offset: 0x18"]
2364 pub ISR: u32,
2365 #[doc = "< I2C Interrupt clear register, Address offset: 0x1C"]
2366 pub ICR: u32,
2367 #[doc = "< I2C PEC register, Address offset: 0x20"]
2368 pub PECR: u32,
2369 #[doc = "< I2C Receive data register, Address offset: 0x24"]
2370 pub RXDR: u32,
2371 #[doc = "< I2C Transmit data register, Address offset: 0x28"]
2372 pub TXDR: u32,
2373}
2374#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2375const _: () = {
2376 ["Size of I2C_TypeDef"][::core::mem::size_of::<I2C_TypeDef>() - 44usize];
2377 ["Alignment of I2C_TypeDef"][::core::mem::align_of::<I2C_TypeDef>() - 4usize];
2378 ["Offset of field: I2C_TypeDef::CR1"][::core::mem::offset_of!(I2C_TypeDef, CR1) - 0usize];
2379 ["Offset of field: I2C_TypeDef::CR2"][::core::mem::offset_of!(I2C_TypeDef, CR2) - 4usize];
2380 ["Offset of field: I2C_TypeDef::OAR1"][::core::mem::offset_of!(I2C_TypeDef, OAR1) - 8usize];
2381 ["Offset of field: I2C_TypeDef::OAR2"][::core::mem::offset_of!(I2C_TypeDef, OAR2) - 12usize];
2382 ["Offset of field: I2C_TypeDef::TIMINGR"]
2383 [::core::mem::offset_of!(I2C_TypeDef, TIMINGR) - 16usize];
2384 ["Offset of field: I2C_TypeDef::TIMEOUTR"]
2385 [::core::mem::offset_of!(I2C_TypeDef, TIMEOUTR) - 20usize];
2386 ["Offset of field: I2C_TypeDef::ISR"][::core::mem::offset_of!(I2C_TypeDef, ISR) - 24usize];
2387 ["Offset of field: I2C_TypeDef::ICR"][::core::mem::offset_of!(I2C_TypeDef, ICR) - 28usize];
2388 ["Offset of field: I2C_TypeDef::PECR"][::core::mem::offset_of!(I2C_TypeDef, PECR) - 32usize];
2389 ["Offset of field: I2C_TypeDef::RXDR"][::core::mem::offset_of!(I2C_TypeDef, RXDR) - 36usize];
2390 ["Offset of field: I2C_TypeDef::TXDR"][::core::mem::offset_of!(I2C_TypeDef, TXDR) - 40usize];
2391};
2392#[doc = "LPTIMER"]
2393#[repr(C)]
2394#[derive(Debug, Copy, Clone)]
2395pub struct LPTIM_TypeDef {
2396 #[doc = "< LPTIM Interrupt and Status register, Address offset: 0x00"]
2397 pub ISR: u32,
2398 #[doc = "< LPTIM Interrupt Clear register, Address offset: 0x04"]
2399 pub ICR: u32,
2400 #[doc = "< LPTIM Interrupt Enable register, Address offset: 0x08"]
2401 pub IER: u32,
2402 #[doc = "< LPTIM Configuration register, Address offset: 0x0C"]
2403 pub CFGR: u32,
2404 #[doc = "< LPTIM Control register, Address offset: 0x10"]
2405 pub CR: u32,
2406 #[doc = "< LPTIM Compare register, Address offset: 0x14"]
2407 pub CMP: u32,
2408 #[doc = "< LPTIM Autoreload register, Address offset: 0x18"]
2409 pub ARR: u32,
2410 #[doc = "< LPTIM Counter register, Address offset: 0x1C"]
2411 pub CNT: u32,
2412 #[doc = "< LPTIM Option register, Address offset: 0x20"]
2413 pub OR: u32,
2414}
2415#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2416const _: () = {
2417 ["Size of LPTIM_TypeDef"][::core::mem::size_of::<LPTIM_TypeDef>() - 36usize];
2418 ["Alignment of LPTIM_TypeDef"][::core::mem::align_of::<LPTIM_TypeDef>() - 4usize];
2419 ["Offset of field: LPTIM_TypeDef::ISR"][::core::mem::offset_of!(LPTIM_TypeDef, ISR) - 0usize];
2420 ["Offset of field: LPTIM_TypeDef::ICR"][::core::mem::offset_of!(LPTIM_TypeDef, ICR) - 4usize];
2421 ["Offset of field: LPTIM_TypeDef::IER"][::core::mem::offset_of!(LPTIM_TypeDef, IER) - 8usize];
2422 ["Offset of field: LPTIM_TypeDef::CFGR"]
2423 [::core::mem::offset_of!(LPTIM_TypeDef, CFGR) - 12usize];
2424 ["Offset of field: LPTIM_TypeDef::CR"][::core::mem::offset_of!(LPTIM_TypeDef, CR) - 16usize];
2425 ["Offset of field: LPTIM_TypeDef::CMP"][::core::mem::offset_of!(LPTIM_TypeDef, CMP) - 20usize];
2426 ["Offset of field: LPTIM_TypeDef::ARR"][::core::mem::offset_of!(LPTIM_TypeDef, ARR) - 24usize];
2427 ["Offset of field: LPTIM_TypeDef::CNT"][::core::mem::offset_of!(LPTIM_TypeDef, CNT) - 28usize];
2428 ["Offset of field: LPTIM_TypeDef::OR"][::core::mem::offset_of!(LPTIM_TypeDef, OR) - 32usize];
2429};
2430#[doc = "Real-Time Clock"]
2431#[repr(C)]
2432#[derive(Debug, Copy, Clone)]
2433pub struct RTC_TypeDef {
2434 #[doc = "< RTC time register, Address offset: 0x00"]
2435 pub TR: u32,
2436 #[doc = "< RTC date register, Address offset: 0x04"]
2437 pub DR: u32,
2438 #[doc = "< RTC control register, Address offset: 0x08"]
2439 pub CR: u32,
2440 #[doc = "< RTC initialization and status register, Address offset: 0x0C"]
2441 pub ISR: u32,
2442 #[doc = "< RTC prescaler register, Address offset: 0x10"]
2443 pub PRER: u32,
2444 #[doc = "< RTC wakeup timer register, Address offset: 0x14"]
2445 pub WUTR: u32,
2446 #[doc = "< Reserved, Address offset: 0x18"]
2447 pub RESERVED: u32,
2448 #[doc = "< RTC alarm A register, Address offset: 0x1C"]
2449 pub ALRMAR: u32,
2450 #[doc = "< RTC alarm B register, Address offset: 0x20"]
2451 pub ALRMBR: u32,
2452 #[doc = "< RTC write protection register, Address offset: 0x24"]
2453 pub WPR: u32,
2454 #[doc = "< RTC sub second register, Address offset: 0x28"]
2455 pub SSR: u32,
2456 #[doc = "< RTC shift control register, Address offset: 0x2C"]
2457 pub SHIFTR: u32,
2458 #[doc = "< RTC time stamp time register, Address offset: 0x30"]
2459 pub TSTR: u32,
2460 #[doc = "< RTC time stamp date register, Address offset: 0x34"]
2461 pub TSDR: u32,
2462 #[doc = "< RTC time-stamp sub second register, Address offset: 0x38"]
2463 pub TSSSR: u32,
2464 #[doc = "< RTC calibration register, Address offset: 0x3C"]
2465 pub CALR: u32,
2466 #[doc = "< RTC tamper configuration register, Address offset: 0x40"]
2467 pub TAMPCR: u32,
2468 #[doc = "< RTC alarm A sub second register, Address offset: 0x44"]
2469 pub ALRMASSR: u32,
2470 #[doc = "< RTC alarm B sub second register, Address offset: 0x48"]
2471 pub ALRMBSSR: u32,
2472 #[doc = "< RTC option register, Address offset 0x4C"]
2473 pub OR: u32,
2474 #[doc = "< RTC backup register 0, Address offset: 0x50"]
2475 pub BKP0R: u32,
2476 #[doc = "< RTC backup register 1, Address offset: 0x54"]
2477 pub BKP1R: u32,
2478 #[doc = "< RTC backup register 2, Address offset: 0x58"]
2479 pub BKP2R: u32,
2480 #[doc = "< RTC backup register 3, Address offset: 0x5C"]
2481 pub BKP3R: u32,
2482 #[doc = "< RTC backup register 4, Address offset: 0x60"]
2483 pub BKP4R: u32,
2484 #[doc = "< RTC backup register 5, Address offset: 0x64"]
2485 pub BKP5R: u32,
2486 #[doc = "< RTC backup register 6, Address offset: 0x68"]
2487 pub BKP6R: u32,
2488 #[doc = "< RTC backup register 7, Address offset: 0x6C"]
2489 pub BKP7R: u32,
2490 #[doc = "< RTC backup register 8, Address offset: 0x70"]
2491 pub BKP8R: u32,
2492 #[doc = "< RTC backup register 9, Address offset: 0x74"]
2493 pub BKP9R: u32,
2494 #[doc = "< RTC backup register 10, Address offset: 0x78"]
2495 pub BKP10R: u32,
2496 #[doc = "< RTC backup register 11, Address offset: 0x7C"]
2497 pub BKP11R: u32,
2498 #[doc = "< RTC backup register 12, Address offset: 0x80"]
2499 pub BKP12R: u32,
2500 #[doc = "< RTC backup register 13, Address offset: 0x84"]
2501 pub BKP13R: u32,
2502 #[doc = "< RTC backup register 14, Address offset: 0x88"]
2503 pub BKP14R: u32,
2504 #[doc = "< RTC backup register 15, Address offset: 0x8C"]
2505 pub BKP15R: u32,
2506 #[doc = "< RTC backup register 16, Address offset: 0x90"]
2507 pub BKP16R: u32,
2508 #[doc = "< RTC backup register 17, Address offset: 0x94"]
2509 pub BKP17R: u32,
2510 #[doc = "< RTC backup register 18, Address offset: 0x98"]
2511 pub BKP18R: u32,
2512 #[doc = "< RTC backup register 19, Address offset: 0x9C"]
2513 pub BKP19R: u32,
2514}
2515#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2516const _: () = {
2517 ["Size of RTC_TypeDef"][::core::mem::size_of::<RTC_TypeDef>() - 160usize];
2518 ["Alignment of RTC_TypeDef"][::core::mem::align_of::<RTC_TypeDef>() - 4usize];
2519 ["Offset of field: RTC_TypeDef::TR"][::core::mem::offset_of!(RTC_TypeDef, TR) - 0usize];
2520 ["Offset of field: RTC_TypeDef::DR"][::core::mem::offset_of!(RTC_TypeDef, DR) - 4usize];
2521 ["Offset of field: RTC_TypeDef::CR"][::core::mem::offset_of!(RTC_TypeDef, CR) - 8usize];
2522 ["Offset of field: RTC_TypeDef::ISR"][::core::mem::offset_of!(RTC_TypeDef, ISR) - 12usize];
2523 ["Offset of field: RTC_TypeDef::PRER"][::core::mem::offset_of!(RTC_TypeDef, PRER) - 16usize];
2524 ["Offset of field: RTC_TypeDef::WUTR"][::core::mem::offset_of!(RTC_TypeDef, WUTR) - 20usize];
2525 ["Offset of field: RTC_TypeDef::RESERVED"]
2526 [::core::mem::offset_of!(RTC_TypeDef, RESERVED) - 24usize];
2527 ["Offset of field: RTC_TypeDef::ALRMAR"]
2528 [::core::mem::offset_of!(RTC_TypeDef, ALRMAR) - 28usize];
2529 ["Offset of field: RTC_TypeDef::ALRMBR"]
2530 [::core::mem::offset_of!(RTC_TypeDef, ALRMBR) - 32usize];
2531 ["Offset of field: RTC_TypeDef::WPR"][::core::mem::offset_of!(RTC_TypeDef, WPR) - 36usize];
2532 ["Offset of field: RTC_TypeDef::SSR"][::core::mem::offset_of!(RTC_TypeDef, SSR) - 40usize];
2533 ["Offset of field: RTC_TypeDef::SHIFTR"]
2534 [::core::mem::offset_of!(RTC_TypeDef, SHIFTR) - 44usize];
2535 ["Offset of field: RTC_TypeDef::TSTR"][::core::mem::offset_of!(RTC_TypeDef, TSTR) - 48usize];
2536 ["Offset of field: RTC_TypeDef::TSDR"][::core::mem::offset_of!(RTC_TypeDef, TSDR) - 52usize];
2537 ["Offset of field: RTC_TypeDef::TSSSR"][::core::mem::offset_of!(RTC_TypeDef, TSSSR) - 56usize];
2538 ["Offset of field: RTC_TypeDef::CALR"][::core::mem::offset_of!(RTC_TypeDef, CALR) - 60usize];
2539 ["Offset of field: RTC_TypeDef::TAMPCR"]
2540 [::core::mem::offset_of!(RTC_TypeDef, TAMPCR) - 64usize];
2541 ["Offset of field: RTC_TypeDef::ALRMASSR"]
2542 [::core::mem::offset_of!(RTC_TypeDef, ALRMASSR) - 68usize];
2543 ["Offset of field: RTC_TypeDef::ALRMBSSR"]
2544 [::core::mem::offset_of!(RTC_TypeDef, ALRMBSSR) - 72usize];
2545 ["Offset of field: RTC_TypeDef::OR"][::core::mem::offset_of!(RTC_TypeDef, OR) - 76usize];
2546 ["Offset of field: RTC_TypeDef::BKP0R"][::core::mem::offset_of!(RTC_TypeDef, BKP0R) - 80usize];
2547 ["Offset of field: RTC_TypeDef::BKP1R"][::core::mem::offset_of!(RTC_TypeDef, BKP1R) - 84usize];
2548 ["Offset of field: RTC_TypeDef::BKP2R"][::core::mem::offset_of!(RTC_TypeDef, BKP2R) - 88usize];
2549 ["Offset of field: RTC_TypeDef::BKP3R"][::core::mem::offset_of!(RTC_TypeDef, BKP3R) - 92usize];
2550 ["Offset of field: RTC_TypeDef::BKP4R"][::core::mem::offset_of!(RTC_TypeDef, BKP4R) - 96usize];
2551 ["Offset of field: RTC_TypeDef::BKP5R"][::core::mem::offset_of!(RTC_TypeDef, BKP5R) - 100usize];
2552 ["Offset of field: RTC_TypeDef::BKP6R"][::core::mem::offset_of!(RTC_TypeDef, BKP6R) - 104usize];
2553 ["Offset of field: RTC_TypeDef::BKP7R"][::core::mem::offset_of!(RTC_TypeDef, BKP7R) - 108usize];
2554 ["Offset of field: RTC_TypeDef::BKP8R"][::core::mem::offset_of!(RTC_TypeDef, BKP8R) - 112usize];
2555 ["Offset of field: RTC_TypeDef::BKP9R"][::core::mem::offset_of!(RTC_TypeDef, BKP9R) - 116usize];
2556 ["Offset of field: RTC_TypeDef::BKP10R"]
2557 [::core::mem::offset_of!(RTC_TypeDef, BKP10R) - 120usize];
2558 ["Offset of field: RTC_TypeDef::BKP11R"]
2559 [::core::mem::offset_of!(RTC_TypeDef, BKP11R) - 124usize];
2560 ["Offset of field: RTC_TypeDef::BKP12R"]
2561 [::core::mem::offset_of!(RTC_TypeDef, BKP12R) - 128usize];
2562 ["Offset of field: RTC_TypeDef::BKP13R"]
2563 [::core::mem::offset_of!(RTC_TypeDef, BKP13R) - 132usize];
2564 ["Offset of field: RTC_TypeDef::BKP14R"]
2565 [::core::mem::offset_of!(RTC_TypeDef, BKP14R) - 136usize];
2566 ["Offset of field: RTC_TypeDef::BKP15R"]
2567 [::core::mem::offset_of!(RTC_TypeDef, BKP15R) - 140usize];
2568 ["Offset of field: RTC_TypeDef::BKP16R"]
2569 [::core::mem::offset_of!(RTC_TypeDef, BKP16R) - 144usize];
2570 ["Offset of field: RTC_TypeDef::BKP17R"]
2571 [::core::mem::offset_of!(RTC_TypeDef, BKP17R) - 148usize];
2572 ["Offset of field: RTC_TypeDef::BKP18R"]
2573 [::core::mem::offset_of!(RTC_TypeDef, BKP18R) - 152usize];
2574 ["Offset of field: RTC_TypeDef::BKP19R"]
2575 [::core::mem::offset_of!(RTC_TypeDef, BKP19R) - 156usize];
2576};
2577#[doc = "Serial Peripheral Interface"]
2578#[repr(C)]
2579#[derive(Debug, Copy, Clone)]
2580pub struct SPI_TypeDef {
2581 #[doc = "< SPI Control register 1, Address offset: 0x00"]
2582 pub CR1: u32,
2583 #[doc = "< SPI Control register 2, Address offset: 0x04"]
2584 pub CR2: u32,
2585 #[doc = "< SPI Status register, Address offset: 0x08"]
2586 pub SR: u32,
2587 #[doc = "< SPI data register, Address offset: 0x0C"]
2588 pub DR: u32,
2589 #[doc = "< SPI CRC polynomial register, Address offset: 0x10"]
2590 pub CRCPR: u32,
2591 #[doc = "< SPI Rx CRC register, Address offset: 0x14"]
2592 pub RXCRCR: u32,
2593 #[doc = "< SPI Tx CRC register, Address offset: 0x18"]
2594 pub TXCRCR: u32,
2595}
2596#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2597const _: () = {
2598 ["Size of SPI_TypeDef"][::core::mem::size_of::<SPI_TypeDef>() - 28usize];
2599 ["Alignment of SPI_TypeDef"][::core::mem::align_of::<SPI_TypeDef>() - 4usize];
2600 ["Offset of field: SPI_TypeDef::CR1"][::core::mem::offset_of!(SPI_TypeDef, CR1) - 0usize];
2601 ["Offset of field: SPI_TypeDef::CR2"][::core::mem::offset_of!(SPI_TypeDef, CR2) - 4usize];
2602 ["Offset of field: SPI_TypeDef::SR"][::core::mem::offset_of!(SPI_TypeDef, SR) - 8usize];
2603 ["Offset of field: SPI_TypeDef::DR"][::core::mem::offset_of!(SPI_TypeDef, DR) - 12usize];
2604 ["Offset of field: SPI_TypeDef::CRCPR"][::core::mem::offset_of!(SPI_TypeDef, CRCPR) - 16usize];
2605 ["Offset of field: SPI_TypeDef::RXCRCR"]
2606 [::core::mem::offset_of!(SPI_TypeDef, RXCRCR) - 20usize];
2607 ["Offset of field: SPI_TypeDef::TXCRCR"]
2608 [::core::mem::offset_of!(SPI_TypeDef, TXCRCR) - 24usize];
2609};
2610#[doc = "TIM"]
2611#[repr(C)]
2612#[derive(Debug, Copy, Clone)]
2613pub struct TIM_TypeDef {
2614 #[doc = "< TIM control register 1, Address offset: 0x00"]
2615 pub CR1: u32,
2616 #[doc = "< TIM control register 2, Address offset: 0x04"]
2617 pub CR2: u32,
2618 #[doc = "< TIM slave mode control register, Address offset: 0x08"]
2619 pub SMCR: u32,
2620 #[doc = "< TIM DMA/interrupt enable register, Address offset: 0x0C"]
2621 pub DIER: u32,
2622 #[doc = "< TIM status register, Address offset: 0x10"]
2623 pub SR: u32,
2624 #[doc = "< TIM event generation register, Address offset: 0x14"]
2625 pub EGR: u32,
2626 #[doc = "< TIM capture/compare mode register 1, Address offset: 0x18"]
2627 pub CCMR1: u32,
2628 #[doc = "< TIM capture/compare mode register 2, Address offset: 0x1C"]
2629 pub CCMR2: u32,
2630 #[doc = "< TIM capture/compare enable register, Address offset: 0x20"]
2631 pub CCER: u32,
2632 #[doc = "< TIM counter register, Address offset: 0x24"]
2633 pub CNT: u32,
2634 #[doc = "< TIM prescaler register, Address offset: 0x28"]
2635 pub PSC: u32,
2636 #[doc = "< TIM auto-reload register, Address offset: 0x2C"]
2637 pub ARR: u32,
2638 #[doc = "< TIM repetition counter register, Address offset: 0x30"]
2639 pub RCR: u32,
2640 #[doc = "< TIM capture/compare register 1, Address offset: 0x34"]
2641 pub CCR1: u32,
2642 #[doc = "< TIM capture/compare register 2, Address offset: 0x38"]
2643 pub CCR2: u32,
2644 #[doc = "< TIM capture/compare register 3, Address offset: 0x3C"]
2645 pub CCR3: u32,
2646 #[doc = "< TIM capture/compare register 4, Address offset: 0x40"]
2647 pub CCR4: u32,
2648 #[doc = "< TIM break and dead-time register, Address offset: 0x44"]
2649 pub BDTR: u32,
2650 #[doc = "< TIM DMA control register, Address offset: 0x48"]
2651 pub DCR: u32,
2652 #[doc = "< TIM DMA address for full transfer, Address offset: 0x4C"]
2653 pub DMAR: u32,
2654 #[doc = "< TIM option register Address offset: 0x50"]
2655 pub OR: u32,
2656 #[doc = "< TIM capture/compare mode register 3, Address offset: 0x54"]
2657 pub CCMR3: u32,
2658 #[doc = "< TIM capture/compare register5, Address offset: 0x58"]
2659 pub CCR5: u32,
2660 #[doc = "< TIM capture/compare register6, Address offset: 0x5C"]
2661 pub CCR6: u32,
2662 #[doc = "< TIM Alternate function option register 1, Address offset: 0x60"]
2663 pub AF1: u32,
2664 #[doc = "< TIM Alternate function option register 2, Address offset: 0x64"]
2665 pub AF2: u32,
2666}
2667#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2668const _: () = {
2669 ["Size of TIM_TypeDef"][::core::mem::size_of::<TIM_TypeDef>() - 104usize];
2670 ["Alignment of TIM_TypeDef"][::core::mem::align_of::<TIM_TypeDef>() - 4usize];
2671 ["Offset of field: TIM_TypeDef::CR1"][::core::mem::offset_of!(TIM_TypeDef, CR1) - 0usize];
2672 ["Offset of field: TIM_TypeDef::CR2"][::core::mem::offset_of!(TIM_TypeDef, CR2) - 4usize];
2673 ["Offset of field: TIM_TypeDef::SMCR"][::core::mem::offset_of!(TIM_TypeDef, SMCR) - 8usize];
2674 ["Offset of field: TIM_TypeDef::DIER"][::core::mem::offset_of!(TIM_TypeDef, DIER) - 12usize];
2675 ["Offset of field: TIM_TypeDef::SR"][::core::mem::offset_of!(TIM_TypeDef, SR) - 16usize];
2676 ["Offset of field: TIM_TypeDef::EGR"][::core::mem::offset_of!(TIM_TypeDef, EGR) - 20usize];
2677 ["Offset of field: TIM_TypeDef::CCMR1"][::core::mem::offset_of!(TIM_TypeDef, CCMR1) - 24usize];
2678 ["Offset of field: TIM_TypeDef::CCMR2"][::core::mem::offset_of!(TIM_TypeDef, CCMR2) - 28usize];
2679 ["Offset of field: TIM_TypeDef::CCER"][::core::mem::offset_of!(TIM_TypeDef, CCER) - 32usize];
2680 ["Offset of field: TIM_TypeDef::CNT"][::core::mem::offset_of!(TIM_TypeDef, CNT) - 36usize];
2681 ["Offset of field: TIM_TypeDef::PSC"][::core::mem::offset_of!(TIM_TypeDef, PSC) - 40usize];
2682 ["Offset of field: TIM_TypeDef::ARR"][::core::mem::offset_of!(TIM_TypeDef, ARR) - 44usize];
2683 ["Offset of field: TIM_TypeDef::RCR"][::core::mem::offset_of!(TIM_TypeDef, RCR) - 48usize];
2684 ["Offset of field: TIM_TypeDef::CCR1"][::core::mem::offset_of!(TIM_TypeDef, CCR1) - 52usize];
2685 ["Offset of field: TIM_TypeDef::CCR2"][::core::mem::offset_of!(TIM_TypeDef, CCR2) - 56usize];
2686 ["Offset of field: TIM_TypeDef::CCR3"][::core::mem::offset_of!(TIM_TypeDef, CCR3) - 60usize];
2687 ["Offset of field: TIM_TypeDef::CCR4"][::core::mem::offset_of!(TIM_TypeDef, CCR4) - 64usize];
2688 ["Offset of field: TIM_TypeDef::BDTR"][::core::mem::offset_of!(TIM_TypeDef, BDTR) - 68usize];
2689 ["Offset of field: TIM_TypeDef::DCR"][::core::mem::offset_of!(TIM_TypeDef, DCR) - 72usize];
2690 ["Offset of field: TIM_TypeDef::DMAR"][::core::mem::offset_of!(TIM_TypeDef, DMAR) - 76usize];
2691 ["Offset of field: TIM_TypeDef::OR"][::core::mem::offset_of!(TIM_TypeDef, OR) - 80usize];
2692 ["Offset of field: TIM_TypeDef::CCMR3"][::core::mem::offset_of!(TIM_TypeDef, CCMR3) - 84usize];
2693 ["Offset of field: TIM_TypeDef::CCR5"][::core::mem::offset_of!(TIM_TypeDef, CCR5) - 88usize];
2694 ["Offset of field: TIM_TypeDef::CCR6"][::core::mem::offset_of!(TIM_TypeDef, CCR6) - 92usize];
2695 ["Offset of field: TIM_TypeDef::AF1"][::core::mem::offset_of!(TIM_TypeDef, AF1) - 96usize];
2696 ["Offset of field: TIM_TypeDef::AF2"][::core::mem::offset_of!(TIM_TypeDef, AF2) - 100usize];
2697};
2698#[doc = "Universal Synchronous Asynchronous Receiver Transmitter"]
2699#[repr(C)]
2700#[derive(Debug, Copy, Clone)]
2701pub struct USART_TypeDef {
2702 #[doc = "< USART Control register 1, Address offset: 0x00"]
2703 pub CR1: u32,
2704 #[doc = "< USART Control register 2, Address offset: 0x04"]
2705 pub CR2: u32,
2706 #[doc = "< USART Control register 3, Address offset: 0x08"]
2707 pub CR3: u32,
2708 #[doc = "< USART Baud rate register, Address offset: 0x0C"]
2709 pub BRR: u32,
2710 #[doc = "< USART Guard time and prescaler register, Address offset: 0x10"]
2711 pub GTPR: u32,
2712 #[doc = "< USART Receiver Time Out register, Address offset: 0x14"]
2713 pub RTOR: u32,
2714 #[doc = "< USART Request register, Address offset: 0x18"]
2715 pub RQR: u32,
2716 #[doc = "< USART Interrupt and status register, Address offset: 0x1C"]
2717 pub ISR: u32,
2718 #[doc = "< USART Interrupt flag Clear register, Address offset: 0x20"]
2719 pub ICR: u32,
2720 #[doc = "< USART Receive Data register, Address offset: 0x24"]
2721 pub RDR: u32,
2722 #[doc = "< USART Transmit Data register, Address offset: 0x28"]
2723 pub TDR: u32,
2724 #[doc = "< USART Prescaler register, Address offset: 0x2C"]
2725 pub PRESC: u32,
2726}
2727#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2728const _: () = {
2729 ["Size of USART_TypeDef"][::core::mem::size_of::<USART_TypeDef>() - 48usize];
2730 ["Alignment of USART_TypeDef"][::core::mem::align_of::<USART_TypeDef>() - 4usize];
2731 ["Offset of field: USART_TypeDef::CR1"][::core::mem::offset_of!(USART_TypeDef, CR1) - 0usize];
2732 ["Offset of field: USART_TypeDef::CR2"][::core::mem::offset_of!(USART_TypeDef, CR2) - 4usize];
2733 ["Offset of field: USART_TypeDef::CR3"][::core::mem::offset_of!(USART_TypeDef, CR3) - 8usize];
2734 ["Offset of field: USART_TypeDef::BRR"][::core::mem::offset_of!(USART_TypeDef, BRR) - 12usize];
2735 ["Offset of field: USART_TypeDef::GTPR"]
2736 [::core::mem::offset_of!(USART_TypeDef, GTPR) - 16usize];
2737 ["Offset of field: USART_TypeDef::RTOR"]
2738 [::core::mem::offset_of!(USART_TypeDef, RTOR) - 20usize];
2739 ["Offset of field: USART_TypeDef::RQR"][::core::mem::offset_of!(USART_TypeDef, RQR) - 24usize];
2740 ["Offset of field: USART_TypeDef::ISR"][::core::mem::offset_of!(USART_TypeDef, ISR) - 28usize];
2741 ["Offset of field: USART_TypeDef::ICR"][::core::mem::offset_of!(USART_TypeDef, ICR) - 32usize];
2742 ["Offset of field: USART_TypeDef::RDR"][::core::mem::offset_of!(USART_TypeDef, RDR) - 36usize];
2743 ["Offset of field: USART_TypeDef::TDR"][::core::mem::offset_of!(USART_TypeDef, TDR) - 40usize];
2744 ["Offset of field: USART_TypeDef::PRESC"]
2745 [::core::mem::offset_of!(USART_TypeDef, PRESC) - 44usize];
2746};
2747pub const SUCCESS: ErrorStatus = ErrorStatus(0);
2748pub const ERROR: ErrorStatus = ErrorStatus(1);
2749#[repr(transparent)]
2750#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2751pub struct ErrorStatus(pub core::ffi::c_uchar);
2752#[doc = "LL GPIO Init Structure definition"]
2753#[repr(C)]
2754#[derive(Debug, Copy, Clone)]
2755pub struct LL_GPIO_InitTypeDef {
2756 #[doc = "< Specifies the GPIO pins to be configured.\nThis parameter can be any value of GPIO_LL_EC_PIN"]
2757 pub Pin: u32,
2758 #[doc = "< Specifies the operating mode for the selected pins.\nThis parameter can be a value of GPIO_LL_EC_MODE.\n\nGPIO HW configuration can be modified afterwards using unitary function LL_GPIO_SetPinMode()."]
2759 pub Mode: u32,
2760 #[doc = "< Specifies the speed for the selected pins.\nThis parameter can be a value of GPIO_LL_EC_SPEED.\n\nGPIO HW configuration can be modified afterwards using unitary function LL_GPIO_SetPinSpeed()."]
2761 pub Speed: u32,
2762 #[doc = "< Specifies the operating output type for the selected pins.\nThis parameter can be a value of GPIO_LL_EC_OUTPUT.\n\nGPIO HW configuration can be modified afterwards using unitary function LL_GPIO_SetPinOutputType()."]
2763 pub OutputType: u32,
2764 #[doc = "< Specifies the operating Pull-up/Pull down for the selected pins.\nThis parameter can be a value of GPIO_LL_EC_PULL.\n\nGPIO HW configuration can be modified afterwards using unitary function LL_GPIO_SetPinPull()."]
2765 pub Pull: u32,
2766 #[doc = "< Specifies the Peripheral to be connected to the selected pins.\nThis parameter can be a value of GPIO_LL_EC_AF.\n\nGPIO HW configuration can be modified afterwards using unitary function LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15()."]
2767 pub Alternate: u32,
2768}
2769#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2770const _: () = {
2771 ["Size of LL_GPIO_InitTypeDef"][::core::mem::size_of::<LL_GPIO_InitTypeDef>() - 24usize];
2772 ["Alignment of LL_GPIO_InitTypeDef"][::core::mem::align_of::<LL_GPIO_InitTypeDef>() - 4usize];
2773 ["Offset of field: LL_GPIO_InitTypeDef::Pin"]
2774 [::core::mem::offset_of!(LL_GPIO_InitTypeDef, Pin) - 0usize];
2775 ["Offset of field: LL_GPIO_InitTypeDef::Mode"]
2776 [::core::mem::offset_of!(LL_GPIO_InitTypeDef, Mode) - 4usize];
2777 ["Offset of field: LL_GPIO_InitTypeDef::Speed"]
2778 [::core::mem::offset_of!(LL_GPIO_InitTypeDef, Speed) - 8usize];
2779 ["Offset of field: LL_GPIO_InitTypeDef::OutputType"]
2780 [::core::mem::offset_of!(LL_GPIO_InitTypeDef, OutputType) - 12usize];
2781 ["Offset of field: LL_GPIO_InitTypeDef::Pull"]
2782 [::core::mem::offset_of!(LL_GPIO_InitTypeDef, Pull) - 16usize];
2783 ["Offset of field: LL_GPIO_InitTypeDef::Alternate"]
2784 [::core::mem::offset_of!(LL_GPIO_InitTypeDef, Alternate) - 20usize];
2785};
2786unsafe extern "C" {
2787 pub fn LL_GPIO_Init(
2788 GPIOx: *mut GPIO_TypeDef,
2789 GPIO_InitStruct: *mut LL_GPIO_InitTypeDef,
2790 ) -> ErrorStatus;
2791}
2792#[doc = "Interrupt callback prototype"]
2793pub type GpioExtiCallback =
2794 ::core::option::Option<unsafe extern "C" fn(ctx: *mut core::ffi::c_void)>;
2795#[doc = "Gpio interrupt type"]
2796#[repr(C)]
2797#[derive(Debug, Copy, Clone)]
2798pub struct GpioInterrupt {
2799 pub callback: GpioExtiCallback,
2800 pub context: *mut core::ffi::c_void,
2801}
2802#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2803const _: () = {
2804 ["Size of GpioInterrupt"][::core::mem::size_of::<GpioInterrupt>() - 8usize];
2805 ["Alignment of GpioInterrupt"][::core::mem::align_of::<GpioInterrupt>() - 4usize];
2806 ["Offset of field: GpioInterrupt::callback"]
2807 [::core::mem::offset_of!(GpioInterrupt, callback) - 0usize];
2808 ["Offset of field: GpioInterrupt::context"]
2809 [::core::mem::offset_of!(GpioInterrupt, context) - 4usize];
2810};
2811pub const GpioModeInput: GpioMode = GpioMode(0);
2812pub const GpioModeOutputPushPull: GpioMode = GpioMode(1);
2813pub const GpioModeOutputOpenDrain: GpioMode = GpioMode(2);
2814pub const GpioModeAltFunctionPushPull: GpioMode = GpioMode(3);
2815pub const GpioModeAltFunctionOpenDrain: GpioMode = GpioMode(4);
2816pub const GpioModeAnalog: GpioMode = GpioMode(5);
2817pub const GpioModeInterruptRise: GpioMode = GpioMode(6);
2818pub const GpioModeInterruptFall: GpioMode = GpioMode(7);
2819pub const GpioModeInterruptRiseFall: GpioMode = GpioMode(8);
2820pub const GpioModeEventRise: GpioMode = GpioMode(9);
2821pub const GpioModeEventFall: GpioMode = GpioMode(10);
2822pub const GpioModeEventRiseFall: GpioMode = GpioMode(11);
2823#[repr(transparent)]
2824#[doc = "Gpio modes"]
2825#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2826pub struct GpioMode(pub core::ffi::c_uchar);
2827pub const GpioPullNo: GpioPull = GpioPull(0);
2828pub const GpioPullUp: GpioPull = GpioPull(1);
2829pub const GpioPullDown: GpioPull = GpioPull(2);
2830#[repr(transparent)]
2831#[doc = "Gpio pull modes"]
2832#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2833pub struct GpioPull(pub core::ffi::c_uchar);
2834pub const GpioSpeedLow: GpioSpeed = GpioSpeed(0);
2835pub const GpioSpeedMedium: GpioSpeed = GpioSpeed(1);
2836pub const GpioSpeedHigh: GpioSpeed = GpioSpeed(2);
2837pub const GpioSpeedVeryHigh: GpioSpeed = GpioSpeed(3);
2838#[repr(transparent)]
2839#[doc = "Gpio speed modes"]
2840#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2841pub struct GpioSpeed(pub core::ffi::c_uchar);
2842#[doc = "< MCO Alternate Function mapping"]
2843pub const GpioAltFn0MCO: GpioAltFn = GpioAltFn(0);
2844#[doc = "< LSCO Alternate Function mapping"]
2845pub const GpioAltFn0LSCO: GpioAltFn = GpioAltFn(0);
2846#[doc = "< JTMS-SWDIO Alternate Function mapping"]
2847pub const GpioAltFn0JTMS_SWDIO: GpioAltFn = GpioAltFn(0);
2848#[doc = "< JTCK-SWCLK Alternate Function mapping"]
2849pub const GpioAltFn0JTCK_SWCLK: GpioAltFn = GpioAltFn(0);
2850#[doc = "< JTDI Alternate Function mapping"]
2851pub const GpioAltFn0JTDI: GpioAltFn = GpioAltFn(0);
2852#[doc = "< RCT_OUT Alternate Function mapping"]
2853pub const GpioAltFn0RTC_OUT: GpioAltFn = GpioAltFn(0);
2854#[doc = "< JTDO-TRACESWO Alternate Function mapping"]
2855pub const GpioAltFn0JTD_TRACE: GpioAltFn = GpioAltFn(0);
2856#[doc = "< NJTRST Alternate Function mapping"]
2857pub const GpioAltFn0NJTRST: GpioAltFn = GpioAltFn(0);
2858#[doc = "< RTC_REFIN Alternate Function mapping"]
2859pub const GpioAltFn0RTC_REFIN: GpioAltFn = GpioAltFn(0);
2860#[doc = "< TRACED0 Alternate Function mapping"]
2861pub const GpioAltFn0TRACED0: GpioAltFn = GpioAltFn(0);
2862#[doc = "< TRACED1 Alternate Function mapping"]
2863pub const GpioAltFn0TRACED1: GpioAltFn = GpioAltFn(0);
2864#[doc = "< TRACED2 Alternate Function mapping"]
2865pub const GpioAltFn0TRACED2: GpioAltFn = GpioAltFn(0);
2866#[doc = "< TRACED3 Alternate Function mapping"]
2867pub const GpioAltFn0TRACED3: GpioAltFn = GpioAltFn(0);
2868#[doc = "< TRIG_INOUT Alternate Function mapping"]
2869pub const GpioAltFn0TRIG_INOUT: GpioAltFn = GpioAltFn(0);
2870#[doc = "< TRACECK Alternate Function mapping"]
2871pub const GpioAltFn0TRACECK: GpioAltFn = GpioAltFn(0);
2872#[doc = "< System Function mapping"]
2873pub const GpioAltFn0SYS: GpioAltFn = GpioAltFn(0);
2874#[doc = "< TIM1 Alternate Function mapping"]
2875pub const GpioAltFn1TIM1: GpioAltFn = GpioAltFn(1);
2876#[doc = "< TIM2 Alternate Function mapping"]
2877pub const GpioAltFn1TIM2: GpioAltFn = GpioAltFn(1);
2878#[doc = "< LPTIM1 Alternate Function mapping"]
2879pub const GpioAltFn1LPTIM1: GpioAltFn = GpioAltFn(1);
2880#[doc = "< TIM2 Alternate Function mapping"]
2881pub const GpioAltFn2TIM2: GpioAltFn = GpioAltFn(2);
2882#[doc = "< TIM1 Alternate Function mapping"]
2883pub const GpioAltFn2TIM1: GpioAltFn = GpioAltFn(2);
2884#[doc = "< SAI1_CK1 Alternate Function mapping"]
2885pub const GpioAltFn3SAI1: GpioAltFn = GpioAltFn(3);
2886#[doc = "< SPI2 Alternate Function mapping"]
2887pub const GpioAltFn3SPI2: GpioAltFn = GpioAltFn(3);
2888#[doc = "< TIM1 Alternate Function mapping"]
2889pub const GpioAltFn3TIM1: GpioAltFn = GpioAltFn(3);
2890#[doc = "< I2C1 Alternate Function mapping"]
2891pub const GpioAltFn4I2C1: GpioAltFn = GpioAltFn(4);
2892#[doc = "< I2C3 Alternate Function mapping"]
2893pub const GpioAltFn4I2C3: GpioAltFn = GpioAltFn(4);
2894#[doc = "< SPI1 Alternate Function mapping"]
2895pub const GpioAltFn5SPI1: GpioAltFn = GpioAltFn(5);
2896#[doc = "< SPI2 Alternate Function mapping"]
2897pub const GpioAltFn5SPI2: GpioAltFn = GpioAltFn(5);
2898#[doc = "< MCO Alternate Function mapping"]
2899pub const GpioAltFn6MCO: GpioAltFn = GpioAltFn(6);
2900#[doc = "< LSCO Alternate Function mapping"]
2901pub const GpioAltFn6LSCO: GpioAltFn = GpioAltFn(6);
2902#[doc = "< RF_DTB0 Alternate Function mapping"]
2903pub const GpioAltFn6RF_DTB0: GpioAltFn = GpioAltFn(6);
2904#[doc = "< RF_DTB1 Alternate Function mapping"]
2905pub const GpioAltFn6RF_DTB1: GpioAltFn = GpioAltFn(6);
2906#[doc = "< RF_DTB2 Alternate Function mapping"]
2907pub const GpioAltFn6RF_DTB2: GpioAltFn = GpioAltFn(6);
2908#[doc = "< RF_DTB3 Alternate Function mapping"]
2909pub const GpioAltFn6RF_DTB3: GpioAltFn = GpioAltFn(6);
2910#[doc = "< RF_DTB4 Alternate Function mapping"]
2911pub const GpioAltFn6RF_DTB4: GpioAltFn = GpioAltFn(6);
2912#[doc = "< RF_DTB5 Alternate Function mapping"]
2913pub const GpioAltFn6RF_DTB5: GpioAltFn = GpioAltFn(6);
2914#[doc = "< RF_DTB6 Alternate Function mapping"]
2915pub const GpioAltFn6RF_DTB6: GpioAltFn = GpioAltFn(6);
2916#[doc = "< RF_DTB7 Alternate Function mapping"]
2917pub const GpioAltFn6RF_DTB7: GpioAltFn = GpioAltFn(6);
2918#[doc = "< RF_DTB8 Alternate Function mapping"]
2919pub const GpioAltFn6RF_DTB8: GpioAltFn = GpioAltFn(6);
2920#[doc = "< RF_DTB9 Alternate Function mapping"]
2921pub const GpioAltFn6RF_DTB9: GpioAltFn = GpioAltFn(6);
2922#[doc = "< RF_DTB10 Alternate Function mapping"]
2923pub const GpioAltFn6RF_DTB10: GpioAltFn = GpioAltFn(6);
2924#[doc = "< RF_DTB11 Alternate Function mapping"]
2925pub const GpioAltFn6RF_DTB11: GpioAltFn = GpioAltFn(6);
2926#[doc = "< RF_DTB12 Alternate Function mapping"]
2927pub const GpioAltFn6RF_DTB12: GpioAltFn = GpioAltFn(6);
2928#[doc = "< RF_DTB13 Alternate Function mapping"]
2929pub const GpioAltFn6RF_DTB13: GpioAltFn = GpioAltFn(6);
2930#[doc = "< RF_DTB14 Alternate Function mapping"]
2931pub const GpioAltFn6RF_DTB14: GpioAltFn = GpioAltFn(6);
2932#[doc = "< RF_DTB15 Alternate Function mapping"]
2933pub const GpioAltFn6RF_DTB15: GpioAltFn = GpioAltFn(6);
2934#[doc = "< RF_DTB16 Alternate Function mapping"]
2935pub const GpioAltFn6RF_DTB16: GpioAltFn = GpioAltFn(6);
2936#[doc = "< RF_DTB17 Alternate Function mapping"]
2937pub const GpioAltFn6RF_DTB17: GpioAltFn = GpioAltFn(6);
2938#[doc = "< RF_DTB18 Alternate Function mapping"]
2939pub const GpioAltFn6RF_DTB18: GpioAltFn = GpioAltFn(6);
2940#[doc = "< RF_MISO Alternate Function mapping"]
2941pub const GpioAltFn6RF_MISO: GpioAltFn = GpioAltFn(6);
2942#[doc = "< RF_MOSI Alternate Function mapping"]
2943pub const GpioAltFn6RF_MOSI: GpioAltFn = GpioAltFn(6);
2944#[doc = "< RF_SCK Alternate Function mapping"]
2945pub const GpioAltFn6RF_SCK: GpioAltFn = GpioAltFn(6);
2946#[doc = "< RF_NSS Alternate Function mapping"]
2947pub const GpioAltFn6RF_NSS: GpioAltFn = GpioAltFn(6);
2948#[doc = "< USART1 Alternate Function mapping"]
2949pub const GpioAltFn7USART1: GpioAltFn = GpioAltFn(7);
2950#[doc = "< LPUART1 Alternate Function mapping"]
2951pub const GpioAltFn8LPUART1: GpioAltFn = GpioAltFn(8);
2952#[doc = "< IR Alternate Function mapping"]
2953pub const GpioAltFn8IR: GpioAltFn = GpioAltFn(8);
2954#[doc = "< TSC Alternate Function mapping"]
2955pub const GpioAltFn9TSC: GpioAltFn = GpioAltFn(9);
2956#[doc = "< QUADSPI Alternate Function mapping"]
2957pub const GpioAltFn10QUADSPI: GpioAltFn = GpioAltFn(10);
2958#[doc = "< USB Alternate Function mapping"]
2959pub const GpioAltFn10USB: GpioAltFn = GpioAltFn(10);
2960#[doc = "< LCD Alternate Function mapping"]
2961pub const GpioAltFn11LCD: GpioAltFn = GpioAltFn(11);
2962#[doc = "< COMP1 Alternate Function mapping"]
2963pub const GpioAltFn12COMP1: GpioAltFn = GpioAltFn(12);
2964#[doc = "< COMP2 Alternate Function mapping"]
2965pub const GpioAltFn12COMP2: GpioAltFn = GpioAltFn(12);
2966#[doc = "< TIM1 Alternate Function mapping"]
2967pub const GpioAltFn12TIM1: GpioAltFn = GpioAltFn(12);
2968#[doc = "< SAI1 Alternate Function mapping"]
2969pub const GpioAltFn13SAI1: GpioAltFn = GpioAltFn(13);
2970#[doc = "< TIM2 Alternate Function mapping"]
2971pub const GpioAltFn14TIM2: GpioAltFn = GpioAltFn(14);
2972#[doc = "< TIM16 Alternate Function mapping"]
2973pub const GpioAltFn14TIM16: GpioAltFn = GpioAltFn(14);
2974#[doc = "< TIM17 Alternate Function mapping"]
2975pub const GpioAltFn14TIM17: GpioAltFn = GpioAltFn(14);
2976#[doc = "< LPTIM2 Alternate Function mapping"]
2977pub const GpioAltFn14LPTIM2: GpioAltFn = GpioAltFn(14);
2978#[doc = "< EVENTOUT Alternate Function mapping"]
2979pub const GpioAltFn15EVENTOUT: GpioAltFn = GpioAltFn(15);
2980#[doc = "< just dummy value"]
2981pub const GpioAltFnUnused: GpioAltFn = GpioAltFn(16);
2982#[repr(transparent)]
2983#[doc = "Gpio alternate functions"]
2984#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2985pub struct GpioAltFn(pub core::ffi::c_uchar);
2986#[doc = "Gpio structure"]
2987#[repr(C)]
2988#[derive(Debug, Copy, Clone)]
2989pub struct GpioPin {
2990 pub port: *mut GPIO_TypeDef,
2991 pub pin: u16,
2992}
2993#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2994const _: () = {
2995 ["Size of GpioPin"][::core::mem::size_of::<GpioPin>() - 8usize];
2996 ["Alignment of GpioPin"][::core::mem::align_of::<GpioPin>() - 4usize];
2997 ["Offset of field: GpioPin::port"][::core::mem::offset_of!(GpioPin, port) - 0usize];
2998 ["Offset of field: GpioPin::pin"][::core::mem::offset_of!(GpioPin, pin) - 4usize];
2999};
3000unsafe extern "C" {
3001 #[doc = "GPIO initialization function, simple version\n # Arguments\n\n* `gpio` - GpioPin\n * `mode` - GpioMode"]
3002 pub fn furi_hal_gpio_init_simple(gpio: *const GpioPin, mode: GpioMode);
3003}
3004unsafe extern "C" {
3005 #[doc = "GPIO initialization function, normal version\n # Arguments\n\n* `gpio` - GpioPin\n * `mode` - GpioMode\n * `pull` - GpioPull\n * `speed` - GpioSpeed"]
3006 pub fn furi_hal_gpio_init(
3007 gpio: *const GpioPin,
3008 mode: GpioMode,
3009 pull: GpioPull,
3010 speed: GpioSpeed,
3011 );
3012}
3013unsafe extern "C" {
3014 #[doc = "GPIO initialization function, extended version\n # Arguments\n\n* `gpio` - GpioPin\n * `mode` - GpioMode\n * `pull` - GpioPull\n * `speed` - GpioSpeed\n * `alt_fn` - GpioAltFn"]
3015 pub fn furi_hal_gpio_init_ex(
3016 gpio: *const GpioPin,
3017 mode: GpioMode,
3018 pull: GpioPull,
3019 speed: GpioSpeed,
3020 alt_fn: GpioAltFn,
3021 );
3022}
3023unsafe extern "C" {
3024 #[doc = "Add and enable interrupt\n # Arguments\n\n* `gpio` - GpioPin\n * `cb` - GpioExtiCallback\n * `ctx` - context for callback"]
3025 pub fn furi_hal_gpio_add_int_callback(
3026 gpio: *const GpioPin,
3027 cb: GpioExtiCallback,
3028 ctx: *mut core::ffi::c_void,
3029 );
3030}
3031unsafe extern "C" {
3032 #[doc = "Enable interrupt\n # Arguments\n\n* `gpio` - GpioPin"]
3033 pub fn furi_hal_gpio_enable_int_callback(gpio: *const GpioPin);
3034}
3035unsafe extern "C" {
3036 #[doc = "Disable interrupt\n # Arguments\n\n* `gpio` - GpioPin"]
3037 pub fn furi_hal_gpio_disable_int_callback(gpio: *const GpioPin);
3038}
3039unsafe extern "C" {
3040 #[doc = "Remove interrupt\n # Arguments\n\n* `gpio` - GpioPin"]
3041 pub fn furi_hal_gpio_remove_int_callback(gpio: *const GpioPin);
3042}
3043unsafe extern "C" {
3044 pub fn powf(arg1: f32, arg2: f32) -> f32;
3045}
3046unsafe extern "C" {
3047 pub fn roundf(arg1: f32) -> f32;
3048}
3049unsafe extern "C" {
3050 pub fn scalbnf(arg1: f32, arg2: core::ffi::c_int) -> f32;
3051}
3052unsafe extern "C" {
3053 pub fn furi_run();
3054}
3055#[doc = "Cortex timer provides high precision low level expiring timer"]
3056#[repr(C)]
3057#[derive(Debug, Copy, Clone)]
3058pub struct FuriHalCortexTimer {
3059 pub start: u32,
3060 pub value: u32,
3061}
3062#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3063const _: () = {
3064 ["Size of FuriHalCortexTimer"][::core::mem::size_of::<FuriHalCortexTimer>() - 8usize];
3065 ["Alignment of FuriHalCortexTimer"][::core::mem::align_of::<FuriHalCortexTimer>() - 4usize];
3066 ["Offset of field: FuriHalCortexTimer::start"]
3067 [::core::mem::offset_of!(FuriHalCortexTimer, start) - 0usize];
3068 ["Offset of field: FuriHalCortexTimer::value"]
3069 [::core::mem::offset_of!(FuriHalCortexTimer, value) - 4usize];
3070};
3071unsafe extern "C" {
3072 #[doc = "Microseconds delay\n\n # Arguments\n\n* `microseconds` (direction in) - The microseconds to wait"]
3073 pub fn furi_hal_cortex_delay_us(microseconds: u32);
3074}
3075unsafe extern "C" {
3076 #[doc = "Get instructions per microsecond count\n\n # Returns\n\ninstructions per microsecond count"]
3077 pub fn furi_hal_cortex_instructions_per_microsecond() -> u32;
3078}
3079unsafe extern "C" {
3080 #[doc = "Get Timer\n\n # Arguments\n\n* `timeout_us` (direction in) - The expire timeout in us\n\n # Returns\n\nThe FuriHalCortexTimer"]
3081 pub fn furi_hal_cortex_timer_get(timeout_us: u32) -> FuriHalCortexTimer;
3082}
3083unsafe extern "C" {
3084 #[doc = "Check if timer expired\n\n # Arguments\n\n* `cortex_timer` (direction in) - The FuriHalCortexTimer\n\n # Returns\n\ntrue if expired"]
3085 pub fn furi_hal_cortex_timer_is_expired(cortex_timer: FuriHalCortexTimer) -> bool;
3086}
3087unsafe extern "C" {
3088 #[doc = "Wait for timer expire\n\n # Arguments\n\n* `cortex_timer` (direction in) - The FuriHalCortexTimer"]
3089 pub fn furi_hal_cortex_timer_wait(cortex_timer: FuriHalCortexTimer);
3090}
3091pub const FuriHalCortexComp0: FuriHalCortexComp = FuriHalCortexComp(0);
3092pub const FuriHalCortexComp1: FuriHalCortexComp = FuriHalCortexComp(1);
3093pub const FuriHalCortexComp2: FuriHalCortexComp = FuriHalCortexComp(2);
3094pub const FuriHalCortexComp3: FuriHalCortexComp = FuriHalCortexComp(3);
3095#[repr(transparent)]
3096#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3097pub struct FuriHalCortexComp(pub core::ffi::c_uchar);
3098pub const FuriHalCortexCompSizeWord: FuriHalCortexCompSize = FuriHalCortexCompSize(2);
3099pub const FuriHalCortexCompSizeHalfWord: FuriHalCortexCompSize = FuriHalCortexCompSize(1);
3100pub const FuriHalCortexCompSizeByte: FuriHalCortexCompSize = FuriHalCortexCompSize(0);
3101#[repr(transparent)]
3102#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3103pub struct FuriHalCortexCompSize(pub core::ffi::c_uchar);
3104pub const FuriHalCortexCompFunctionPC: FuriHalCortexCompFunction = FuriHalCortexCompFunction(4);
3105pub const FuriHalCortexCompFunctionRead: FuriHalCortexCompFunction = FuriHalCortexCompFunction(5);
3106pub const FuriHalCortexCompFunctionWrite: FuriHalCortexCompFunction = FuriHalCortexCompFunction(6);
3107pub const FuriHalCortexCompFunctionReadWrite: FuriHalCortexCompFunction =
3108 FuriHalCortexCompFunction(6);
3109#[repr(transparent)]
3110#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3111pub struct FuriHalCortexCompFunction(pub core::ffi::c_uchar);
3112unsafe extern "C" {
3113 #[doc = "Enable DWT comparator\n\n Allows to programmatically set instruction/data breakpoints.\n\n More details on how it works can be found in armv7m official documentation:\n https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/The-Data-Watchpoint-and-Trace-unit/The-DWT-comparators\n https://developer.arm.com/documentation/ddi0403/d/Debug-Architecture/ARMv7-M-Debug/The-Data-Watchpoint-and-Trace-unit/Comparator-Function-registers--DWT-FUNCTIONn\n\n # Arguments\n\n* `comp` (direction in) - The Comparator\n * `function` (direction in) - The Comparator Function to use\n * `value` (direction in) - The value\n * `mask` (direction in) - The mask\n * `size` (direction in) - The size"]
3114 pub fn furi_hal_cortex_comp_enable(
3115 comp: FuriHalCortexComp,
3116 function: FuriHalCortexCompFunction,
3117 value: u32,
3118 mask: u32,
3119 size: FuriHalCortexCompSize,
3120 );
3121}
3122unsafe extern "C" {
3123 #[doc = "Reset DWT comparator\n\n # Arguments\n\n* `comp` (direction in) - The Comparator"]
3124 pub fn furi_hal_cortex_comp_reset(comp: FuriHalCortexComp);
3125}
3126unsafe extern "C" {
3127 pub fn LL_RCC_GetUSARTClockFreq(USARTxSource: u32) -> u32;
3128}
3129unsafe extern "C" {
3130 pub fn LL_RCC_GetLPUARTClockFreq(LPUARTxSource: u32) -> u32;
3131}
3132pub const FuriHalClockMcoLse: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(0);
3133pub const FuriHalClockMcoSysclk: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(1);
3134pub const FuriHalClockMcoMsi100k: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(2);
3135pub const FuriHalClockMcoMsi200k: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(3);
3136pub const FuriHalClockMcoMsi400k: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(4);
3137pub const FuriHalClockMcoMsi800k: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(5);
3138pub const FuriHalClockMcoMsi1m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(6);
3139pub const FuriHalClockMcoMsi2m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(7);
3140pub const FuriHalClockMcoMsi4m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(8);
3141pub const FuriHalClockMcoMsi8m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(9);
3142pub const FuriHalClockMcoMsi16m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(10);
3143pub const FuriHalClockMcoMsi24m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(11);
3144pub const FuriHalClockMcoMsi32m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(12);
3145pub const FuriHalClockMcoMsi48m: FuriHalClockMcoSourceId = FuriHalClockMcoSourceId(13);
3146#[repr(transparent)]
3147#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3148pub struct FuriHalClockMcoSourceId(pub core::ffi::c_uchar);
3149pub const FuriHalClockMcoDiv1: FuriHalClockMcoDivisorId = FuriHalClockMcoDivisorId(0);
3150pub const FuriHalClockMcoDiv2: FuriHalClockMcoDivisorId = FuriHalClockMcoDivisorId(268435456);
3151pub const FuriHalClockMcoDiv4: FuriHalClockMcoDivisorId = FuriHalClockMcoDivisorId(536870912);
3152pub const FuriHalClockMcoDiv8: FuriHalClockMcoDivisorId = FuriHalClockMcoDivisorId(805306368);
3153pub const FuriHalClockMcoDiv16: FuriHalClockMcoDivisorId = FuriHalClockMcoDivisorId(1073741824);
3154#[repr(transparent)]
3155#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3156pub struct FuriHalClockMcoDivisorId(pub core::ffi::c_uint);
3157unsafe extern "C" {
3158 #[doc = "Enable clock output on MCO pin\n\n # Arguments\n\n* `source` - MCO clock source\n * `div` - MCO clock division"]
3159 pub fn furi_hal_clock_mco_enable(
3160 source: FuriHalClockMcoSourceId,
3161 div: FuriHalClockMcoDivisorId,
3162 );
3163}
3164unsafe extern "C" {
3165 #[doc = "Disable clock output on MCO pin"]
3166 pub fn furi_hal_clock_mco_disable();
3167}
3168#[repr(C)]
3169#[derive(Debug, Copy, Clone)]
3170pub struct FuriHalAdcHandle {
3171 _unused: [u8; 0],
3172}
3173#[doc = "< 2.048V scale"]
3174pub const FuriHalAdcScale2048: FuriHalAdcScale = FuriHalAdcScale(0);
3175#[doc = "< 2.5V scale"]
3176pub const FuriHalAdcScale2500: FuriHalAdcScale = FuriHalAdcScale(1);
3177#[repr(transparent)]
3178#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3179pub struct FuriHalAdcScale(pub core::ffi::c_uchar);
3180#[doc = "< 16MHZ, synchronous"]
3181pub const FuriHalAdcClockSync16: FuriHalAdcClock = FuriHalAdcClock(0);
3182#[doc = "< 32MHZ, synchronous"]
3183pub const FuriHalAdcClockSync32: FuriHalAdcClock = FuriHalAdcClock(1);
3184#[doc = "< 64MHz, synchronous"]
3185pub const FuriHalAdcClockSync64: FuriHalAdcClock = FuriHalAdcClock(2);
3186#[repr(transparent)]
3187#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3188pub struct FuriHalAdcClock(pub core::ffi::c_uchar);
3189#[doc = "< ADC will take 2 samples per each value"]
3190pub const FuriHalAdcOversample2: FuriHalAdcOversample = FuriHalAdcOversample(0);
3191#[doc = "< ADC will take 4 samples per each value"]
3192pub const FuriHalAdcOversample4: FuriHalAdcOversample = FuriHalAdcOversample(1);
3193#[doc = "< ADC will take 8 samples per each value"]
3194pub const FuriHalAdcOversample8: FuriHalAdcOversample = FuriHalAdcOversample(2);
3195#[doc = "< ADC will take 16 samples per each value"]
3196pub const FuriHalAdcOversample16: FuriHalAdcOversample = FuriHalAdcOversample(3);
3197#[doc = "< ADC will take 32 samples per each value"]
3198pub const FuriHalAdcOversample32: FuriHalAdcOversample = FuriHalAdcOversample(4);
3199#[doc = "< ADC will take 64 samples per each value"]
3200pub const FuriHalAdcOversample64: FuriHalAdcOversample = FuriHalAdcOversample(5);
3201#[doc = "< ADC will take 128 samples per each value"]
3202pub const FuriHalAdcOversample128: FuriHalAdcOversample = FuriHalAdcOversample(6);
3203#[doc = "< ADC will take 256 samples per each value"]
3204pub const FuriHalAdcOversample256: FuriHalAdcOversample = FuriHalAdcOversample(7);
3205#[doc = "< disable oversampling"]
3206pub const FuriHalAdcOversampleNone: FuriHalAdcOversample = FuriHalAdcOversample(8);
3207#[repr(transparent)]
3208#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3209pub struct FuriHalAdcOversample(pub core::ffi::c_uchar);
3210#[doc = "< Sampling time 2.5 ADC clock"]
3211pub const FuriHalAdcSamplingtime2_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(0);
3212#[doc = "< Sampling time 6.5 ADC clock"]
3213pub const FuriHalAdcSamplingtime6_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(1);
3214#[doc = "< Sampling time 12.5 ADC clock"]
3215pub const FuriHalAdcSamplingtime12_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(2);
3216#[doc = "< Sampling time 24.5 ADC clock"]
3217pub const FuriHalAdcSamplingtime24_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(3);
3218#[doc = "< Sampling time 47.5 ADC clock"]
3219pub const FuriHalAdcSamplingtime47_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(4);
3220#[doc = "< Sampling time 92.5 ADC clock"]
3221pub const FuriHalAdcSamplingtime92_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(5);
3222#[doc = "< Sampling time 247.5 ADC clock"]
3223pub const FuriHalAdcSamplingtime247_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(6);
3224#[doc = "< Sampling time 640.5 ADC clock"]
3225pub const FuriHalAdcSamplingtime640_5: FuriHalAdcSamplingTime = FuriHalAdcSamplingTime(7);
3226#[repr(transparent)]
3227#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3228pub struct FuriHalAdcSamplingTime(pub core::ffi::c_uchar);
3229#[doc = "< Internal channel, see `FuriHalAdcChannelVREFINT`."]
3230pub const FuriHalAdcChannel0: FuriHalAdcChannel = FuriHalAdcChannel(0);
3231#[doc = "< Channel 1p"]
3232pub const FuriHalAdcChannel1: FuriHalAdcChannel = FuriHalAdcChannel(1);
3233#[doc = "< Channel 2p or 1n"]
3234pub const FuriHalAdcChannel2: FuriHalAdcChannel = FuriHalAdcChannel(2);
3235#[doc = "< Channel 3p or 2n"]
3236pub const FuriHalAdcChannel3: FuriHalAdcChannel = FuriHalAdcChannel(3);
3237#[doc = "< Channel 4p or 3n"]
3238pub const FuriHalAdcChannel4: FuriHalAdcChannel = FuriHalAdcChannel(4);
3239#[doc = "< Channel 5p or 4n"]
3240pub const FuriHalAdcChannel5: FuriHalAdcChannel = FuriHalAdcChannel(5);
3241#[doc = "< Channel 6p or 5n"]
3242pub const FuriHalAdcChannel6: FuriHalAdcChannel = FuriHalAdcChannel(6);
3243#[doc = "< Channel 7p or 6n"]
3244pub const FuriHalAdcChannel7: FuriHalAdcChannel = FuriHalAdcChannel(7);
3245#[doc = "< Channel 8p or 7n"]
3246pub const FuriHalAdcChannel8: FuriHalAdcChannel = FuriHalAdcChannel(8);
3247#[doc = "< Channel 9p or 8n"]
3248pub const FuriHalAdcChannel9: FuriHalAdcChannel = FuriHalAdcChannel(9);
3249#[doc = "< Channel 10p or 9n"]
3250pub const FuriHalAdcChannel10: FuriHalAdcChannel = FuriHalAdcChannel(10);
3251#[doc = "< Channel 11p or 10n"]
3252pub const FuriHalAdcChannel11: FuriHalAdcChannel = FuriHalAdcChannel(11);
3253#[doc = "< Channel 12p or 11n"]
3254pub const FuriHalAdcChannel12: FuriHalAdcChannel = FuriHalAdcChannel(12);
3255#[doc = "< Channel 13p or 12n"]
3256pub const FuriHalAdcChannel13: FuriHalAdcChannel = FuriHalAdcChannel(13);
3257#[doc = "< Channel 14p or 13n"]
3258pub const FuriHalAdcChannel14: FuriHalAdcChannel = FuriHalAdcChannel(14);
3259#[doc = "< Channel 15p or 14n"]
3260pub const FuriHalAdcChannel15: FuriHalAdcChannel = FuriHalAdcChannel(15);
3261#[doc = "< Channel 16p or 15n"]
3262pub const FuriHalAdcChannel16: FuriHalAdcChannel = FuriHalAdcChannel(16);
3263#[doc = "< Internal channel, see `FuriHalAdcChannelTEMPSENSOR`."]
3264pub const FuriHalAdcChannel17: FuriHalAdcChannel = FuriHalAdcChannel(17);
3265#[doc = "< Internal channel, see `FuriHalAdcChannelVBAT`."]
3266pub const FuriHalAdcChannel18: FuriHalAdcChannel = FuriHalAdcChannel(18);
3267#[doc = "< Special channel for VREFINT, used for calibration and self test"]
3268pub const FuriHalAdcChannelVREFINT: FuriHalAdcChannel = FuriHalAdcChannel(19);
3269#[doc = "< Special channel for on-die temperature sensor, requires at least 5us of sampling time"]
3270pub const FuriHalAdcChannelTEMPSENSOR: FuriHalAdcChannel = FuriHalAdcChannel(20);
3271#[doc = "< Special channel for VBAT/3 voltage, requires at least 12us of sampling time"]
3272pub const FuriHalAdcChannelVBAT: FuriHalAdcChannel = FuriHalAdcChannel(21);
3273#[doc = "< No channel"]
3274pub const FuriHalAdcChannelNone: FuriHalAdcChannel = FuriHalAdcChannel(22);
3275#[repr(transparent)]
3276#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3277pub struct FuriHalAdcChannel(pub core::ffi::c_uchar);
3278unsafe extern "C" {
3279 #[doc = "Initialize ADC subsystem"]
3280 pub fn furi_hal_adc_init();
3281}
3282unsafe extern "C" {
3283 #[doc = "Acquire ADC handle\n\n Enables appropriate power and clocking domains\n\n # Returns\n\nFuriHalAdcHandle pointer"]
3284 pub fn furi_hal_adc_acquire() -> *mut FuriHalAdcHandle;
3285}
3286unsafe extern "C" {
3287 #[doc = "Release ADC handle\n\n # Arguments\n\n* `handle` - The ADC handle"]
3288 pub fn furi_hal_adc_release(handle: *mut FuriHalAdcHandle);
3289}
3290unsafe extern "C" {
3291 #[doc = "Configure with default parameters and enable ADC\n\n Parameters used:\n - FuriHalAdcScale2048 - 2.048V VREF Scale. Your signal should be in 0 -\n 2.048V range.\n - FuriHalAdcClockSync64 - Clocked from sysclk bus at 64MHz in synchronous\n mode. Fast, no delay on data bus access.\n - FuriHalAdcOversample64 - Going to acquire and average 64 samples. For\n circuits with slowly or not changing signal. Total time per one read:\n (1/64)*(12.5+247.5)*64 = 260us. The best results you'll get if your signal\n will stay on the same level all this time.\n - FuriHalAdcSamplingtime247_5 - Sampling(transfer from source to internal\n sampling capacitor) time is 247.5 ADC clocks: (1/64)*247.5 = 3.8671875us.\n For relatively high impedance circuits.\n\n Also keep your measurement circuit impedance under 10KOhm or oversampling\n results will be compromised. Verify your signal with oscilloscope(you may\n need fast oscilloscope: 200MHz bandwidth, 125MS/s), ensure that signal is not\n distorted by sampling.\n\n Those parameters were optimized for 0 - 2.048 voltage measurement with ~0.1%\n precision. You can get more, but it will require some magic.\n\n # Arguments\n\n* `handle` - The ADC handle"]
3292 pub fn furi_hal_adc_configure(handle: *mut FuriHalAdcHandle);
3293}
3294unsafe extern "C" {
3295 #[doc = "Configure with extended parameters and enable ADC\n\n General advice is to start with default parameters, figure out what exactly\n is not working for you and then tune it. Also in some cases changing\n circuit(adding caps, lowering impedance, adding opamp) may be better than changing\n parameters.\n\n In general ADC is a world of magic: make sure that you understand\n how your circuit and ADC works. Then carefully read STM32WB\n series reference manual. Setting incorrect parameters leads to\n very poor results. Also internal channels require special\n settings.\n\n # Arguments\n\n* `handle` - The ADC handle\n * `scale` (direction in) - The ADC voltage scale\n * `clock` (direction in) - The ADC clock\n * `oversample` (direction in) - The ADC oversample mode\n * `sampling_time` (direction in) - The ADC sampling time"]
3296 pub fn furi_hal_adc_configure_ex(
3297 handle: *mut FuriHalAdcHandle,
3298 scale: FuriHalAdcScale,
3299 clock: FuriHalAdcClock,
3300 oversample: FuriHalAdcOversample,
3301 sampling_time: FuriHalAdcSamplingTime,
3302 );
3303}
3304unsafe extern "C" {
3305 #[doc = "Read single ADC value\n\n # Arguments\n\n* `handle` - The ADC handle\n * `channel` (direction in) - The channel to sample\n\n # Returns\n\nvalue, 12 bits"]
3306 pub fn furi_hal_adc_read(handle: *mut FuriHalAdcHandle, channel: FuriHalAdcChannel) -> u16;
3307}
3308unsafe extern "C" {
3309 #[doc = "Convert sampled value to voltage\n\n # Arguments\n\n* `handle` - The ADC handle\n * `value` (direction in) - The value acquired with `furi_hal_adc_read`\n\n # Returns\n\nVoltage in mV"]
3310 pub fn furi_hal_adc_convert_to_voltage(handle: *mut FuriHalAdcHandle, value: u16) -> f32;
3311}
3312unsafe extern "C" {
3313 #[doc = "Convert sampled VREFINT value to voltage\n\n # Arguments\n\n* `handle` - The ADC handle\n * `value` (direction in) - The value acquired with `furi_hal_adc_read` for\n `FuriHalAdcChannelVREFINT` channel\n\n # Returns\n\nVoltage in mV"]
3314 pub fn furi_hal_adc_convert_vref(handle: *mut FuriHalAdcHandle, value: u16) -> f32;
3315}
3316unsafe extern "C" {
3317 #[doc = "Convert sampled TEMPSENSOR value to temperature\n\n # Arguments\n\n* `handle` - The ADC handle\n * `value` (direction in) - The value acquired with `furi_hal_adc_read` for\n `FuriHalAdcChannelTEMPSENSOR` channel\n\n # Returns\n\ntemperature in degree C"]
3318 pub fn furi_hal_adc_convert_temp(handle: *mut FuriHalAdcHandle, value: u16) -> f32;
3319}
3320unsafe extern "C" {
3321 #[doc = "Convert sampled VBAT value to voltage\n\n # Arguments\n\n* `handle` - The ADC handle\n * `value` (direction in) - The value acquired with `furi_hal_adc_read` for\n `FuriHalAdcChannelVBAT` channel\n\n # Returns\n\nVoltage in mV"]
3322 pub fn furi_hal_adc_convert_vbat(handle: *mut FuriHalAdcHandle, value: u16) -> f32;
3323}
3324pub const FuriHalBusAHB1_GRP1: FuriHalBus = FuriHalBus(0);
3325pub const FuriHalBusDMA1: FuriHalBus = FuriHalBus(1);
3326pub const FuriHalBusDMA2: FuriHalBus = FuriHalBus(2);
3327pub const FuriHalBusDMAMUX1: FuriHalBus = FuriHalBus(3);
3328pub const FuriHalBusCRC: FuriHalBus = FuriHalBus(4);
3329pub const FuriHalBusTSC: FuriHalBus = FuriHalBus(5);
3330pub const FuriHalBusAHB2_GRP1: FuriHalBus = FuriHalBus(6);
3331pub const FuriHalBusGPIOA: FuriHalBus = FuriHalBus(7);
3332pub const FuriHalBusGPIOB: FuriHalBus = FuriHalBus(8);
3333pub const FuriHalBusGPIOC: FuriHalBus = FuriHalBus(9);
3334pub const FuriHalBusGPIOD: FuriHalBus = FuriHalBus(10);
3335pub const FuriHalBusGPIOE: FuriHalBus = FuriHalBus(11);
3336pub const FuriHalBusGPIOH: FuriHalBus = FuriHalBus(12);
3337pub const FuriHalBusADC: FuriHalBus = FuriHalBus(13);
3338pub const FuriHalBusAES1: FuriHalBus = FuriHalBus(14);
3339pub const FuriHalBusAHB3_GRP1: FuriHalBus = FuriHalBus(15);
3340pub const FuriHalBusQUADSPI: FuriHalBus = FuriHalBus(16);
3341pub const FuriHalBusPKA: FuriHalBus = FuriHalBus(17);
3342pub const FuriHalBusAES2: FuriHalBus = FuriHalBus(18);
3343pub const FuriHalBusRNG: FuriHalBus = FuriHalBus(19);
3344pub const FuriHalBusHSEM: FuriHalBus = FuriHalBus(20);
3345pub const FuriHalBusIPCC: FuriHalBus = FuriHalBus(21);
3346pub const FuriHalBusFLASH: FuriHalBus = FuriHalBus(22);
3347pub const FuriHalBusAPB1_GRP1: FuriHalBus = FuriHalBus(23);
3348pub const FuriHalBusTIM2: FuriHalBus = FuriHalBus(24);
3349pub const FuriHalBusLCD: FuriHalBus = FuriHalBus(25);
3350pub const FuriHalBusSPI2: FuriHalBus = FuriHalBus(26);
3351pub const FuriHalBusI2C1: FuriHalBus = FuriHalBus(27);
3352pub const FuriHalBusI2C3: FuriHalBus = FuriHalBus(28);
3353pub const FuriHalBusCRS: FuriHalBus = FuriHalBus(29);
3354pub const FuriHalBusUSB: FuriHalBus = FuriHalBus(30);
3355pub const FuriHalBusLPTIM1: FuriHalBus = FuriHalBus(31);
3356pub const FuriHalBusAPB1_GRP2: FuriHalBus = FuriHalBus(32);
3357pub const FuriHalBusLPUART1: FuriHalBus = FuriHalBus(33);
3358pub const FuriHalBusLPTIM2: FuriHalBus = FuriHalBus(34);
3359pub const FuriHalBusAPB2_GRP1: FuriHalBus = FuriHalBus(35);
3360pub const FuriHalBusTIM1: FuriHalBus = FuriHalBus(36);
3361pub const FuriHalBusSPI1: FuriHalBus = FuriHalBus(37);
3362pub const FuriHalBusUSART1: FuriHalBus = FuriHalBus(38);
3363pub const FuriHalBusTIM16: FuriHalBus = FuriHalBus(39);
3364pub const FuriHalBusTIM17: FuriHalBus = FuriHalBus(40);
3365pub const FuriHalBusSAI1: FuriHalBus = FuriHalBus(41);
3366pub const FuriHalBusAPB3_GRP1: FuriHalBus = FuriHalBus(42);
3367pub const FuriHalBusRF: FuriHalBus = FuriHalBus(43);
3368pub const FuriHalBusMAX: FuriHalBus = FuriHalBus(44);
3369#[repr(transparent)]
3370#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3371pub struct FuriHalBus(pub core::ffi::c_uchar);
3372unsafe extern "C" {
3373 #[doc = "Early initialization"]
3374 pub fn furi_hal_bus_init_early();
3375}
3376unsafe extern "C" {
3377 #[doc = "Early de-initialization"]
3378 pub fn furi_hal_bus_deinit_early();
3379}
3380unsafe extern "C" {
3381 #[doc = "Enable a peripheral by turning the clocking on and deasserting the reset.\n # Arguments\n\n* `[in]` - bus Peripheral to be enabled.\n Peripheral must be in disabled state in order to be enabled."]
3382 pub fn furi_hal_bus_enable(bus: FuriHalBus);
3383}
3384unsafe extern "C" {
3385 #[doc = "Reset a peripheral by sequentially asserting and deasserting the reset.\n # Arguments\n\n* `[in]` - bus Peripheral to be reset.\n Peripheral must be in enabled state in order to be reset."]
3386 pub fn furi_hal_bus_reset(bus: FuriHalBus);
3387}
3388unsafe extern "C" {
3389 #[doc = "Disable a peripheral by turning the clocking off and asserting the reset.\n # Arguments\n\n* `[in]` - bus Peripheral to be disabled.\n Peripheral must be in enabled state in order to be disabled."]
3390 pub fn furi_hal_bus_disable(bus: FuriHalBus);
3391}
3392unsafe extern "C" {
3393 #[doc = "Check if peripheral is enabled\n\n FuriHalBusAPB3_GRP1 is a special group of shared peripherals, for\n core1 its clock is always on and the only status we can report is\n peripheral reset status. Check code and Reference Manual for\n details.\n\n # Arguments\n\n* `bus` (direction in) - The peripheral to check\n\n # Returns\n\ntrue if enabled or always enabled, false otherwise"]
3394 pub fn furi_hal_bus_is_enabled(bus: FuriHalBus) -> bool;
3395}
3396#[doc = "< Master key"]
3397pub const FuriHalCryptoKeyTypeMaster: FuriHalCryptoKeyType = FuriHalCryptoKeyType(0);
3398#[doc = "< Simple unencrypted key"]
3399pub const FuriHalCryptoKeyTypeSimple: FuriHalCryptoKeyType = FuriHalCryptoKeyType(1);
3400#[doc = "< Encrypted with Master key"]
3401pub const FuriHalCryptoKeyTypeEncrypted: FuriHalCryptoKeyType = FuriHalCryptoKeyType(2);
3402#[repr(transparent)]
3403#[doc = "FuriHalCryptoKey Type"]
3404#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3405pub struct FuriHalCryptoKeyType(pub core::ffi::c_uchar);
3406pub const FuriHalCryptoKeySize128: FuriHalCryptoKeySize = FuriHalCryptoKeySize(0);
3407pub const FuriHalCryptoKeySize256: FuriHalCryptoKeySize = FuriHalCryptoKeySize(1);
3408#[repr(transparent)]
3409#[doc = "FuriHalCryptoKey Size in bits"]
3410#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3411pub struct FuriHalCryptoKeySize(pub core::ffi::c_uchar);
3412#[doc = "FuriHalCryptoKey"]
3413#[repr(C)]
3414#[derive(Debug, Copy, Clone)]
3415pub struct FuriHalCryptoKey {
3416 pub type_: FuriHalCryptoKeyType,
3417 pub size: FuriHalCryptoKeySize,
3418 pub data: *mut u8,
3419}
3420#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3421const _: () = {
3422 ["Size of FuriHalCryptoKey"][::core::mem::size_of::<FuriHalCryptoKey>() - 8usize];
3423 ["Alignment of FuriHalCryptoKey"][::core::mem::align_of::<FuriHalCryptoKey>() - 4usize];
3424 ["Offset of field: FuriHalCryptoKey::type_"]
3425 [::core::mem::offset_of!(FuriHalCryptoKey, type_) - 0usize];
3426 ["Offset of field: FuriHalCryptoKey::size"]
3427 [::core::mem::offset_of!(FuriHalCryptoKey, size) - 1usize];
3428 ["Offset of field: FuriHalCryptoKey::data"]
3429 [::core::mem::offset_of!(FuriHalCryptoKey, data) - 4usize];
3430};
3431#[doc = "< operation successful"]
3432pub const FuriHalCryptoGCMStateOk: FuriHalCryptoGCMState = FuriHalCryptoGCMState(0);
3433#[doc = "< error during encryption/decryption"]
3434pub const FuriHalCryptoGCMStateError: FuriHalCryptoGCMState = FuriHalCryptoGCMState(1);
3435#[doc = "< tags do not match, auth failed"]
3436pub const FuriHalCryptoGCMStateAuthFailure: FuriHalCryptoGCMState = FuriHalCryptoGCMState(2);
3437#[repr(transparent)]
3438#[doc = "FuriHalCryptoGCMState Result of a GCM operation"]
3439#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3440pub struct FuriHalCryptoGCMState(pub core::ffi::c_uchar);
3441unsafe extern "C" {
3442 #[doc = "Verify factory provisioned keys\n\n # Arguments\n\n* `keys_nb` - The keys number of\n * `valid_keys_nb` - The valid keys number of\n\n # Returns\n\ntrue if all enclave keys are intact, false otherwise"]
3443 pub fn furi_hal_crypto_enclave_verify(keys_nb: *mut u8, valid_keys_nb: *mut u8) -> bool;
3444}
3445unsafe extern "C" {
3446 #[doc = "Ensure that requested slot and slots before this slot contains keys.\n\n This function is used to provision FURI_HAL_CRYPTO_ENCLAVE_UNIQUE_KEY_SLOT. Also you\n may want to use it to generate some unique keys in user key slot range.\n\n Because of the sequential nature of the secure enclave this\n method will generate key for all slots from\n FURI_HAL_CRYPTO_ENCLAVE_FACTORY_KEY_SLOT_END to the slot your requested.\n Keys are generated using on-chip RNG.\n\n # Arguments\n\n* `key_slot` (direction in) - The key slot to enclave\n\n # Returns\n\ntrue if key exists or created, false if enclave corrupted"]
3447 pub fn furi_hal_crypto_enclave_ensure_key(key_slot: u8) -> bool;
3448}
3449unsafe extern "C" {
3450 #[doc = "Store key in crypto enclave\n\n # Arguments\n\n* `key` - FuriHalCryptoKey to be stored\n * `slot` - pointer to int where enclave slot will be stored\n\n # Returns\n\ntrue on success"]
3451 pub fn furi_hal_crypto_enclave_store_key(key: *mut FuriHalCryptoKey, slot: *mut u8) -> bool;
3452}
3453unsafe extern "C" {
3454 #[doc = "Init AES engine and load key from crypto enclave\n\n Use only with furi_hal_crypto_enclave_unload_key()\n\n # Arguments\n\n* `slot` - enclave slot\n * `iv` (direction in) - pointer to 16 bytes Initialization Vector data\n\n # Returns\n\ntrue on success"]
3455 pub fn furi_hal_crypto_enclave_load_key(slot: u8, iv: *const u8) -> bool;
3456}
3457unsafe extern "C" {
3458 #[doc = "Unload key and deinit AES engine\n\n Use only with furi_hal_crypto_enclave_load_key()\n\n # Arguments\n\n* `slot` - enclave slot\n\n # Returns\n\ntrue on success"]
3459 pub fn furi_hal_crypto_enclave_unload_key(slot: u8) -> bool;
3460}
3461unsafe extern "C" {
3462 #[doc = "Init AES engine and load supplied key\n\n Use only with furi_hal_crypto_unload_key()\n\n # Arguments\n\n* `key` (direction in) - pointer to 32 bytes key data\n * `iv` (direction in) - pointer to 16 bytes Initialization Vector data\n\n # Returns\n\ntrue on success"]
3463 pub fn furi_hal_crypto_load_key(key: *const u8, iv: *const u8) -> bool;
3464}
3465unsafe extern "C" {
3466 #[doc = "Unload key and de-init AES engine\n\n Use this function only with furi_hal_crypto_load_key()\n\n # Returns\n\ntrue on success"]
3467 pub fn furi_hal_crypto_unload_key() -> bool;
3468}
3469unsafe extern "C" {
3470 #[doc = "Encrypt data\n\n # Arguments\n\n* `input` - pointer to input data\n * `output` - pointer to output data\n * `size` - input/output buffer size in bytes\n\n # Returns\n\ntrue on success"]
3471 pub fn furi_hal_crypto_encrypt(input: *const u8, output: *mut u8, size: usize) -> bool;
3472}
3473unsafe extern "C" {
3474 #[doc = "Decrypt data\n\n # Arguments\n\n* `input` - pointer to input data\n * `output` - pointer to output data\n * `size` - input/output buffer size in bytes\n\n # Returns\n\ntrue on success"]
3475 pub fn furi_hal_crypto_decrypt(input: *const u8, output: *mut u8, size: usize) -> bool;
3476}
3477unsafe extern "C" {
3478 #[doc = "Encrypt the input using AES-CTR\n\n Decryption can be performed by supplying the ciphertext as input. Inits and\n deinits the AES engine internally.\n\n # Arguments\n\n* `key` (direction in) - pointer to 32 bytes key data\n * `iv` (direction in) - pointer to 12 bytes Initialization Vector data\n * `input` (direction in) - pointer to input data\n * `output` (direction out) - pointer to output data\n * `length` - length of the input and output in bytes\n\n # Returns\n\ntrue on success"]
3479 pub fn furi_hal_crypto_ctr(
3480 key: *const u8,
3481 iv: *const u8,
3482 input: *const u8,
3483 output: *mut u8,
3484 length: usize,
3485 ) -> bool;
3486}
3487unsafe extern "C" {
3488 #[doc = "Encrypt/decrypt the input using AES-GCM\n\n When decrypting the tag generated needs to be compared to the tag attached to\n the ciphertext in a constant-time fashion. If the tags are not equal, the\n decryption failed and the plaintext returned needs to be discarded. Inits and\n deinits the AES engine internally.\n\n # Arguments\n\n* `key` (direction in) - pointer to 32 bytes key data\n * `iv` (direction in) - pointer to 12 bytes Initialization Vector data\n * `aad` (direction in) - pointer to additional authentication data\n * `aad_length` - length of the additional authentication data in bytes\n * `input` (direction in) - pointer to input data\n * `output` (direction out) - pointer to output data\n * `length` - length of the input and output in bytes\n * `tag` (direction out) - pointer to 16 bytes space for the tag\n * `decrypt` - true for decryption, false otherwise\n\n # Returns\n\ntrue on success"]
3489 pub fn furi_hal_crypto_gcm(
3490 key: *const u8,
3491 iv: *const u8,
3492 aad: *const u8,
3493 aad_length: usize,
3494 input: *const u8,
3495 output: *mut u8,
3496 length: usize,
3497 tag: *mut u8,
3498 decrypt: bool,
3499 ) -> bool;
3500}
3501unsafe extern "C" {
3502 #[doc = "Encrypt the input using AES-GCM and generate a tag\n\n Inits and deinits the AES engine internally.\n\n # Arguments\n\n* `key` (direction in) - pointer to 32 bytes key data\n * `iv` (direction in) - pointer to 12 bytes Initialization Vector data\n * `aad` (direction in) - pointer to additional authentication data\n * `aad_length` - length of the additional authentication data in bytes\n * `input` (direction in) - pointer to input data\n * `output` (direction out) - pointer to output data\n * `length` - length of the input and output in bytes\n * `tag` (direction out) - pointer to 16 bytes space for the tag\n\n # Returns\n\nFuriHalCryptoGCMStateOk on success, FuriHalCryptoGCMStateError on\n failure"]
3503 pub fn furi_hal_crypto_gcm_encrypt_and_tag(
3504 key: *const u8,
3505 iv: *const u8,
3506 aad: *const u8,
3507 aad_length: usize,
3508 input: *const u8,
3509 output: *mut u8,
3510 length: usize,
3511 tag: *mut u8,
3512 ) -> FuriHalCryptoGCMState;
3513}
3514unsafe extern "C" {
3515 #[doc = "Decrypt the input using AES-GCM and verify the provided tag\n\n Inits and deinits the AES engine internally.\n\n # Arguments\n\n* `key` (direction in) - pointer to 32 bytes key data\n * `iv` (direction in) - pointer to 12 bytes Initialization Vector data\n * `aad` (direction in) - pointer to additional authentication data\n * `aad_length` - length of the additional authentication data in bytes\n * `input` (direction in) - pointer to input data\n * `output` (direction out) - pointer to output data\n * `length` - length of the input and output in bytes\n * `tag` (direction out) - pointer to 16 bytes tag\n\n # Returns\n\nFuriHalCryptoGCMStateOk on success, FuriHalCryptoGCMStateError on\n failure, FuriHalCryptoGCMStateAuthFailure if the tag does not\n match"]
3516 pub fn furi_hal_crypto_gcm_decrypt_and_verify(
3517 key: *const u8,
3518 iv: *const u8,
3519 aad: *const u8,
3520 aad_length: usize,
3521 input: *const u8,
3522 output: *mut u8,
3523 length: usize,
3524 tag: *const u8,
3525 ) -> FuriHalCryptoGCMState;
3526}
3527unsafe extern "C" {
3528 #[doc = "Enable MCU debug"]
3529 pub fn furi_hal_debug_enable();
3530}
3531unsafe extern "C" {
3532 #[doc = "Disable MCU debug"]
3533 pub fn furi_hal_debug_disable();
3534}
3535unsafe extern "C" {
3536 #[doc = "Check if GDB debug session is active"]
3537 pub fn furi_hal_debug_is_gdb_session_active() -> bool;
3538}
3539unsafe extern "C" {
3540 #[doc = "Early initialization"]
3541 pub fn furi_hal_dma_init_early();
3542}
3543unsafe extern "C" {
3544 #[doc = "Early de-initialization"]
3545 pub fn furi_hal_dma_deinit_early();
3546}
3547unsafe extern "C" {
3548 pub fn furi_hal_os_tick();
3549}
3550#[repr(C)]
3551#[derive(Debug, Copy, Clone)]
3552pub struct FuriHalSdInfo {
3553 #[doc = "< total capacity in bytes"]
3554 pub capacity: u64,
3555 #[doc = "< block size"]
3556 pub block_size: u32,
3557 #[doc = "< logical capacity in blocks"]
3558 pub logical_block_count: u32,
3559 #[doc = "< logical block size in bytes"]
3560 pub logical_block_size: u32,
3561 #[doc = "< manufacturer ID"]
3562 pub manufacturer_id: u8,
3563 #[doc = "< OEM ID, 2 characters + null terminator"]
3564 pub oem_id: [core::ffi::c_char; 3usize],
3565 #[doc = "< product name, 5 characters + null terminator"]
3566 pub product_name: [core::ffi::c_char; 6usize],
3567 #[doc = "< product revision major"]
3568 pub product_revision_major: u8,
3569 #[doc = "< product revision minor"]
3570 pub product_revision_minor: u8,
3571 #[doc = "< product serial number"]
3572 pub product_serial_number: u32,
3573 #[doc = "< manufacturing month"]
3574 pub manufacturing_month: u8,
3575 #[doc = "< manufacturing year"]
3576 pub manufacturing_year: u16,
3577}
3578#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3579const _: () = {
3580 ["Size of FuriHalSdInfo"][::core::mem::size_of::<FuriHalSdInfo>() - 40usize];
3581 ["Alignment of FuriHalSdInfo"][::core::mem::align_of::<FuriHalSdInfo>() - 8usize];
3582 ["Offset of field: FuriHalSdInfo::capacity"]
3583 [::core::mem::offset_of!(FuriHalSdInfo, capacity) - 0usize];
3584 ["Offset of field: FuriHalSdInfo::block_size"]
3585 [::core::mem::offset_of!(FuriHalSdInfo, block_size) - 8usize];
3586 ["Offset of field: FuriHalSdInfo::logical_block_count"]
3587 [::core::mem::offset_of!(FuriHalSdInfo, logical_block_count) - 12usize];
3588 ["Offset of field: FuriHalSdInfo::logical_block_size"]
3589 [::core::mem::offset_of!(FuriHalSdInfo, logical_block_size) - 16usize];
3590 ["Offset of field: FuriHalSdInfo::manufacturer_id"]
3591 [::core::mem::offset_of!(FuriHalSdInfo, manufacturer_id) - 20usize];
3592 ["Offset of field: FuriHalSdInfo::oem_id"]
3593 [::core::mem::offset_of!(FuriHalSdInfo, oem_id) - 21usize];
3594 ["Offset of field: FuriHalSdInfo::product_name"]
3595 [::core::mem::offset_of!(FuriHalSdInfo, product_name) - 24usize];
3596 ["Offset of field: FuriHalSdInfo::product_revision_major"]
3597 [::core::mem::offset_of!(FuriHalSdInfo, product_revision_major) - 30usize];
3598 ["Offset of field: FuriHalSdInfo::product_revision_minor"]
3599 [::core::mem::offset_of!(FuriHalSdInfo, product_revision_minor) - 31usize];
3600 ["Offset of field: FuriHalSdInfo::product_serial_number"]
3601 [::core::mem::offset_of!(FuriHalSdInfo, product_serial_number) - 32usize];
3602 ["Offset of field: FuriHalSdInfo::manufacturing_month"]
3603 [::core::mem::offset_of!(FuriHalSdInfo, manufacturing_month) - 36usize];
3604 ["Offset of field: FuriHalSdInfo::manufacturing_year"]
3605 [::core::mem::offset_of!(FuriHalSdInfo, manufacturing_year) - 38usize];
3606};
3607unsafe extern "C" {
3608 #[doc = "Init SD card presence detection"]
3609 pub fn furi_hal_sd_presence_init();
3610}
3611unsafe extern "C" {
3612 #[doc = "Get SD card status\n # Returns\n\ntrue if SD card is present"]
3613 pub fn furi_hal_sd_is_present() -> bool;
3614}
3615unsafe extern "C" {
3616 #[doc = "SD card max mount retry count\n # Returns\n\nuint8_t"]
3617 pub fn furi_hal_sd_max_mount_retry_count() -> u8;
3618}
3619unsafe extern "C" {
3620 #[doc = "Init SD card\n # Arguments\n\n* `power_reset` - reset card power\n # Returns\n\nFuriStatus"]
3621 pub fn furi_hal_sd_init(power_reset: bool) -> FuriStatus;
3622}
3623unsafe extern "C" {
3624 #[doc = "Read blocks from SD card\n # Arguments\n\n* `buff` -\n * `sector` -\n * `count` -\n # Returns\n\nFuriStatus"]
3625 pub fn furi_hal_sd_read_blocks(buff: *mut u32, sector: u32, count: u32) -> FuriStatus;
3626}
3627unsafe extern "C" {
3628 #[doc = "Write blocks to SD card\n # Arguments\n\n* `buff` -\n * `sector` -\n * `count` -\n # Returns\n\nFuriStatus"]
3629 pub fn furi_hal_sd_write_blocks(buff: *const u32, sector: u32, count: u32) -> FuriStatus;
3630}
3631unsafe extern "C" {
3632 #[doc = "Get SD card info\n # Arguments\n\n* `info` -\n # Returns\n\nFuriStatus"]
3633 pub fn furi_hal_sd_info(info: *mut FuriHalSdInfo) -> FuriStatus;
3634}
3635unsafe extern "C" {
3636 #[doc = "Get SD card state\n # Returns\n\nFuriStatus"]
3637 pub fn furi_hal_sd_get_card_state() -> FuriStatus;
3638}
3639#[doc = "I2C_LL_ES_INIT I2C Exported Init structure\n # "]
3640#[repr(C)]
3641#[derive(Debug, Copy, Clone)]
3642pub struct LL_I2C_InitTypeDef {
3643 #[doc = "< Specifies the peripheral mode.\nThis parameter can be a value of I2C_LL_EC_PERIPHERAL_MODE.\n\nThis feature can be modified afterwards using unitary function\nLL_I2C_SetMode()."]
3644 pub PeripheralMode: u32,
3645 #[doc = "< Specifies the SDA setup, hold time and the SCL high, low period values.\nThis parameter must be set by referring to the STM32CubeMX Tool and\nthe helper macro __LL_I2C_CONVERT_TIMINGS().\n\nThis feature can be modified afterwards using unitary function\nLL_I2C_SetTiming()."]
3646 pub Timing: u32,
3647 #[doc = "< Enables or disables analog noise filter.\nThis parameter can be a value of I2C_LL_EC_ANALOGFILTER_SELECTION.\n\nThis feature can be modified afterwards using unitary functions\nLL_I2C_EnableAnalogFilter() or LL_I2C_DisableAnalogFilter()."]
3648 pub AnalogFilter: u32,
3649 #[doc = "< Configures the digital noise filter.\nThis parameter can be a number between Min_Data = 0x00 and Max_Data = 0x0F.\n\nThis feature can be modified afterwards using unitary function\nLL_I2C_SetDigitalFilter()."]
3650 pub DigitalFilter: u32,
3651 #[doc = "< Specifies the device own address 1.\nThis parameter must be a value between Min_Data = 0x00 and Max_Data = 0x3FF.\n\nThis feature can be modified afterwards using unitary function\nLL_I2C_SetOwnAddress1()."]
3652 pub OwnAddress1: u32,
3653 #[doc = "< Specifies the ACKnowledge or Non ACKnowledge condition after the address receive\nmatch code or next received byte.\nThis parameter can be a value of I2C_LL_EC_I2C_ACKNOWLEDGE.\n\nThis feature can be modified afterwards using unitary function\nLL_I2C_AcknowledgeNextData()."]
3654 pub TypeAcknowledge: u32,
3655 #[doc = "< Specifies the device own address 1 size (7-bit or 10-bit).\nThis parameter can be a value of I2C_LL_EC_OWNADDRESS1.\n\nThis feature can be modified afterwards using unitary function\nLL_I2C_SetOwnAddress1()."]
3656 pub OwnAddrSize: u32,
3657}
3658#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3659const _: () = {
3660 ["Size of LL_I2C_InitTypeDef"][::core::mem::size_of::<LL_I2C_InitTypeDef>() - 28usize];
3661 ["Alignment of LL_I2C_InitTypeDef"][::core::mem::align_of::<LL_I2C_InitTypeDef>() - 4usize];
3662 ["Offset of field: LL_I2C_InitTypeDef::PeripheralMode"]
3663 [::core::mem::offset_of!(LL_I2C_InitTypeDef, PeripheralMode) - 0usize];
3664 ["Offset of field: LL_I2C_InitTypeDef::Timing"]
3665 [::core::mem::offset_of!(LL_I2C_InitTypeDef, Timing) - 4usize];
3666 ["Offset of field: LL_I2C_InitTypeDef::AnalogFilter"]
3667 [::core::mem::offset_of!(LL_I2C_InitTypeDef, AnalogFilter) - 8usize];
3668 ["Offset of field: LL_I2C_InitTypeDef::DigitalFilter"]
3669 [::core::mem::offset_of!(LL_I2C_InitTypeDef, DigitalFilter) - 12usize];
3670 ["Offset of field: LL_I2C_InitTypeDef::OwnAddress1"]
3671 [::core::mem::offset_of!(LL_I2C_InitTypeDef, OwnAddress1) - 16usize];
3672 ["Offset of field: LL_I2C_InitTypeDef::TypeAcknowledge"]
3673 [::core::mem::offset_of!(LL_I2C_InitTypeDef, TypeAcknowledge) - 20usize];
3674 ["Offset of field: LL_I2C_InitTypeDef::OwnAddrSize"]
3675 [::core::mem::offset_of!(LL_I2C_InitTypeDef, OwnAddrSize) - 24usize];
3676};
3677unsafe extern "C" {
3678 #[doc = "I2C_LL_EF_Init Initialization and de-initialization functions\n # "]
3679 pub fn LL_I2C_Init(
3680 I2Cx: *mut I2C_TypeDef,
3681 I2C_InitStruct: *const LL_I2C_InitTypeDef,
3682 ) -> ErrorStatus;
3683}
3684#[doc = "< Bus initialization event, called on system start"]
3685pub const FuriHalI2cBusEventInit: FuriHalI2cBusEvent = FuriHalI2cBusEvent(0);
3686#[doc = "< Bus deinitialization event, called on system stop"]
3687pub const FuriHalI2cBusEventDeinit: FuriHalI2cBusEvent = FuriHalI2cBusEvent(1);
3688#[doc = "< Bus lock event, called before activation"]
3689pub const FuriHalI2cBusEventLock: FuriHalI2cBusEvent = FuriHalI2cBusEvent(2);
3690#[doc = "< Bus unlock event, called after deactivation"]
3691pub const FuriHalI2cBusEventUnlock: FuriHalI2cBusEvent = FuriHalI2cBusEvent(3);
3692#[doc = "< Bus activation event, called before handle activation"]
3693pub const FuriHalI2cBusEventActivate: FuriHalI2cBusEvent = FuriHalI2cBusEvent(4);
3694#[doc = "< Bus deactivation event, called after handle deactivation"]
3695pub const FuriHalI2cBusEventDeactivate: FuriHalI2cBusEvent = FuriHalI2cBusEvent(5);
3696#[repr(transparent)]
3697#[doc = "FuriHal i2c bus states"]
3698#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3699pub struct FuriHalI2cBusEvent(pub core::ffi::c_uchar);
3700#[doc = "FuriHal i2c bus event callback"]
3701pub type FuriHalI2cBusEventCallback = ::core::option::Option<
3702 unsafe extern "C" fn(bus: *mut FuriHalI2cBus, event: FuriHalI2cBusEvent),
3703>;
3704#[doc = "FuriHal i2c bus"]
3705#[repr(C)]
3706#[derive(Debug, Copy, Clone)]
3707pub struct FuriHalI2cBus {
3708 pub i2c: *mut I2C_TypeDef,
3709 pub current_handle: *const FuriHalI2cBusHandle,
3710 pub callback: FuriHalI2cBusEventCallback,
3711}
3712#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3713const _: () = {
3714 ["Size of FuriHalI2cBus"][::core::mem::size_of::<FuriHalI2cBus>() - 12usize];
3715 ["Alignment of FuriHalI2cBus"][::core::mem::align_of::<FuriHalI2cBus>() - 4usize];
3716 ["Offset of field: FuriHalI2cBus::i2c"][::core::mem::offset_of!(FuriHalI2cBus, i2c) - 0usize];
3717 ["Offset of field: FuriHalI2cBus::current_handle"]
3718 [::core::mem::offset_of!(FuriHalI2cBus, current_handle) - 4usize];
3719 ["Offset of field: FuriHalI2cBus::callback"]
3720 [::core::mem::offset_of!(FuriHalI2cBus, callback) - 8usize];
3721};
3722#[doc = "< Handle activate: connect gpio and apply bus config"]
3723pub const FuriHalI2cBusHandleEventActivate: FuriHalI2cBusHandleEvent = FuriHalI2cBusHandleEvent(0);
3724#[doc = "< Handle deactivate: disconnect gpio and reset bus config"]
3725pub const FuriHalI2cBusHandleEventDeactivate: FuriHalI2cBusHandleEvent =
3726 FuriHalI2cBusHandleEvent(1);
3727#[repr(transparent)]
3728#[doc = "FuriHal i2c handle states"]
3729#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3730pub struct FuriHalI2cBusHandleEvent(pub core::ffi::c_uchar);
3731#[doc = "FuriHal i2c handle event callback"]
3732pub type FuriHalI2cBusHandleEventCallback = ::core::option::Option<
3733 unsafe extern "C" fn(handle: *const FuriHalI2cBusHandle, event: FuriHalI2cBusHandleEvent),
3734>;
3735#[doc = "FuriHal i2c handle"]
3736#[repr(C)]
3737#[derive(Debug, Copy, Clone)]
3738pub struct FuriHalI2cBusHandle {
3739 pub bus: *mut FuriHalI2cBus,
3740 pub callback: FuriHalI2cBusHandleEventCallback,
3741}
3742#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3743const _: () = {
3744 ["Size of FuriHalI2cBusHandle"][::core::mem::size_of::<FuriHalI2cBusHandle>() - 8usize];
3745 ["Alignment of FuriHalI2cBusHandle"][::core::mem::align_of::<FuriHalI2cBusHandle>() - 4usize];
3746 ["Offset of field: FuriHalI2cBusHandle::bus"]
3747 [::core::mem::offset_of!(FuriHalI2cBusHandle, bus) - 0usize];
3748 ["Offset of field: FuriHalI2cBusHandle::callback"]
3749 [::core::mem::offset_of!(FuriHalI2cBusHandle, callback) - 4usize];
3750};
3751unsafe extern "C" {
3752 #[doc = "Internal(power) i2c bus, I2C1, under reset when not used"]
3753 pub static mut furi_hal_i2c_bus_power: FuriHalI2cBus;
3754}
3755unsafe extern "C" {
3756 #[doc = "External i2c bus, I2C3, under reset when not used"]
3757 pub static mut furi_hal_i2c_bus_external: FuriHalI2cBus;
3758}
3759unsafe extern "C" {
3760 #[doc = "Handle for internal(power) i2c bus\n Bus: furi_hal_i2c_bus_external\n Pins: PA9(SCL) / PA10(SDA), float on release\n Params: 400khz"]
3761 pub static furi_hal_i2c_handle_power: FuriHalI2cBusHandle;
3762}
3763unsafe extern "C" {
3764 #[doc = "Handle for external i2c bus\n Bus: furi_hal_i2c_bus_external\n Pins: PC0(SCL) / PC1(SDA), float on release\n Params: 100khz"]
3765 pub static furi_hal_i2c_handle_external: FuriHalI2cBusHandle;
3766}
3767#[doc = "Begin the transaction by sending a START condition followed by the\n address"]
3768pub const FuriHalI2cBeginStart: FuriHalI2cBegin = FuriHalI2cBegin(0);
3769#[doc = "Begin the transaction by sending a RESTART condition followed by the\n address\n > **Note:** Must follow a transaction ended with\n FuriHalI2cEndAwaitRestart"]
3770pub const FuriHalI2cBeginRestart: FuriHalI2cBegin = FuriHalI2cBegin(1);
3771#[doc = "Continue the previous transaction with new data\n > **Note:** Must follow a transaction ended with FuriHalI2cEndPause and\n be of the same type (RX/TX)"]
3772pub const FuriHalI2cBeginResume: FuriHalI2cBegin = FuriHalI2cBegin(2);
3773#[repr(transparent)]
3774#[doc = "Transaction beginning signal"]
3775#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3776pub struct FuriHalI2cBegin(pub core::ffi::c_uchar);
3777#[doc = "End the transaction by sending a STOP condition"]
3778pub const FuriHalI2cEndStop: FuriHalI2cEnd = FuriHalI2cEnd(0);
3779#[doc = "End the transaction by clock stretching\n > **Note:** Must be followed by a transaction using\n FuriHalI2cBeginRestart"]
3780pub const FuriHalI2cEndAwaitRestart: FuriHalI2cEnd = FuriHalI2cEnd(1);
3781#[doc = "Pauses the transaction by clock stretching\n > **Note:** Must be followed by a transaction using FuriHalI2cBeginResume"]
3782pub const FuriHalI2cEndPause: FuriHalI2cEnd = FuriHalI2cEnd(2);
3783#[repr(transparent)]
3784#[doc = "Transaction end signal"]
3785#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3786pub struct FuriHalI2cEnd(pub core::ffi::c_uchar);
3787unsafe extern "C" {
3788 #[doc = "Acquire I2C bus handle\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance"]
3789 pub fn furi_hal_i2c_acquire(handle: *const FuriHalI2cBusHandle);
3790}
3791unsafe extern "C" {
3792 #[doc = "Release I2C bus handle\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance acquired in\n `furi_hal_i2c_acquire`"]
3793 pub fn furi_hal_i2c_release(handle: *const FuriHalI2cBusHandle);
3794}
3795unsafe extern "C" {
3796 #[doc = "Perform I2C TX transfer\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `address` - I2C slave address\n * `data` - Pointer to data buffer\n * `size` - Size of data buffer\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3797 pub fn furi_hal_i2c_tx(
3798 handle: *const FuriHalI2cBusHandle,
3799 address: u8,
3800 data: *const u8,
3801 size: usize,
3802 timeout: u32,
3803 ) -> bool;
3804}
3805unsafe extern "C" {
3806 #[doc = "Perform I2C TX transfer, with additional settings.\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `address` - I2C slave address\n * `ten_bit` - Whether the address is 10 bits wide\n * `data` - Pointer to data buffer\n * `size` - Size of data buffer\n * `begin` - How to begin the transaction\n * `end` - How to end the transaction\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3807 pub fn furi_hal_i2c_tx_ext(
3808 handle: *const FuriHalI2cBusHandle,
3809 address: u16,
3810 ten_bit: bool,
3811 data: *const u8,
3812 size: usize,
3813 begin: FuriHalI2cBegin,
3814 end: FuriHalI2cEnd,
3815 timeout: u32,
3816 ) -> bool;
3817}
3818unsafe extern "C" {
3819 #[doc = "Perform I2C RX transfer\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `address` - I2C slave address\n * `data` - Pointer to data buffer\n * `size` - Size of data buffer\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3820 pub fn furi_hal_i2c_rx(
3821 handle: *const FuriHalI2cBusHandle,
3822 address: u8,
3823 data: *mut u8,
3824 size: usize,
3825 timeout: u32,
3826 ) -> bool;
3827}
3828unsafe extern "C" {
3829 #[doc = "Perform I2C RX transfer, with additional settings.\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `address` - I2C slave address\n * `ten_bit` - Whether the address is 10 bits wide\n * `data` - Pointer to data buffer\n * `size` - Size of data buffer\n * `begin` - How to begin the transaction\n * `end` - How to end the transaction\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3830 pub fn furi_hal_i2c_rx_ext(
3831 handle: *const FuriHalI2cBusHandle,
3832 address: u16,
3833 ten_bit: bool,
3834 data: *mut u8,
3835 size: usize,
3836 begin: FuriHalI2cBegin,
3837 end: FuriHalI2cEnd,
3838 timeout: u32,
3839 ) -> bool;
3840}
3841unsafe extern "C" {
3842 #[doc = "Perform I2C TX and RX transfers\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `address` - I2C slave address\n * `tx_data` - Pointer to TX data buffer\n * `tx_size` - Size of TX data buffer\n * `rx_data` - Pointer to RX data buffer\n * `rx_size` - Size of RX data buffer\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3843 pub fn furi_hal_i2c_trx(
3844 handle: *const FuriHalI2cBusHandle,
3845 address: u8,
3846 tx_data: *const u8,
3847 tx_size: usize,
3848 rx_data: *mut u8,
3849 rx_size: usize,
3850 timeout: u32,
3851 ) -> bool;
3852}
3853unsafe extern "C" {
3854 #[doc = "Check if I2C device presents on bus\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue if device present and is ready, false otherwise"]
3855 pub fn furi_hal_i2c_is_device_ready(
3856 handle: *const FuriHalI2cBusHandle,
3857 i2c_addr: u8,
3858 timeout: u32,
3859 ) -> bool;
3860}
3861unsafe extern "C" {
3862 #[doc = "Perform I2C device register read (8-bit)\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `reg_addr` - Register address\n * `data` - Pointer to register value\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3863 pub fn furi_hal_i2c_read_reg_8(
3864 handle: *const FuriHalI2cBusHandle,
3865 i2c_addr: u8,
3866 reg_addr: u8,
3867 data: *mut u8,
3868 timeout: u32,
3869 ) -> bool;
3870}
3871unsafe extern "C" {
3872 #[doc = "Perform I2C device register read (16-bit)\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `reg_addr` - Register address\n * `data` - Pointer to register value\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3873 pub fn furi_hal_i2c_read_reg_16(
3874 handle: *const FuriHalI2cBusHandle,
3875 i2c_addr: u8,
3876 reg_addr: u8,
3877 data: *mut u16,
3878 timeout: u32,
3879 ) -> bool;
3880}
3881unsafe extern "C" {
3882 #[doc = "Perform I2C device memory read\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `mem_addr` - Memory start address\n * `data` - Pointer to data buffer\n * `len` - Size of data buffer\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3883 pub fn furi_hal_i2c_read_mem(
3884 handle: *const FuriHalI2cBusHandle,
3885 i2c_addr: u8,
3886 mem_addr: u8,
3887 data: *mut u8,
3888 len: usize,
3889 timeout: u32,
3890 ) -> bool;
3891}
3892unsafe extern "C" {
3893 #[doc = "Perform I2C device register write (8-bit)\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `reg_addr` - Register address\n * `data` - Register value\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3894 pub fn furi_hal_i2c_write_reg_8(
3895 handle: *const FuriHalI2cBusHandle,
3896 i2c_addr: u8,
3897 reg_addr: u8,
3898 data: u8,
3899 timeout: u32,
3900 ) -> bool;
3901}
3902unsafe extern "C" {
3903 #[doc = "Perform I2C device register write (16-bit)\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `reg_addr` - Register address\n * `data` - Register value\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3904 pub fn furi_hal_i2c_write_reg_16(
3905 handle: *const FuriHalI2cBusHandle,
3906 i2c_addr: u8,
3907 reg_addr: u8,
3908 data: u16,
3909 timeout: u32,
3910 ) -> bool;
3911}
3912unsafe extern "C" {
3913 #[doc = "Perform I2C device memory\n\n # Arguments\n\n* `handle` - Pointer to FuriHalI2cBusHandle instance\n * `i2c_addr` - I2C slave address\n * `mem_addr` - Memory start address\n * `data` - Pointer to data buffer\n * `len` - Size of data buffer\n * `timeout` - Timeout in milliseconds\n\n # Returns\n\ntrue on successful transfer, false otherwise"]
3914 pub fn furi_hal_i2c_write_mem(
3915 handle: *const FuriHalI2cBusHandle,
3916 i2c_addr: u8,
3917 mem_addr: u8,
3918 data: *const u8,
3919 len: usize,
3920 timeout: u32,
3921 ) -> bool;
3922}
3923#[repr(C)]
3924#[derive(Debug, Copy, Clone)]
3925pub struct FuriHalRegionBand {
3926 pub start: u32,
3927 pub end: u32,
3928 pub power_limit: i8,
3929 pub duty_cycle: u8,
3930}
3931#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3932const _: () = {
3933 ["Size of FuriHalRegionBand"][::core::mem::size_of::<FuriHalRegionBand>() - 12usize];
3934 ["Alignment of FuriHalRegionBand"][::core::mem::align_of::<FuriHalRegionBand>() - 4usize];
3935 ["Offset of field: FuriHalRegionBand::start"]
3936 [::core::mem::offset_of!(FuriHalRegionBand, start) - 0usize];
3937 ["Offset of field: FuriHalRegionBand::end"]
3938 [::core::mem::offset_of!(FuriHalRegionBand, end) - 4usize];
3939 ["Offset of field: FuriHalRegionBand::power_limit"]
3940 [::core::mem::offset_of!(FuriHalRegionBand, power_limit) - 8usize];
3941 ["Offset of field: FuriHalRegionBand::duty_cycle"]
3942 [::core::mem::offset_of!(FuriHalRegionBand, duty_cycle) - 9usize];
3943};
3944#[repr(C)]
3945#[derive(Debug)]
3946pub struct FuriHalRegion {
3947 pub country_code: [core::ffi::c_char; 4usize],
3948 pub bands_count: u16,
3949 pub bands: __IncompleteArrayField<FuriHalRegionBand>,
3950}
3951#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3952const _: () = {
3953 ["Size of FuriHalRegion"][::core::mem::size_of::<FuriHalRegion>() - 8usize];
3954 ["Alignment of FuriHalRegion"][::core::mem::align_of::<FuriHalRegion>() - 4usize];
3955 ["Offset of field: FuriHalRegion::country_code"]
3956 [::core::mem::offset_of!(FuriHalRegion, country_code) - 0usize];
3957 ["Offset of field: FuriHalRegion::bands_count"]
3958 [::core::mem::offset_of!(FuriHalRegion, bands_count) - 4usize];
3959 ["Offset of field: FuriHalRegion::bands"]
3960 [::core::mem::offset_of!(FuriHalRegion, bands) - 8usize];
3961};
3962unsafe extern "C" {
3963 #[doc = "Get Region Data.\n\n Region data may be allocated in Flash or in RAM.\n Keep in mind that we don't do memory management on our side.\n\n # Returns\n\npointer to FuriHalRegion instance (in RAM or Flash, check before freeing on region update)"]
3964 pub fn furi_hal_region_get() -> *const FuriHalRegion;
3965}
3966unsafe extern "C" {
3967 #[doc = "Set device region data\n\n # Arguments\n\n* `region` - pointer to the FuriHalRegion"]
3968 pub fn furi_hal_region_set(region: *mut FuriHalRegion);
3969}
3970unsafe extern "C" {
3971 #[doc = "Check if region data provisioned\n\n # Returns\n\ntrue if provisioned, false otherwise"]
3972 pub fn furi_hal_region_is_provisioned() -> bool;
3973}
3974unsafe extern "C" {
3975 #[doc = "Get region name\n\n 2 letter Region code according to iso 3166 standard\n There are 2 extra values that we use in special cases:\n - \"00\" - developer edition, unlocked\n - \"WW\" - world wide, region provisioned by default\n - \"--\" - no provisioned region\n\n # Returns\n\nPointer to string"]
3976 pub fn furi_hal_region_get_name() -> *const core::ffi::c_char;
3977}
3978unsafe extern "C" {
3979 #[doc = "Сheck if transmission is allowed on this frequency for your flipper region\n\n # Arguments\n\n* `frequency` (direction in) - The frequency\n * `value` - frequency in Hz\n\n # Returns\n\ntrue if allowed"]
3980 pub fn furi_hal_region_is_frequency_allowed(frequency: u32) -> bool;
3981}
3982unsafe extern "C" {
3983 #[doc = "Get band data for frequency\n\n\n\n # Arguments\n\n* `frequency` (direction in) - The frequency\n\n # Returns\n\n{ description_of_the_return_value }"]
3984 pub fn furi_hal_region_get_band(frequency: u32) -> *const FuriHalRegionBand;
3985}
3986pub const FuriHalPwmOutputIdNone: FuriHalPwmOutputId = FuriHalPwmOutputId(0);
3987pub const FuriHalPwmOutputIdTim1PA7: FuriHalPwmOutputId = FuriHalPwmOutputId(1);
3988pub const FuriHalPwmOutputIdLptim2PA4: FuriHalPwmOutputId = FuriHalPwmOutputId(2);
3989#[repr(transparent)]
3990#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3991pub struct FuriHalPwmOutputId(pub core::ffi::c_uchar);
3992unsafe extern "C" {
3993 #[doc = "Enable PWM channel and set parameters\n\n # Arguments\n\n* `channel` (direction in) - PWM channel (FuriHalPwmOutputId)\n * `freq` (direction in) - Frequency in Hz\n * `duty` (direction in) - Duty cycle value in %"]
3994 pub fn furi_hal_pwm_start(channel: FuriHalPwmOutputId, freq: u32, duty: u8);
3995}
3996unsafe extern "C" {
3997 #[doc = "Disable PWM channel\n\n # Arguments\n\n* `channel` (direction in) - PWM channel (FuriHalPwmOutputId)"]
3998 pub fn furi_hal_pwm_stop(channel: FuriHalPwmOutputId);
3999}
4000unsafe extern "C" {
4001 #[doc = "Set PWM channel parameters\n\n # Arguments\n\n* `channel` (direction in) - PWM channel (FuriHalPwmOutputId)\n * `freq` (direction in) - Frequency in Hz\n * `duty` (direction in) - Duty cycle value in %"]
4002 pub fn furi_hal_pwm_set_params(channel: FuriHalPwmOutputId, freq: u32, duty: u8);
4003}
4004unsafe extern "C" {
4005 #[doc = "Is PWM channel running?\n\n # Arguments\n\n* `channel` (direction in) - PWM channel (FuriHalPwmOutputId)\n # Returns\n\nbool - true if running"]
4006 pub fn furi_hal_pwm_is_running(channel: FuriHalPwmOutputId) -> bool;
4007}
4008pub const InputKeyUp: InputKey = InputKey(0);
4009pub const InputKeyDown: InputKey = InputKey(1);
4010pub const InputKeyRight: InputKey = InputKey(2);
4011pub const InputKeyLeft: InputKey = InputKey(3);
4012pub const InputKeyOk: InputKey = InputKey(4);
4013pub const InputKeyBack: InputKey = InputKey(5);
4014#[doc = "< Special value"]
4015pub const InputKeyMAX: InputKey = InputKey(6);
4016#[repr(transparent)]
4017#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4018pub struct InputKey(pub core::ffi::c_uchar);
4019pub const LightRed: Light = Light(1);
4020pub const LightGreen: Light = Light(2);
4021pub const LightBlue: Light = Light(4);
4022pub const LightBacklight: Light = Light(8);
4023#[repr(transparent)]
4024#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4025pub struct Light(pub core::ffi::c_uchar);
4026#[repr(C)]
4027#[derive(Debug, Copy, Clone)]
4028pub struct InputPin {
4029 pub gpio: *const GpioPin,
4030 pub key: InputKey,
4031 pub inverted: bool,
4032 pub name: *const core::ffi::c_char,
4033}
4034#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4035const _: () = {
4036 ["Size of InputPin"][::core::mem::size_of::<InputPin>() - 12usize];
4037 ["Alignment of InputPin"][::core::mem::align_of::<InputPin>() - 4usize];
4038 ["Offset of field: InputPin::gpio"][::core::mem::offset_of!(InputPin, gpio) - 0usize];
4039 ["Offset of field: InputPin::key"][::core::mem::offset_of!(InputPin, key) - 4usize];
4040 ["Offset of field: InputPin::inverted"][::core::mem::offset_of!(InputPin, inverted) - 5usize];
4041 ["Offset of field: InputPin::name"][::core::mem::offset_of!(InputPin, name) - 8usize];
4042};
4043#[repr(C)]
4044#[derive(Debug, Copy, Clone)]
4045pub struct GpioPinRecord {
4046 pub pin: *const GpioPin,
4047 pub name: *const core::ffi::c_char,
4048 pub channel: FuriHalAdcChannel,
4049 pub pwm_output: FuriHalPwmOutputId,
4050 pub number: u8,
4051 pub debug: bool,
4052}
4053#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4054const _: () = {
4055 ["Size of GpioPinRecord"][::core::mem::size_of::<GpioPinRecord>() - 12usize];
4056 ["Alignment of GpioPinRecord"][::core::mem::align_of::<GpioPinRecord>() - 4usize];
4057 ["Offset of field: GpioPinRecord::pin"][::core::mem::offset_of!(GpioPinRecord, pin) - 0usize];
4058 ["Offset of field: GpioPinRecord::name"][::core::mem::offset_of!(GpioPinRecord, name) - 4usize];
4059 ["Offset of field: GpioPinRecord::channel"]
4060 [::core::mem::offset_of!(GpioPinRecord, channel) - 8usize];
4061 ["Offset of field: GpioPinRecord::pwm_output"]
4062 [::core::mem::offset_of!(GpioPinRecord, pwm_output) - 9usize];
4063 ["Offset of field: GpioPinRecord::number"]
4064 [::core::mem::offset_of!(GpioPinRecord, number) - 10usize];
4065 ["Offset of field: GpioPinRecord::debug"]
4066 [::core::mem::offset_of!(GpioPinRecord, debug) - 11usize];
4067};
4068unsafe extern "C" {
4069 pub static input_pins: [InputPin; 0usize];
4070}
4071unsafe extern "C" {
4072 pub static input_pins_count: usize;
4073}
4074unsafe extern "C" {
4075 pub static gpio_pins: [GpioPinRecord; 0usize];
4076}
4077unsafe extern "C" {
4078 pub static gpio_pins_count: usize;
4079}
4080unsafe extern "C" {
4081 pub static gpio_swdio: GpioPin;
4082}
4083unsafe extern "C" {
4084 pub static gpio_swclk: GpioPin;
4085}
4086unsafe extern "C" {
4087 pub static gpio_vibro: GpioPin;
4088}
4089unsafe extern "C" {
4090 pub static gpio_ibutton: GpioPin;
4091}
4092unsafe extern "C" {
4093 pub static gpio_cc1101_g0: GpioPin;
4094}
4095unsafe extern "C" {
4096 pub static gpio_rf_sw_0: GpioPin;
4097}
4098unsafe extern "C" {
4099 pub static gpio_subghz_cs: GpioPin;
4100}
4101unsafe extern "C" {
4102 pub static gpio_display_cs: GpioPin;
4103}
4104unsafe extern "C" {
4105 pub static gpio_display_rst_n: GpioPin;
4106}
4107unsafe extern "C" {
4108 pub static gpio_display_di: GpioPin;
4109}
4110unsafe extern "C" {
4111 pub static gpio_sdcard_cs: GpioPin;
4112}
4113unsafe extern "C" {
4114 pub static gpio_sdcard_cd: GpioPin;
4115}
4116unsafe extern "C" {
4117 pub static gpio_nfc_cs: GpioPin;
4118}
4119unsafe extern "C" {
4120 pub static gpio_button_up: GpioPin;
4121}
4122unsafe extern "C" {
4123 pub static gpio_button_down: GpioPin;
4124}
4125unsafe extern "C" {
4126 pub static gpio_button_right: GpioPin;
4127}
4128unsafe extern "C" {
4129 pub static gpio_button_left: GpioPin;
4130}
4131unsafe extern "C" {
4132 pub static gpio_button_ok: GpioPin;
4133}
4134unsafe extern "C" {
4135 pub static gpio_button_back: GpioPin;
4136}
4137unsafe extern "C" {
4138 pub static gpio_spi_d_miso: GpioPin;
4139}
4140unsafe extern "C" {
4141 pub static gpio_spi_d_mosi: GpioPin;
4142}
4143unsafe extern "C" {
4144 pub static gpio_spi_d_sck: GpioPin;
4145}
4146unsafe extern "C" {
4147 pub static gpio_spi_r_miso: GpioPin;
4148}
4149unsafe extern "C" {
4150 pub static gpio_spi_r_mosi: GpioPin;
4151}
4152unsafe extern "C" {
4153 pub static gpio_spi_r_sck: GpioPin;
4154}
4155unsafe extern "C" {
4156 pub static gpio_ext_pc0: GpioPin;
4157}
4158unsafe extern "C" {
4159 pub static gpio_ext_pc1: GpioPin;
4160}
4161unsafe extern "C" {
4162 pub static gpio_ext_pc3: GpioPin;
4163}
4164unsafe extern "C" {
4165 pub static gpio_ext_pb2: GpioPin;
4166}
4167unsafe extern "C" {
4168 pub static gpio_ext_pb3: GpioPin;
4169}
4170unsafe extern "C" {
4171 pub static gpio_ext_pa4: GpioPin;
4172}
4173unsafe extern "C" {
4174 pub static gpio_ext_pa6: GpioPin;
4175}
4176unsafe extern "C" {
4177 pub static gpio_ext_pa7: GpioPin;
4178}
4179unsafe extern "C" {
4180 pub static gpio_nfc_irq_rfid_pull: GpioPin;
4181}
4182unsafe extern "C" {
4183 pub static gpio_rfid_carrier_out: GpioPin;
4184}
4185unsafe extern "C" {
4186 pub static gpio_rfid_data_in: GpioPin;
4187}
4188unsafe extern "C" {
4189 pub static gpio_rfid_carrier: GpioPin;
4190}
4191unsafe extern "C" {
4192 pub static gpio_infrared_rx: GpioPin;
4193}
4194unsafe extern "C" {
4195 pub static gpio_infrared_tx: GpioPin;
4196}
4197unsafe extern "C" {
4198 pub static gpio_usart_tx: GpioPin;
4199}
4200unsafe extern "C" {
4201 pub static gpio_usart_rx: GpioPin;
4202}
4203unsafe extern "C" {
4204 pub static gpio_i2c_power_sda: GpioPin;
4205}
4206unsafe extern "C" {
4207 pub static gpio_i2c_power_scl: GpioPin;
4208}
4209unsafe extern "C" {
4210 pub static gpio_speaker: GpioPin;
4211}
4212unsafe extern "C" {
4213 pub static gpio_periph_power: GpioPin;
4214}
4215unsafe extern "C" {
4216 pub static gpio_usb_dm: GpioPin;
4217}
4218unsafe extern "C" {
4219 pub static gpio_usb_dp: GpioPin;
4220}
4221unsafe extern "C" {
4222 #[doc = "Get a corresponding external connector pin number for a gpio\n\n # Arguments\n\n* `gpio` - GpioPin\n\n # Returns\n\npin number or -1 if gpio is not on the external connector"]
4223 pub fn furi_hal_resources_get_ext_pin_number(gpio: *const GpioPin) -> i32;
4224}
4225unsafe extern "C" {
4226 #[doc = "Finds a pin by its name\n\n # Arguments\n\n* `name` - case-insensitive pin name to look for (e.g. `\"Pc3\"`, `\"pA4\"`)\n\n # Returns\n\na pointer to the corresponding `GpioPinRecord` if such a pin exists,\n `NULL` otherwise."]
4227 pub fn furi_hal_resources_pin_by_name(name: *const core::ffi::c_char) -> *const GpioPinRecord;
4228}
4229unsafe extern "C" {
4230 #[doc = "Finds a pin by its number\n\n # Arguments\n\n* `name` - pin number to look for (e.g. `7`, `4`)\n\n # Returns\n\na pointer to the corresponding `GpioPinRecord` if such a pin exists,\n `NULL` otherwise."]
4231 pub fn furi_hal_resources_pin_by_number(number: u8) -> *const GpioPinRecord;
4232}
4233#[repr(C)]
4234#[derive(Debug, Copy, Clone)]
4235pub struct DateTime {
4236 #[doc = "< Hour in 24H format: 0-23"]
4237 pub hour: u8,
4238 #[doc = "< Minute: 0-59"]
4239 pub minute: u8,
4240 #[doc = "< Second: 0-59"]
4241 pub second: u8,
4242 #[doc = "< Current day: 1-31"]
4243 pub day: u8,
4244 #[doc = "< Current month: 1-12"]
4245 pub month: u8,
4246 #[doc = "< Current year: 2000-2099"]
4247 pub year: u16,
4248 #[doc = "< Current weekday: 1-7"]
4249 pub weekday: u8,
4250}
4251#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4252const _: () = {
4253 ["Size of DateTime"][::core::mem::size_of::<DateTime>() - 10usize];
4254 ["Alignment of DateTime"][::core::mem::align_of::<DateTime>() - 2usize];
4255 ["Offset of field: DateTime::hour"][::core::mem::offset_of!(DateTime, hour) - 0usize];
4256 ["Offset of field: DateTime::minute"][::core::mem::offset_of!(DateTime, minute) - 1usize];
4257 ["Offset of field: DateTime::second"][::core::mem::offset_of!(DateTime, second) - 2usize];
4258 ["Offset of field: DateTime::day"][::core::mem::offset_of!(DateTime, day) - 3usize];
4259 ["Offset of field: DateTime::month"][::core::mem::offset_of!(DateTime, month) - 4usize];
4260 ["Offset of field: DateTime::year"][::core::mem::offset_of!(DateTime, year) - 6usize];
4261 ["Offset of field: DateTime::weekday"][::core::mem::offset_of!(DateTime, weekday) - 8usize];
4262};
4263unsafe extern "C" {
4264 #[doc = "Validate Date Time\n\n # Arguments\n\n* `datetime` - The datetime to validate\n\n # Returns\n\n{ description_of_the_return_value }"]
4265 pub fn datetime_validate_datetime(datetime: *mut DateTime) -> bool;
4266}
4267unsafe extern "C" {
4268 #[doc = "Convert DateTime to UNIX timestamp\n\n Mind timezone when perform conversion\n\n # Arguments\n\n* `datetime` - The datetime (UTC)\n\n # Returns\n\nUNIX Timestamp in seconds from UNIX epoch start"]
4269 pub fn datetime_datetime_to_timestamp(datetime: *mut DateTime) -> u32;
4270}
4271unsafe extern "C" {
4272 #[doc = "Convert UNIX timestamp to DateTime\n\n Mind timezone when perform conversion\n\n # Arguments\n\n* `timestamp` (direction in) - UNIX Timestamp in seconds from UNIX epoch start\n * `datetime` (direction out) - The datetime (UTC)"]
4273 pub fn datetime_timestamp_to_datetime(timestamp: u32, datetime: *mut DateTime);
4274}
4275unsafe extern "C" {
4276 #[doc = "Gets the number of days in the year according to the Gregorian calendar.\n\n # Arguments\n\n* `year` - Input year.\n\n # Returns\n\nnumber of days in `year`."]
4277 pub fn datetime_get_days_per_year(year: u16) -> u16;
4278}
4279unsafe extern "C" {
4280 #[doc = "Check if a year a leap year in the Gregorian calendar.\n\n # Arguments\n\n* `year` - Input year.\n\n # Returns\n\ntrue if `year` is a leap year."]
4281 pub fn datetime_is_leap_year(year: u16) -> bool;
4282}
4283unsafe extern "C" {
4284 #[doc = "Get the number of days in the month.\n\n # Arguments\n\n* `leap_year` - true to calculate based on leap years\n * `month` - month to check, where 1 = January\n # Returns\n\nthe number of days in the month"]
4285 pub fn datetime_get_days_per_month(leap_year: bool, month: u8) -> u8;
4286}
4287pub const FuriHalRtcFlagDebug: FuriHalRtcFlag = FuriHalRtcFlag(1);
4288pub const FuriHalRtcFlagStorageFormatInternal: FuriHalRtcFlag = FuriHalRtcFlag(2);
4289pub const FuriHalRtcFlagLock: FuriHalRtcFlag = FuriHalRtcFlag(4);
4290pub const FuriHalRtcFlagC2Update: FuriHalRtcFlag = FuriHalRtcFlag(8);
4291pub const FuriHalRtcFlagHandOrient: FuriHalRtcFlag = FuriHalRtcFlag(16);
4292pub const FuriHalRtcFlagLegacySleep: FuriHalRtcFlag = FuriHalRtcFlag(32);
4293pub const FuriHalRtcFlagStealthMode: FuriHalRtcFlag = FuriHalRtcFlag(64);
4294pub const FuriHalRtcFlagDetailedFilename: FuriHalRtcFlag = FuriHalRtcFlag(128);
4295#[repr(transparent)]
4296#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4297pub struct FuriHalRtcFlag(pub core::ffi::c_uchar);
4298#[doc = "< Normal boot mode, default value"]
4299pub const FuriHalRtcBootModeNormal: FuriHalRtcBootMode = FuriHalRtcBootMode(0);
4300#[doc = "< Boot to DFU (MCU bootloader by ST)"]
4301pub const FuriHalRtcBootModeDfu: FuriHalRtcBootMode = FuriHalRtcBootMode(1);
4302#[doc = "< Boot to Update, pre update"]
4303pub const FuriHalRtcBootModePreUpdate: FuriHalRtcBootMode = FuriHalRtcBootMode(2);
4304#[doc = "< Boot to Update, main"]
4305pub const FuriHalRtcBootModeUpdate: FuriHalRtcBootMode = FuriHalRtcBootMode(3);
4306#[doc = "< Boot to Update, post update"]
4307pub const FuriHalRtcBootModePostUpdate: FuriHalRtcBootMode = FuriHalRtcBootMode(4);
4308#[repr(transparent)]
4309#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4310pub struct FuriHalRtcBootMode(pub core::ffi::c_uchar);
4311#[doc = "< Disable allocation tracking"]
4312pub const FuriHalRtcHeapTrackModeNone: FuriHalRtcHeapTrackMode = FuriHalRtcHeapTrackMode(0);
4313#[doc = "< Enable allocation tracking for main application thread"]
4314pub const FuriHalRtcHeapTrackModeMain: FuriHalRtcHeapTrackMode = FuriHalRtcHeapTrackMode(1);
4315#[doc = "< Enable allocation tracking for main and children application threads"]
4316pub const FuriHalRtcHeapTrackModeTree: FuriHalRtcHeapTrackMode = FuriHalRtcHeapTrackMode(2);
4317#[doc = "< Enable allocation tracking for all threads"]
4318pub const FuriHalRtcHeapTrackModeAll: FuriHalRtcHeapTrackMode = FuriHalRtcHeapTrackMode(3);
4319#[repr(transparent)]
4320#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4321pub struct FuriHalRtcHeapTrackMode(pub core::ffi::c_uchar);
4322#[doc = "< RTC structure header"]
4323pub const FuriHalRtcRegisterHeader: FuriHalRtcRegister = FuriHalRtcRegister(0);
4324#[doc = "< Various system bits"]
4325pub const FuriHalRtcRegisterSystem: FuriHalRtcRegister = FuriHalRtcRegister(1);
4326#[doc = "< Pointer to Version"]
4327pub const FuriHalRtcRegisterVersion: FuriHalRtcRegister = FuriHalRtcRegister(2);
4328#[doc = "< LFS geometry fingerprint"]
4329pub const FuriHalRtcRegisterLfsFingerprint: FuriHalRtcRegister = FuriHalRtcRegister(3);
4330#[doc = "< Pointer to last fault message"]
4331pub const FuriHalRtcRegisterFaultData: FuriHalRtcRegister = FuriHalRtcRegister(4);
4332#[doc = "< Failed PINs count"]
4333pub const FuriHalRtcRegisterPinFails: FuriHalRtcRegister = FuriHalRtcRegister(5);
4334pub const FuriHalRtcRegisterUpdateFolderFSIndex: FuriHalRtcRegister = FuriHalRtcRegister(6);
4335#[doc = "< Encoded value of the currently set PIN"]
4336pub const FuriHalRtcRegisterPinValue: FuriHalRtcRegister = FuriHalRtcRegister(7);
4337#[doc = "< Service value, do not use"]
4338pub const FuriHalRtcRegisterMAX: FuriHalRtcRegister = FuriHalRtcRegister(8);
4339#[repr(transparent)]
4340#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4341pub struct FuriHalRtcRegister(pub core::ffi::c_uchar);
4342#[doc = "< Metric measurement units"]
4343pub const FuriHalRtcLocaleUnitsMetric: FuriHalRtcLocaleUnits = FuriHalRtcLocaleUnits(0);
4344#[doc = "< Imperial measurement units"]
4345pub const FuriHalRtcLocaleUnitsImperial: FuriHalRtcLocaleUnits = FuriHalRtcLocaleUnits(1);
4346#[repr(transparent)]
4347#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4348pub struct FuriHalRtcLocaleUnits(pub core::ffi::c_uchar);
4349#[doc = "< 24-hour format"]
4350pub const FuriHalRtcLocaleTimeFormat24h: FuriHalRtcLocaleTimeFormat = FuriHalRtcLocaleTimeFormat(0);
4351#[doc = "< 12-hour format"]
4352pub const FuriHalRtcLocaleTimeFormat12h: FuriHalRtcLocaleTimeFormat = FuriHalRtcLocaleTimeFormat(1);
4353#[repr(transparent)]
4354#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4355pub struct FuriHalRtcLocaleTimeFormat(pub core::ffi::c_uchar);
4356#[doc = "< Day/Month/Year"]
4357pub const FuriHalRtcLocaleDateFormatDMY: FuriHalRtcLocaleDateFormat = FuriHalRtcLocaleDateFormat(0);
4358#[doc = "< Month/Day/Year"]
4359pub const FuriHalRtcLocaleDateFormatMDY: FuriHalRtcLocaleDateFormat = FuriHalRtcLocaleDateFormat(1);
4360#[doc = "< Year/Month/Day"]
4361pub const FuriHalRtcLocaleDateFormatYMD: FuriHalRtcLocaleDateFormat = FuriHalRtcLocaleDateFormat(2);
4362#[repr(transparent)]
4363#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4364pub struct FuriHalRtcLocaleDateFormat(pub core::ffi::c_uchar);
4365#[doc = "< Default: USART"]
4366pub const FuriHalRtcLogDeviceUsart: FuriHalRtcLogDevice = FuriHalRtcLogDevice(0);
4367#[doc = "< Default: LPUART"]
4368pub const FuriHalRtcLogDeviceLpuart: FuriHalRtcLogDevice = FuriHalRtcLogDevice(1);
4369#[doc = "< Reserved for future use"]
4370pub const FuriHalRtcLogDeviceReserved: FuriHalRtcLogDevice = FuriHalRtcLogDevice(2);
4371#[doc = "< None, disable serial logging"]
4372pub const FuriHalRtcLogDeviceNone: FuriHalRtcLogDevice = FuriHalRtcLogDevice(3);
4373#[repr(transparent)]
4374#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4375pub struct FuriHalRtcLogDevice(pub core::ffi::c_uchar);
4376#[doc = "< 230400 baud"]
4377pub const FuriHalRtcLogBaudRate230400: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(0);
4378#[doc = "< 9600 baud"]
4379pub const FuriHalRtcLogBaudRate9600: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(1);
4380#[doc = "< 38400 baud"]
4381pub const FuriHalRtcLogBaudRate38400: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(2);
4382#[doc = "< 57600 baud"]
4383pub const FuriHalRtcLogBaudRate57600: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(3);
4384#[doc = "< 115200 baud"]
4385pub const FuriHalRtcLogBaudRate115200: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(4);
4386#[doc = "< 460800 baud"]
4387pub const FuriHalRtcLogBaudRate460800: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(5);
4388#[doc = "< 921600 baud"]
4389pub const FuriHalRtcLogBaudRate921600: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(6);
4390#[doc = "< 1843200 baud"]
4391pub const FuriHalRtcLogBaudRate1843200: FuriHalRtcLogBaudRate = FuriHalRtcLogBaudRate(7);
4392#[repr(transparent)]
4393#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4394pub struct FuriHalRtcLogBaudRate(pub core::ffi::c_uchar);
4395unsafe extern "C" {
4396 #[doc = "Force sync shadow registers"]
4397 pub fn furi_hal_rtc_sync_shadow();
4398}
4399unsafe extern "C" {
4400 #[doc = "Reset ALL RTC registers content"]
4401 pub fn furi_hal_rtc_reset_registers();
4402}
4403unsafe extern "C" {
4404 #[doc = "Get RTC register content\n\n # Arguments\n\n* `reg` (direction in) - The register identifier\n\n # Returns\n\ncontent of the register"]
4405 pub fn furi_hal_rtc_get_register(reg: FuriHalRtcRegister) -> u32;
4406}
4407unsafe extern "C" {
4408 #[doc = "Set register content\n\n # Arguments\n\n* `reg` (direction in) - The register identifier\n * `value` (direction in) - The value to store into register"]
4409 pub fn furi_hal_rtc_set_register(reg: FuriHalRtcRegister, value: u32);
4410}
4411unsafe extern "C" {
4412 #[doc = "Set Log Level value\n\n # Arguments\n\n* `level` (direction in) - The level to store"]
4413 pub fn furi_hal_rtc_set_log_level(level: u8);
4414}
4415unsafe extern "C" {
4416 #[doc = "Get Log Level value\n\n # Returns\n\nThe Log Level value"]
4417 pub fn furi_hal_rtc_get_log_level() -> u8;
4418}
4419unsafe extern "C" {
4420 #[doc = "Set logging device\n\n # Arguments\n\n* `device` (direction in) - The device"]
4421 pub fn furi_hal_rtc_set_log_device(device: FuriHalRtcLogDevice);
4422}
4423unsafe extern "C" {
4424 #[doc = "Get logging device\n\n # Returns\n\nThe furi hal rtc log device."]
4425 pub fn furi_hal_rtc_get_log_device() -> FuriHalRtcLogDevice;
4426}
4427unsafe extern "C" {
4428 #[doc = "Set logging baud rate\n\n # Arguments\n\n* `baud_rate` (direction in) - The baud rate"]
4429 pub fn furi_hal_rtc_set_log_baud_rate(baud_rate: FuriHalRtcLogBaudRate);
4430}
4431unsafe extern "C" {
4432 #[doc = "Get logging baud rate\n\n # Returns\n\nThe furi hal rtc log baud rate."]
4433 pub fn furi_hal_rtc_get_log_baud_rate() -> FuriHalRtcLogBaudRate;
4434}
4435unsafe extern "C" {
4436 #[doc = "Set RTC Flag\n\n # Arguments\n\n* `flag` (direction in) - The flag to set"]
4437 pub fn furi_hal_rtc_set_flag(flag: FuriHalRtcFlag);
4438}
4439unsafe extern "C" {
4440 #[doc = "Reset RTC Flag\n\n # Arguments\n\n* `flag` (direction in) - The flag to reset"]
4441 pub fn furi_hal_rtc_reset_flag(flag: FuriHalRtcFlag);
4442}
4443unsafe extern "C" {
4444 #[doc = "Check if RTC Flag is set\n\n # Arguments\n\n* `flag` (direction in) - The flag to check\n\n # Returns\n\ntrue if set"]
4445 pub fn furi_hal_rtc_is_flag_set(flag: FuriHalRtcFlag) -> bool;
4446}
4447unsafe extern "C" {
4448 #[doc = "Set RTC boot mode\n\n # Arguments\n\n* `mode` (direction in) - The mode to set"]
4449 pub fn furi_hal_rtc_set_boot_mode(mode: FuriHalRtcBootMode);
4450}
4451unsafe extern "C" {
4452 #[doc = "Get RTC boot mode\n\n # Returns\n\nThe RTC boot mode."]
4453 pub fn furi_hal_rtc_get_boot_mode() -> FuriHalRtcBootMode;
4454}
4455unsafe extern "C" {
4456 #[doc = "Set Heap Track mode\n\n # Arguments\n\n* `mode` (direction in) - The mode to set"]
4457 pub fn furi_hal_rtc_set_heap_track_mode(mode: FuriHalRtcHeapTrackMode);
4458}
4459unsafe extern "C" {
4460 #[doc = "Get RTC Heap Track mode\n\n # Returns\n\nThe RTC heap track mode."]
4461 pub fn furi_hal_rtc_get_heap_track_mode() -> FuriHalRtcHeapTrackMode;
4462}
4463unsafe extern "C" {
4464 #[doc = "Set locale units\n\n # Arguments\n\n* `value` (direction in) - The RTC Locale Units"]
4465 pub fn furi_hal_rtc_set_locale_units(value: FuriHalRtcLocaleUnits);
4466}
4467unsafe extern "C" {
4468 #[doc = "Get RTC Locale Units\n\n # Returns\n\nThe RTC Locale Units."]
4469 pub fn furi_hal_rtc_get_locale_units() -> FuriHalRtcLocaleUnits;
4470}
4471unsafe extern "C" {
4472 #[doc = "Set RTC Locale Time Format\n\n # Arguments\n\n* `value` (direction in) - The RTC Locale Time Format"]
4473 pub fn furi_hal_rtc_set_locale_timeformat(value: FuriHalRtcLocaleTimeFormat);
4474}
4475unsafe extern "C" {
4476 #[doc = "Get RTC Locale Time Format\n\n # Returns\n\nThe RTC Locale Time Format."]
4477 pub fn furi_hal_rtc_get_locale_timeformat() -> FuriHalRtcLocaleTimeFormat;
4478}
4479unsafe extern "C" {
4480 #[doc = "Set RTC Locale Date Format\n\n # Arguments\n\n* `value` (direction in) - The RTC Locale Date Format"]
4481 pub fn furi_hal_rtc_set_locale_dateformat(value: FuriHalRtcLocaleDateFormat);
4482}
4483unsafe extern "C" {
4484 #[doc = "Get RTC Locale Date Format\n\n # Returns\n\nThe RTC Locale Date Format"]
4485 pub fn furi_hal_rtc_get_locale_dateformat() -> FuriHalRtcLocaleDateFormat;
4486}
4487unsafe extern "C" {
4488 #[doc = "Set RTC Date Time\n\n # Arguments\n\n* `datetime` - The date time to set"]
4489 pub fn furi_hal_rtc_set_datetime(datetime: *mut DateTime);
4490}
4491unsafe extern "C" {
4492 #[doc = "Get RTC Date Time\n\n # Arguments\n\n* `datetime` - The datetime"]
4493 pub fn furi_hal_rtc_get_datetime(datetime: *mut DateTime);
4494}
4495#[doc = "Furi HAL RTC alarm callback signature"]
4496pub type FuriHalRtcAlarmCallback =
4497 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
4498unsafe extern "C" {
4499 #[doc = "Set RTC Fault Data\n\n # Arguments\n\n* `value` (direction in) - The value"]
4500 pub fn furi_hal_rtc_set_fault_data(value: u32);
4501}
4502unsafe extern "C" {
4503 #[doc = "Get RTC Fault Data\n\n # Returns\n\nRTC Fault Data value"]
4504 pub fn furi_hal_rtc_get_fault_data() -> u32;
4505}
4506unsafe extern "C" {
4507 #[doc = "Set PIN Fails count\n\n # Arguments\n\n* `value` (direction in) - The PIN Fails count"]
4508 pub fn furi_hal_rtc_set_pin_fails(value: u32);
4509}
4510unsafe extern "C" {
4511 #[doc = "Get PIN Fails count\n\n # Returns\n\nPIN Fails Count"]
4512 pub fn furi_hal_rtc_get_pin_fails() -> u32;
4513}
4514unsafe extern "C" {
4515 #[doc = "Get UNIX Timestamp\n\n # Returns\n\nUnix Timestamp in seconds from UNIX epoch start"]
4516 pub fn furi_hal_rtc_get_timestamp() -> u32;
4517}
4518unsafe extern "C" {
4519 #[doc = "Acquire speaker ownership\n\n You must acquire speaker ownership before use\n\n # Arguments\n\n* `timeout` - Timeout during which speaker ownership must be acquired\n\n # Returns\n\nbool returns true on success"]
4520 pub fn furi_hal_speaker_acquire(timeout: u32) -> bool;
4521}
4522unsafe extern "C" {
4523 #[doc = "Release speaker ownership\n\n You must release speaker ownership after use"]
4524 pub fn furi_hal_speaker_release();
4525}
4526unsafe extern "C" {
4527 #[doc = "Check current process speaker ownership\n\n always returns true if called from ISR\n\n # Returns\n\nbool returns true if process owns speaker"]
4528 pub fn furi_hal_speaker_is_mine() -> bool;
4529}
4530unsafe extern "C" {
4531 #[doc = "Play a note\n\n no ownership check if called from ISR\n\n # Arguments\n\n* `frequency` - The frequency\n * `volume` - The volume"]
4532 pub fn furi_hal_speaker_start(frequency: f32, volume: f32);
4533}
4534unsafe extern "C" {
4535 #[doc = "Set volume\n\n no ownership check if called from ISR\n\n # Arguments\n\n* `volume` - The volume"]
4536 pub fn furi_hal_speaker_set_volume(volume: f32);
4537}
4538unsafe extern "C" {
4539 #[doc = "Stop playback\n\n no ownership check if called from ISR"]
4540 pub fn furi_hal_speaker_stop();
4541}
4542unsafe extern "C" {
4543 #[doc = "Set light value\n\n # Arguments\n\n* `light` - Light\n * `value` - light brightness [0-255]"]
4544 pub fn furi_hal_light_set(light: Light, value: u8);
4545}
4546unsafe extern "C" {
4547 #[doc = "Start hardware LED blinking mode\n\n # Arguments\n\n* `light` - Light\n * `brightness` - light brightness [0-255]\n * `on_time` - LED on time in ms\n * `period` - LED blink period in ms"]
4548 pub fn furi_hal_light_blink_start(light: Light, brightness: u8, on_time: u16, period: u16);
4549}
4550unsafe extern "C" {
4551 #[doc = "Stop hardware LED blinking mode"]
4552 pub fn furi_hal_light_blink_stop();
4553}
4554unsafe extern "C" {
4555 #[doc = "Set color in hardware LED blinking mode\n\n # Arguments\n\n* `light` - Light"]
4556 pub fn furi_hal_light_blink_set_color(light: Light);
4557}
4558unsafe extern "C" {
4559 #[doc = "Execute sequence\n\n # Arguments\n\n* `sequence` - Sequence to execute"]
4560 pub fn furi_hal_light_sequence(sequence: *const core::ffi::c_char);
4561}
4562#[doc = "Callback type called every time another key-value pair of device information is ready\n\n # Arguments\n\n* `key[in]` - device information type identifier\n * `value[in]` - device information value\n * `last[in]` - whether the passed key-value pair is the last one\n * `context[in]` - to pass to callback"]
4563pub type PropertyValueCallback = ::core::option::Option<
4564 unsafe extern "C" fn(
4565 key: *const core::ffi::c_char,
4566 value: *const core::ffi::c_char,
4567 last: bool,
4568 context: *mut core::ffi::c_void,
4569 ),
4570>;
4571#[repr(C)]
4572#[derive(Debug, Copy, Clone)]
4573pub struct PropertyValueContext {
4574 #[doc = "< key string buffer, must be initialised before use"]
4575 pub key: *mut FuriString,
4576 #[doc = "< value string buffer, must be initialised before use"]
4577 pub value: *mut FuriString,
4578 #[doc = "< output callback function"]
4579 pub out: PropertyValueCallback,
4580 #[doc = "< separator character between key parts"]
4581 pub sep: core::ffi::c_char,
4582 #[doc = "< flag to indicate last element"]
4583 pub last: bool,
4584 #[doc = "< user-defined context, passed through to out callback"]
4585 pub context: *mut core::ffi::c_void,
4586}
4587#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4588const _: () = {
4589 ["Size of PropertyValueContext"][::core::mem::size_of::<PropertyValueContext>() - 20usize];
4590 ["Alignment of PropertyValueContext"][::core::mem::align_of::<PropertyValueContext>() - 4usize];
4591 ["Offset of field: PropertyValueContext::key"]
4592 [::core::mem::offset_of!(PropertyValueContext, key) - 0usize];
4593 ["Offset of field: PropertyValueContext::value"]
4594 [::core::mem::offset_of!(PropertyValueContext, value) - 4usize];
4595 ["Offset of field: PropertyValueContext::out"]
4596 [::core::mem::offset_of!(PropertyValueContext, out) - 8usize];
4597 ["Offset of field: PropertyValueContext::sep"]
4598 [::core::mem::offset_of!(PropertyValueContext, sep) - 12usize];
4599 ["Offset of field: PropertyValueContext::last"]
4600 [::core::mem::offset_of!(PropertyValueContext, last) - 13usize];
4601 ["Offset of field: PropertyValueContext::context"]
4602 [::core::mem::offset_of!(PropertyValueContext, context) - 16usize];
4603};
4604unsafe extern "C" {
4605 #[doc = "Builds key and value strings and outputs them via a callback function\n\n # Arguments\n\n* `ctx[in]` - local property context\n * `fmt[in]` - value format, set to NULL to bypass formatting\n * `nparts[in]` - number of key parts (separated by character)\n * `...[in]` - list of key parts followed by value"]
4606 pub fn property_value_out(
4607 ctx: *mut PropertyValueContext,
4608 fmt: *const core::ffi::c_char,
4609 nparts: core::ffi::c_uint,
4610 ...
4611 );
4612}
4613pub const FuriHalPowerICCharger: FuriHalPowerIC = FuriHalPowerIC(0);
4614pub const FuriHalPowerICFuelGauge: FuriHalPowerIC = FuriHalPowerIC(1);
4615#[repr(transparent)]
4616#[doc = "Power IC type"]
4617#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4618pub struct FuriHalPowerIC(pub core::ffi::c_uchar);
4619unsafe extern "C" {
4620 #[doc = "Check if gauge is ok\n\n Verifies that:\n - gauge is alive\n - correct profile loaded\n - self diagnostic status is good\n\n # Returns\n\ntrue if gauge is ok"]
4621 pub fn furi_hal_power_gauge_is_ok() -> bool;
4622}
4623unsafe extern "C" {
4624 #[doc = "Check if gauge requests system shutdown\n\n # Returns\n\ntrue if system shutdown requested"]
4625 pub fn furi_hal_power_is_shutdown_requested() -> bool;
4626}
4627unsafe extern "C" {
4628 #[doc = "Enter insomnia mode Prevents device from going to sleep\n Internally increases insomnia level Must be paired with\n furi_hal_power_insomnia_exit"]
4629 pub fn furi_hal_power_insomnia_enter();
4630}
4631unsafe extern "C" {
4632 #[doc = "Exit insomnia mode Allow device to go to sleep\n Internally decreases insomnia level. Must be paired with\n furi_hal_power_insomnia_enter"]
4633 pub fn furi_hal_power_insomnia_exit();
4634}
4635unsafe extern "C" {
4636 #[doc = "Check if sleep available\n\n # Returns\n\ntrue if available"]
4637 pub fn furi_hal_power_sleep_available() -> bool;
4638}
4639unsafe extern "C" {
4640 #[doc = "Go to sleep"]
4641 pub fn furi_hal_power_sleep();
4642}
4643unsafe extern "C" {
4644 #[doc = "Get predicted remaining battery capacity in percents\n\n # Returns\n\nremaining battery capacity in percents"]
4645 pub fn furi_hal_power_get_pct() -> u8;
4646}
4647unsafe extern "C" {
4648 #[doc = "Get battery health state in percents\n\n # Returns\n\nhealth in percents"]
4649 pub fn furi_hal_power_get_bat_health_pct() -> u8;
4650}
4651unsafe extern "C" {
4652 #[doc = "Get charging status\n\n # Returns\n\ntrue if charging"]
4653 pub fn furi_hal_power_is_charging() -> bool;
4654}
4655unsafe extern "C" {
4656 #[doc = "Get charge complete status\n\n # Returns\n\ntrue if done charging and connected to charger"]
4657 pub fn furi_hal_power_is_charging_done() -> bool;
4658}
4659unsafe extern "C" {
4660 #[doc = "Switch MCU to SHUTDOWN"]
4661 pub fn furi_hal_power_shutdown();
4662}
4663unsafe extern "C" {
4664 #[doc = "Poweroff device"]
4665 pub fn furi_hal_power_off();
4666}
4667unsafe extern "C" {
4668 #[doc = "Reset device"]
4669 pub fn furi_hal_power_reset();
4670}
4671unsafe extern "C" {
4672 #[doc = "OTG enable\n\n this is low level control, use power service instead"]
4673 pub fn furi_hal_power_enable_otg() -> bool;
4674}
4675unsafe extern "C" {
4676 #[doc = "OTG disable\n\n this is low level control, use power service instead"]
4677 pub fn furi_hal_power_disable_otg();
4678}
4679unsafe extern "C" {
4680 #[doc = "Check OTG status fault"]
4681 pub fn furi_hal_power_check_otg_fault() -> bool;
4682}
4683unsafe extern "C" {
4684 #[doc = "Check OTG status and disable it if falt happened"]
4685 pub fn furi_hal_power_check_otg_status();
4686}
4687unsafe extern "C" {
4688 #[doc = "Get OTG status\n\n # Returns\n\ntrue if enabled"]
4689 pub fn furi_hal_power_is_otg_enabled() -> bool;
4690}
4691unsafe extern "C" {
4692 #[doc = "Get battery charge voltage limit in V\n\n # Returns\n\nvoltage in V"]
4693 pub fn furi_hal_power_get_battery_charge_voltage_limit() -> f32;
4694}
4695unsafe extern "C" {
4696 #[doc = "Set battery charge voltage limit in V\n\n Invalid values will be clamped downward to the nearest valid value.\n\n # Arguments\n\n* `voltage` (direction in) - voltage in V"]
4697 pub fn furi_hal_power_set_battery_charge_voltage_limit(voltage: f32);
4698}
4699unsafe extern "C" {
4700 #[doc = "Get remaining battery battery capacity in mAh\n\n # Returns\n\ncapacity in mAh"]
4701 pub fn furi_hal_power_get_battery_remaining_capacity() -> u32;
4702}
4703unsafe extern "C" {
4704 #[doc = "Get full charge battery capacity in mAh\n\n # Returns\n\ncapacity in mAh"]
4705 pub fn furi_hal_power_get_battery_full_capacity() -> u32;
4706}
4707unsafe extern "C" {
4708 #[doc = "Get battery capacity in mAh from battery profile\n\n # Returns\n\ncapacity in mAh"]
4709 pub fn furi_hal_power_get_battery_design_capacity() -> u32;
4710}
4711unsafe extern "C" {
4712 #[doc = "Get battery voltage in V\n\n # Arguments\n\n* `ic` (direction in) - FuriHalPowerIc to get measurment\n\n # Returns\n\nvoltage in V"]
4713 pub fn furi_hal_power_get_battery_voltage(ic: FuriHalPowerIC) -> f32;
4714}
4715unsafe extern "C" {
4716 #[doc = "Get battery current in A\n\n # Arguments\n\n* `ic` (direction in) - FuriHalPowerIc to get measurment\n\n # Returns\n\ncurrent in A"]
4717 pub fn furi_hal_power_get_battery_current(ic: FuriHalPowerIC) -> f32;
4718}
4719unsafe extern "C" {
4720 #[doc = "Get temperature in C\n\n # Arguments\n\n* `ic` (direction in) - FuriHalPowerIc to get measurment\n\n # Returns\n\ntemperature in C"]
4721 pub fn furi_hal_power_get_battery_temperature(ic: FuriHalPowerIC) -> f32;
4722}
4723unsafe extern "C" {
4724 #[doc = "Get USB voltage in V\n\n # Returns\n\nvoltage in V"]
4725 pub fn furi_hal_power_get_usb_voltage() -> f32;
4726}
4727unsafe extern "C" {
4728 #[doc = "Enable 3.3v on external gpio and sd card"]
4729 pub fn furi_hal_power_enable_external_3_3v();
4730}
4731unsafe extern "C" {
4732 #[doc = "Disable 3.3v on external gpio and sd card"]
4733 pub fn furi_hal_power_disable_external_3_3v();
4734}
4735unsafe extern "C" {
4736 #[doc = "Enter supress charge mode.\n\n Use this function when your application need clean power supply."]
4737 pub fn furi_hal_power_suppress_charge_enter();
4738}
4739unsafe extern "C" {
4740 #[doc = "Exit supress charge mode"]
4741 pub fn furi_hal_power_suppress_charge_exit();
4742}
4743unsafe extern "C" {
4744 #[doc = "Get power information\n\n # Arguments\n\n* `callback` (direction in) - callback to provide with new data\n * `sep` (direction in) - category separator character\n * `context` (direction in) - context to pass to callback"]
4745 pub fn furi_hal_power_info_get(
4746 callback: PropertyValueCallback,
4747 sep: core::ffi::c_char,
4748 context: *mut core::ffi::c_void,
4749 );
4750}
4751unsafe extern "C" {
4752 #[doc = "Get power debug information\n\n # Arguments\n\n* `callback` (direction in) - callback to provide with new data\n * `context` (direction in) - context to pass to callback"]
4753 pub fn furi_hal_power_debug_get(
4754 callback: PropertyValueCallback,
4755 context: *mut core::ffi::c_void,
4756 );
4757}
4758#[doc = "TIM Time Base configuration structure definition."]
4759#[repr(C)]
4760#[derive(Debug, Copy, Clone)]
4761pub struct LL_TIM_InitTypeDef {
4762 #[doc = "< Specifies the prescaler value used to divide the TIM clock.\nThis parameter can be a number between Min_Data=0x0000 and Max_Data=0xFFFF.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_SetPrescaler()."]
4763 pub Prescaler: u16,
4764 #[doc = "< Specifies the counter mode.\nThis parameter can be a value of TIM_LL_EC_COUNTERMODE.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_SetCounterMode()."]
4765 pub CounterMode: u32,
4766 #[doc = "< Specifies the auto reload value to be loaded into the active\nAuto-Reload Register at the next update event.\nThis parameter must be a number between Min_Data=0x0000 and Max_Data=0xFFFF.\nSome timer instances may support 32 bits counters. In that case this parameter must\nbe a number between 0x0000 and 0xFFFFFFFF.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_SetAutoReload()."]
4767 pub Autoreload: u32,
4768 #[doc = "< Specifies the clock division.\nThis parameter can be a value of TIM_LL_EC_CLOCKDIVISION.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_SetClockDivision()."]
4769 pub ClockDivision: u32,
4770 #[doc = "< Specifies the repetition counter value. Each time the RCR downcounter\nreaches zero, an update event is generated and counting restarts\nfrom the RCR value (N).\nThis means in PWM mode that (N+1) corresponds to:\n- the number of PWM periods in edge-aligned mode\n- the number of half PWM period in center-aligned mode\nGP timers: this parameter must be a number between Min_Data = 0x00 and\nMax_Data = 0xFF.\nAdvanced timers: this parameter must be a number between Min_Data = 0x0000 and\nMax_Data = 0xFFFF.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_SetRepetitionCounter()."]
4771 pub RepetitionCounter: u32,
4772}
4773#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4774const _: () = {
4775 ["Size of LL_TIM_InitTypeDef"][::core::mem::size_of::<LL_TIM_InitTypeDef>() - 20usize];
4776 ["Alignment of LL_TIM_InitTypeDef"][::core::mem::align_of::<LL_TIM_InitTypeDef>() - 4usize];
4777 ["Offset of field: LL_TIM_InitTypeDef::Prescaler"]
4778 [::core::mem::offset_of!(LL_TIM_InitTypeDef, Prescaler) - 0usize];
4779 ["Offset of field: LL_TIM_InitTypeDef::CounterMode"]
4780 [::core::mem::offset_of!(LL_TIM_InitTypeDef, CounterMode) - 4usize];
4781 ["Offset of field: LL_TIM_InitTypeDef::Autoreload"]
4782 [::core::mem::offset_of!(LL_TIM_InitTypeDef, Autoreload) - 8usize];
4783 ["Offset of field: LL_TIM_InitTypeDef::ClockDivision"]
4784 [::core::mem::offset_of!(LL_TIM_InitTypeDef, ClockDivision) - 12usize];
4785 ["Offset of field: LL_TIM_InitTypeDef::RepetitionCounter"]
4786 [::core::mem::offset_of!(LL_TIM_InitTypeDef, RepetitionCounter) - 16usize];
4787};
4788#[doc = "TIM Output Compare configuration structure definition."]
4789#[repr(C)]
4790#[derive(Debug, Copy, Clone)]
4791pub struct LL_TIM_OC_InitTypeDef {
4792 #[doc = "< Specifies the output mode.\nThis parameter can be a value of TIM_LL_EC_OCMODE.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_OC_SetMode()."]
4793 pub OCMode: u32,
4794 #[doc = "< Specifies the TIM Output Compare state.\nThis parameter can be a value of TIM_LL_EC_OCSTATE.\n\nThis feature can be modified afterwards using unitary functions\nLL_TIM_CC_EnableChannel() or LL_TIM_CC_DisableChannel()."]
4795 pub OCState: u32,
4796 #[doc = "< Specifies the TIM complementary Output Compare state.\nThis parameter can be a value of TIM_LL_EC_OCSTATE.\n\nThis feature can be modified afterwards using unitary functions\nLL_TIM_CC_EnableChannel() or LL_TIM_CC_DisableChannel()."]
4797 pub OCNState: u32,
4798 #[doc = "< Specifies the Compare value to be loaded into the Capture Compare Register.\nThis parameter can be a number between Min_Data=0x0000 and Max_Data=0xFFFF.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_OC_SetCompareCHx (x=1..6)."]
4799 pub CompareValue: u32,
4800 #[doc = "< Specifies the output polarity.\nThis parameter can be a value of TIM_LL_EC_OCPOLARITY.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_OC_SetPolarity()."]
4801 pub OCPolarity: u32,
4802 #[doc = "< Specifies the complementary output polarity.\nThis parameter can be a value of TIM_LL_EC_OCPOLARITY.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_OC_SetPolarity()."]
4803 pub OCNPolarity: u32,
4804 #[doc = "< Specifies the TIM Output Compare pin state during Idle state.\nThis parameter can be a value of TIM_LL_EC_OCIDLESTATE.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_OC_SetIdleState()."]
4805 pub OCIdleState: u32,
4806 #[doc = "< Specifies the TIM Output Compare pin state during Idle state.\nThis parameter can be a value of TIM_LL_EC_OCIDLESTATE.\n\nThis feature can be modified afterwards using unitary function\nLL_TIM_OC_SetIdleState()."]
4807 pub OCNIdleState: u32,
4808}
4809#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4810const _: () = {
4811 ["Size of LL_TIM_OC_InitTypeDef"][::core::mem::size_of::<LL_TIM_OC_InitTypeDef>() - 32usize];
4812 ["Alignment of LL_TIM_OC_InitTypeDef"]
4813 [::core::mem::align_of::<LL_TIM_OC_InitTypeDef>() - 4usize];
4814 ["Offset of field: LL_TIM_OC_InitTypeDef::OCMode"]
4815 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCMode) - 0usize];
4816 ["Offset of field: LL_TIM_OC_InitTypeDef::OCState"]
4817 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCState) - 4usize];
4818 ["Offset of field: LL_TIM_OC_InitTypeDef::OCNState"]
4819 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCNState) - 8usize];
4820 ["Offset of field: LL_TIM_OC_InitTypeDef::CompareValue"]
4821 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, CompareValue) - 12usize];
4822 ["Offset of field: LL_TIM_OC_InitTypeDef::OCPolarity"]
4823 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCPolarity) - 16usize];
4824 ["Offset of field: LL_TIM_OC_InitTypeDef::OCNPolarity"]
4825 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCNPolarity) - 20usize];
4826 ["Offset of field: LL_TIM_OC_InitTypeDef::OCIdleState"]
4827 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCIdleState) - 24usize];
4828 ["Offset of field: LL_TIM_OC_InitTypeDef::OCNIdleState"]
4829 [::core::mem::offset_of!(LL_TIM_OC_InitTypeDef, OCNIdleState) - 28usize];
4830};
4831unsafe extern "C" {
4832 #[doc = "TIM_LL_EF_Init Initialisation and deinitialisation functions\n # "]
4833 pub fn LL_TIM_DeInit(TIMx: *mut TIM_TypeDef) -> ErrorStatus;
4834}
4835unsafe extern "C" {
4836 pub fn LL_TIM_Init(
4837 TIMx: *mut TIM_TypeDef,
4838 TIM_InitStruct: *const LL_TIM_InitTypeDef,
4839 ) -> ErrorStatus;
4840}
4841unsafe extern "C" {
4842 pub fn LL_TIM_OC_Init(
4843 TIMx: *mut TIM_TypeDef,
4844 Channel: u32,
4845 TIM_OC_InitStruct: *const LL_TIM_OC_InitTypeDef,
4846 ) -> ErrorStatus;
4847}
4848#[doc = "Timer ISR"]
4849pub type FuriHalInterruptISR =
4850 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
4851pub const FuriHalInterruptIdTim1TrgComTim17: FuriHalInterruptId = FuriHalInterruptId(0);
4852pub const FuriHalInterruptIdTim1Cc: FuriHalInterruptId = FuriHalInterruptId(1);
4853pub const FuriHalInterruptIdTim1UpTim16: FuriHalInterruptId = FuriHalInterruptId(2);
4854pub const FuriHalInterruptIdTIM2: FuriHalInterruptId = FuriHalInterruptId(3);
4855pub const FuriHalInterruptIdDma1Ch1: FuriHalInterruptId = FuriHalInterruptId(4);
4856pub const FuriHalInterruptIdDma1Ch2: FuriHalInterruptId = FuriHalInterruptId(5);
4857pub const FuriHalInterruptIdDma1Ch3: FuriHalInterruptId = FuriHalInterruptId(6);
4858pub const FuriHalInterruptIdDma1Ch4: FuriHalInterruptId = FuriHalInterruptId(7);
4859pub const FuriHalInterruptIdDma1Ch5: FuriHalInterruptId = FuriHalInterruptId(8);
4860pub const FuriHalInterruptIdDma1Ch6: FuriHalInterruptId = FuriHalInterruptId(9);
4861pub const FuriHalInterruptIdDma1Ch7: FuriHalInterruptId = FuriHalInterruptId(10);
4862pub const FuriHalInterruptIdDma2Ch1: FuriHalInterruptId = FuriHalInterruptId(11);
4863pub const FuriHalInterruptIdDma2Ch2: FuriHalInterruptId = FuriHalInterruptId(12);
4864pub const FuriHalInterruptIdDma2Ch3: FuriHalInterruptId = FuriHalInterruptId(13);
4865pub const FuriHalInterruptIdDma2Ch4: FuriHalInterruptId = FuriHalInterruptId(14);
4866pub const FuriHalInterruptIdDma2Ch5: FuriHalInterruptId = FuriHalInterruptId(15);
4867pub const FuriHalInterruptIdDma2Ch6: FuriHalInterruptId = FuriHalInterruptId(16);
4868pub const FuriHalInterruptIdDma2Ch7: FuriHalInterruptId = FuriHalInterruptId(17);
4869pub const FuriHalInterruptIdRcc: FuriHalInterruptId = FuriHalInterruptId(18);
4870pub const FuriHalInterruptIdCOMP: FuriHalInterruptId = FuriHalInterruptId(19);
4871pub const FuriHalInterruptIdRtcAlarm: FuriHalInterruptId = FuriHalInterruptId(20);
4872pub const FuriHalInterruptIdHsem: FuriHalInterruptId = FuriHalInterruptId(21);
4873pub const FuriHalInterruptIdLpTim1: FuriHalInterruptId = FuriHalInterruptId(22);
4874pub const FuriHalInterruptIdLpTim2: FuriHalInterruptId = FuriHalInterruptId(23);
4875pub const FuriHalInterruptIdUart1: FuriHalInterruptId = FuriHalInterruptId(24);
4876pub const FuriHalInterruptIdLpUart1: FuriHalInterruptId = FuriHalInterruptId(25);
4877pub const FuriHalInterruptIdMax: FuriHalInterruptId = FuriHalInterruptId(26);
4878#[repr(transparent)]
4879#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4880pub struct FuriHalInterruptId(pub core::ffi::c_uchar);
4881pub const FuriHalInterruptPriorityLowest: FuriHalInterruptPriority = FuriHalInterruptPriority(-3);
4882pub const FuriHalInterruptPriorityLower: FuriHalInterruptPriority = FuriHalInterruptPriority(-2);
4883pub const FuriHalInterruptPriorityLow: FuriHalInterruptPriority = FuriHalInterruptPriority(-1);
4884pub const FuriHalInterruptPriorityNormal: FuriHalInterruptPriority = FuriHalInterruptPriority(0);
4885pub const FuriHalInterruptPriorityHigh: FuriHalInterruptPriority = FuriHalInterruptPriority(1);
4886pub const FuriHalInterruptPriorityHigher: FuriHalInterruptPriority = FuriHalInterruptPriority(2);
4887pub const FuriHalInterruptPriorityHighest: FuriHalInterruptPriority = FuriHalInterruptPriority(3);
4888pub const FuriHalInterruptPriorityKamiSama: FuriHalInterruptPriority = FuriHalInterruptPriority(6);
4889#[repr(transparent)]
4890#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4891pub struct FuriHalInterruptPriority(pub core::ffi::c_schar);
4892unsafe extern "C" {
4893 #[doc = "Set ISR and enable interrupt with default priority\n\n Interrupt flags are not cleared automatically. You may want to\n ensure that your peripheral status flags are cleared.\n\n # Arguments\n\n* `index` - - interrupt ID\n * `isr` - - your interrupt service routine or use NULL to clear\n * `context` - - isr context"]
4894 pub fn furi_hal_interrupt_set_isr(
4895 index: FuriHalInterruptId,
4896 isr: FuriHalInterruptISR,
4897 context: *mut core::ffi::c_void,
4898 );
4899}
4900unsafe extern "C" {
4901 #[doc = "Set ISR and enable interrupt with custom priority\n\n Interrupt flags are not cleared automatically. You may want to\n ensure that your peripheral status flags are cleared.\n\n # Arguments\n\n* `index` - - interrupt ID\n * `priority` - - One of FuriHalInterruptPriority\n * `isr` - - your interrupt service routine or use NULL to clear\n * `context` - - isr context"]
4902 pub fn furi_hal_interrupt_set_isr_ex(
4903 index: FuriHalInterruptId,
4904 priority: FuriHalInterruptPriority,
4905 isr: FuriHalInterruptISR,
4906 context: *mut core::ffi::c_void,
4907 );
4908}
4909unsafe extern "C" {
4910 #[doc = "Get interrupt name by exception number.\n Exception number can be obtained from IPSR register.\n\n # Arguments\n\n* `exception_number` -\n # Returns\n\nconst char* or NULL if interrupt name is not found"]
4911 pub fn furi_hal_interrupt_get_name(exception_number: u8) -> *const core::ffi::c_char;
4912}
4913unsafe extern "C" {
4914 #[doc = "Get total time(in CPU clocks) spent in ISR\n\n # Returns\n\ntotal time in CPU clocks"]
4915 pub fn furi_hal_interrupt_get_time_in_isr_total() -> u32;
4916}
4917#[repr(C)]
4918#[derive(Debug, Copy, Clone)]
4919pub struct Version {
4920 _unused: [u8; 0],
4921}
4922unsafe extern "C" {
4923 #[doc = "Get current running firmware version handle.\n\n You can store it somewhere. But if you want to retrieve data, you have to use\n 'version_*_get()' set of functions. Also, 'version_*_get()' imply to use this\n handle if no handle (NULL_PTR) provided.\n\n # Returns\n\npointer to Version data."]
4924 pub fn version_get() -> *const Version;
4925}
4926unsafe extern "C" {
4927 #[doc = "Get git commit hash.\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\ngit hash"]
4928 pub fn version_get_githash(v: *const Version) -> *const core::ffi::c_char;
4929}
4930unsafe extern "C" {
4931 #[doc = "Get git branch.\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\ngit branch"]
4932 pub fn version_get_gitbranch(v: *const Version) -> *const core::ffi::c_char;
4933}
4934unsafe extern "C" {
4935 #[doc = "Get number of commit in git branch.\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\nnumber of commit"]
4936 pub fn version_get_gitbranchnum(v: *const Version) -> *const core::ffi::c_char;
4937}
4938unsafe extern "C" {
4939 #[doc = "Get build date.\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\nbuild date"]
4940 pub fn version_get_builddate(v: *const Version) -> *const core::ffi::c_char;
4941}
4942unsafe extern "C" {
4943 #[doc = "Get build version. Build version is last tag in git history.\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\nbuild date"]
4944 pub fn version_get_version(v: *const Version) -> *const core::ffi::c_char;
4945}
4946unsafe extern "C" {
4947 #[doc = "Get hardware target this firmware was built for\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\nbuild date"]
4948 pub fn version_get_target(v: *const Version) -> u8;
4949}
4950unsafe extern "C" {
4951 #[doc = "Get flag indicating if this build is \"dirty\" (source code had uncommited changes)\n\n # Arguments\n\n* `v` - pointer to Version data. NULL for currently running\n software.\n\n # Returns\n\nbuild date"]
4952 pub fn version_get_dirty_flag(v: *const Version) -> bool;
4953}
4954unsafe extern "C" {
4955 #[doc = "Get firmware origin. \"Official\" for mainline firmware, fork name for forks.\n Set by FIRMWARE_ORIGIN fbt argument."]
4956 pub fn version_get_firmware_origin(v: *const Version) -> *const core::ffi::c_char;
4957}
4958unsafe extern "C" {
4959 #[doc = "Get git repo origin"]
4960 pub fn version_get_git_origin(v: *const Version) -> *const core::ffi::c_char;
4961}
4962pub const FuriHalVersionOtpVersion0: FuriHalVersionOtpVersion = FuriHalVersionOtpVersion(0);
4963pub const FuriHalVersionOtpVersion1: FuriHalVersionOtpVersion = FuriHalVersionOtpVersion(1);
4964pub const FuriHalVersionOtpVersion2: FuriHalVersionOtpVersion = FuriHalVersionOtpVersion(2);
4965pub const FuriHalVersionOtpVersionEmpty: FuriHalVersionOtpVersion =
4966 FuriHalVersionOtpVersion(4294967294);
4967pub const FuriHalVersionOtpVersionUnknown: FuriHalVersionOtpVersion =
4968 FuriHalVersionOtpVersion(4294967295);
4969#[repr(transparent)]
4970#[doc = "OTP Versions enum"]
4971#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4972pub struct FuriHalVersionOtpVersion(pub core::ffi::c_uint);
4973pub const FuriHalVersionColorUnknown: FuriHalVersionColor = FuriHalVersionColor(0);
4974pub const FuriHalVersionColorBlack: FuriHalVersionColor = FuriHalVersionColor(1);
4975pub const FuriHalVersionColorWhite: FuriHalVersionColor = FuriHalVersionColor(2);
4976pub const FuriHalVersionColorTransparent: FuriHalVersionColor = FuriHalVersionColor(3);
4977#[repr(transparent)]
4978#[doc = "Device Colors"]
4979#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4980pub struct FuriHalVersionColor(pub core::ffi::c_uchar);
4981pub const FuriHalVersionRegionUnknown: FuriHalVersionRegion = FuriHalVersionRegion(0);
4982pub const FuriHalVersionRegionEuRu: FuriHalVersionRegion = FuriHalVersionRegion(1);
4983pub const FuriHalVersionRegionUsCaAu: FuriHalVersionRegion = FuriHalVersionRegion(2);
4984pub const FuriHalVersionRegionJp: FuriHalVersionRegion = FuriHalVersionRegion(3);
4985pub const FuriHalVersionRegionWorld: FuriHalVersionRegion = FuriHalVersionRegion(4);
4986#[repr(transparent)]
4987#[doc = "Device Regions"]
4988#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4989pub struct FuriHalVersionRegion(pub core::ffi::c_uchar);
4990pub const FuriHalVersionDisplayUnknown: FuriHalVersionDisplay = FuriHalVersionDisplay(0);
4991pub const FuriHalVersionDisplayErc: FuriHalVersionDisplay = FuriHalVersionDisplay(1);
4992pub const FuriHalVersionDisplayMgg: FuriHalVersionDisplay = FuriHalVersionDisplay(2);
4993#[repr(transparent)]
4994#[doc = "Device Display"]
4995#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4996pub struct FuriHalVersionDisplay(pub core::ffi::c_uchar);
4997unsafe extern "C" {
4998 #[doc = "Check target firmware version\n\n # Returns\n\ntrue if target and real matches"]
4999 pub fn furi_hal_version_do_i_belong_here() -> bool;
5000}
5001unsafe extern "C" {
5002 #[doc = "Get model name\n\n # Returns\n\nmodel name C-string"]
5003 pub fn furi_hal_version_get_model_name() -> *const core::ffi::c_char;
5004}
5005unsafe extern "C" {
5006 #[doc = "Get model name\n\n # Returns\n\nmodel code C-string"]
5007 pub fn furi_hal_version_get_model_code() -> *const core::ffi::c_char;
5008}
5009unsafe extern "C" {
5010 #[doc = "Get FCC ID\n\n # Returns\n\nFCC id as C-string"]
5011 pub fn furi_hal_version_get_fcc_id() -> *const core::ffi::c_char;
5012}
5013unsafe extern "C" {
5014 #[doc = "Get IC id\n\n # Returns\n\nIC id as C-string"]
5015 pub fn furi_hal_version_get_ic_id() -> *const core::ffi::c_char;
5016}
5017unsafe extern "C" {
5018 #[doc = "Get MIC id\n\n # Returns\n\nMIC id as C-string"]
5019 pub fn furi_hal_version_get_mic_id() -> *const core::ffi::c_char;
5020}
5021unsafe extern "C" {
5022 #[doc = "Get SRRC id\n\n # Returns\n\nSRRC id as C-string"]
5023 pub fn furi_hal_version_get_srrc_id() -> *const core::ffi::c_char;
5024}
5025unsafe extern "C" {
5026 #[doc = "Get NCC id\n\n # Returns\n\nNCC id as C-string"]
5027 pub fn furi_hal_version_get_ncc_id() -> *const core::ffi::c_char;
5028}
5029unsafe extern "C" {
5030 #[doc = "Get OTP version\n\n # Returns\n\nOTP Version"]
5031 pub fn furi_hal_version_get_otp_version() -> FuriHalVersionOtpVersion;
5032}
5033unsafe extern "C" {
5034 #[doc = "Get hardware version\n\n # Returns\n\nHardware Version"]
5035 pub fn furi_hal_version_get_hw_version() -> u8;
5036}
5037unsafe extern "C" {
5038 #[doc = "Get hardware target\n\n # Returns\n\nHardware Target"]
5039 pub fn furi_hal_version_get_hw_target() -> u8;
5040}
5041unsafe extern "C" {
5042 #[doc = "Get hardware body\n\n # Returns\n\nHardware Body"]
5043 pub fn furi_hal_version_get_hw_body() -> u8;
5044}
5045unsafe extern "C" {
5046 #[doc = "Get hardware body color\n\n # Returns\n\nHardware Color"]
5047 pub fn furi_hal_version_get_hw_color() -> FuriHalVersionColor;
5048}
5049unsafe extern "C" {
5050 #[doc = "Get hardware connect\n\n # Returns\n\nHardware Interconnect"]
5051 pub fn furi_hal_version_get_hw_connect() -> u8;
5052}
5053unsafe extern "C" {
5054 #[doc = "Get hardware region\n\n # Returns\n\nHardware Region"]
5055 pub fn furi_hal_version_get_hw_region() -> FuriHalVersionRegion;
5056}
5057unsafe extern "C" {
5058 #[doc = "Get hardware region name\n\n # Returns\n\nHardware Region name"]
5059 pub fn furi_hal_version_get_hw_region_name() -> *const core::ffi::c_char;
5060}
5061unsafe extern "C" {
5062 #[doc = "Get hardware display id\n\n # Returns\n\nDisplay id"]
5063 pub fn furi_hal_version_get_hw_display() -> FuriHalVersionDisplay;
5064}
5065unsafe extern "C" {
5066 #[doc = "Get hardware timestamp\n\n # Returns\n\nHardware Manufacture timestamp"]
5067 pub fn furi_hal_version_get_hw_timestamp() -> u32;
5068}
5069unsafe extern "C" {
5070 #[doc = "Get pointer to target name\n\n # Returns\n\nHardware Name C-string"]
5071 pub fn furi_hal_version_get_name_ptr() -> *const core::ffi::c_char;
5072}
5073unsafe extern "C" {
5074 #[doc = "Get pointer to target device name\n\n # Returns\n\nHardware Device Name C-string"]
5075 pub fn furi_hal_version_get_device_name_ptr() -> *const core::ffi::c_char;
5076}
5077unsafe extern "C" {
5078 #[doc = "Get pointer to target ble local device name\n\n # Returns\n\nBle Device Name C-string"]
5079 pub fn furi_hal_version_get_ble_local_device_name_ptr() -> *const core::ffi::c_char;
5080}
5081unsafe extern "C" {
5082 #[doc = "Get BLE MAC address\n\n # Returns\n\npointer to BLE MAC address"]
5083 pub fn furi_hal_version_get_ble_mac() -> *const u8;
5084}
5085unsafe extern "C" {
5086 #[doc = "Get address of version structure of firmware.\n\n # Returns\n\nAddress of firmware version structure."]
5087 pub fn furi_hal_version_get_firmware_version() -> *const Version;
5088}
5089unsafe extern "C" {
5090 #[doc = "Get platform UID size in bytes\n\n # Returns\n\nUID size in bytes"]
5091 pub fn furi_hal_version_uid_size() -> usize;
5092}
5093unsafe extern "C" {
5094 #[doc = "Get const pointer to UID\n\n # Returns\n\npointer to UID"]
5095 pub fn furi_hal_version_uid() -> *const u8;
5096}
5097pub const GapEventTypeConnected: GapEventType = GapEventType(0);
5098pub const GapEventTypeDisconnected: GapEventType = GapEventType(1);
5099pub const GapEventTypeStartAdvertising: GapEventType = GapEventType(2);
5100pub const GapEventTypeStopAdvertising: GapEventType = GapEventType(3);
5101pub const GapEventTypePinCodeShow: GapEventType = GapEventType(4);
5102pub const GapEventTypePinCodeVerify: GapEventType = GapEventType(5);
5103pub const GapEventTypeUpdateMTU: GapEventType = GapEventType(6);
5104pub const GapEventTypeBeaconStart: GapEventType = GapEventType(7);
5105pub const GapEventTypeBeaconStop: GapEventType = GapEventType(8);
5106#[repr(transparent)]
5107#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5108pub struct GapEventType(pub core::ffi::c_uchar);
5109#[repr(C)]
5110#[derive(Copy, Clone)]
5111pub union GapEventData {
5112 pub pin_code: u32,
5113 pub max_packet_size: u16,
5114}
5115#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5116const _: () = {
5117 ["Size of GapEventData"][::core::mem::size_of::<GapEventData>() - 4usize];
5118 ["Alignment of GapEventData"][::core::mem::align_of::<GapEventData>() - 4usize];
5119 ["Offset of field: GapEventData::pin_code"]
5120 [::core::mem::offset_of!(GapEventData, pin_code) - 0usize];
5121 ["Offset of field: GapEventData::max_packet_size"]
5122 [::core::mem::offset_of!(GapEventData, max_packet_size) - 0usize];
5123};
5124#[repr(C)]
5125#[derive(Copy, Clone)]
5126pub struct GapEvent {
5127 pub type_: GapEventType,
5128 pub data: GapEventData,
5129}
5130#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5131const _: () = {
5132 ["Size of GapEvent"][::core::mem::size_of::<GapEvent>() - 8usize];
5133 ["Alignment of GapEvent"][::core::mem::align_of::<GapEvent>() - 4usize];
5134 ["Offset of field: GapEvent::type_"][::core::mem::offset_of!(GapEvent, type_) - 0usize];
5135 ["Offset of field: GapEvent::data"][::core::mem::offset_of!(GapEvent, data) - 4usize];
5136};
5137pub type GapEventCallback = ::core::option::Option<
5138 unsafe extern "C" fn(event: GapEvent, context: *mut core::ffi::c_void) -> bool,
5139>;
5140pub const GapPairingNone: GapPairing = GapPairing(0);
5141pub const GapPairingPinCodeShow: GapPairing = GapPairing(1);
5142pub const GapPairingPinCodeVerifyYesNo: GapPairing = GapPairing(2);
5143#[repr(transparent)]
5144#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5145pub struct GapPairing(pub core::ffi::c_uchar);
5146#[repr(C)]
5147#[derive(Debug, Copy, Clone)]
5148pub struct GapConnectionParamsRequest {
5149 pub conn_int_min: u16,
5150 pub conn_int_max: u16,
5151 pub slave_latency: u16,
5152 pub supervisor_timeout: u16,
5153}
5154#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5155const _: () = {
5156 ["Size of GapConnectionParamsRequest"]
5157 [::core::mem::size_of::<GapConnectionParamsRequest>() - 8usize];
5158 ["Alignment of GapConnectionParamsRequest"]
5159 [::core::mem::align_of::<GapConnectionParamsRequest>() - 2usize];
5160 ["Offset of field: GapConnectionParamsRequest::conn_int_min"]
5161 [::core::mem::offset_of!(GapConnectionParamsRequest, conn_int_min) - 0usize];
5162 ["Offset of field: GapConnectionParamsRequest::conn_int_max"]
5163 [::core::mem::offset_of!(GapConnectionParamsRequest, conn_int_max) - 2usize];
5164 ["Offset of field: GapConnectionParamsRequest::slave_latency"]
5165 [::core::mem::offset_of!(GapConnectionParamsRequest, slave_latency) - 4usize];
5166 ["Offset of field: GapConnectionParamsRequest::supervisor_timeout"]
5167 [::core::mem::offset_of!(GapConnectionParamsRequest, supervisor_timeout) - 6usize];
5168};
5169#[repr(C)]
5170#[derive(Debug, Copy, Clone)]
5171pub struct GapConfig {
5172 pub adv_service: GapConfig__bindgen_ty_1,
5173 pub mfg_data: [u8; 23usize],
5174 pub mfg_data_len: u8,
5175 pub appearance_char: u16,
5176 pub bonding_mode: bool,
5177 pub pairing_method: GapPairing,
5178 pub mac_address: [u8; 6usize],
5179 pub adv_name: [core::ffi::c_char; 18usize],
5180 pub conn_param: GapConnectionParamsRequest,
5181}
5182#[repr(C)]
5183#[derive(Debug, Copy, Clone)]
5184pub struct GapConfig__bindgen_ty_1 {
5185 pub UUID_Type: u8,
5186 pub Service_UUID_16: u16,
5187 pub Service_UUID_128: [u8; 16usize],
5188}
5189#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5190const _: () = {
5191 ["Size of GapConfig__bindgen_ty_1"]
5192 [::core::mem::size_of::<GapConfig__bindgen_ty_1>() - 20usize];
5193 ["Alignment of GapConfig__bindgen_ty_1"]
5194 [::core::mem::align_of::<GapConfig__bindgen_ty_1>() - 2usize];
5195 ["Offset of field: GapConfig__bindgen_ty_1::UUID_Type"]
5196 [::core::mem::offset_of!(GapConfig__bindgen_ty_1, UUID_Type) - 0usize];
5197 ["Offset of field: GapConfig__bindgen_ty_1::Service_UUID_16"]
5198 [::core::mem::offset_of!(GapConfig__bindgen_ty_1, Service_UUID_16) - 2usize];
5199 ["Offset of field: GapConfig__bindgen_ty_1::Service_UUID_128"]
5200 [::core::mem::offset_of!(GapConfig__bindgen_ty_1, Service_UUID_128) - 4usize];
5201};
5202#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5203const _: () = {
5204 ["Size of GapConfig"][::core::mem::size_of::<GapConfig>() - 80usize];
5205 ["Alignment of GapConfig"][::core::mem::align_of::<GapConfig>() - 2usize];
5206 ["Offset of field: GapConfig::adv_service"]
5207 [::core::mem::offset_of!(GapConfig, adv_service) - 0usize];
5208 ["Offset of field: GapConfig::mfg_data"]
5209 [::core::mem::offset_of!(GapConfig, mfg_data) - 20usize];
5210 ["Offset of field: GapConfig::mfg_data_len"]
5211 [::core::mem::offset_of!(GapConfig, mfg_data_len) - 43usize];
5212 ["Offset of field: GapConfig::appearance_char"]
5213 [::core::mem::offset_of!(GapConfig, appearance_char) - 44usize];
5214 ["Offset of field: GapConfig::bonding_mode"]
5215 [::core::mem::offset_of!(GapConfig, bonding_mode) - 46usize];
5216 ["Offset of field: GapConfig::pairing_method"]
5217 [::core::mem::offset_of!(GapConfig, pairing_method) - 47usize];
5218 ["Offset of field: GapConfig::mac_address"]
5219 [::core::mem::offset_of!(GapConfig, mac_address) - 48usize];
5220 ["Offset of field: GapConfig::adv_name"]
5221 [::core::mem::offset_of!(GapConfig, adv_name) - 54usize];
5222 ["Offset of field: GapConfig::conn_param"]
5223 [::core::mem::offset_of!(GapConfig, conn_param) - 72usize];
5224};
5225#[repr(C)]
5226#[derive(Debug, Copy, Clone)]
5227pub struct GapRootSecurityKeys {
5228 pub erk: [u8; 16usize],
5229 pub irk: [u8; 16usize],
5230}
5231#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5232const _: () = {
5233 ["Size of GapRootSecurityKeys"][::core::mem::size_of::<GapRootSecurityKeys>() - 32usize];
5234 ["Alignment of GapRootSecurityKeys"][::core::mem::align_of::<GapRootSecurityKeys>() - 1usize];
5235 ["Offset of field: GapRootSecurityKeys::erk"]
5236 [::core::mem::offset_of!(GapRootSecurityKeys, erk) - 0usize];
5237 ["Offset of field: GapRootSecurityKeys::irk"]
5238 [::core::mem::offset_of!(GapRootSecurityKeys, irk) - 16usize];
5239};
5240pub const GapAdvChannelMap37: GapAdvChannelMap = GapAdvChannelMap(1);
5241pub const GapAdvChannelMap38: GapAdvChannelMap = GapAdvChannelMap(2);
5242pub const GapAdvChannelMap39: GapAdvChannelMap = GapAdvChannelMap(4);
5243pub const GapAdvChannelMapAll: GapAdvChannelMap = GapAdvChannelMap(7);
5244#[repr(transparent)]
5245#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5246pub struct GapAdvChannelMap(pub core::ffi::c_uchar);
5247pub const GapAdvPowerLevel_Neg40dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(0);
5248pub const GapAdvPowerLevel_Neg20_85dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(1);
5249pub const GapAdvPowerLevel_Neg19_75dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(2);
5250pub const GapAdvPowerLevel_Neg18_85dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(3);
5251pub const GapAdvPowerLevel_Neg17_6dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(4);
5252pub const GapAdvPowerLevel_Neg16_5dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(5);
5253pub const GapAdvPowerLevel_Neg15_25dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(6);
5254pub const GapAdvPowerLevel_Neg14_1dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(7);
5255pub const GapAdvPowerLevel_Neg13_15dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(8);
5256pub const GapAdvPowerLevel_Neg12_05dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(9);
5257pub const GapAdvPowerLevel_Neg10_9dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(10);
5258pub const GapAdvPowerLevel_Neg9_9dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(11);
5259pub const GapAdvPowerLevel_Neg8_85dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(12);
5260pub const GapAdvPowerLevel_Neg7_8dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(13);
5261pub const GapAdvPowerLevel_Neg6_9dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(14);
5262pub const GapAdvPowerLevel_Neg5_9dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(15);
5263pub const GapAdvPowerLevel_Neg4_95dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(16);
5264pub const GapAdvPowerLevel_Neg4dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(17);
5265pub const GapAdvPowerLevel_Neg3_15dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(18);
5266pub const GapAdvPowerLevel_Neg2_45dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(19);
5267pub const GapAdvPowerLevel_Neg1_8dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(20);
5268pub const GapAdvPowerLevel_Neg1_3dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(21);
5269pub const GapAdvPowerLevel_Neg0_85dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(22);
5270pub const GapAdvPowerLevel_Neg0_5dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(23);
5271pub const GapAdvPowerLevel_Neg0_15dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(24);
5272pub const GapAdvPowerLevel_0dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(25);
5273pub const GapAdvPowerLevel_1dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(26);
5274pub const GapAdvPowerLevel_2dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(27);
5275pub const GapAdvPowerLevel_3dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(28);
5276pub const GapAdvPowerLevel_4dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(29);
5277pub const GapAdvPowerLevel_5dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(30);
5278pub const GapAdvPowerLevel_6dBm: GapAdvPowerLevelInd = GapAdvPowerLevelInd(31);
5279#[repr(transparent)]
5280#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5281pub struct GapAdvPowerLevelInd(pub core::ffi::c_uchar);
5282pub const GapAddressTypePublic: GapAddressType = GapAddressType(0);
5283pub const GapAddressTypeRandom: GapAddressType = GapAddressType(1);
5284#[repr(transparent)]
5285#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5286pub struct GapAddressType(pub core::ffi::c_uchar);
5287#[repr(C)]
5288#[derive(Debug, Copy, Clone)]
5289pub struct GapExtraBeaconConfig {
5290 pub min_adv_interval_ms: u16,
5291 pub max_adv_interval_ms: u16,
5292 pub adv_channel_map: GapAdvChannelMap,
5293 pub adv_power_level: GapAdvPowerLevelInd,
5294 pub address_type: GapAddressType,
5295 pub address: [u8; 6usize],
5296}
5297#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5298const _: () = {
5299 ["Size of GapExtraBeaconConfig"][::core::mem::size_of::<GapExtraBeaconConfig>() - 14usize];
5300 ["Alignment of GapExtraBeaconConfig"][::core::mem::align_of::<GapExtraBeaconConfig>() - 2usize];
5301 ["Offset of field: GapExtraBeaconConfig::min_adv_interval_ms"]
5302 [::core::mem::offset_of!(GapExtraBeaconConfig, min_adv_interval_ms) - 0usize];
5303 ["Offset of field: GapExtraBeaconConfig::max_adv_interval_ms"]
5304 [::core::mem::offset_of!(GapExtraBeaconConfig, max_adv_interval_ms) - 2usize];
5305 ["Offset of field: GapExtraBeaconConfig::adv_channel_map"]
5306 [::core::mem::offset_of!(GapExtraBeaconConfig, adv_channel_map) - 4usize];
5307 ["Offset of field: GapExtraBeaconConfig::adv_power_level"]
5308 [::core::mem::offset_of!(GapExtraBeaconConfig, adv_power_level) - 5usize];
5309 ["Offset of field: GapExtraBeaconConfig::address_type"]
5310 [::core::mem::offset_of!(GapExtraBeaconConfig, address_type) - 6usize];
5311 ["Offset of field: GapExtraBeaconConfig::address"]
5312 [::core::mem::offset_of!(GapExtraBeaconConfig, address) - 7usize];
5313};
5314#[repr(C)]
5315#[derive(Debug, Copy, Clone)]
5316pub struct FuriHalBleProfileBase {
5317 pub config: *const FuriHalBleProfileTemplate,
5318}
5319#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5320const _: () = {
5321 ["Size of FuriHalBleProfileBase"][::core::mem::size_of::<FuriHalBleProfileBase>() - 4usize];
5322 ["Alignment of FuriHalBleProfileBase"]
5323 [::core::mem::align_of::<FuriHalBleProfileBase>() - 4usize];
5324 ["Offset of field: FuriHalBleProfileBase::config"]
5325 [::core::mem::offset_of!(FuriHalBleProfileBase, config) - 0usize];
5326};
5327pub type FuriHalBleProfileParams = *mut core::ffi::c_void;
5328pub type FuriHalBleProfileStart = ::core::option::Option<
5329 unsafe extern "C" fn(profile_params: FuriHalBleProfileParams) -> *mut FuriHalBleProfileBase,
5330>;
5331pub type FuriHalBleProfileStop =
5332 ::core::option::Option<unsafe extern "C" fn(profile: *mut FuriHalBleProfileBase)>;
5333pub type FuriHalBleProfileGetGapConfig = ::core::option::Option<
5334 unsafe extern "C" fn(target_config: *mut GapConfig, profile_params: FuriHalBleProfileParams),
5335>;
5336#[repr(C)]
5337#[derive(Debug, Copy, Clone)]
5338pub struct FuriHalBleProfileTemplate {
5339 pub start: FuriHalBleProfileStart,
5340 pub stop: FuriHalBleProfileStop,
5341 pub get_gap_config: FuriHalBleProfileGetGapConfig,
5342}
5343#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5344const _: () = {
5345 ["Size of FuriHalBleProfileTemplate"]
5346 [::core::mem::size_of::<FuriHalBleProfileTemplate>() - 12usize];
5347 ["Alignment of FuriHalBleProfileTemplate"]
5348 [::core::mem::align_of::<FuriHalBleProfileTemplate>() - 4usize];
5349 ["Offset of field: FuriHalBleProfileTemplate::start"]
5350 [::core::mem::offset_of!(FuriHalBleProfileTemplate, start) - 0usize];
5351 ["Offset of field: FuriHalBleProfileTemplate::stop"]
5352 [::core::mem::offset_of!(FuriHalBleProfileTemplate, stop) - 4usize];
5353 ["Offset of field: FuriHalBleProfileTemplate::get_gap_config"]
5354 [::core::mem::offset_of!(FuriHalBleProfileTemplate, get_gap_config) - 8usize];
5355};
5356pub const BleGlueC2ModeUnknown: BleGlueC2Mode = BleGlueC2Mode(0);
5357pub const BleGlueC2ModeFUS: BleGlueC2Mode = BleGlueC2Mode(1);
5358pub const BleGlueC2ModeStack: BleGlueC2Mode = BleGlueC2Mode(2);
5359#[repr(transparent)]
5360#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5361pub struct BleGlueC2Mode(pub core::ffi::c_uchar);
5362#[repr(C)]
5363#[derive(Debug, Copy, Clone)]
5364pub struct BleGlueC2Info {
5365 pub mode: BleGlueC2Mode,
5366 #[doc = "Wireless Info"]
5367 pub VersionMajor: u8,
5368 pub VersionMinor: u8,
5369 pub VersionSub: u8,
5370 pub VersionBranch: u8,
5371 pub VersionReleaseType: u8,
5372 pub MemorySizeSram2B: u8,
5373 pub MemorySizeSram2A: u8,
5374 pub MemorySizeSram1: u8,
5375 pub MemorySizeFlash: u8,
5376 pub StackType: u8,
5377 pub StackTypeString: [core::ffi::c_char; 20usize],
5378 #[doc = "Fus Info"]
5379 pub FusVersionMajor: u8,
5380 pub FusVersionMinor: u8,
5381 pub FusVersionSub: u8,
5382 pub FusMemorySizeSram2B: u8,
5383 pub FusMemorySizeSram2A: u8,
5384 pub FusMemorySizeFlash: u8,
5385}
5386#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5387const _: () = {
5388 ["Size of BleGlueC2Info"][::core::mem::size_of::<BleGlueC2Info>() - 37usize];
5389 ["Alignment of BleGlueC2Info"][::core::mem::align_of::<BleGlueC2Info>() - 1usize];
5390 ["Offset of field: BleGlueC2Info::mode"][::core::mem::offset_of!(BleGlueC2Info, mode) - 0usize];
5391 ["Offset of field: BleGlueC2Info::VersionMajor"]
5392 [::core::mem::offset_of!(BleGlueC2Info, VersionMajor) - 1usize];
5393 ["Offset of field: BleGlueC2Info::VersionMinor"]
5394 [::core::mem::offset_of!(BleGlueC2Info, VersionMinor) - 2usize];
5395 ["Offset of field: BleGlueC2Info::VersionSub"]
5396 [::core::mem::offset_of!(BleGlueC2Info, VersionSub) - 3usize];
5397 ["Offset of field: BleGlueC2Info::VersionBranch"]
5398 [::core::mem::offset_of!(BleGlueC2Info, VersionBranch) - 4usize];
5399 ["Offset of field: BleGlueC2Info::VersionReleaseType"]
5400 [::core::mem::offset_of!(BleGlueC2Info, VersionReleaseType) - 5usize];
5401 ["Offset of field: BleGlueC2Info::MemorySizeSram2B"]
5402 [::core::mem::offset_of!(BleGlueC2Info, MemorySizeSram2B) - 6usize];
5403 ["Offset of field: BleGlueC2Info::MemorySizeSram2A"]
5404 [::core::mem::offset_of!(BleGlueC2Info, MemorySizeSram2A) - 7usize];
5405 ["Offset of field: BleGlueC2Info::MemorySizeSram1"]
5406 [::core::mem::offset_of!(BleGlueC2Info, MemorySizeSram1) - 8usize];
5407 ["Offset of field: BleGlueC2Info::MemorySizeFlash"]
5408 [::core::mem::offset_of!(BleGlueC2Info, MemorySizeFlash) - 9usize];
5409 ["Offset of field: BleGlueC2Info::StackType"]
5410 [::core::mem::offset_of!(BleGlueC2Info, StackType) - 10usize];
5411 ["Offset of field: BleGlueC2Info::StackTypeString"]
5412 [::core::mem::offset_of!(BleGlueC2Info, StackTypeString) - 11usize];
5413 ["Offset of field: BleGlueC2Info::FusVersionMajor"]
5414 [::core::mem::offset_of!(BleGlueC2Info, FusVersionMajor) - 31usize];
5415 ["Offset of field: BleGlueC2Info::FusVersionMinor"]
5416 [::core::mem::offset_of!(BleGlueC2Info, FusVersionMinor) - 32usize];
5417 ["Offset of field: BleGlueC2Info::FusVersionSub"]
5418 [::core::mem::offset_of!(BleGlueC2Info, FusVersionSub) - 33usize];
5419 ["Offset of field: BleGlueC2Info::FusMemorySizeSram2B"]
5420 [::core::mem::offset_of!(BleGlueC2Info, FusMemorySizeSram2B) - 34usize];
5421 ["Offset of field: BleGlueC2Info::FusMemorySizeSram2A"]
5422 [::core::mem::offset_of!(BleGlueC2Info, FusMemorySizeSram2A) - 35usize];
5423 ["Offset of field: BleGlueC2Info::FusMemorySizeFlash"]
5424 [::core::mem::offset_of!(BleGlueC2Info, FusMemorySizeFlash) - 36usize];
5425};
5426pub const BleGlueStatusStartup: BleGlueStatus = BleGlueStatus(0);
5427pub const BleGlueStatusBroken: BleGlueStatus = BleGlueStatus(1);
5428pub const BleGlueStatusC2Started: BleGlueStatus = BleGlueStatus(2);
5429pub const BleGlueStatusRadioStackRunning: BleGlueStatus = BleGlueStatus(3);
5430pub const BleGlueStatusRadioStackMissing: BleGlueStatus = BleGlueStatus(4);
5431#[repr(transparent)]
5432#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5433pub struct BleGlueStatus(pub core::ffi::c_uchar);
5434pub type BleGlueKeyStorageChangedCallback = ::core::option::Option<
5435 unsafe extern "C" fn(change_addr_start: *mut u8, size: u16, context: *mut core::ffi::c_void),
5436>;
5437unsafe extern "C" {
5438 #[doc = "Initialize start core2 and initialize transport"]
5439 pub fn ble_glue_init();
5440}
5441unsafe extern "C" {
5442 #[doc = "Is core2 alive and at least FUS is running\n\n # Returns\n\ntrue if core2 is alive"]
5443 pub fn ble_glue_is_alive() -> bool;
5444}
5445unsafe extern "C" {
5446 #[doc = "Waits for C2 to reports its mode to callback\n\n # Returns\n\ntrue if it reported before reaching timeout"]
5447 pub fn ble_glue_wait_for_c2_start(timeout_ms: i32) -> bool;
5448}
5449unsafe extern "C" {
5450 pub fn ble_glue_get_c2_info() -> *const BleGlueC2Info;
5451}
5452unsafe extern "C" {
5453 #[doc = "Is core2 radio stack present and ready\n\n # Returns\n\ntrue if present and ready"]
5454 pub fn ble_glue_is_radio_stack_ready() -> bool;
5455}
5456unsafe extern "C" {
5457 #[doc = "Set callback for NVM in RAM changes\n\n # Arguments\n\n* `callback` (direction in) - The callback to call on NVM change\n * `context` - The context for callback"]
5458 pub fn ble_glue_set_key_storage_changed_callback(
5459 callback: BleGlueKeyStorageChangedCallback,
5460 context: *mut core::ffi::c_void,
5461 );
5462}
5463unsafe extern "C" {
5464 pub fn ble_glue_reinit_c2() -> bool;
5465}
5466pub const BleGlueCommandResultUnknown: BleGlueCommandResult = BleGlueCommandResult(0);
5467pub const BleGlueCommandResultOK: BleGlueCommandResult = BleGlueCommandResult(1);
5468pub const BleGlueCommandResultError: BleGlueCommandResult = BleGlueCommandResult(2);
5469pub const BleGlueCommandResultRestartPending: BleGlueCommandResult = BleGlueCommandResult(3);
5470pub const BleGlueCommandResultOperationOngoing: BleGlueCommandResult = BleGlueCommandResult(4);
5471#[repr(transparent)]
5472#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5473pub struct BleGlueCommandResult(pub core::ffi::c_uchar);
5474unsafe extern "C" {
5475 #[doc = "Restart MCU to launch radio stack firmware if necessary\n\n # Returns\n\ntrue on radio stack start command"]
5476 pub fn ble_glue_force_c2_mode(mode: BleGlueC2Mode) -> BleGlueCommandResult;
5477}
5478#[repr(C)]
5479#[derive(Debug, Copy, Clone)]
5480pub struct BleGlueHardfaultInfo {
5481 pub magic: u32,
5482 pub source_pc: u32,
5483 pub source_lr: u32,
5484 pub source_sp: u32,
5485}
5486#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5487const _: () = {
5488 ["Size of BleGlueHardfaultInfo"][::core::mem::size_of::<BleGlueHardfaultInfo>() - 16usize];
5489 ["Alignment of BleGlueHardfaultInfo"][::core::mem::align_of::<BleGlueHardfaultInfo>() - 4usize];
5490 ["Offset of field: BleGlueHardfaultInfo::magic"]
5491 [::core::mem::offset_of!(BleGlueHardfaultInfo, magic) - 0usize];
5492 ["Offset of field: BleGlueHardfaultInfo::source_pc"]
5493 [::core::mem::offset_of!(BleGlueHardfaultInfo, source_pc) - 4usize];
5494 ["Offset of field: BleGlueHardfaultInfo::source_lr"]
5495 [::core::mem::offset_of!(BleGlueHardfaultInfo, source_lr) - 8usize];
5496 ["Offset of field: BleGlueHardfaultInfo::source_sp"]
5497 [::core::mem::offset_of!(BleGlueHardfaultInfo, source_sp) - 12usize];
5498};
5499pub const FuriHalBtStackUnknown: FuriHalBtStack = FuriHalBtStack(0);
5500pub const FuriHalBtStackLight: FuriHalBtStack = FuriHalBtStack(1);
5501pub const FuriHalBtStackFull: FuriHalBtStack = FuriHalBtStack(2);
5502#[repr(transparent)]
5503#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5504pub struct FuriHalBtStack(pub core::ffi::c_uchar);
5505unsafe extern "C" {
5506 #[doc = "Lock core2 state transition"]
5507 pub fn furi_hal_bt_lock_core2();
5508}
5509unsafe extern "C" {
5510 #[doc = "Lock core2 state transition"]
5511 pub fn furi_hal_bt_unlock_core2();
5512}
5513unsafe extern "C" {
5514 #[doc = "Start radio stack\n\n # Returns\n\ntrue on successfull radio stack start"]
5515 pub fn furi_hal_bt_start_radio_stack() -> bool;
5516}
5517unsafe extern "C" {
5518 #[doc = "Get radio stack type\n\n # Returns\n\nFuriHalBtStack instance"]
5519 pub fn furi_hal_bt_get_radio_stack() -> FuriHalBtStack;
5520}
5521unsafe extern "C" {
5522 #[doc = "Check if radio stack supports BLE GAT/GAP\n\n # Returns\n\ntrue if supported"]
5523 pub fn furi_hal_bt_is_gatt_gap_supported() -> bool;
5524}
5525unsafe extern "C" {
5526 #[doc = "Check if radio stack supports testing\n\n # Returns\n\ntrue if supported"]
5527 pub fn furi_hal_bt_is_testing_supported() -> bool;
5528}
5529unsafe extern "C" {
5530 #[doc = "Check if particular instance of profile belongs to given type\n\n # Arguments\n\n* `profile` - FuriHalBtProfile instance. If NULL, uses current profile\n * `profile_template` - basic profile template to check against\n\n # Returns\n\ntrue on success"]
5531 pub fn furi_hal_bt_check_profile_type(
5532 profile: *mut FuriHalBleProfileBase,
5533 profile_template: *const FuriHalBleProfileTemplate,
5534 ) -> bool;
5535}
5536unsafe extern "C" {
5537 #[doc = "Start BLE app\n\n # Arguments\n\n* `profile_template` - FuriHalBleProfileTemplate instance\n * `params` - Parameters to pass to the profile. Can be NULL\n * `root_keys` - pointer to root keys\n * `event_cb` - GapEventCallback instance\n * `context` - pointer to context\n\n # Returns\n\ninstance of profile, NULL on failure"]
5538 pub fn furi_hal_bt_start_app(
5539 profile_template: *const FuriHalBleProfileTemplate,
5540 params: FuriHalBleProfileParams,
5541 root_keys: *const GapRootSecurityKeys,
5542 event_cb: GapEventCallback,
5543 context: *mut core::ffi::c_void,
5544 ) -> *mut FuriHalBleProfileBase;
5545}
5546unsafe extern "C" {
5547 #[doc = "Reinitialize core2\n\n Also can be used to prepare core2 for stop modes"]
5548 pub fn furi_hal_bt_reinit();
5549}
5550unsafe extern "C" {
5551 #[doc = "Change BLE app\n Restarts 2nd core\n\n # Arguments\n\n* `profile_template` - FuriHalBleProfileTemplate instance\n * `profile_params` - Parameters to pass to the profile. Can be NULL\n * `event_cb` - GapEventCallback instance\n * `root_keys` - pointer to root keys\n * `context` - pointer to context\n\n # Returns\n\ninstance of profile, NULL on failure"]
5552 pub fn furi_hal_bt_change_app(
5553 profile_template: *const FuriHalBleProfileTemplate,
5554 profile_params: FuriHalBleProfileParams,
5555 root_keys: *const GapRootSecurityKeys,
5556 event_cb: GapEventCallback,
5557 context: *mut core::ffi::c_void,
5558 ) -> *mut FuriHalBleProfileBase;
5559}
5560unsafe extern "C" {
5561 #[doc = "Update battery level\n\n # Arguments\n\n* `battery_level` - battery level"]
5562 pub fn furi_hal_bt_update_battery_level(battery_level: u8);
5563}
5564unsafe extern "C" {
5565 #[doc = "Update battery power state"]
5566 pub fn furi_hal_bt_update_power_state(charging: bool);
5567}
5568unsafe extern "C" {
5569 #[doc = "Checks if BLE state is active\n\n # Returns\n\ntrue if device is connected or advertising, false otherwise"]
5570 pub fn furi_hal_bt_is_active() -> bool;
5571}
5572unsafe extern "C" {
5573 #[doc = "Start advertising"]
5574 pub fn furi_hal_bt_start_advertising();
5575}
5576unsafe extern "C" {
5577 #[doc = "Stop advertising"]
5578 pub fn furi_hal_bt_stop_advertising();
5579}
5580unsafe extern "C" {
5581 #[doc = "Get BT/BLE system component state\n\n # Arguments\n\n* `buffer` (direction in) - FuriString* buffer to write to"]
5582 pub fn furi_hal_bt_dump_state(buffer: *mut FuriString);
5583}
5584unsafe extern "C" {
5585 #[doc = "Get BT/BLE system component state\n\n # Returns\n\ntrue if core2 is alive"]
5586 pub fn furi_hal_bt_is_alive() -> bool;
5587}
5588unsafe extern "C" {
5589 #[doc = "Get key storage buffer address and size\n\n # Arguments\n\n* `key_buff_addr` - pointer to store buffer address\n * `key_buff_size` - pointer to store buffer size"]
5590 pub fn furi_hal_bt_get_key_storage_buff(key_buff_addr: *mut *mut u8, key_buff_size: *mut u16);
5591}
5592unsafe extern "C" {
5593 #[doc = "Get SRAM2 hardware semaphore\n > **Note:** Must be called before SRAM2 read/write operations"]
5594 pub fn furi_hal_bt_nvm_sram_sem_acquire();
5595}
5596unsafe extern "C" {
5597 #[doc = "Release SRAM2 hardware semaphore\n > **Note:** Must be called after SRAM2 read/write operations"]
5598 pub fn furi_hal_bt_nvm_sram_sem_release();
5599}
5600unsafe extern "C" {
5601 #[doc = "Clear key storage\n\n # Returns\n\ntrue on success"]
5602 pub fn furi_hal_bt_clear_white_list() -> bool;
5603}
5604unsafe extern "C" {
5605 #[doc = "Set key storage change callback\n\n # Arguments\n\n* `callback` - BleGlueKeyStorageChangedCallback instance\n * `context` - pointer to context"]
5606 pub fn furi_hal_bt_set_key_storage_change_callback(
5607 callback: BleGlueKeyStorageChangedCallback,
5608 context: *mut core::ffi::c_void,
5609 );
5610}
5611unsafe extern "C" {
5612 #[doc = "Start ble tone tx at given channel and power\n\n # Arguments\n\n* `channel` (direction in) - The channel\n * `power` (direction in) - The power"]
5613 pub fn furi_hal_bt_start_tone_tx(channel: u8, power: u8);
5614}
5615unsafe extern "C" {
5616 #[doc = "Stop ble tone tx"]
5617 pub fn furi_hal_bt_stop_tone_tx();
5618}
5619unsafe extern "C" {
5620 #[doc = "Start sending ble packets at a given frequency and datarate\n\n # Arguments\n\n* `channel` (direction in) - The channel\n * `pattern` (direction in) - The pattern\n * `datarate` (direction in) - The datarate"]
5621 pub fn furi_hal_bt_start_packet_tx(channel: u8, pattern: u8, datarate: u8);
5622}
5623unsafe extern "C" {
5624 #[doc = "Stop sending ble packets\n\n # Returns\n\nsent packet count"]
5625 pub fn furi_hal_bt_stop_packet_test() -> u16;
5626}
5627unsafe extern "C" {
5628 #[doc = "Start receiving packets\n\n # Arguments\n\n* `channel` (direction in) - RX channel\n * `datarate` (direction in) - Datarate"]
5629 pub fn furi_hal_bt_start_packet_rx(channel: u8, datarate: u8);
5630}
5631unsafe extern "C" {
5632 #[doc = "Set up the RF to listen to a given RF channel\n\n # Arguments\n\n* `channel` (direction in) - RX channel"]
5633 pub fn furi_hal_bt_start_rx(channel: u8);
5634}
5635unsafe extern "C" {
5636 #[doc = "Stop RF listenning"]
5637 pub fn furi_hal_bt_stop_rx();
5638}
5639unsafe extern "C" {
5640 #[doc = "Get RSSI\n\n # Returns\n\nRSSI in dBm"]
5641 pub fn furi_hal_bt_get_rssi() -> f32;
5642}
5643unsafe extern "C" {
5644 #[doc = "Get number of transmitted packets\n\n # Returns\n\npacket count"]
5645 pub fn furi_hal_bt_get_transmitted_packets() -> u32;
5646}
5647unsafe extern "C" {
5648 #[doc = "Check & switch C2 to given mode\n\n # Arguments\n\n* `mode` (direction in) - mode to switch into"]
5649 pub fn furi_hal_bt_ensure_c2_mode(mode: BleGlueC2Mode) -> bool;
5650}
5651unsafe extern "C" {
5652 #[doc = "Set extra beacon data. Can be called in any state\n\n # Arguments\n\n* `data` (direction in) - data to set\n * `len` (direction in) - data length. Must be <= EXTRA_BEACON_MAX_DATA_SIZE\n\n # Returns\n\ntrue on success"]
5653 pub fn furi_hal_bt_extra_beacon_set_data(data: *const u8, len: u8) -> bool;
5654}
5655unsafe extern "C" {
5656 #[doc = "Get last configured extra beacon data\n\n # Arguments\n\n* `data` - data buffer to write to. Must be at least EXTRA_BEACON_MAX_DATA_SIZE bytes long\n\n # Returns\n\nvalid data length"]
5657 pub fn furi_hal_bt_extra_beacon_get_data(data: *mut u8) -> u8;
5658}
5659unsafe extern "C" {
5660 #[doc = "Configure extra beacon.\n\n # Arguments\n\n* `config` (direction in) - extra beacon config: interval, power, address, etc.\n\n # Returns\n\ntrue on success"]
5661 pub fn furi_hal_bt_extra_beacon_set_config(config: *const GapExtraBeaconConfig) -> bool;
5662}
5663unsafe extern "C" {
5664 #[doc = "Start extra beacon.\n Beacon must configured with furi_hal_bt_extra_beacon_set_config()\n and in stopped state before calling this function.\n\n # Returns\n\ntrue on success"]
5665 pub fn furi_hal_bt_extra_beacon_start() -> bool;
5666}
5667unsafe extern "C" {
5668 #[doc = "Stop extra beacon\n\n # Returns\n\ntrue on success"]
5669 pub fn furi_hal_bt_extra_beacon_stop() -> bool;
5670}
5671unsafe extern "C" {
5672 #[doc = "Check if extra beacon is active.\n\n # Returns\n\nextra beacon state"]
5673 pub fn furi_hal_bt_extra_beacon_is_active() -> bool;
5674}
5675unsafe extern "C" {
5676 #[doc = "Get last configured extra beacon config\n\n # Returns\n\nextra beacon config. NULL if beacon had never been configured."]
5677 pub fn furi_hal_bt_extra_beacon_get_config() -> *const GapExtraBeaconConfig;
5678}
5679#[doc = "SPI Init structures definition"]
5680#[repr(C)]
5681#[derive(Debug, Copy, Clone)]
5682pub struct LL_SPI_InitTypeDef {
5683 #[doc = "< Specifies the SPI unidirectional or bidirectional data mode.\nThis parameter can be a value of SPI_LL_EC_TRANSFER_MODE.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetTransferDirection()."]
5684 pub TransferDirection: u32,
5685 #[doc = "< Specifies the SPI mode (Master/Slave).\nThis parameter can be a value of SPI_LL_EC_MODE.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetMode()."]
5686 pub Mode: u32,
5687 #[doc = "< Specifies the SPI data width.\nThis parameter can be a value of SPI_LL_EC_DATAWIDTH.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetDataWidth()."]
5688 pub DataWidth: u32,
5689 #[doc = "< Specifies the serial clock steady state.\nThis parameter can be a value of SPI_LL_EC_POLARITY.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetClockPolarity()."]
5690 pub ClockPolarity: u32,
5691 #[doc = "< Specifies the clock active edge for the bit capture.\nThis parameter can be a value of SPI_LL_EC_PHASE.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetClockPhase()."]
5692 pub ClockPhase: u32,
5693 #[doc = "< Specifies whether the NSS signal is managed by hardware (NSS pin) or by software using the SSI bit.\nThis parameter can be a value of SPI_LL_EC_NSS_MODE.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetNSSMode()."]
5694 pub NSS: u32,
5695 #[doc = "< Specifies the BaudRate prescaler value which will be used to configure the transmit and receive SCK clock.\nThis parameter can be a value of SPI_LL_EC_BAUDRATEPRESCALER.\n> **Note:** The communication clock is derived from the master clock. The slave clock does not need to be set.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetBaudRatePrescaler()."]
5696 pub BaudRate: u32,
5697 #[doc = "< Specifies whether data transfers start from MSB or LSB bit.\nThis parameter can be a value of SPI_LL_EC_BIT_ORDER.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetTransferBitOrder()."]
5698 pub BitOrder: u32,
5699 #[doc = "< Specifies if the CRC calculation is enabled or not.\nThis parameter can be a value of SPI_LL_EC_CRC_CALCULATION.\n\nThis feature can be modified afterwards using unitary functions LL_SPI_EnableCRC() and LL_SPI_DisableCRC()."]
5700 pub CRCCalculation: u32,
5701 #[doc = "< Specifies the polynomial used for the CRC calculation.\nThis parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFFF.\n\nThis feature can be modified afterwards using unitary function LL_SPI_SetCRCPolynomial()."]
5702 pub CRCPoly: u32,
5703}
5704#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5705const _: () = {
5706 ["Size of LL_SPI_InitTypeDef"][::core::mem::size_of::<LL_SPI_InitTypeDef>() - 40usize];
5707 ["Alignment of LL_SPI_InitTypeDef"][::core::mem::align_of::<LL_SPI_InitTypeDef>() - 4usize];
5708 ["Offset of field: LL_SPI_InitTypeDef::TransferDirection"]
5709 [::core::mem::offset_of!(LL_SPI_InitTypeDef, TransferDirection) - 0usize];
5710 ["Offset of field: LL_SPI_InitTypeDef::Mode"]
5711 [::core::mem::offset_of!(LL_SPI_InitTypeDef, Mode) - 4usize];
5712 ["Offset of field: LL_SPI_InitTypeDef::DataWidth"]
5713 [::core::mem::offset_of!(LL_SPI_InitTypeDef, DataWidth) - 8usize];
5714 ["Offset of field: LL_SPI_InitTypeDef::ClockPolarity"]
5715 [::core::mem::offset_of!(LL_SPI_InitTypeDef, ClockPolarity) - 12usize];
5716 ["Offset of field: LL_SPI_InitTypeDef::ClockPhase"]
5717 [::core::mem::offset_of!(LL_SPI_InitTypeDef, ClockPhase) - 16usize];
5718 ["Offset of field: LL_SPI_InitTypeDef::NSS"]
5719 [::core::mem::offset_of!(LL_SPI_InitTypeDef, NSS) - 20usize];
5720 ["Offset of field: LL_SPI_InitTypeDef::BaudRate"]
5721 [::core::mem::offset_of!(LL_SPI_InitTypeDef, BaudRate) - 24usize];
5722 ["Offset of field: LL_SPI_InitTypeDef::BitOrder"]
5723 [::core::mem::offset_of!(LL_SPI_InitTypeDef, BitOrder) - 28usize];
5724 ["Offset of field: LL_SPI_InitTypeDef::CRCCalculation"]
5725 [::core::mem::offset_of!(LL_SPI_InitTypeDef, CRCCalculation) - 32usize];
5726 ["Offset of field: LL_SPI_InitTypeDef::CRCPoly"]
5727 [::core::mem::offset_of!(LL_SPI_InitTypeDef, CRCPoly) - 36usize];
5728};
5729unsafe extern "C" {
5730 pub fn LL_SPI_Init(
5731 SPIx: *mut SPI_TypeDef,
5732 SPI_InitStruct: *mut LL_SPI_InitTypeDef,
5733 ) -> ErrorStatus;
5734}
5735#[doc = "< Bus initialization event, called on system start"]
5736pub const FuriHalSpiBusEventInit: FuriHalSpiBusEvent = FuriHalSpiBusEvent(0);
5737#[doc = "< Bus deinitialization event, called on system stop"]
5738pub const FuriHalSpiBusEventDeinit: FuriHalSpiBusEvent = FuriHalSpiBusEvent(1);
5739#[doc = "< Bus lock event, called before activation"]
5740pub const FuriHalSpiBusEventLock: FuriHalSpiBusEvent = FuriHalSpiBusEvent(2);
5741#[doc = "< Bus unlock event, called after deactivation"]
5742pub const FuriHalSpiBusEventUnlock: FuriHalSpiBusEvent = FuriHalSpiBusEvent(3);
5743#[doc = "< Bus activation event, called before handle activation"]
5744pub const FuriHalSpiBusEventActivate: FuriHalSpiBusEvent = FuriHalSpiBusEvent(4);
5745#[doc = "< Bus deactivation event, called after handle deactivation"]
5746pub const FuriHalSpiBusEventDeactivate: FuriHalSpiBusEvent = FuriHalSpiBusEvent(5);
5747#[repr(transparent)]
5748#[doc = "FuriHal spi bus states"]
5749#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5750pub struct FuriHalSpiBusEvent(pub core::ffi::c_uchar);
5751#[doc = "FuriHal spi bus event callback"]
5752pub type FuriHalSpiBusEventCallback = ::core::option::Option<
5753 unsafe extern "C" fn(bus: *mut FuriHalSpiBus, event: FuriHalSpiBusEvent),
5754>;
5755#[doc = "FuriHal spi bus"]
5756#[repr(C)]
5757#[derive(Debug, Copy, Clone)]
5758pub struct FuriHalSpiBus {
5759 pub spi: *mut SPI_TypeDef,
5760 pub callback: FuriHalSpiBusEventCallback,
5761 pub current_handle: *const FuriHalSpiBusHandle,
5762}
5763#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5764const _: () = {
5765 ["Size of FuriHalSpiBus"][::core::mem::size_of::<FuriHalSpiBus>() - 12usize];
5766 ["Alignment of FuriHalSpiBus"][::core::mem::align_of::<FuriHalSpiBus>() - 4usize];
5767 ["Offset of field: FuriHalSpiBus::spi"][::core::mem::offset_of!(FuriHalSpiBus, spi) - 0usize];
5768 ["Offset of field: FuriHalSpiBus::callback"]
5769 [::core::mem::offset_of!(FuriHalSpiBus, callback) - 4usize];
5770 ["Offset of field: FuriHalSpiBus::current_handle"]
5771 [::core::mem::offset_of!(FuriHalSpiBus, current_handle) - 8usize];
5772};
5773#[doc = "< Handle init, called on system start, initialize gpio for idle state"]
5774pub const FuriHalSpiBusHandleEventInit: FuriHalSpiBusHandleEvent = FuriHalSpiBusHandleEvent(0);
5775#[doc = "< Handle deinit, called on system stop, deinitialize gpio for default state"]
5776pub const FuriHalSpiBusHandleEventDeinit: FuriHalSpiBusHandleEvent = FuriHalSpiBusHandleEvent(1);
5777#[doc = "< Handle activate: connect gpio and apply bus config"]
5778pub const FuriHalSpiBusHandleEventActivate: FuriHalSpiBusHandleEvent = FuriHalSpiBusHandleEvent(2);
5779#[doc = "< Handle deactivate: disconnect gpio and reset bus config"]
5780pub const FuriHalSpiBusHandleEventDeactivate: FuriHalSpiBusHandleEvent =
5781 FuriHalSpiBusHandleEvent(3);
5782#[repr(transparent)]
5783#[doc = "FuriHal spi handle states"]
5784#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5785pub struct FuriHalSpiBusHandleEvent(pub core::ffi::c_uchar);
5786#[doc = "FuriHal spi handle event callback"]
5787pub type FuriHalSpiBusHandleEventCallback = ::core::option::Option<
5788 unsafe extern "C" fn(handle: *const FuriHalSpiBusHandle, event: FuriHalSpiBusHandleEvent),
5789>;
5790#[doc = "FuriHal spi handle"]
5791#[repr(C)]
5792#[derive(Debug, Copy, Clone)]
5793pub struct FuriHalSpiBusHandle {
5794 pub bus: *mut FuriHalSpiBus,
5795 pub callback: FuriHalSpiBusHandleEventCallback,
5796 pub miso: *const GpioPin,
5797 pub mosi: *const GpioPin,
5798 pub sck: *const GpioPin,
5799 pub cs: *const GpioPin,
5800}
5801#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5802const _: () = {
5803 ["Size of FuriHalSpiBusHandle"][::core::mem::size_of::<FuriHalSpiBusHandle>() - 24usize];
5804 ["Alignment of FuriHalSpiBusHandle"][::core::mem::align_of::<FuriHalSpiBusHandle>() - 4usize];
5805 ["Offset of field: FuriHalSpiBusHandle::bus"]
5806 [::core::mem::offset_of!(FuriHalSpiBusHandle, bus) - 0usize];
5807 ["Offset of field: FuriHalSpiBusHandle::callback"]
5808 [::core::mem::offset_of!(FuriHalSpiBusHandle, callback) - 4usize];
5809 ["Offset of field: FuriHalSpiBusHandle::miso"]
5810 [::core::mem::offset_of!(FuriHalSpiBusHandle, miso) - 8usize];
5811 ["Offset of field: FuriHalSpiBusHandle::mosi"]
5812 [::core::mem::offset_of!(FuriHalSpiBusHandle, mosi) - 12usize];
5813 ["Offset of field: FuriHalSpiBusHandle::sck"]
5814 [::core::mem::offset_of!(FuriHalSpiBusHandle, sck) - 16usize];
5815 ["Offset of field: FuriHalSpiBusHandle::cs"]
5816 [::core::mem::offset_of!(FuriHalSpiBusHandle, cs) - 20usize];
5817};
5818unsafe extern "C" {
5819 #[doc = "Preset for ST25R916"]
5820 pub static furi_hal_spi_preset_2edge_low_8m: LL_SPI_InitTypeDef;
5821}
5822unsafe extern "C" {
5823 #[doc = "Preset for CC1101"]
5824 pub static furi_hal_spi_preset_1edge_low_8m: LL_SPI_InitTypeDef;
5825}
5826unsafe extern "C" {
5827 #[doc = "Preset for ST7567 (Display)"]
5828 pub static furi_hal_spi_preset_1edge_low_4m: LL_SPI_InitTypeDef;
5829}
5830unsafe extern "C" {
5831 #[doc = "Preset for SdCard in fast mode"]
5832 pub static furi_hal_spi_preset_1edge_low_16m: LL_SPI_InitTypeDef;
5833}
5834unsafe extern "C" {
5835 #[doc = "Preset for SdCard in slow mode"]
5836 pub static furi_hal_spi_preset_1edge_low_2m: LL_SPI_InitTypeDef;
5837}
5838unsafe extern "C" {
5839 #[doc = "Furi Hal Spi Bus R (Radio: CC1101, Nfc, External)"]
5840 pub static mut furi_hal_spi_bus_r: FuriHalSpiBus;
5841}
5842unsafe extern "C" {
5843 #[doc = "Furi Hal Spi Bus D (Display, SdCard)"]
5844 pub static mut furi_hal_spi_bus_d: FuriHalSpiBus;
5845}
5846unsafe extern "C" {
5847 #[doc = "CC1101 on `furi_hal_spi_bus_r`"]
5848 pub static furi_hal_spi_bus_handle_subghz: FuriHalSpiBusHandle;
5849}
5850unsafe extern "C" {
5851 #[doc = "ST25R3916 on `furi_hal_spi_bus_r`"]
5852 pub static furi_hal_spi_bus_handle_nfc: FuriHalSpiBusHandle;
5853}
5854unsafe extern "C" {
5855 #[doc = "External on `furi_hal_spi_bus_r`\n Preset: `furi_hal_spi_preset_1edge_low_2m`\n\n miso: pa6\n mosi: pa7\n sck: pb3\n cs: pa4 (software controlled)\n\n not initialized by default, call `furi_hal_spi_bus_handle_init` to initialize\n Bus pins are floating on inactive state, CS high after initialization\n"]
5856 pub static furi_hal_spi_bus_handle_external: FuriHalSpiBusHandle;
5857}
5858unsafe extern "C" {
5859 #[doc = "ST7567(Display) on `furi_hal_spi_bus_d`"]
5860 pub static furi_hal_spi_bus_handle_display: FuriHalSpiBusHandle;
5861}
5862unsafe extern "C" {
5863 #[doc = "SdCard in fast mode on `furi_hal_spi_bus_d`"]
5864 pub static furi_hal_spi_bus_handle_sd_fast: FuriHalSpiBusHandle;
5865}
5866unsafe extern "C" {
5867 #[doc = "SdCard in slow mode on `furi_hal_spi_bus_d`"]
5868 pub static furi_hal_spi_bus_handle_sd_slow: FuriHalSpiBusHandle;
5869}
5870unsafe extern "C" {
5871 #[doc = "Initialize SPI Bus\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBus instance"]
5872 pub fn furi_hal_spi_bus_init(bus: *mut FuriHalSpiBus);
5873}
5874unsafe extern "C" {
5875 #[doc = "Deinitialize SPI Bus\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBus instance"]
5876 pub fn furi_hal_spi_bus_deinit(bus: *mut FuriHalSpiBus);
5877}
5878unsafe extern "C" {
5879 #[doc = "Initialize SPI Bus Handle\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance"]
5880 pub fn furi_hal_spi_bus_handle_init(handle: *const FuriHalSpiBusHandle);
5881}
5882unsafe extern "C" {
5883 #[doc = "Deinitialize SPI Bus Handle\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance"]
5884 pub fn furi_hal_spi_bus_handle_deinit(handle: *const FuriHalSpiBusHandle);
5885}
5886unsafe extern "C" {
5887 #[doc = "Acquire SPI bus\n\n blocking, calls `furi_crash` on programming error, CS transition is up to handler event routine\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance"]
5888 pub fn furi_hal_spi_acquire(handle: *const FuriHalSpiBusHandle);
5889}
5890unsafe extern "C" {
5891 #[doc = "Release SPI bus\n\n calls `furi_crash` on programming error, CS transition is up to handler event routine\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance"]
5892 pub fn furi_hal_spi_release(handle: *const FuriHalSpiBusHandle);
5893}
5894unsafe extern "C" {
5895 #[doc = "SPI Receive\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance\n * `buffer` - receive buffer\n * `size` - transaction size (buffer size)\n * `timeout` - operation timeout in ms\n\n # Returns\n\ntrue on sucess"]
5896 pub fn furi_hal_spi_bus_rx(
5897 handle: *const FuriHalSpiBusHandle,
5898 buffer: *mut u8,
5899 size: usize,
5900 timeout: u32,
5901 ) -> bool;
5902}
5903unsafe extern "C" {
5904 #[doc = "SPI Transmit\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance\n * `buffer` - transmit buffer\n * `size` - transaction size (buffer size)\n * `timeout` - operation timeout in ms\n\n # Returns\n\ntrue on success"]
5905 pub fn furi_hal_spi_bus_tx(
5906 handle: *const FuriHalSpiBusHandle,
5907 buffer: *const u8,
5908 size: usize,
5909 timeout: u32,
5910 ) -> bool;
5911}
5912unsafe extern "C" {
5913 #[doc = "SPI Transmit and Receive\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance\n * `tx_buffer` - pointer to tx buffer\n * `rx_buffer` - pointer to rx buffer\n * `size` - transaction size (buffer size)\n * `timeout` - operation timeout in ms\n\n # Returns\n\ntrue on success"]
5914 pub fn furi_hal_spi_bus_trx(
5915 handle: *const FuriHalSpiBusHandle,
5916 tx_buffer: *const u8,
5917 rx_buffer: *mut u8,
5918 size: usize,
5919 timeout: u32,
5920 ) -> bool;
5921}
5922unsafe extern "C" {
5923 #[doc = "SPI Transmit and Receive with DMA\n\n # Arguments\n\n* `handle` - pointer to FuriHalSpiBusHandle instance\n * `tx_buffer` - pointer to tx buffer\n * `rx_buffer` - pointer to rx buffer\n * `size` - transaction size (buffer size)\n * `timeout_ms` - operation timeout in ms\n\n # Returns\n\ntrue on success"]
5924 pub fn furi_hal_spi_bus_trx_dma(
5925 handle: *const FuriHalSpiBusHandle,
5926 tx_buffer: *mut u8,
5927 rx_buffer: *mut u8,
5928 size: usize,
5929 timeout_ms: u32,
5930 ) -> bool;
5931}
5932#[repr(C)]
5933#[derive(Copy, Clone)]
5934pub union FuriHalFlashRawOptionByteData {
5935 pub bytes: [u8; 128usize],
5936 pub obs: [FuriHalFlashRawOptionByteData__bindgen_ty_1; 16usize],
5937}
5938#[repr(C)]
5939#[derive(Copy, Clone)]
5940pub union FuriHalFlashRawOptionByteData__bindgen_ty_1 {
5941 pub values: FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1,
5942 pub dword: u64,
5943}
5944#[repr(C)]
5945#[derive(Debug, Copy, Clone)]
5946pub struct FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1 {
5947 pub base: u32,
5948 pub complementary_value: u32,
5949}
5950#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5951const _: () = {
5952 ["Size of FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1"][::core::mem::size_of::<
5953 FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1,
5954 >() - 8usize];
5955 ["Alignment of FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1"][::core::mem::align_of::<
5956 FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1,
5957 >() - 4usize];
5958 ["Offset of field: FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1::base"][::core::mem::offset_of!(
5959 FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1,
5960 base
5961 )
5962 - 0usize];
5963 [
5964 "Offset of field: FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1::complementary_value",
5965 ][::core::mem::offset_of!(
5966 FuriHalFlashRawOptionByteData__bindgen_ty_1__bindgen_ty_1,
5967 complementary_value
5968 ) - 4usize];
5969};
5970#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5971const _: () = {
5972 ["Size of FuriHalFlashRawOptionByteData__bindgen_ty_1"]
5973 [::core::mem::size_of::<FuriHalFlashRawOptionByteData__bindgen_ty_1>() - 8usize];
5974 ["Alignment of FuriHalFlashRawOptionByteData__bindgen_ty_1"]
5975 [::core::mem::align_of::<FuriHalFlashRawOptionByteData__bindgen_ty_1>() - 8usize];
5976 ["Offset of field: FuriHalFlashRawOptionByteData__bindgen_ty_1::values"]
5977 [::core::mem::offset_of!(FuriHalFlashRawOptionByteData__bindgen_ty_1, values) - 0usize];
5978 ["Offset of field: FuriHalFlashRawOptionByteData__bindgen_ty_1::dword"]
5979 [::core::mem::offset_of!(FuriHalFlashRawOptionByteData__bindgen_ty_1, dword) - 0usize];
5980};
5981#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5982const _: () = {
5983 ["Size of FuriHalFlashRawOptionByteData"]
5984 [::core::mem::size_of::<FuriHalFlashRawOptionByteData>() - 128usize];
5985 ["Alignment of FuriHalFlashRawOptionByteData"]
5986 [::core::mem::align_of::<FuriHalFlashRawOptionByteData>() - 8usize];
5987 ["Offset of field: FuriHalFlashRawOptionByteData::bytes"]
5988 [::core::mem::offset_of!(FuriHalFlashRawOptionByteData, bytes) - 0usize];
5989 ["Offset of field: FuriHalFlashRawOptionByteData::obs"]
5990 [::core::mem::offset_of!(FuriHalFlashRawOptionByteData, obs) - 0usize];
5991};
5992unsafe extern "C" {
5993 #[doc = "Turn on/off vibro\n\n # Arguments\n\n* `value` (direction in) - new state"]
5994 pub fn furi_hal_vibro_on(value: bool);
5995}
5996#[doc = "<Function has an error, STALLPID will be issued."]
5997pub const usbd_fail: _usbd_respond = _usbd_respond(0);
5998#[doc = "<Function completes request accepted ZLP or data will be send."]
5999pub const usbd_ack: _usbd_respond = _usbd_respond(1);
6000#[doc = "<Function is busy. NAK handshake."]
6001pub const usbd_nak: _usbd_respond = _usbd_respond(2);
6002#[repr(transparent)]
6003#[doc = "Reporting status results."]
6004#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6005pub struct _usbd_respond(pub core::ffi::c_uchar);
6006#[doc = "Reporting status results."]
6007pub use self::_usbd_respond as usbd_respond;
6008#[doc = "Represents a USB device data."]
6009pub type usbd_device = _usbd_device;
6010#[doc = "Represents generic USB control request."]
6011#[repr(C)]
6012#[derive(Debug)]
6013pub struct usbd_ctlreq {
6014 #[doc = "<This bitmapped field identifies the characteristics of\n the specific request."]
6015 pub bmRequestType: u8,
6016 #[doc = "<This field specifies the particular request."]
6017 pub bRequest: u8,
6018 #[doc = "<It is used to pass a parameter to the device, specific to\n the request."]
6019 pub wValue: u16,
6020 #[doc = "<It is used to pass a parameter to the device, specific to\n the request."]
6021 pub wIndex: u16,
6022 #[doc = "<This field specifies the length of the data transferred\n during the second phase of the control transfer."]
6023 pub wLength: u16,
6024 #[doc = "<Data payload."]
6025 pub data: __IncompleteArrayField<u8>,
6026}
6027#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6028const _: () = {
6029 ["Size of usbd_ctlreq"][::core::mem::size_of::<usbd_ctlreq>() - 8usize];
6030 ["Alignment of usbd_ctlreq"][::core::mem::align_of::<usbd_ctlreq>() - 2usize];
6031 ["Offset of field: usbd_ctlreq::bmRequestType"]
6032 [::core::mem::offset_of!(usbd_ctlreq, bmRequestType) - 0usize];
6033 ["Offset of field: usbd_ctlreq::bRequest"]
6034 [::core::mem::offset_of!(usbd_ctlreq, bRequest) - 1usize];
6035 ["Offset of field: usbd_ctlreq::wValue"][::core::mem::offset_of!(usbd_ctlreq, wValue) - 2usize];
6036 ["Offset of field: usbd_ctlreq::wIndex"][::core::mem::offset_of!(usbd_ctlreq, wIndex) - 4usize];
6037 ["Offset of field: usbd_ctlreq::wLength"]
6038 [::core::mem::offset_of!(usbd_ctlreq, wLength) - 6usize];
6039 ["Offset of field: usbd_ctlreq::data"][::core::mem::offset_of!(usbd_ctlreq, data) - 8usize];
6040};
6041#[doc = "USB device status data."]
6042#[repr(C)]
6043#[derive(Debug, Copy, Clone)]
6044pub struct usbd_status {
6045 #[doc = "<Pointer to data buffer used for control requests."]
6046 pub data_buf: *mut core::ffi::c_void,
6047 #[doc = "<Pointer to current data for control request."]
6048 pub data_ptr: *mut core::ffi::c_void,
6049 #[doc = "<Count remained data for control request."]
6050 pub data_count: u16,
6051 #[doc = "<Size of the data buffer for control requests."]
6052 pub data_maxsize: u16,
6053 #[doc = "<Size of the control endpoint."]
6054 pub ep0size: u8,
6055 #[doc = "<Current device configuration number."]
6056 pub device_cfg: u8,
6057 #[doc = "<Current usbd_machine_state."]
6058 pub device_state: u8,
6059 #[doc = "<Current usbd_ctl_state."]
6060 pub control_state: u8,
6061}
6062#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6063const _: () = {
6064 ["Size of usbd_status"][::core::mem::size_of::<usbd_status>() - 16usize];
6065 ["Alignment of usbd_status"][::core::mem::align_of::<usbd_status>() - 4usize];
6066 ["Offset of field: usbd_status::data_buf"]
6067 [::core::mem::offset_of!(usbd_status, data_buf) - 0usize];
6068 ["Offset of field: usbd_status::data_ptr"]
6069 [::core::mem::offset_of!(usbd_status, data_ptr) - 4usize];
6070 ["Offset of field: usbd_status::data_count"]
6071 [::core::mem::offset_of!(usbd_status, data_count) - 8usize];
6072 ["Offset of field: usbd_status::data_maxsize"]
6073 [::core::mem::offset_of!(usbd_status, data_maxsize) - 10usize];
6074 ["Offset of field: usbd_status::ep0size"]
6075 [::core::mem::offset_of!(usbd_status, ep0size) - 12usize];
6076 ["Offset of field: usbd_status::device_cfg"]
6077 [::core::mem::offset_of!(usbd_status, device_cfg) - 13usize];
6078 ["Offset of field: usbd_status::device_state"]
6079 [::core::mem::offset_of!(usbd_status, device_state) - 14usize];
6080 ["Offset of field: usbd_status::control_state"]
6081 [::core::mem::offset_of!(usbd_status, control_state) - 15usize];
6082};
6083#[doc = "Generic USB device event callback for events and endpoints processing\n # Arguments\n\n* `dev` (direction in) - pointer to USB device\n * `event` - USB_EVENTS \"USB event\"\n * `ep` - active endpoint number\n > **Note:** endpoints with same indexes i.e. 0x01 and 0x81 shares same callback."]
6084pub type usbd_evt_callback =
6085 ::core::option::Option<unsafe extern "C" fn(dev: *mut usbd_device, event: u8, ep: u8)>;
6086#[doc = "USB control transfer completed callback function.\n # Arguments\n\n* `dev` (direction in) - pointer to USB device\n * `req` (direction in) - pointer to usb request structure\n > **Note:** usbd_device->complete_callback will be set to NULL after this callback completion."]
6087pub type usbd_rqc_callback =
6088 ::core::option::Option<unsafe extern "C" fn(dev: *mut usbd_device, req: *mut usbd_ctlreq)>;
6089#[doc = "USB control callback function.\n \n\nUses for the control request processing.\n Some requests will be handled by core if callback don't process it (returns FALSE).\n If request was not processed STALL PID will be issued.\n - GET_CONFIGURATION\n - SET_CONFIGURATION (passes to usbd_cfg_callback)\n - GET_DESCRIPTOR (passes to usbd_dsc_callback)\n - GET_STATUS\n - SET_FEATURE, CLEAR_FEATURE (endpoints only)\n - SET_ADDRESS\n # Arguments\n\n* `dev` (direction in) - points to USB device\n * `req` (direction in) - points to usb control request\n * `*callback` (direction out) - USB control transfer completion callback, default is NULL (no callback)\n # Returns\n\nusbd_respond status."]
6090pub type usbd_ctl_callback = ::core::option::Option<
6091 unsafe extern "C" fn(
6092 dev: *mut usbd_device,
6093 req: *mut usbd_ctlreq,
6094 callback: *mut usbd_rqc_callback,
6095 ) -> usbd_respond,
6096>;
6097#[doc = "USB get descriptor callback function\n \n\nCalled when GET_DESCRIPTOR request issued\n # Arguments\n\n* `req` (direction in) - pointer to usb control request structure\n * `address` (direction in, out) - pointer to the descriptor in memory. Points to req->data by default. You\n can use this buffer.\n * `dsize` (direction in, out) - descriptor size. maximum buffer size by default.\n # Returns\n\nusbd_ack if you passed the correct descriptor, usbd_fail otherwise."]
6098pub type usbd_dsc_callback = ::core::option::Option<
6099 unsafe extern "C" fn(
6100 req: *mut usbd_ctlreq,
6101 address: *mut *mut core::ffi::c_void,
6102 dsize: *mut u16,
6103 ) -> usbd_respond,
6104>;
6105#[doc = "USB set configuration callback function\n \n\ncalled when SET_CONFIGURATION request issued\n # Arguments\n\n* `dev` (direction in) - pointer to USB device\n * `cfg` (direction in) - configuration number.\n > **Note:** if config is 0 device endpoints should be de-configured\n # Returns\n\nTRUE if success"]
6106pub type usbd_cfg_callback =
6107 ::core::option::Option<unsafe extern "C" fn(dev: *mut usbd_device, cfg: u8) -> usbd_respond>;
6108#[doc = "USBD_HW\n # /\n/**Get USB device status and capabilities.\n # Returns\n\nHardware status and capabilities USBD_HW_CAPS"]
6109pub type usbd_hw_getinfo = ::core::option::Option<unsafe extern "C" fn() -> u32>;
6110#[doc = "Enables or disables USB hardware\n # Arguments\n\n* `enable` - Enables USB when TRUE disables otherwise."]
6111pub type usbd_hw_enable = ::core::option::Option<unsafe extern "C" fn(enable: bool)>;
6112#[doc = "Connects or disconnects USB hardware to/from usb host\n # Arguments\n\n* `connect` - Connects USB to host if TRUE, disconnects otherwise\n # Returns\n\nlanes connection status."]
6113pub type usbd_hw_connect = ::core::option::Option<unsafe extern "C" fn(connect: bool) -> u8>;
6114#[doc = "Sets USB hardware address\n # Arguments\n\n* `address` - USB address"]
6115pub type usbd_hw_setaddr = ::core::option::Option<unsafe extern "C" fn(address: u8)>;
6116#[doc = "Configures endpoint\n # Arguments\n\n* `ep` - endpoint address. Use USB_EPDIR_ macros to set endpoint direction\n * `eptype` - endpoint type. Use USB_EPTYPE_* macros.\n * `epsize` - endpoint size in bytes\n # Returns\n\nTRUE if success"]
6117pub type usbd_hw_ep_config =
6118 ::core::option::Option<unsafe extern "C" fn(ep: u8, eptype: u8, epsize: u16) -> bool>;
6119#[doc = "De-configures, cleans and disables endpoint\n # Arguments\n\n* `ep` - endpoint index\n > **Note:** if you have two one-direction single-buffered endpoints with same index (i.e. 0x02 and 0x82)\n both will be deconfigured."]
6120pub type usbd_hw_ep_deconfig = ::core::option::Option<unsafe extern "C" fn(ep: u8)>;
6121#[doc = "Reads data from OUT or control endpoint\n # Arguments\n\n* `ep` - endpoint index, should belong to OUT or CONTROL endpoint.\n * `buf` - pointer to read buffer\n * `blen` - size of the read buffer in bytes\n # Returns\n\nsize of the actually received data, -1 on error.\n > **Note:** if data does not fit buffer it will be truncated"]
6122pub type usbd_hw_ep_read = ::core::option::Option<
6123 unsafe extern "C" fn(ep: u8, buf: *mut core::ffi::c_void, blen: u16) -> i32,
6124>;
6125#[doc = "Writes data to IN or control endpoint\n # Arguments\n\n* `ep` - endpoint index, hould belong to IN or CONTROL endpoint\n * `buf` - pointer to data buffer\n * `blen` - size of data will be written\n # Returns\n\nnumber of written bytes"]
6126pub type usbd_hw_ep_write = ::core::option::Option<
6127 unsafe extern "C" fn(ep: u8, buf: *const core::ffi::c_void, blen: u16) -> i32,
6128>;
6129#[doc = "Stalls and unstalls endpoint\n # Arguments\n\n* `ep` - endpoint address\n * `stall` - endpoint will be stalled if TRUE and unstalled otherwise.\n > **Note:** Has no effect on inactive endpoints."]
6130pub type usbd_hw_ep_setstall = ::core::option::Option<unsafe extern "C" fn(ep: u8, stall: bool)>;
6131#[doc = "Checks endpoint for stalled state\n # Arguments\n\n* `ep` - endpoint address\n # Returns\n\nTRUE if endpoint is stalled"]
6132pub type usbd_hw_ep_isstalled = ::core::option::Option<unsafe extern "C" fn(ep: u8) -> bool>;
6133#[doc = "Polls USB hardware for the events\n # Arguments\n\n* `dev` (direction in) - pointer to usb device structure\n * `callback` - callback to event processing subroutine"]
6134pub type usbd_hw_poll = ::core::option::Option<
6135 unsafe extern "C" fn(dev: *mut usbd_device, callback: usbd_evt_callback),
6136>;
6137#[doc = "Gets frame number from usb hardware."]
6138pub type usbd_hw_get_frameno = ::core::option::Option<unsafe extern "C" fn() -> u16>;
6139#[doc = "Makes a string descriptor contains unique serial number from hardware ID's\n # Arguments\n\n* `buffer` (direction in) - pointer to buffer for the descriptor\n # Returns\n\nof the descriptor in bytes"]
6140pub type usbd_hw_get_serialno =
6141 ::core::option::Option<unsafe extern "C" fn(buffer: *mut core::ffi::c_void) -> u16>;
6142#[doc = "Represents a hardware USB driver call table."]
6143#[repr(C)]
6144#[derive(Debug, Copy, Clone)]
6145pub struct usbd_driver {
6146 #[doc = "<usbd_hw_getinfo"]
6147 pub getinfo: usbd_hw_getinfo,
6148 #[doc = "<usbd_hw_enable"]
6149 pub enable: usbd_hw_enable,
6150 #[doc = "<usbd_hw_connect"]
6151 pub connect: usbd_hw_connect,
6152 #[doc = "<usbd_hw_setaddr"]
6153 pub setaddr: usbd_hw_setaddr,
6154 #[doc = "<usbd_hw_ep_config"]
6155 pub ep_config: usbd_hw_ep_config,
6156 #[doc = "<usbd_hw_ep_deconfig"]
6157 pub ep_deconfig: usbd_hw_ep_deconfig,
6158 #[doc = "<usbd_hw_ep_read"]
6159 pub ep_read: usbd_hw_ep_read,
6160 #[doc = "<usbd_hw_ep_write"]
6161 pub ep_write: usbd_hw_ep_write,
6162 #[doc = "<usbd_hw_ep_setstall"]
6163 pub ep_setstall: usbd_hw_ep_setstall,
6164 #[doc = "<usbd_hw_ep_isstalled"]
6165 pub ep_isstalled: usbd_hw_ep_isstalled,
6166 #[doc = "<usbd_hw_poll"]
6167 pub poll: usbd_hw_poll,
6168 #[doc = "<usbd_hw_get_frameno"]
6169 pub frame_no: usbd_hw_get_frameno,
6170 #[doc = "<usbd_hw_get_serialno"]
6171 pub get_serialno_desc: usbd_hw_get_serialno,
6172}
6173#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6174const _: () = {
6175 ["Size of usbd_driver"][::core::mem::size_of::<usbd_driver>() - 52usize];
6176 ["Alignment of usbd_driver"][::core::mem::align_of::<usbd_driver>() - 4usize];
6177 ["Offset of field: usbd_driver::getinfo"]
6178 [::core::mem::offset_of!(usbd_driver, getinfo) - 0usize];
6179 ["Offset of field: usbd_driver::enable"][::core::mem::offset_of!(usbd_driver, enable) - 4usize];
6180 ["Offset of field: usbd_driver::connect"]
6181 [::core::mem::offset_of!(usbd_driver, connect) - 8usize];
6182 ["Offset of field: usbd_driver::setaddr"]
6183 [::core::mem::offset_of!(usbd_driver, setaddr) - 12usize];
6184 ["Offset of field: usbd_driver::ep_config"]
6185 [::core::mem::offset_of!(usbd_driver, ep_config) - 16usize];
6186 ["Offset of field: usbd_driver::ep_deconfig"]
6187 [::core::mem::offset_of!(usbd_driver, ep_deconfig) - 20usize];
6188 ["Offset of field: usbd_driver::ep_read"]
6189 [::core::mem::offset_of!(usbd_driver, ep_read) - 24usize];
6190 ["Offset of field: usbd_driver::ep_write"]
6191 [::core::mem::offset_of!(usbd_driver, ep_write) - 28usize];
6192 ["Offset of field: usbd_driver::ep_setstall"]
6193 [::core::mem::offset_of!(usbd_driver, ep_setstall) - 32usize];
6194 ["Offset of field: usbd_driver::ep_isstalled"]
6195 [::core::mem::offset_of!(usbd_driver, ep_isstalled) - 36usize];
6196 ["Offset of field: usbd_driver::poll"][::core::mem::offset_of!(usbd_driver, poll) - 40usize];
6197 ["Offset of field: usbd_driver::frame_no"]
6198 [::core::mem::offset_of!(usbd_driver, frame_no) - 44usize];
6199 ["Offset of field: usbd_driver::get_serialno_desc"]
6200 [::core::mem::offset_of!(usbd_driver, get_serialno_desc) - 48usize];
6201};
6202#[doc = "Represents a USB device data."]
6203#[repr(C)]
6204#[derive(Debug, Copy, Clone)]
6205pub struct _usbd_device {
6206 #[doc = "<usbd_driver"]
6207 pub driver: *const usbd_driver,
6208 #[doc = "<usbd_ctl_callback"]
6209 pub control_callback: usbd_ctl_callback,
6210 #[doc = "<usbd_rqc_callback"]
6211 pub complete_callback: usbd_rqc_callback,
6212 #[doc = "<usbd_cfg_callback"]
6213 pub config_callback: usbd_cfg_callback,
6214 #[doc = "<usbd_dsc_callback"]
6215 pub descriptor_callback: usbd_dsc_callback,
6216 #[doc = "<array of the event callbacks."]
6217 pub events: [usbd_evt_callback; 8usize],
6218 #[doc = "<array of the endpoint callbacks."]
6219 pub endpoint: [usbd_evt_callback; 8usize],
6220 #[doc = "<usbd_status"]
6221 pub status: usbd_status,
6222}
6223#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6224const _: () = {
6225 ["Size of _usbd_device"][::core::mem::size_of::<_usbd_device>() - 100usize];
6226 ["Alignment of _usbd_device"][::core::mem::align_of::<_usbd_device>() - 4usize];
6227 ["Offset of field: _usbd_device::driver"]
6228 [::core::mem::offset_of!(_usbd_device, driver) - 0usize];
6229 ["Offset of field: _usbd_device::control_callback"]
6230 [::core::mem::offset_of!(_usbd_device, control_callback) - 4usize];
6231 ["Offset of field: _usbd_device::complete_callback"]
6232 [::core::mem::offset_of!(_usbd_device, complete_callback) - 8usize];
6233 ["Offset of field: _usbd_device::config_callback"]
6234 [::core::mem::offset_of!(_usbd_device, config_callback) - 12usize];
6235 ["Offset of field: _usbd_device::descriptor_callback"]
6236 [::core::mem::offset_of!(_usbd_device, descriptor_callback) - 16usize];
6237 ["Offset of field: _usbd_device::events"]
6238 [::core::mem::offset_of!(_usbd_device, events) - 20usize];
6239 ["Offset of field: _usbd_device::endpoint"]
6240 [::core::mem::offset_of!(_usbd_device, endpoint) - 52usize];
6241 ["Offset of field: _usbd_device::status"]
6242 [::core::mem::offset_of!(_usbd_device, status) - 84usize];
6243};
6244#[doc = "Represents a USB device descriptor\n \n\nA device descriptor describes general information about a USB device. It includes\n information that applies globally to the device and all of the device’s configurations. A USB\n device has only one device descriptor. A high-speed capable device that has different device\n information for full-speed and high-speed must also have a usb_qualifier_descriptor."]
6245#[repr(C, packed)]
6246#[derive(Debug, Copy, Clone)]
6247pub struct usb_device_descriptor {
6248 #[doc = "<Size of the descriptor, in bytes."]
6249 pub bLength: u8,
6250 #[doc = "<USB_DTYPE_DEVICE Device descriptor."]
6251 pub bDescriptorType: u8,
6252 #[doc = "<BCD of the supported USB specification."]
6253 pub bcdUSB: u16,
6254 #[doc = "<USB device class."]
6255 pub bDeviceClass: u8,
6256 #[doc = "<USB device subclass."]
6257 pub bDeviceSubClass: u8,
6258 #[doc = "<USB device protocol."]
6259 pub bDeviceProtocol: u8,
6260 #[doc = "<Size of the control endpoint's bank in bytes."]
6261 pub bMaxPacketSize0: u8,
6262 #[doc = "<Vendor ID for the USB product."]
6263 pub idVendor: u16,
6264 #[doc = "<Unique product ID for the USB product."]
6265 pub idProduct: u16,
6266 #[doc = "<Product release (version) number."]
6267 pub bcdDevice: u16,
6268 #[doc = "<String index for the manufacturer's name."]
6269 pub iManufacturer: u8,
6270 #[doc = "<String index for the product name/details."]
6271 pub iProduct: u8,
6272 #[doc = "<String index for the product serial number."]
6273 pub iSerialNumber: u8,
6274 #[doc = "<Total number of configurations supported by the device."]
6275 pub bNumConfigurations: u8,
6276}
6277#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6278const _: () = {
6279 ["Size of usb_device_descriptor"][::core::mem::size_of::<usb_device_descriptor>() - 18usize];
6280 ["Alignment of usb_device_descriptor"]
6281 [::core::mem::align_of::<usb_device_descriptor>() - 1usize];
6282 ["Offset of field: usb_device_descriptor::bLength"]
6283 [::core::mem::offset_of!(usb_device_descriptor, bLength) - 0usize];
6284 ["Offset of field: usb_device_descriptor::bDescriptorType"]
6285 [::core::mem::offset_of!(usb_device_descriptor, bDescriptorType) - 1usize];
6286 ["Offset of field: usb_device_descriptor::bcdUSB"]
6287 [::core::mem::offset_of!(usb_device_descriptor, bcdUSB) - 2usize];
6288 ["Offset of field: usb_device_descriptor::bDeviceClass"]
6289 [::core::mem::offset_of!(usb_device_descriptor, bDeviceClass) - 4usize];
6290 ["Offset of field: usb_device_descriptor::bDeviceSubClass"]
6291 [::core::mem::offset_of!(usb_device_descriptor, bDeviceSubClass) - 5usize];
6292 ["Offset of field: usb_device_descriptor::bDeviceProtocol"]
6293 [::core::mem::offset_of!(usb_device_descriptor, bDeviceProtocol) - 6usize];
6294 ["Offset of field: usb_device_descriptor::bMaxPacketSize0"]
6295 [::core::mem::offset_of!(usb_device_descriptor, bMaxPacketSize0) - 7usize];
6296 ["Offset of field: usb_device_descriptor::idVendor"]
6297 [::core::mem::offset_of!(usb_device_descriptor, idVendor) - 8usize];
6298 ["Offset of field: usb_device_descriptor::idProduct"]
6299 [::core::mem::offset_of!(usb_device_descriptor, idProduct) - 10usize];
6300 ["Offset of field: usb_device_descriptor::bcdDevice"]
6301 [::core::mem::offset_of!(usb_device_descriptor, bcdDevice) - 12usize];
6302 ["Offset of field: usb_device_descriptor::iManufacturer"]
6303 [::core::mem::offset_of!(usb_device_descriptor, iManufacturer) - 14usize];
6304 ["Offset of field: usb_device_descriptor::iProduct"]
6305 [::core::mem::offset_of!(usb_device_descriptor, iProduct) - 15usize];
6306 ["Offset of field: usb_device_descriptor::iSerialNumber"]
6307 [::core::mem::offset_of!(usb_device_descriptor, iSerialNumber) - 16usize];
6308 ["Offset of field: usb_device_descriptor::bNumConfigurations"]
6309 [::core::mem::offset_of!(usb_device_descriptor, bNumConfigurations) - 17usize];
6310};
6311unsafe extern "C" {
6312 pub static usbd_devfs: usbd_driver;
6313}
6314#[repr(C)]
6315#[derive(Debug, Copy, Clone)]
6316pub struct FuriHalUsbInterface {
6317 pub init: ::core::option::Option<
6318 unsafe extern "C" fn(
6319 dev: *mut usbd_device,
6320 intf: *mut FuriHalUsbInterface,
6321 ctx: *mut core::ffi::c_void,
6322 ),
6323 >,
6324 pub deinit: ::core::option::Option<unsafe extern "C" fn(dev: *mut usbd_device)>,
6325 pub wakeup: ::core::option::Option<unsafe extern "C" fn(dev: *mut usbd_device)>,
6326 pub suspend: ::core::option::Option<unsafe extern "C" fn(dev: *mut usbd_device)>,
6327 pub dev_descr: *mut usb_device_descriptor,
6328 pub str_manuf_descr: *mut core::ffi::c_void,
6329 pub str_prod_descr: *mut core::ffi::c_void,
6330 pub str_serial_descr: *mut core::ffi::c_void,
6331 pub cfg_descr: *mut core::ffi::c_void,
6332}
6333#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6334const _: () = {
6335 ["Size of FuriHalUsbInterface"][::core::mem::size_of::<FuriHalUsbInterface>() - 36usize];
6336 ["Alignment of FuriHalUsbInterface"][::core::mem::align_of::<FuriHalUsbInterface>() - 4usize];
6337 ["Offset of field: FuriHalUsbInterface::init"]
6338 [::core::mem::offset_of!(FuriHalUsbInterface, init) - 0usize];
6339 ["Offset of field: FuriHalUsbInterface::deinit"]
6340 [::core::mem::offset_of!(FuriHalUsbInterface, deinit) - 4usize];
6341 ["Offset of field: FuriHalUsbInterface::wakeup"]
6342 [::core::mem::offset_of!(FuriHalUsbInterface, wakeup) - 8usize];
6343 ["Offset of field: FuriHalUsbInterface::suspend"]
6344 [::core::mem::offset_of!(FuriHalUsbInterface, suspend) - 12usize];
6345 ["Offset of field: FuriHalUsbInterface::dev_descr"]
6346 [::core::mem::offset_of!(FuriHalUsbInterface, dev_descr) - 16usize];
6347 ["Offset of field: FuriHalUsbInterface::str_manuf_descr"]
6348 [::core::mem::offset_of!(FuriHalUsbInterface, str_manuf_descr) - 20usize];
6349 ["Offset of field: FuriHalUsbInterface::str_prod_descr"]
6350 [::core::mem::offset_of!(FuriHalUsbInterface, str_prod_descr) - 24usize];
6351 ["Offset of field: FuriHalUsbInterface::str_serial_descr"]
6352 [::core::mem::offset_of!(FuriHalUsbInterface, str_serial_descr) - 28usize];
6353 ["Offset of field: FuriHalUsbInterface::cfg_descr"]
6354 [::core::mem::offset_of!(FuriHalUsbInterface, cfg_descr) - 32usize];
6355};
6356unsafe extern "C" {
6357 #[doc = "USB device interface modes"]
6358 pub static mut usb_cdc_single: FuriHalUsbInterface;
6359}
6360unsafe extern "C" {
6361 pub static mut usb_cdc_dual: FuriHalUsbInterface;
6362}
6363unsafe extern "C" {
6364 pub static mut usb_hid: FuriHalUsbInterface;
6365}
6366unsafe extern "C" {
6367 pub static mut usb_hid_u2f: FuriHalUsbInterface;
6368}
6369unsafe extern "C" {
6370 pub static mut usb_ccid: FuriHalUsbInterface;
6371}
6372pub const FuriHalUsbStateEventReset: FuriHalUsbStateEvent = FuriHalUsbStateEvent(0);
6373pub const FuriHalUsbStateEventWakeup: FuriHalUsbStateEvent = FuriHalUsbStateEvent(1);
6374pub const FuriHalUsbStateEventSuspend: FuriHalUsbStateEvent = FuriHalUsbStateEvent(2);
6375pub const FuriHalUsbStateEventDescriptorRequest: FuriHalUsbStateEvent = FuriHalUsbStateEvent(3);
6376#[repr(transparent)]
6377#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6378pub struct FuriHalUsbStateEvent(pub core::ffi::c_uchar);
6379pub type FuriHalUsbStateCallback = ::core::option::Option<
6380 unsafe extern "C" fn(state: FuriHalUsbStateEvent, context: *mut core::ffi::c_void),
6381>;
6382unsafe extern "C" {
6383 #[doc = "Set USB device configuration\n\n # Arguments\n\n* `mode` - new USB device mode\n * `ctx` - context passed to device mode init function\n # Returns\n\ntrue - mode switch started, false - mode switch is locked"]
6384 pub fn furi_hal_usb_set_config(
6385 new_if: *mut FuriHalUsbInterface,
6386 ctx: *mut core::ffi::c_void,
6387 ) -> bool;
6388}
6389unsafe extern "C" {
6390 #[doc = "Get USB device configuration\n\n # Returns\n\ncurrent USB device mode"]
6391 pub fn furi_hal_usb_get_config() -> *mut FuriHalUsbInterface;
6392}
6393unsafe extern "C" {
6394 #[doc = "Lock USB device mode switch"]
6395 pub fn furi_hal_usb_lock();
6396}
6397unsafe extern "C" {
6398 #[doc = "Unlock USB device mode switch"]
6399 pub fn furi_hal_usb_unlock();
6400}
6401unsafe extern "C" {
6402 #[doc = "Check if USB device mode switch locked\n\n # Returns\n\nlock state"]
6403 pub fn furi_hal_usb_is_locked() -> bool;
6404}
6405unsafe extern "C" {
6406 #[doc = "Disable USB device"]
6407 pub fn furi_hal_usb_disable();
6408}
6409unsafe extern "C" {
6410 #[doc = "Enable USB device"]
6411 pub fn furi_hal_usb_enable();
6412}
6413unsafe extern "C" {
6414 #[doc = "Set USB state callback"]
6415 pub fn furi_hal_usb_set_state_callback(
6416 cb: FuriHalUsbStateCallback,
6417 ctx: *mut core::ffi::c_void,
6418 );
6419}
6420unsafe extern "C" {
6421 #[doc = "Restart USB device"]
6422 pub fn furi_hal_usb_reinit();
6423}
6424#[repr(C)]
6425#[derive(Debug, Copy, Clone)]
6426pub struct FuriHalUsbHidConfig {
6427 pub vid: u32,
6428 pub pid: u32,
6429 pub manuf: [core::ffi::c_char; 32usize],
6430 pub product: [core::ffi::c_char; 32usize],
6431}
6432#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6433const _: () = {
6434 ["Size of FuriHalUsbHidConfig"][::core::mem::size_of::<FuriHalUsbHidConfig>() - 72usize];
6435 ["Alignment of FuriHalUsbHidConfig"][::core::mem::align_of::<FuriHalUsbHidConfig>() - 4usize];
6436 ["Offset of field: FuriHalUsbHidConfig::vid"]
6437 [::core::mem::offset_of!(FuriHalUsbHidConfig, vid) - 0usize];
6438 ["Offset of field: FuriHalUsbHidConfig::pid"]
6439 [::core::mem::offset_of!(FuriHalUsbHidConfig, pid) - 4usize];
6440 ["Offset of field: FuriHalUsbHidConfig::manuf"]
6441 [::core::mem::offset_of!(FuriHalUsbHidConfig, manuf) - 8usize];
6442 ["Offset of field: FuriHalUsbHidConfig::product"]
6443 [::core::mem::offset_of!(FuriHalUsbHidConfig, product) - 40usize];
6444};
6445pub type HidStateCallback =
6446 ::core::option::Option<unsafe extern "C" fn(state: bool, context: *mut core::ffi::c_void)>;
6447unsafe extern "C" {
6448 #[doc = "Get USB HID connection state\n\n # Returns\n\ntrue / false"]
6449 pub fn furi_hal_hid_is_connected() -> bool;
6450}
6451unsafe extern "C" {
6452 #[doc = "Get USB HID keyboard leds state\n\n # Returns\n\nleds state"]
6453 pub fn furi_hal_hid_get_led_state() -> u8;
6454}
6455unsafe extern "C" {
6456 #[doc = "Set USB HID connect/disconnect callback\n\n # Arguments\n\n* `cb` - callback\n * `ctx` - callback context"]
6457 pub fn furi_hal_hid_set_state_callback(cb: HidStateCallback, ctx: *mut core::ffi::c_void);
6458}
6459unsafe extern "C" {
6460 #[doc = "Set the following key to pressed state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6461 pub fn furi_hal_hid_kb_press(button: u16) -> bool;
6462}
6463unsafe extern "C" {
6464 #[doc = "Set the following key to released state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6465 pub fn furi_hal_hid_kb_release(button: u16) -> bool;
6466}
6467unsafe extern "C" {
6468 #[doc = "Clear all pressed keys and send HID report\n"]
6469 pub fn furi_hal_hid_kb_release_all() -> bool;
6470}
6471unsafe extern "C" {
6472 #[doc = "Set mouse movement and send HID report\n\n # Arguments\n\n* `dx` - x coordinate delta\n * `dy` - y coordinate delta"]
6473 pub fn furi_hal_hid_mouse_move(dx: i8, dy: i8) -> bool;
6474}
6475unsafe extern "C" {
6476 #[doc = "Set mouse button to pressed state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6477 pub fn furi_hal_hid_mouse_press(button: u8) -> bool;
6478}
6479unsafe extern "C" {
6480 #[doc = "Set mouse button to released state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6481 pub fn furi_hal_hid_mouse_release(button: u8) -> bool;
6482}
6483unsafe extern "C" {
6484 #[doc = "Set mouse wheel position and send HID report\n\n # Arguments\n\n* `delta` - number of scroll steps"]
6485 pub fn furi_hal_hid_mouse_scroll(delta: i8) -> bool;
6486}
6487unsafe extern "C" {
6488 #[doc = "Set the following consumer key to pressed state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6489 pub fn furi_hal_hid_consumer_key_press(button: u16) -> bool;
6490}
6491unsafe extern "C" {
6492 #[doc = "Set the following consumer key to released state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6493 pub fn furi_hal_hid_consumer_key_release(button: u16) -> bool;
6494}
6495unsafe extern "C" {
6496 #[doc = "Clear all pressed consumer keys and send HID report\n"]
6497 pub fn furi_hal_hid_consumer_key_release_all() -> bool;
6498}
6499#[repr(C)]
6500#[derive(Debug, Copy, Clone)]
6501pub struct FuriHalUsbCcidConfig {
6502 pub vid: u16,
6503 pub pid: u16,
6504 pub manuf: [core::ffi::c_char; 32usize],
6505 pub product: [core::ffi::c_char; 32usize],
6506}
6507#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6508const _: () = {
6509 ["Size of FuriHalUsbCcidConfig"][::core::mem::size_of::<FuriHalUsbCcidConfig>() - 68usize];
6510 ["Alignment of FuriHalUsbCcidConfig"][::core::mem::align_of::<FuriHalUsbCcidConfig>() - 2usize];
6511 ["Offset of field: FuriHalUsbCcidConfig::vid"]
6512 [::core::mem::offset_of!(FuriHalUsbCcidConfig, vid) - 0usize];
6513 ["Offset of field: FuriHalUsbCcidConfig::pid"]
6514 [::core::mem::offset_of!(FuriHalUsbCcidConfig, pid) - 2usize];
6515 ["Offset of field: FuriHalUsbCcidConfig::manuf"]
6516 [::core::mem::offset_of!(FuriHalUsbCcidConfig, manuf) - 4usize];
6517 ["Offset of field: FuriHalUsbCcidConfig::product"]
6518 [::core::mem::offset_of!(FuriHalUsbCcidConfig, product) - 36usize];
6519};
6520#[repr(C)]
6521#[derive(Debug, Copy, Clone)]
6522pub struct CcidCallbacks {
6523 pub icc_power_on_callback: ::core::option::Option<
6524 unsafe extern "C" fn(
6525 dataBlock: *mut u8,
6526 dataBlockLen: *mut u32,
6527 context: *mut core::ffi::c_void,
6528 ),
6529 >,
6530 pub xfr_datablock_callback: ::core::option::Option<
6531 unsafe extern "C" fn(
6532 pcToReaderDataBlock: *const u8,
6533 pcToReaderDataBlockLen: u32,
6534 readerToPcDataBlock: *mut u8,
6535 readerToPcDataBlockLen: *mut u32,
6536 context: *mut core::ffi::c_void,
6537 ),
6538 >,
6539}
6540#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6541const _: () = {
6542 ["Size of CcidCallbacks"][::core::mem::size_of::<CcidCallbacks>() - 8usize];
6543 ["Alignment of CcidCallbacks"][::core::mem::align_of::<CcidCallbacks>() - 4usize];
6544 ["Offset of field: CcidCallbacks::icc_power_on_callback"]
6545 [::core::mem::offset_of!(CcidCallbacks, icc_power_on_callback) - 0usize];
6546 ["Offset of field: CcidCallbacks::xfr_datablock_callback"]
6547 [::core::mem::offset_of!(CcidCallbacks, xfr_datablock_callback) - 4usize];
6548};
6549unsafe extern "C" {
6550 #[doc = "Set CCID callbacks\n\n # Arguments\n\n* `cb` - CcidCallbacks instance\n * `context` - The context for callbacks"]
6551 pub fn furi_hal_usb_ccid_set_callbacks(cb: *mut CcidCallbacks, context: *mut core::ffi::c_void);
6552}
6553unsafe extern "C" {
6554 #[doc = "Insert Smart Card"]
6555 pub fn furi_hal_usb_ccid_insert_smartcard();
6556}
6557unsafe extern "C" {
6558 #[doc = "Remove Smart Card"]
6559 pub fn furi_hal_usb_ccid_remove_smartcard();
6560}
6561pub const FuriHalSerialIdUsart: FuriHalSerialId = FuriHalSerialId(0);
6562pub const FuriHalSerialIdLpuart: FuriHalSerialId = FuriHalSerialId(1);
6563pub const FuriHalSerialIdMax: FuriHalSerialId = FuriHalSerialId(2);
6564#[repr(transparent)]
6565#[doc = "UART channels"]
6566#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6567pub struct FuriHalSerialId(pub core::ffi::c_uchar);
6568pub const FuriHalSerialDirectionTx: FuriHalSerialDirection = FuriHalSerialDirection(0);
6569pub const FuriHalSerialDirectionRx: FuriHalSerialDirection = FuriHalSerialDirection(1);
6570pub const FuriHalSerialDirectionMax: FuriHalSerialDirection = FuriHalSerialDirection(2);
6571#[repr(transparent)]
6572#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6573pub struct FuriHalSerialDirection(pub core::ffi::c_uchar);
6574pub const FuriHalSerialDataBits6: FuriHalSerialDataBits = FuriHalSerialDataBits(0);
6575pub const FuriHalSerialDataBits7: FuriHalSerialDataBits = FuriHalSerialDataBits(1);
6576pub const FuriHalSerialDataBits8: FuriHalSerialDataBits = FuriHalSerialDataBits(2);
6577pub const FuriHalSerialDataBits9: FuriHalSerialDataBits = FuriHalSerialDataBits(3);
6578pub const FuriHalSerialDataBitsMax: FuriHalSerialDataBits = FuriHalSerialDataBits(4);
6579#[repr(transparent)]
6580#[doc = "Actual data bits, i.e. not including start/stop and parity bits\n > **Note:** 6 data bits are only permitted when parity is enabled\n > **Note:** 9 data bits are only permitted when parity is disabled"]
6581#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6582pub struct FuriHalSerialDataBits(pub core::ffi::c_uchar);
6583pub const FuriHalSerialParityNone: FuriHalSerialParity = FuriHalSerialParity(0);
6584pub const FuriHalSerialParityEven: FuriHalSerialParity = FuriHalSerialParity(1);
6585pub const FuriHalSerialParityOdd: FuriHalSerialParity = FuriHalSerialParity(2);
6586pub const FuriHalSerialParityMax: FuriHalSerialParity = FuriHalSerialParity(3);
6587#[repr(transparent)]
6588#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6589pub struct FuriHalSerialParity(pub core::ffi::c_uchar);
6590pub const FuriHalSerialStopBits0_5: FuriHalSerialStopBits = FuriHalSerialStopBits(0);
6591pub const FuriHalSerialStopBits1: FuriHalSerialStopBits = FuriHalSerialStopBits(1);
6592pub const FuriHalSerialStopBits1_5: FuriHalSerialStopBits = FuriHalSerialStopBits(2);
6593pub const FuriHalSerialStopBits2: FuriHalSerialStopBits = FuriHalSerialStopBits(3);
6594pub const FuriHalSerialStopBits2Max: FuriHalSerialStopBits = FuriHalSerialStopBits(4);
6595#[repr(transparent)]
6596#[doc = "Stop bit length\n > **Note:** LPUART only supports whole stop bit lengths (i.e. 1 and 2, but not 0.5 and 1.5)"]
6597#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6598pub struct FuriHalSerialStopBits(pub core::ffi::c_uchar);
6599#[repr(C)]
6600#[derive(Debug, Copy, Clone)]
6601pub struct FuriHalSerialHandle {
6602 _unused: [u8; 0],
6603}
6604unsafe extern "C" {
6605 #[doc = "Initialize Serial Control"]
6606 pub fn furi_hal_serial_control_init();
6607}
6608unsafe extern "C" {
6609 #[doc = "De-Initialize Serial Control"]
6610 pub fn furi_hal_serial_control_deinit();
6611}
6612unsafe extern "C" {
6613 #[doc = "Acquire Serial Interface Handler\n\n # Arguments\n\n* `serial_id` (direction in) - The serial transceiver identifier\n\n # Returns\n\nThe Serial Interface Handle or null if interfaces is in use"]
6614 pub fn furi_hal_serial_control_acquire(serial_id: FuriHalSerialId) -> *mut FuriHalSerialHandle;
6615}
6616unsafe extern "C" {
6617 #[doc = "Release Serial Interface Handler\n\n # Arguments\n\n* `handle` - The handle"]
6618 pub fn furi_hal_serial_control_release(handle: *mut FuriHalSerialHandle);
6619}
6620unsafe extern "C" {
6621 #[doc = "Acquire Serial Interface Handler\n\n # Arguments\n\n* `serial_id` (direction in) - The serial transceiver identifier\n\n # Returns\n\ntrue if handle is acquired by someone"]
6622 pub fn furi_hal_serial_control_is_busy(serial_id: FuriHalSerialId) -> bool;
6623}
6624unsafe extern "C" {
6625 #[doc = "Acquire Serial Interface Handler\n\n # Arguments\n\n* `serial_id` (direction in) - The serial transceiver identifier. Use FuriHalSerialIdMax to disable logging.\n * `baud_rate` (direction in) - The baud rate\n\n # Returns\n\nThe Serial Interface Handle or null if interfaces is in use"]
6626 pub fn furi_hal_serial_control_set_logging_config(serial_id: FuriHalSerialId, baud_rate: u32);
6627}
6628#[doc = "Expansion module detection callback type.\n\n # Arguments\n\n* `context` (direction in, out) - Pointer to the user-defined context object."]
6629pub type FuriHalSerialControlExpansionCallback =
6630 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
6631unsafe extern "C" {
6632 #[doc = "Enable expansion module detection for a given serial interface.\n\n Passing NULL as the callback parameter disables external module detection.\n\n # Arguments\n\n* `serial_id` (direction in) - Identifier of the serial interface to be used.\n * `callback` (direction in) - Pointer to the callback function to be called upon module detection.\n * `context` (direction in, out) - Pointer to the user-defined context object. Will be passed to the callback function."]
6633 pub fn furi_hal_serial_control_set_expansion_callback(
6634 serial_id: FuriHalSerialId,
6635 callback: FuriHalSerialControlExpansionCallback,
6636 context: *mut core::ffi::c_void,
6637 );
6638}
6639unsafe extern "C" {
6640 #[doc = "Initialize Serial\n\n Configures GPIO, configures and enables transceiver. Default framing settings\n are used: 8 data bits, no parity, 1 stop bit. Override them with\n `furi_hal_serial_configure_framing`.\n\n # Arguments\n\n* `handle` - Serial handle\n * `baud` - baud rate"]
6641 pub fn furi_hal_serial_init(handle: *mut FuriHalSerialHandle, baud: u32);
6642}
6643unsafe extern "C" {
6644 #[doc = "De-initialize Serial\n\n Configures GPIO to analog, clears callback and callback context, disables\n hardware\n\n # Arguments\n\n* `handle` - Serial handle"]
6645 pub fn furi_hal_serial_deinit(handle: *mut FuriHalSerialHandle);
6646}
6647unsafe extern "C" {
6648 #[doc = "Suspend operation\n\n Suspend hardware, settings and callbacks are preserved\n\n # Arguments\n\n* `handle` - Serial handle"]
6649 pub fn furi_hal_serial_suspend(handle: *mut FuriHalSerialHandle);
6650}
6651unsafe extern "C" {
6652 #[doc = "Resume operation\n\n Resumes hardware from suspended state\n\n # Arguments\n\n* `handle` - Serial handle"]
6653 pub fn furi_hal_serial_resume(handle: *mut FuriHalSerialHandle);
6654}
6655unsafe extern "C" {
6656 #[doc = "Determine whether a certain baud rate is supported\n\n # Arguments\n\n* `handle` - Serial handle\n * `baud` - baud rate to be checked\n # Returns\n\ntrue if baud rate is supported, false otherwise."]
6657 pub fn furi_hal_serial_is_baud_rate_supported(
6658 handle: *mut FuriHalSerialHandle,
6659 baud: u32,
6660 ) -> bool;
6661}
6662unsafe extern "C" {
6663 #[doc = "Changes baud rate\n\n # Arguments\n\n* `handle` - Serial handle\n * `baud` - baud rate"]
6664 pub fn furi_hal_serial_set_br(handle: *mut FuriHalSerialHandle, baud: u32);
6665}
6666unsafe extern "C" {
6667 #[doc = "Configures framing of a serial interface\n\n # Arguments\n\n* `handle` - Serial handle\n * `data_bits` - Data bits\n * `parity` - Parity\n * `stop_bits` - Stop bits"]
6668 pub fn furi_hal_serial_configure_framing(
6669 handle: *mut FuriHalSerialHandle,
6670 data_bits: FuriHalSerialDataBits,
6671 parity: FuriHalSerialParity,
6672 stop_bits: FuriHalSerialStopBits,
6673 );
6674}
6675unsafe extern "C" {
6676 #[doc = "Transmits data in semi-blocking mode\n\n Fills transmission pipe with data, returns as soon as all bytes from buffer\n are in the pipe.\n\n Real transmission will be completed later. Use\n `furi_hal_serial_tx_wait_complete` to wait for completion if you need it.\n\n # Arguments\n\n* `handle` - Serial handle\n * `buffer` - data\n * `buffer_size` - data size (in bytes)"]
6677 pub fn furi_hal_serial_tx(
6678 handle: *mut FuriHalSerialHandle,
6679 buffer: *const u8,
6680 buffer_size: usize,
6681 );
6682}
6683unsafe extern "C" {
6684 #[doc = "Wait until transmission is completed\n\n Ensures that all data has been sent.\n\n # Arguments\n\n* `handle` - Serial handle"]
6685 pub fn furi_hal_serial_tx_wait_complete(handle: *mut FuriHalSerialHandle);
6686}
6687#[doc = "< Data: new data available"]
6688pub const FuriHalSerialRxEventData: FuriHalSerialRxEvent = FuriHalSerialRxEvent(1);
6689#[doc = "< Idle: bus idle detected"]
6690pub const FuriHalSerialRxEventIdle: FuriHalSerialRxEvent = FuriHalSerialRxEvent(2);
6691#[doc = "< Framing Error: incorrect frame detected"]
6692pub const FuriHalSerialRxEventFrameError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(4);
6693#[doc = "< Noise Error: noise on the line detected"]
6694pub const FuriHalSerialRxEventNoiseError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(8);
6695#[doc = "< Overrun Error: no space for received data"]
6696pub const FuriHalSerialRxEventOverrunError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(16);
6697#[doc = "< Parity Error: incorrect parity bit received"]
6698pub const FuriHalSerialRxEventParityError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(32);
6699#[repr(transparent)]
6700#[doc = "Serial RX events"]
6701#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6702pub struct FuriHalSerialRxEvent(pub core::ffi::c_uchar);
6703#[doc = "Receive callback\n\n Callback will be called in interrupt context, ensure thread\n safety on your side.\n # Arguments\n\n* `handle` - Serial handle\n * `event` - FuriHalSerialRxEvent\n * `context` - Callback context provided earlier"]
6704pub type FuriHalSerialAsyncRxCallback = ::core::option::Option<
6705 unsafe extern "C" fn(
6706 handle: *mut FuriHalSerialHandle,
6707 event: FuriHalSerialRxEvent,
6708 context: *mut core::ffi::c_void,
6709 ),
6710>;
6711unsafe extern "C" {
6712 #[doc = "Start and sets Serial Receive callback\n\n Callback will be called in interrupt context, ensure thread\n safety on your side\n\n # Arguments\n\n* `handle` - Serial handle\n * `callback` - callback pointer\n * `context` - callback context\n * `report_errors` (direction in) - report RX error"]
6713 pub fn furi_hal_serial_async_rx_start(
6714 handle: *mut FuriHalSerialHandle,
6715 callback: FuriHalSerialAsyncRxCallback,
6716 context: *mut core::ffi::c_void,
6717 report_errors: bool,
6718 );
6719}
6720unsafe extern "C" {
6721 #[doc = "Stop Serial Receive\n\n # Arguments\n\n* `handle` - Serial handle"]
6722 pub fn furi_hal_serial_async_rx_stop(handle: *mut FuriHalSerialHandle);
6723}
6724unsafe extern "C" {
6725 #[doc = "Check if there is data available for reading\n\n This function must be called only from the callback\n FuriHalSerialAsyncRxCallback\n\n # Arguments\n\n* `handle` - Serial handle\n # Returns\n\ntrue if data is available for reading, false otherwise"]
6726 pub fn furi_hal_serial_async_rx_available(handle: *mut FuriHalSerialHandle) -> bool;
6727}
6728unsafe extern "C" {
6729 #[doc = "Get data Serial receive\n\n This function must be called only from the callback\n FuriHalSerialAsyncRxCallback\n\n # Arguments\n\n* `handle` - Serial handle\n\n # Returns\n\ndata"]
6730 pub fn furi_hal_serial_async_rx(handle: *mut FuriHalSerialHandle) -> u8;
6731}
6732#[doc = "Receive DMA callback\n\n DMA Callback will be called in interrupt context, ensure thread\n safety on your side.\n\n # Arguments\n\n* `handle` - Serial handle\n * `event` - FuriHalSerialDmaRxEvent\n * `data_len` - Received data\n * `context` - Callback context provided earlier"]
6733pub type FuriHalSerialDmaRxCallback = ::core::option::Option<
6734 unsafe extern "C" fn(
6735 handle: *mut FuriHalSerialHandle,
6736 event: FuriHalSerialRxEvent,
6737 data_len: usize,
6738 context: *mut core::ffi::c_void,
6739 ),
6740>;
6741unsafe extern "C" {
6742 #[doc = "Enable an input/output direction\n\n Takes over the respective pin by reconfiguring it to\n the appropriate alternative function.\n\n # Arguments\n\n* `handle` - Serial handle\n * `direction` - Direction to enable"]
6743 pub fn furi_hal_serial_enable_direction(
6744 handle: *mut FuriHalSerialHandle,
6745 direction: FuriHalSerialDirection,
6746 );
6747}
6748unsafe extern "C" {
6749 #[doc = "Disable an input/output direction\n\n Releases the respective pin by reconfiguring it to\n initial state, making possible its use for other purposes.\n\n # Arguments\n\n* `handle` - Serial handle\n * `direction` - Direction to disable"]
6750 pub fn furi_hal_serial_disable_direction(
6751 handle: *mut FuriHalSerialHandle,
6752 direction: FuriHalSerialDirection,
6753 );
6754}
6755unsafe extern "C" {
6756 #[doc = "Get the GPIO pin associated with a serial\n\n # Arguments\n\n* `handle` - Serial handle\n * `direction` - Direction to query\n # Returns\n\npointer to the respective pin instance"]
6757 pub fn furi_hal_serial_get_gpio_pin(
6758 handle: *mut FuriHalSerialHandle,
6759 direction: FuriHalSerialDirection,
6760 ) -> *const GpioPin;
6761}
6762unsafe extern "C" {
6763 #[doc = "Start and sets Serial event callback receive DMA\n\n # Arguments\n\n* `handle` - Serial handle\n * `callback` - callback pointer\n * `context` - callback context\n * `report_errors` (direction in) - report RX error"]
6764 pub fn furi_hal_serial_dma_rx_start(
6765 handle: *mut FuriHalSerialHandle,
6766 callback: FuriHalSerialDmaRxCallback,
6767 context: *mut core::ffi::c_void,
6768 report_errors: bool,
6769 );
6770}
6771unsafe extern "C" {
6772 #[doc = "Stop Serial receive DMA\n\n # Arguments\n\n* `handle` - Serial handle"]
6773 pub fn furi_hal_serial_dma_rx_stop(handle: *mut FuriHalSerialHandle);
6774}
6775unsafe extern "C" {
6776 #[doc = "Get data Serial receive DMA\n\n This function must be called only from the callback\n FuriHalSerialDmaRxCallback\n\n # Arguments\n\n* `handle` - Serial handle\n * `data` - pointer to data buffer\n * `len` - get data size (in bytes)\n\n # Returns\n\nsize actual data receive (in bytes)"]
6777 pub fn furi_hal_serial_dma_rx(
6778 handle: *mut FuriHalSerialHandle,
6779 data: *mut u8,
6780 len: usize,
6781 ) -> usize;
6782}
6783unsafe extern "C" {
6784 pub fn furi_hal_info_get_api_version(major: *mut u16, minor: *mut u16);
6785}
6786unsafe extern "C" {
6787 #[doc = "Get device information\n\n # Arguments\n\n* `callback` (direction in) - callback to provide with new data\n * `sep` (direction in) - category separator character\n * `context` (direction in) - context to pass to callback"]
6788 pub fn furi_hal_info_get(
6789 callback: PropertyValueCallback,
6790 sep: core::ffi::c_char,
6791 context: *mut core::ffi::c_void,
6792 );
6793}
6794unsafe extern "C" {
6795 #[doc = "Initialize random subsystem"]
6796 pub fn furi_hal_random_init();
6797}
6798unsafe extern "C" {
6799 #[doc = "Get random value\n furi_hal_random_get() gives up to FURI_HAL_RANDOM_MAX\n rand() and random() give up to RAND_MAX\n\n # Returns\n\n32 bit random value (up to FURI_HAL_RANDOM_MAX)"]
6800 pub fn furi_hal_random_get() -> u32;
6801}
6802unsafe extern "C" {
6803 #[doc = "Fill buffer with random data\n\n # Arguments\n\n* `buf` - buffer pointer\n * `data` - buffer len"]
6804 pub fn furi_hal_random_fill_buf(buf: *mut u8, len: u32);
6805}
6806#[doc = "< default configuration"]
6807pub const FuriHalSubGhzPresetIDLE: FuriHalSubGhzPreset = FuriHalSubGhzPreset(0);
6808#[doc = "< OOK, bandwidth 270kHz, asynchronous"]
6809pub const FuriHalSubGhzPresetOok270Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(1);
6810#[doc = "< OOK, bandwidth 650kHz, asynchronous"]
6811pub const FuriHalSubGhzPresetOok650Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(2);
6812#[doc = "< FM, deviation 2.380371 kHz, asynchronous"]
6813pub const FuriHalSubGhzPreset2FSKDev238Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(3);
6814#[doc = "< FM, deviation 47.60742 kHz, asynchronous"]
6815pub const FuriHalSubGhzPreset2FSKDev476Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(4);
6816#[doc = "< MSK, deviation 47.60742 kHz, 99.97Kb/s, asynchronous"]
6817pub const FuriHalSubGhzPresetMSK99_97KbAsync: FuriHalSubGhzPreset = FuriHalSubGhzPreset(5);
6818#[doc = "< GFSK, deviation 19.042969 kHz, 9.996Kb/s, asynchronous"]
6819pub const FuriHalSubGhzPresetGFSK9_99KbAsync: FuriHalSubGhzPreset = FuriHalSubGhzPreset(6);
6820pub const FuriHalSubGhzPresetCustom: FuriHalSubGhzPreset = FuriHalSubGhzPreset(7);
6821#[repr(transparent)]
6822#[doc = "Radio Presets"]
6823#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6824pub struct FuriHalSubGhzPreset(pub core::ffi::c_uchar);
6825#[repr(C)]
6826#[derive(Debug, Copy, Clone)]
6827pub struct LevelDuration {
6828 pub _bitfield_align_1: [u32; 0],
6829 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
6830}
6831#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6832const _: () = {
6833 ["Size of LevelDuration"][::core::mem::size_of::<LevelDuration>() - 4usize];
6834 ["Alignment of LevelDuration"][::core::mem::align_of::<LevelDuration>() - 4usize];
6835};
6836impl LevelDuration {
6837 #[inline]
6838 pub fn duration(&self) -> u32 {
6839 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 30u8) as u32) }
6840 }
6841 #[inline]
6842 pub fn set_duration(&mut self, val: u32) {
6843 unsafe {
6844 let val: u32 = ::core::mem::transmute(val);
6845 self._bitfield_1.set(0usize, 30u8, val as u64)
6846 }
6847 }
6848 #[inline]
6849 pub unsafe fn duration_raw(this: *const Self) -> u32 {
6850 unsafe {
6851 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
6852 ::core::ptr::addr_of!((*this)._bitfield_1),
6853 0usize,
6854 30u8,
6855 ) as u32)
6856 }
6857 }
6858 #[inline]
6859 pub unsafe fn set_duration_raw(this: *mut Self, val: u32) {
6860 unsafe {
6861 let val: u32 = ::core::mem::transmute(val);
6862 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
6863 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6864 0usize,
6865 30u8,
6866 val as u64,
6867 )
6868 }
6869 }
6870 #[inline]
6871 pub fn level(&self) -> u8 {
6872 unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u8) }
6873 }
6874 #[inline]
6875 pub fn set_level(&mut self, val: u8) {
6876 unsafe {
6877 let val: u8 = ::core::mem::transmute(val);
6878 self._bitfield_1.set(30usize, 2u8, val as u64)
6879 }
6880 }
6881 #[inline]
6882 pub unsafe fn level_raw(this: *const Self) -> u8 {
6883 unsafe {
6884 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
6885 ::core::ptr::addr_of!((*this)._bitfield_1),
6886 30usize,
6887 2u8,
6888 ) as u8)
6889 }
6890 }
6891 #[inline]
6892 pub unsafe fn set_level_raw(this: *mut Self, val: u8) {
6893 unsafe {
6894 let val: u8 = ::core::mem::transmute(val);
6895 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
6896 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6897 30usize,
6898 2u8,
6899 val as u64,
6900 )
6901 }
6902 }
6903 #[inline]
6904 pub fn new_bitfield_1(duration: u32, level: u8) -> __BindgenBitfieldUnit<[u8; 4usize]> {
6905 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
6906 __bindgen_bitfield_unit.set(0usize, 30u8, {
6907 let duration: u32 = unsafe { ::core::mem::transmute(duration) };
6908 duration as u64
6909 });
6910 __bindgen_bitfield_unit.set(30usize, 2u8, {
6911 let level: u8 = unsafe { ::core::mem::transmute(level) };
6912 level as u64
6913 });
6914 __bindgen_bitfield_unit
6915 }
6916}
6917#[doc = "< Isolate Radio from antenna"]
6918pub const FuriHalSubGhzPathIsolate: FuriHalSubGhzPath = FuriHalSubGhzPath(0);
6919#[doc = "< Center Frequency: 433MHz. Path 1: SW1RF1-SW2RF2, LCLCL"]
6920pub const FuriHalSubGhzPath433: FuriHalSubGhzPath = FuriHalSubGhzPath(1);
6921#[doc = "< Center Frequency: 315MHz. Path 2: SW1RF2-SW2RF1, LCLCLCL"]
6922pub const FuriHalSubGhzPath315: FuriHalSubGhzPath = FuriHalSubGhzPath(2);
6923#[doc = "< Center Frequency: 868MHz. Path 3: SW1RF3-SW2RF3, LCLC"]
6924pub const FuriHalSubGhzPath868: FuriHalSubGhzPath = FuriHalSubGhzPath(3);
6925#[repr(transparent)]
6926#[doc = "Switchable Radio Paths"]
6927#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6928pub struct FuriHalSubGhzPath(pub core::ffi::c_uchar);
6929unsafe extern "C" {
6930 pub fn furi_hal_subghz_set_async_mirror_pin(pin: *const GpioPin);
6931}
6932unsafe extern "C" {
6933 #[doc = "Get data GPIO\n\n # Returns\n\npointer to the gpio pin structure"]
6934 pub fn furi_hal_subghz_get_data_gpio() -> *const GpioPin;
6935}
6936unsafe extern "C" {
6937 #[doc = "Send device to sleep mode"]
6938 pub fn furi_hal_subghz_sleep();
6939}
6940unsafe extern "C" {
6941 #[doc = "Load custom registers from preset\n\n # Arguments\n\n* `preset_data` - registers to load"]
6942 pub fn furi_hal_subghz_load_custom_preset(preset_data: *const u8);
6943}
6944unsafe extern "C" {
6945 #[doc = "Load registers\n\n # Arguments\n\n* `data` - Registers data"]
6946 pub fn furi_hal_subghz_load_registers(data: *const u8);
6947}
6948unsafe extern "C" {
6949 #[doc = "Load PATABLE\n\n # Arguments\n\n* `data` - 8 uint8_t values"]
6950 pub fn furi_hal_subghz_load_patable(data: *const u8);
6951}
6952unsafe extern "C" {
6953 #[doc = "Write packet to FIFO\n\n # Arguments\n\n* `data` - bytes array\n * `size` - size"]
6954 pub fn furi_hal_subghz_write_packet(data: *const u8, size: u8);
6955}
6956unsafe extern "C" {
6957 #[doc = "Check if receive pipe is not empty\n\n # Returns\n\ntrue if not empty"]
6958 pub fn furi_hal_subghz_rx_pipe_not_empty() -> bool;
6959}
6960unsafe extern "C" {
6961 #[doc = "Check if received data crc is valid\n\n # Returns\n\ntrue if valid"]
6962 pub fn furi_hal_subghz_is_rx_data_crc_valid() -> bool;
6963}
6964unsafe extern "C" {
6965 #[doc = "Read packet from FIFO\n\n # Arguments\n\n* `data` - pointer\n * `size` - size"]
6966 pub fn furi_hal_subghz_read_packet(data: *mut u8, size: *mut u8);
6967}
6968unsafe extern "C" {
6969 #[doc = "Flush rx FIFO buffer"]
6970 pub fn furi_hal_subghz_flush_rx();
6971}
6972unsafe extern "C" {
6973 #[doc = "Flush tx FIFO buffer"]
6974 pub fn furi_hal_subghz_flush_tx();
6975}
6976unsafe extern "C" {
6977 #[doc = "Shutdown Issue SPWD command\n registers content will be lost"]
6978 pub fn furi_hal_subghz_shutdown();
6979}
6980unsafe extern "C" {
6981 #[doc = "Reset Issue reset command\n registers content will be lost"]
6982 pub fn furi_hal_subghz_reset();
6983}
6984unsafe extern "C" {
6985 #[doc = "Switch to Idle"]
6986 pub fn furi_hal_subghz_idle();
6987}
6988unsafe extern "C" {
6989 #[doc = "Switch to Receive"]
6990 pub fn furi_hal_subghz_rx();
6991}
6992unsafe extern "C" {
6993 #[doc = "Switch to Transmit\n\n # Returns\n\ntrue if the transfer is allowed by belonging to the region"]
6994 pub fn furi_hal_subghz_tx() -> bool;
6995}
6996unsafe extern "C" {
6997 #[doc = "Get RSSI value in dBm\n\n # Returns\n\nRSSI value"]
6998 pub fn furi_hal_subghz_get_rssi() -> f32;
6999}
7000unsafe extern "C" {
7001 #[doc = "Get LQI\n\n # Returns\n\nLQI value"]
7002 pub fn furi_hal_subghz_get_lqi() -> u8;
7003}
7004unsafe extern "C" {
7005 #[doc = "Check if frequency is in valid range\n\n # Arguments\n\n* `value` - frequency in Hz\n\n # Returns\n\ntrue if frequency is valid, otherwise false"]
7006 pub fn furi_hal_subghz_is_frequency_valid(value: u32) -> bool;
7007}
7008unsafe extern "C" {
7009 #[doc = "Set frequency and path This function automatically selects antenna matching\n network\n\n # Arguments\n\n* `value` - frequency in Hz\n\n # Returns\n\nreal frequency in Hz"]
7010 pub fn furi_hal_subghz_set_frequency_and_path(value: u32) -> u32;
7011}
7012unsafe extern "C" {
7013 #[doc = "Set frequency\n\n # Arguments\n\n* `value` - frequency in Hz\n\n # Returns\n\nreal frequency in Hz"]
7014 pub fn furi_hal_subghz_set_frequency(value: u32) -> u32;
7015}
7016unsafe extern "C" {
7017 #[doc = "Set path\n\n # Arguments\n\n* `path` - path to use"]
7018 pub fn furi_hal_subghz_set_path(path: FuriHalSubGhzPath);
7019}
7020#[doc = "Signal Timings Capture callback"]
7021pub type FuriHalSubGhzCaptureCallback = ::core::option::Option<
7022 unsafe extern "C" fn(level: bool, duration: u32, context: *mut core::ffi::c_void),
7023>;
7024unsafe extern "C" {
7025 #[doc = "Enable signal timings capture Initializes GPIO and TIM2 for timings capture\n\n # Arguments\n\n* `callback` - FuriHalSubGhzCaptureCallback\n * `context` - callback context"]
7026 pub fn furi_hal_subghz_start_async_rx(
7027 callback: FuriHalSubGhzCaptureCallback,
7028 context: *mut core::ffi::c_void,
7029 );
7030}
7031unsafe extern "C" {
7032 #[doc = "Disable signal timings capture Resets GPIO and TIM2"]
7033 pub fn furi_hal_subghz_stop_async_rx();
7034}
7035#[doc = "Async TX callback type\n # Arguments\n\n* `context` - callback context\n # Returns\n\nLevelDuration"]
7036pub type FuriHalSubGhzAsyncTxCallback =
7037 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> LevelDuration>;
7038unsafe extern "C" {
7039 #[doc = "Start async TX Initializes GPIO, TIM2 and DMA1 for signal output\n\n # Arguments\n\n* `callback` - FuriHalSubGhzAsyncTxCallback\n * `context` - callback context\n\n # Returns\n\ntrue if the transfer is allowed by belonging to the region"]
7040 pub fn furi_hal_subghz_start_async_tx(
7041 callback: FuriHalSubGhzAsyncTxCallback,
7042 context: *mut core::ffi::c_void,
7043 ) -> bool;
7044}
7045unsafe extern "C" {
7046 #[doc = "Wait for async transmission to complete\n\n # Returns\n\ntrue if TX complete"]
7047 pub fn furi_hal_subghz_is_async_tx_complete() -> bool;
7048}
7049unsafe extern "C" {
7050 #[doc = "Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1"]
7051 pub fn furi_hal_subghz_stop_async_tx();
7052}
7053pub type FuriHalIbuttonEmulateCallback =
7054 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
7055unsafe extern "C" {
7056 #[doc = "Start emulation timer\n # Arguments\n\n* `period` - timer period\n * `callback` - timer callback\n * `context` - callback context"]
7057 pub fn furi_hal_ibutton_emulate_start(
7058 period: u32,
7059 callback: FuriHalIbuttonEmulateCallback,
7060 context: *mut core::ffi::c_void,
7061 );
7062}
7063unsafe extern "C" {
7064 #[doc = "Update emulation timer period\n # Arguments\n\n* `period` - new timer period"]
7065 pub fn furi_hal_ibutton_emulate_set_next(period: u32);
7066}
7067unsafe extern "C" {
7068 #[doc = "Stop emulation timer"]
7069 pub fn furi_hal_ibutton_emulate_stop();
7070}
7071unsafe extern "C" {
7072 #[doc = "Set the pin to normal mode (open collector), and sets it to float"]
7073 pub fn furi_hal_ibutton_pin_configure();
7074}
7075unsafe extern "C" {
7076 #[doc = "Sets the pin to analog mode, and sets it to float"]
7077 pub fn furi_hal_ibutton_pin_reset();
7078}
7079unsafe extern "C" {
7080 #[doc = "iButton write pin\n # Arguments\n\n* `state` - true / false"]
7081 pub fn furi_hal_ibutton_pin_write(state: bool);
7082}
7083unsafe extern "C" {
7084 #[doc = "Config rfid pins to reset state"]
7085 pub fn furi_hal_rfid_pins_reset();
7086}
7087unsafe extern "C" {
7088 #[doc = "Release rfid pull pin"]
7089 pub fn furi_hal_rfid_pin_pull_release();
7090}
7091unsafe extern "C" {
7092 #[doc = "Pulldown rfid pull pin"]
7093 pub fn furi_hal_rfid_pin_pull_pulldown();
7094}
7095unsafe extern "C" {
7096 #[doc = "Start read timer\n # Arguments\n\n* `freq` - timer frequency\n * `duty_cycle` - timer duty cycle, 0.0-1.0"]
7097 pub fn furi_hal_rfid_tim_read_start(freq: f32, duty_cycle: f32);
7098}
7099unsafe extern "C" {
7100 #[doc = "Pause read timer, to be able to continue later"]
7101 pub fn furi_hal_rfid_tim_read_pause();
7102}
7103unsafe extern "C" {
7104 #[doc = "Continue read timer"]
7105 pub fn furi_hal_rfid_tim_read_continue();
7106}
7107unsafe extern "C" {
7108 #[doc = "Stop read timer"]
7109 pub fn furi_hal_rfid_tim_read_stop();
7110}
7111pub type FuriHalRfidReadCaptureCallback = ::core::option::Option<
7112 unsafe extern "C" fn(level: bool, duration: u32, context: *mut core::ffi::c_void),
7113>;
7114unsafe extern "C" {
7115 pub fn furi_hal_rfid_tim_read_capture_start(
7116 callback: FuriHalRfidReadCaptureCallback,
7117 context: *mut core::ffi::c_void,
7118 );
7119}
7120unsafe extern "C" {
7121 pub fn furi_hal_rfid_tim_read_capture_stop();
7122}
7123pub type FuriHalRfidDMACallback =
7124 ::core::option::Option<unsafe extern "C" fn(half: bool, context: *mut core::ffi::c_void)>;
7125unsafe extern "C" {
7126 pub fn furi_hal_rfid_tim_emulate_dma_start(
7127 duration: *mut u32,
7128 pulse: *mut u32,
7129 length: usize,
7130 callback: FuriHalRfidDMACallback,
7131 context: *mut core::ffi::c_void,
7132 );
7133}
7134unsafe extern "C" {
7135 pub fn furi_hal_rfid_tim_emulate_dma_stop();
7136}
7137unsafe extern "C" {
7138 #[doc = "Set read timer period\n\n # Arguments\n\n* `period` - overall duration"]
7139 pub fn furi_hal_rfid_set_read_period(period: u32);
7140}
7141unsafe extern "C" {
7142 #[doc = "Set read timer pulse\n\n # Arguments\n\n* `pulse` - duration of high level"]
7143 pub fn furi_hal_rfid_set_read_pulse(pulse: u32);
7144}
7145unsafe extern "C" {
7146 #[doc = "Start/Enable comparator"]
7147 pub fn furi_hal_rfid_comp_start();
7148}
7149unsafe extern "C" {
7150 #[doc = "Stop/Disable comparator"]
7151 pub fn furi_hal_rfid_comp_stop();
7152}
7153pub type FuriHalRfidCompCallback =
7154 ::core::option::Option<unsafe extern "C" fn(level: bool, context: *mut core::ffi::c_void)>;
7155unsafe extern "C" {
7156 #[doc = "Set comparator callback"]
7157 pub fn furi_hal_rfid_comp_set_callback(
7158 callback: FuriHalRfidCompCallback,
7159 context: *mut core::ffi::c_void,
7160 );
7161}
7162unsafe extern "C" {
7163 #[doc = "Start/Enable Field Presence detect"]
7164 pub fn furi_hal_rfid_field_detect_start();
7165}
7166unsafe extern "C" {
7167 #[doc = "Stop/Disable Field Presence detect"]
7168 pub fn furi_hal_rfid_field_detect_stop();
7169}
7170unsafe extern "C" {
7171 #[doc = "Check Field Presence\n\n # Arguments\n\n* `frequency` (direction out) - pointer to frequency value to be set if filed detected\n\n # Returns\n\ntrue if field is present, false if not"]
7172 pub fn furi_hal_rfid_field_is_present(frequency: *mut u32) -> bool;
7173}
7174#[doc = "< Oscillator has been started."]
7175pub const FuriHalNfcEventOscOn: FuriHalNfcEvent = FuriHalNfcEvent(1);
7176#[doc = "< External field (carrier) has been detected."]
7177pub const FuriHalNfcEventFieldOn: FuriHalNfcEvent = FuriHalNfcEvent(2);
7178#[doc = "< External field (carrier) has been lost."]
7179pub const FuriHalNfcEventFieldOff: FuriHalNfcEvent = FuriHalNfcEvent(4);
7180#[doc = "< Reader has issued a wake-up command."]
7181pub const FuriHalNfcEventListenerActive: FuriHalNfcEvent = FuriHalNfcEvent(8);
7182#[doc = "< Transmission has started."]
7183pub const FuriHalNfcEventTxStart: FuriHalNfcEvent = FuriHalNfcEvent(16);
7184#[doc = "< Transmission has ended."]
7185pub const FuriHalNfcEventTxEnd: FuriHalNfcEvent = FuriHalNfcEvent(32);
7186#[doc = "< Reception has started."]
7187pub const FuriHalNfcEventRxStart: FuriHalNfcEvent = FuriHalNfcEvent(64);
7188#[doc = "< Reception has ended."]
7189pub const FuriHalNfcEventRxEnd: FuriHalNfcEvent = FuriHalNfcEvent(128);
7190#[doc = "< A collision has occurred."]
7191pub const FuriHalNfcEventCollision: FuriHalNfcEvent = FuriHalNfcEvent(256);
7192#[doc = "< Frame wait timer has expired."]
7193pub const FuriHalNfcEventTimerFwtExpired: FuriHalNfcEvent = FuriHalNfcEvent(512);
7194#[doc = "< Transmission block timer has expired."]
7195pub const FuriHalNfcEventTimerBlockTxExpired: FuriHalNfcEvent = FuriHalNfcEvent(1024);
7196pub const FuriHalNfcEventTimeout: FuriHalNfcEvent = FuriHalNfcEvent(2048);
7197pub const FuriHalNfcEventAbortRequest: FuriHalNfcEvent = FuriHalNfcEvent(4096);
7198#[repr(transparent)]
7199#[doc = "Enumeration of possible NFC HAL events."]
7200#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7201pub struct FuriHalNfcEvent(pub core::ffi::c_ushort);
7202#[doc = "< No error has occurred."]
7203pub const FuriHalNfcErrorNone: FuriHalNfcError = FuriHalNfcError(0);
7204#[doc = "< The communication bus is busy."]
7205pub const FuriHalNfcErrorBusy: FuriHalNfcError = FuriHalNfcError(1);
7206#[doc = "< NFC hardware did not respond or responded unexpectedly."]
7207pub const FuriHalNfcErrorCommunication: FuriHalNfcError = FuriHalNfcError(2);
7208#[doc = "< Oscillator failed to start."]
7209pub const FuriHalNfcErrorOscillator: FuriHalNfcError = FuriHalNfcError(3);
7210#[doc = "< NFC hardware did not respond in time."]
7211pub const FuriHalNfcErrorCommunicationTimeout: FuriHalNfcError = FuriHalNfcError(4);
7212#[doc = "< Receive buffer was too small for the received data."]
7213pub const FuriHalNfcErrorBufferOverflow: FuriHalNfcError = FuriHalNfcError(5);
7214#[doc = "< Not enough data was received to parse a valid frame."]
7215pub const FuriHalNfcErrorIncompleteFrame: FuriHalNfcError = FuriHalNfcError(6);
7216#[doc = "< Cannot parse a frame due to unexpected/invalid data."]
7217pub const FuriHalNfcErrorDataFormat: FuriHalNfcError = FuriHalNfcError(7);
7218#[repr(transparent)]
7219#[doc = "Enumeration of possible NFC HAL errors."]
7220#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7221pub struct FuriHalNfcError(pub core::ffi::c_uchar);
7222#[doc = "< Configure NFC HAL to operate as a poller."]
7223pub const FuriHalNfcModePoller: FuriHalNfcMode = FuriHalNfcMode(0);
7224#[doc = "< Configure NFC HAL to operate as a listener."]
7225pub const FuriHalNfcModeListener: FuriHalNfcMode = FuriHalNfcMode(1);
7226#[doc = "< Special value equal to the operating modes count. Internal use."]
7227pub const FuriHalNfcModeNum: FuriHalNfcMode = FuriHalNfcMode(2);
7228#[repr(transparent)]
7229#[doc = "Enumeration of possible NFC HAL operating modes."]
7230#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7231pub struct FuriHalNfcMode(pub core::ffi::c_uchar);
7232#[doc = "< Configure NFC HAL to use the ISO14443 (type A) technology."]
7233pub const FuriHalNfcTechIso14443a: FuriHalNfcTech = FuriHalNfcTech(0);
7234#[doc = "< Configure NFC HAL to use the ISO14443 (type B) technology."]
7235pub const FuriHalNfcTechIso14443b: FuriHalNfcTech = FuriHalNfcTech(1);
7236#[doc = "< Configure NFC HAL to use the ISO15693 technology."]
7237pub const FuriHalNfcTechIso15693: FuriHalNfcTech = FuriHalNfcTech(2);
7238#[doc = "< Configure NFC HAL to use the FeliCa technology."]
7239pub const FuriHalNfcTechFelica: FuriHalNfcTech = FuriHalNfcTech(3);
7240#[doc = "< Special value equal to the supported technologies count. Internal use."]
7241pub const FuriHalNfcTechNum: FuriHalNfcTech = FuriHalNfcTech(4);
7242#[doc = "< Special value indicating the unconfigured state. Internal use."]
7243pub const FuriHalNfcTechInvalid: FuriHalNfcTech = FuriHalNfcTech(5);
7244#[repr(transparent)]
7245#[doc = "Enumeration of supported NFC technologies."]
7246#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7247pub struct FuriHalNfcTech(pub core::ffi::c_uchar);
7248unsafe extern "C" {
7249 #[doc = "Initialise the NFC HAL and associated hardware.\n\n This function is called automatically during the firmware initialisation,\n so there is no need to call it explicitly.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7250 pub fn furi_hal_nfc_init() -> FuriHalNfcError;
7251}
7252unsafe extern "C" {
7253 #[doc = "Check whether the NFC HAL was properly initialised and is ready.\n\n # Returns\n\nFuriHalNfcErrorNone if ready, any other error code if not ready."]
7254 pub fn furi_hal_nfc_is_hal_ready() -> FuriHalNfcError;
7255}
7256unsafe extern "C" {
7257 #[doc = "Exclusively take over the NFC HAL and associated hardware.\n\n This function needs to be called whenever an interaction with the NFC HAL\n is to take place (usually once upon the application start).\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7258 pub fn furi_hal_nfc_acquire() -> FuriHalNfcError;
7259}
7260unsafe extern "C" {
7261 #[doc = "Release the exclusive lock and make the NFC HAL available for others.\n\n This function needs to be called when the user code is done working\n with the NFC HAL (usually once upon application exit). It must be called\n from the same thread that has called furi_hal_nfc_acquire().\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7262 pub fn furi_hal_nfc_release() -> FuriHalNfcError;
7263}
7264unsafe extern "C" {
7265 #[doc = "Configure the NFC hardware to enter the low-power mode.\n\n This function must be called each time when the user code is done working\n with the NFC HAL for the time being (e.g. waiting on user input).\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7266 pub fn furi_hal_nfc_low_power_mode_start() -> FuriHalNfcError;
7267}
7268unsafe extern "C" {
7269 #[doc = "Configure the NFC hardware to exit the low-power mode.\n\n This function must be called each time when the user code begins working\n with the NFC HAL, as the default state is low-power mode.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7270 pub fn furi_hal_nfc_low_power_mode_stop() -> FuriHalNfcError;
7271}
7272unsafe extern "C" {
7273 #[doc = "Configure the NFC HAL to work in a particular mode.\n\n Not all technologies implement the listener operating mode.\n\n # Arguments\n\n* `mode` (direction in) - required operating mode.\n * `tech` (direction in) - required technology configuration.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7274 pub fn furi_hal_nfc_set_mode(mode: FuriHalNfcMode, tech: FuriHalNfcTech) -> FuriHalNfcError;
7275}
7276unsafe extern "C" {
7277 #[doc = "Reset the NFC HAL to its default (unconfigured) state.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7278 pub fn furi_hal_nfc_reset_mode() -> FuriHalNfcError;
7279}
7280unsafe extern "C" {
7281 #[doc = "Enable field (carrier) detection by the NFC hardware.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7282 pub fn furi_hal_nfc_field_detect_start() -> FuriHalNfcError;
7283}
7284unsafe extern "C" {
7285 #[doc = "Disable field (carrier) detection by the NFC hardware.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7286 pub fn furi_hal_nfc_field_detect_stop() -> FuriHalNfcError;
7287}
7288unsafe extern "C" {
7289 #[doc = "Check if the reader field (carrier) was detected by the NFC hardware.\n\n # Returns\n\ntrue if the field was detected, false otherwise."]
7290 pub fn furi_hal_nfc_field_is_present() -> bool;
7291}
7292unsafe extern "C" {
7293 #[doc = "Enable field (carrier) generation by the NFC hardware.\n\n No carrier modulation will occur unless a transmission is explicitly started.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7294 pub fn furi_hal_nfc_poller_field_on() -> FuriHalNfcError;
7295}
7296unsafe extern "C" {
7297 #[doc = "Wait for an NFC HAL event in poller mode.\n\n # Arguments\n\n* `timeout_ms` (direction in) - time to wait (timeout) in milliseconds.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7298 pub fn furi_hal_nfc_poller_wait_event(timeout_ms: u32) -> FuriHalNfcEvent;
7299}
7300unsafe extern "C" {
7301 #[doc = "Wait for an NFC HAL event in listener mode.\n # Arguments\n\n* `timeout_ms` (direction in) - time to wait (timeout) in milliseconds.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7302 pub fn furi_hal_nfc_listener_wait_event(timeout_ms: u32) -> FuriHalNfcEvent;
7303}
7304unsafe extern "C" {
7305 #[doc = "Transmit data in poller mode.\n\n # Arguments\n\n* `tx_data` (direction in) - pointer to a byte array containing the data to be transmitted.\n * `tx_bits` (direction in) - transmit data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7306 pub fn furi_hal_nfc_poller_tx(tx_data: *const u8, tx_bits: usize) -> FuriHalNfcError;
7307}
7308unsafe extern "C" {
7309 #[doc = "Receive data in poller mode.\n\n The receive buffer must be big enough to accomodate all of the expected data.\n\n # Arguments\n\n* `rx_data` (direction out) - pointer to a byte array to be filled with received data.\n * `rx_data_size` (direction in) - maximum received data size, in bytes.\n * `rx_bits` (direction out) - pointer to the variable to hold received data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7310 pub fn furi_hal_nfc_poller_rx(
7311 rx_data: *mut u8,
7312 rx_data_size: usize,
7313 rx_bits: *mut usize,
7314 ) -> FuriHalNfcError;
7315}
7316unsafe extern "C" {
7317 #[doc = "Transmit data in listener mode.\n\n # Arguments\n\n* `tx_data` (direction in) - pointer to a byte array containing the data to be transmitted.\n * `tx_bits` (direction in) - transmit data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7318 pub fn furi_hal_nfc_listener_tx(tx_data: *const u8, tx_bits: usize) -> FuriHalNfcError;
7319}
7320unsafe extern "C" {
7321 #[doc = "Receive data in listener mode.\n\n The receive buffer must be big enough to accomodate all of the expected data.\n\n # Arguments\n\n* `rx_data` (direction out) - pointer to a byte array to be filled with received data.\n * `rx_data_size` (direction in) - maximum received data size, in bytes.\n * `rx_bits` (direction out) - pointer to the variable to hold received data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7322 pub fn furi_hal_nfc_listener_rx(
7323 rx_data: *mut u8,
7324 rx_data_size: usize,
7325 rx_bits: *mut usize,
7326 ) -> FuriHalNfcError;
7327}
7328unsafe extern "C" {
7329 #[doc = "Go to sleep in listener mode.\n\n Puts the passive target logic into Sleep (Halt) state.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7330 pub fn furi_hal_nfc_listener_sleep() -> FuriHalNfcError;
7331}
7332unsafe extern "C" {
7333 #[doc = "Go to idle in listener mode.\n\n Puts the passive target logic into Sense (Idle) state.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7334 pub fn furi_hal_nfc_listener_idle() -> FuriHalNfcError;
7335}
7336unsafe extern "C" {
7337 #[doc = "Enable reception in listener mode.\n\n Starts hardware receivers and receive decoders.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7338 pub fn furi_hal_nfc_listener_enable_rx() -> FuriHalNfcError;
7339}
7340unsafe extern "C" {
7341 #[doc = "Reset communication.\n\n Resets the communication state and stops all activities: transmission, reception, etc.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7342 pub fn furi_hal_nfc_trx_reset() -> FuriHalNfcError;
7343}
7344unsafe extern "C" {
7345 #[doc = "Enable generation of NFC HAL events.\n\n This function must be called from the same thread from which\n the the furi_hal_nfc_*_wait_event() calls will be made.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7346 pub fn furi_hal_nfc_event_start() -> FuriHalNfcError;
7347}
7348unsafe extern "C" {
7349 #[doc = "Disable generation of NFC HAL events.\n\n Unlike furi_hal_nfc_event_start(), this function may be called from any thread.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7350 pub fn furi_hal_nfc_event_stop() -> FuriHalNfcError;
7351}
7352unsafe extern "C" {
7353 #[doc = "Manually emit the FuriHalNfcEventAbortRequest event.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7354 pub fn furi_hal_nfc_abort() -> FuriHalNfcError;
7355}
7356unsafe extern "C" {
7357 #[doc = "Start frame wait timeout timer.\n\n # Arguments\n\n* `time_fc` (direction in) - time to wait, in carrier cycles."]
7358 pub fn furi_hal_nfc_timer_fwt_start(time_fc: u32);
7359}
7360unsafe extern "C" {
7361 #[doc = "Stop frame wait timeout timer."]
7362 pub fn furi_hal_nfc_timer_fwt_stop();
7363}
7364unsafe extern "C" {
7365 #[doc = "Start block transmit (frame delay) timer.\n\n # Arguments\n\n* `time_fc` (direction in) - time to wait, in carrier cycles."]
7366 pub fn furi_hal_nfc_timer_block_tx_start(time_fc: u32);
7367}
7368unsafe extern "C" {
7369 #[doc = "Start block transmit (frame delay) timer.\n\n # Arguments\n\n* `time_us` (direction in) - time to wait, in microseconds."]
7370 pub fn furi_hal_nfc_timer_block_tx_start_us(time_us: u32);
7371}
7372unsafe extern "C" {
7373 #[doc = "Stop block transmit (frame delay) timer."]
7374 pub fn furi_hal_nfc_timer_block_tx_stop();
7375}
7376unsafe extern "C" {
7377 #[doc = "Check whether block transmit (frame delay) timer is running.\n\n # Returns\n\ntrue if timer is running, false otherwise."]
7378 pub fn furi_hal_nfc_timer_block_tx_is_running() -> bool;
7379}
7380pub const FuriHalNfcaShortFrameAllReq: FuriHalNfcaShortFrame = FuriHalNfcaShortFrame(0);
7381pub const FuriHalNfcaShortFrameSensReq: FuriHalNfcaShortFrame = FuriHalNfcaShortFrame(1);
7382#[repr(transparent)]
7383#[doc = "Enumeration of ISO14443 (Type A) short frame types."]
7384#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7385pub struct FuriHalNfcaShortFrame(pub core::ffi::c_uchar);
7386unsafe extern "C" {
7387 #[doc = "Transmit ISO14443 (Type A) short frame in poller mode.\n\n # Arguments\n\n* `frame` (direction in) - short frame type to be transmitted.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7388 pub fn furi_hal_nfc_iso14443a_poller_trx_short_frame(
7389 frame: FuriHalNfcaShortFrame,
7390 ) -> FuriHalNfcError;
7391}
7392unsafe extern "C" {
7393 #[doc = "Transmit ISO14443 (Type A) SDD frame in poller mode.\n\n # Arguments\n\n* `tx_data` (direction in) - pointer to a byte array containing the data to be transmitted.\n * `tx_bits` (direction in) - transmit data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7394 pub fn furi_hal_nfc_iso14443a_tx_sdd_frame(
7395 tx_data: *const u8,
7396 tx_bits: usize,
7397 ) -> FuriHalNfcError;
7398}
7399unsafe extern "C" {
7400 #[doc = "Receive ISO14443 (Type A) SDD frame in poller mode.\n\n The receive buffer must be big enough to accomodate all of the expected data.\n\n # Arguments\n\n* `rx_data` (direction in) - pointer to a byte array to be filled with received data.\n * `rx_data_size` (direction in) - maximum received data size, in bytes.\n * `rx_bits` (direction in) - pointer to the variable to hold received data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7401 pub fn furi_hal_nfc_iso14443a_rx_sdd_frame(
7402 rx_data: *mut u8,
7403 rx_data_size: usize,
7404 rx_bits: *mut usize,
7405 ) -> FuriHalNfcError;
7406}
7407unsafe extern "C" {
7408 #[doc = "Transmit ISO14443 (Type A) frame with custom parity bits in poller mode.\n\n Same as furi_hal_nfc_poller_tx(), but uses the parity bits provided\n by the user code instead of calculating them automatically.\n\n # Arguments\n\n* `tx_data` (direction in) - pointer to a byte array containing the data to be transmitted.\n * `tx_bits` (direction in) - transmit data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7409 pub fn furi_hal_nfc_iso14443a_poller_tx_custom_parity(
7410 tx_data: *const u8,
7411 tx_bits: usize,
7412 ) -> FuriHalNfcError;
7413}
7414unsafe extern "C" {
7415 #[doc = "Set ISO14443 (Type A) collision resolution parameters in listener mode.\n\n Configures the NFC hardware for automatic collision resolution.\n\n # Arguments\n\n* `uid` (direction in) - pointer to a byte array containing the UID.\n * `uid_len` (direction in) - UID length in bytes (must be supported by the protocol).\n * `atqa` (direction in) - ATQA byte value.\n * `sak` (direction in) - SAK byte value.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7416 pub fn furi_hal_nfc_iso14443a_listener_set_col_res_data(
7417 uid: *mut u8,
7418 uid_len: u8,
7419 atqa: *mut u8,
7420 sak: u8,
7421 ) -> FuriHalNfcError;
7422}
7423unsafe extern "C" {
7424 #[doc = "Transmit ISO14443 (Type A) frame with custom parity bits in listener mode.\n\n # Arguments\n\n* `tx_data` (direction in) - pointer to a byte array containing the data to be transmitted.\n * `tx_parity` (direction in) - pointer to a (bit-packed) byte array containing the parity to be transmitted.\n * `tx_bits` (direction in) - transmit data size, in bits.\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7425 pub fn furi_hal_nfc_iso14443a_listener_tx_custom_parity(
7426 tx_data: *const u8,
7427 tx_parity: *const u8,
7428 tx_bits: usize,
7429 ) -> FuriHalNfcError;
7430}
7431unsafe extern "C" {
7432 #[doc = "Send ISO15693 SOF in listener mode\n\n # Returns\n\nFuriHalNfcError"]
7433 pub fn furi_hal_nfc_iso15693_listener_tx_sof() -> FuriHalNfcError;
7434}
7435unsafe extern "C" {
7436 #[doc = "Set FeliCa collision resolution parameters in listener mode.\n\n Configures the NFC hardware for automatic collision resolution.\n\n # Arguments\n\n* `idm` (direction in) - pointer to a byte array containing the IDm.\n * `idm_len` (direction in) - IDm length in bytes.\n * `pmm` (direction in) - pointer to a byte array containing the PMm.\n * `pmm_len` (direction in) - PMm length in bytes.\n * `sys_code` (direction in) - System code from SYS_C block\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
7437 pub fn furi_hal_nfc_felica_listener_set_sensf_res_data(
7438 idm: *const u8,
7439 idm_len: u8,
7440 pmm: *const u8,
7441 pmm_len: u8,
7442 sys_code: u16,
7443 ) -> FuriHalNfcError;
7444}
7445unsafe extern "C" {
7446 #[doc = "Jump to the void*\n\n Allow your code to transfer control to another firmware.\n\n This code doesn't reset system before jump. Call it only from\n main thread, no kernel should be running. Ensure that no\n peripheral blocks active and no interrupts are pending.\n\n # Arguments\n\n* `address` - The System Vector address(start of your new firmware)"]
7447 pub fn furi_hal_switch(address: *mut core::ffi::c_void);
7448}
7449pub type Elf32_Half = u16;
7450pub type Elf64_Half = u16;
7451pub type Elf32_Word = u32;
7452pub type Elf32_Sword = i32;
7453pub type Elf64_Word = u32;
7454pub type Elf64_Sword = i32;
7455pub type Elf32_Xword = u64;
7456pub type Elf32_Sxword = i64;
7457pub type Elf64_Xword = u64;
7458pub type Elf64_Sxword = i64;
7459pub type Elf32_Addr = u32;
7460pub type Elf64_Addr = u64;
7461pub type Elf32_Off = u32;
7462pub type Elf64_Off = u64;
7463pub type Elf32_Section = u16;
7464pub type Elf64_Section = u16;
7465pub type Elf32_Versym = Elf32_Half;
7466pub type Elf64_Versym = Elf64_Half;
7467#[repr(C)]
7468#[derive(Debug, Copy, Clone)]
7469pub struct Elf32_Ehdr {
7470 pub e_ident: [core::ffi::c_uchar; 16usize],
7471 pub e_type: Elf32_Half,
7472 pub e_machine: Elf32_Half,
7473 pub e_version: Elf32_Word,
7474 pub e_entry: Elf32_Addr,
7475 pub e_phoff: Elf32_Off,
7476 pub e_shoff: Elf32_Off,
7477 pub e_flags: Elf32_Word,
7478 pub e_ehsize: Elf32_Half,
7479 pub e_phentsize: Elf32_Half,
7480 pub e_phnum: Elf32_Half,
7481 pub e_shentsize: Elf32_Half,
7482 pub e_shnum: Elf32_Half,
7483 pub e_shstrndx: Elf32_Half,
7484}
7485#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7486const _: () = {
7487 ["Size of Elf32_Ehdr"][::core::mem::size_of::<Elf32_Ehdr>() - 52usize];
7488 ["Alignment of Elf32_Ehdr"][::core::mem::align_of::<Elf32_Ehdr>() - 4usize];
7489 ["Offset of field: Elf32_Ehdr::e_ident"][::core::mem::offset_of!(Elf32_Ehdr, e_ident) - 0usize];
7490 ["Offset of field: Elf32_Ehdr::e_type"][::core::mem::offset_of!(Elf32_Ehdr, e_type) - 16usize];
7491 ["Offset of field: Elf32_Ehdr::e_machine"]
7492 [::core::mem::offset_of!(Elf32_Ehdr, e_machine) - 18usize];
7493 ["Offset of field: Elf32_Ehdr::e_version"]
7494 [::core::mem::offset_of!(Elf32_Ehdr, e_version) - 20usize];
7495 ["Offset of field: Elf32_Ehdr::e_entry"]
7496 [::core::mem::offset_of!(Elf32_Ehdr, e_entry) - 24usize];
7497 ["Offset of field: Elf32_Ehdr::e_phoff"]
7498 [::core::mem::offset_of!(Elf32_Ehdr, e_phoff) - 28usize];
7499 ["Offset of field: Elf32_Ehdr::e_shoff"]
7500 [::core::mem::offset_of!(Elf32_Ehdr, e_shoff) - 32usize];
7501 ["Offset of field: Elf32_Ehdr::e_flags"]
7502 [::core::mem::offset_of!(Elf32_Ehdr, e_flags) - 36usize];
7503 ["Offset of field: Elf32_Ehdr::e_ehsize"]
7504 [::core::mem::offset_of!(Elf32_Ehdr, e_ehsize) - 40usize];
7505 ["Offset of field: Elf32_Ehdr::e_phentsize"]
7506 [::core::mem::offset_of!(Elf32_Ehdr, e_phentsize) - 42usize];
7507 ["Offset of field: Elf32_Ehdr::e_phnum"]
7508 [::core::mem::offset_of!(Elf32_Ehdr, e_phnum) - 44usize];
7509 ["Offset of field: Elf32_Ehdr::e_shentsize"]
7510 [::core::mem::offset_of!(Elf32_Ehdr, e_shentsize) - 46usize];
7511 ["Offset of field: Elf32_Ehdr::e_shnum"]
7512 [::core::mem::offset_of!(Elf32_Ehdr, e_shnum) - 48usize];
7513 ["Offset of field: Elf32_Ehdr::e_shstrndx"]
7514 [::core::mem::offset_of!(Elf32_Ehdr, e_shstrndx) - 50usize];
7515};
7516#[repr(C)]
7517#[derive(Debug, Copy, Clone)]
7518pub struct Elf64_Ehdr {
7519 pub e_ident: [core::ffi::c_uchar; 16usize],
7520 pub e_type: Elf64_Half,
7521 pub e_machine: Elf64_Half,
7522 pub e_version: Elf64_Word,
7523 pub e_entry: Elf64_Addr,
7524 pub e_phoff: Elf64_Off,
7525 pub e_shoff: Elf64_Off,
7526 pub e_flags: Elf64_Word,
7527 pub e_ehsize: Elf64_Half,
7528 pub e_phentsize: Elf64_Half,
7529 pub e_phnum: Elf64_Half,
7530 pub e_shentsize: Elf64_Half,
7531 pub e_shnum: Elf64_Half,
7532 pub e_shstrndx: Elf64_Half,
7533}
7534#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7535const _: () = {
7536 ["Size of Elf64_Ehdr"][::core::mem::size_of::<Elf64_Ehdr>() - 64usize];
7537 ["Alignment of Elf64_Ehdr"][::core::mem::align_of::<Elf64_Ehdr>() - 8usize];
7538 ["Offset of field: Elf64_Ehdr::e_ident"][::core::mem::offset_of!(Elf64_Ehdr, e_ident) - 0usize];
7539 ["Offset of field: Elf64_Ehdr::e_type"][::core::mem::offset_of!(Elf64_Ehdr, e_type) - 16usize];
7540 ["Offset of field: Elf64_Ehdr::e_machine"]
7541 [::core::mem::offset_of!(Elf64_Ehdr, e_machine) - 18usize];
7542 ["Offset of field: Elf64_Ehdr::e_version"]
7543 [::core::mem::offset_of!(Elf64_Ehdr, e_version) - 20usize];
7544 ["Offset of field: Elf64_Ehdr::e_entry"]
7545 [::core::mem::offset_of!(Elf64_Ehdr, e_entry) - 24usize];
7546 ["Offset of field: Elf64_Ehdr::e_phoff"]
7547 [::core::mem::offset_of!(Elf64_Ehdr, e_phoff) - 32usize];
7548 ["Offset of field: Elf64_Ehdr::e_shoff"]
7549 [::core::mem::offset_of!(Elf64_Ehdr, e_shoff) - 40usize];
7550 ["Offset of field: Elf64_Ehdr::e_flags"]
7551 [::core::mem::offset_of!(Elf64_Ehdr, e_flags) - 48usize];
7552 ["Offset of field: Elf64_Ehdr::e_ehsize"]
7553 [::core::mem::offset_of!(Elf64_Ehdr, e_ehsize) - 52usize];
7554 ["Offset of field: Elf64_Ehdr::e_phentsize"]
7555 [::core::mem::offset_of!(Elf64_Ehdr, e_phentsize) - 54usize];
7556 ["Offset of field: Elf64_Ehdr::e_phnum"]
7557 [::core::mem::offset_of!(Elf64_Ehdr, e_phnum) - 56usize];
7558 ["Offset of field: Elf64_Ehdr::e_shentsize"]
7559 [::core::mem::offset_of!(Elf64_Ehdr, e_shentsize) - 58usize];
7560 ["Offset of field: Elf64_Ehdr::e_shnum"]
7561 [::core::mem::offset_of!(Elf64_Ehdr, e_shnum) - 60usize];
7562 ["Offset of field: Elf64_Ehdr::e_shstrndx"]
7563 [::core::mem::offset_of!(Elf64_Ehdr, e_shstrndx) - 62usize];
7564};
7565#[repr(C)]
7566#[derive(Debug, Copy, Clone)]
7567pub struct Elf32_Shdr {
7568 pub sh_name: Elf32_Word,
7569 pub sh_type: Elf32_Word,
7570 pub sh_flags: Elf32_Word,
7571 pub sh_addr: Elf32_Addr,
7572 pub sh_offset: Elf32_Off,
7573 pub sh_size: Elf32_Word,
7574 pub sh_link: Elf32_Word,
7575 pub sh_info: Elf32_Word,
7576 pub sh_addralign: Elf32_Word,
7577 pub sh_entsize: Elf32_Word,
7578}
7579#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7580const _: () = {
7581 ["Size of Elf32_Shdr"][::core::mem::size_of::<Elf32_Shdr>() - 40usize];
7582 ["Alignment of Elf32_Shdr"][::core::mem::align_of::<Elf32_Shdr>() - 4usize];
7583 ["Offset of field: Elf32_Shdr::sh_name"][::core::mem::offset_of!(Elf32_Shdr, sh_name) - 0usize];
7584 ["Offset of field: Elf32_Shdr::sh_type"][::core::mem::offset_of!(Elf32_Shdr, sh_type) - 4usize];
7585 ["Offset of field: Elf32_Shdr::sh_flags"]
7586 [::core::mem::offset_of!(Elf32_Shdr, sh_flags) - 8usize];
7587 ["Offset of field: Elf32_Shdr::sh_addr"]
7588 [::core::mem::offset_of!(Elf32_Shdr, sh_addr) - 12usize];
7589 ["Offset of field: Elf32_Shdr::sh_offset"]
7590 [::core::mem::offset_of!(Elf32_Shdr, sh_offset) - 16usize];
7591 ["Offset of field: Elf32_Shdr::sh_size"]
7592 [::core::mem::offset_of!(Elf32_Shdr, sh_size) - 20usize];
7593 ["Offset of field: Elf32_Shdr::sh_link"]
7594 [::core::mem::offset_of!(Elf32_Shdr, sh_link) - 24usize];
7595 ["Offset of field: Elf32_Shdr::sh_info"]
7596 [::core::mem::offset_of!(Elf32_Shdr, sh_info) - 28usize];
7597 ["Offset of field: Elf32_Shdr::sh_addralign"]
7598 [::core::mem::offset_of!(Elf32_Shdr, sh_addralign) - 32usize];
7599 ["Offset of field: Elf32_Shdr::sh_entsize"]
7600 [::core::mem::offset_of!(Elf32_Shdr, sh_entsize) - 36usize];
7601};
7602#[repr(C)]
7603#[derive(Debug, Copy, Clone)]
7604pub struct Elf64_Shdr {
7605 pub sh_name: Elf64_Word,
7606 pub sh_type: Elf64_Word,
7607 pub sh_flags: Elf64_Xword,
7608 pub sh_addr: Elf64_Addr,
7609 pub sh_offset: Elf64_Off,
7610 pub sh_size: Elf64_Xword,
7611 pub sh_link: Elf64_Word,
7612 pub sh_info: Elf64_Word,
7613 pub sh_addralign: Elf64_Xword,
7614 pub sh_entsize: Elf64_Xword,
7615}
7616#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7617const _: () = {
7618 ["Size of Elf64_Shdr"][::core::mem::size_of::<Elf64_Shdr>() - 64usize];
7619 ["Alignment of Elf64_Shdr"][::core::mem::align_of::<Elf64_Shdr>() - 8usize];
7620 ["Offset of field: Elf64_Shdr::sh_name"][::core::mem::offset_of!(Elf64_Shdr, sh_name) - 0usize];
7621 ["Offset of field: Elf64_Shdr::sh_type"][::core::mem::offset_of!(Elf64_Shdr, sh_type) - 4usize];
7622 ["Offset of field: Elf64_Shdr::sh_flags"]
7623 [::core::mem::offset_of!(Elf64_Shdr, sh_flags) - 8usize];
7624 ["Offset of field: Elf64_Shdr::sh_addr"]
7625 [::core::mem::offset_of!(Elf64_Shdr, sh_addr) - 16usize];
7626 ["Offset of field: Elf64_Shdr::sh_offset"]
7627 [::core::mem::offset_of!(Elf64_Shdr, sh_offset) - 24usize];
7628 ["Offset of field: Elf64_Shdr::sh_size"]
7629 [::core::mem::offset_of!(Elf64_Shdr, sh_size) - 32usize];
7630 ["Offset of field: Elf64_Shdr::sh_link"]
7631 [::core::mem::offset_of!(Elf64_Shdr, sh_link) - 40usize];
7632 ["Offset of field: Elf64_Shdr::sh_info"]
7633 [::core::mem::offset_of!(Elf64_Shdr, sh_info) - 44usize];
7634 ["Offset of field: Elf64_Shdr::sh_addralign"]
7635 [::core::mem::offset_of!(Elf64_Shdr, sh_addralign) - 48usize];
7636 ["Offset of field: Elf64_Shdr::sh_entsize"]
7637 [::core::mem::offset_of!(Elf64_Shdr, sh_entsize) - 56usize];
7638};
7639#[repr(C)]
7640#[derive(Debug, Copy, Clone)]
7641pub struct Elf32_Chdr {
7642 pub ch_type: Elf32_Word,
7643 pub ch_size: Elf32_Word,
7644 pub ch_addralign: Elf32_Word,
7645}
7646#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7647const _: () = {
7648 ["Size of Elf32_Chdr"][::core::mem::size_of::<Elf32_Chdr>() - 12usize];
7649 ["Alignment of Elf32_Chdr"][::core::mem::align_of::<Elf32_Chdr>() - 4usize];
7650 ["Offset of field: Elf32_Chdr::ch_type"][::core::mem::offset_of!(Elf32_Chdr, ch_type) - 0usize];
7651 ["Offset of field: Elf32_Chdr::ch_size"][::core::mem::offset_of!(Elf32_Chdr, ch_size) - 4usize];
7652 ["Offset of field: Elf32_Chdr::ch_addralign"]
7653 [::core::mem::offset_of!(Elf32_Chdr, ch_addralign) - 8usize];
7654};
7655#[repr(C)]
7656#[derive(Debug, Copy, Clone)]
7657pub struct Elf64_Chdr {
7658 pub ch_type: Elf64_Word,
7659 pub ch_reserved: Elf64_Word,
7660 pub ch_size: Elf64_Xword,
7661 pub ch_addralign: Elf64_Xword,
7662}
7663#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7664const _: () = {
7665 ["Size of Elf64_Chdr"][::core::mem::size_of::<Elf64_Chdr>() - 24usize];
7666 ["Alignment of Elf64_Chdr"][::core::mem::align_of::<Elf64_Chdr>() - 8usize];
7667 ["Offset of field: Elf64_Chdr::ch_type"][::core::mem::offset_of!(Elf64_Chdr, ch_type) - 0usize];
7668 ["Offset of field: Elf64_Chdr::ch_reserved"]
7669 [::core::mem::offset_of!(Elf64_Chdr, ch_reserved) - 4usize];
7670 ["Offset of field: Elf64_Chdr::ch_size"][::core::mem::offset_of!(Elf64_Chdr, ch_size) - 8usize];
7671 ["Offset of field: Elf64_Chdr::ch_addralign"]
7672 [::core::mem::offset_of!(Elf64_Chdr, ch_addralign) - 16usize];
7673};
7674#[repr(C)]
7675#[derive(Debug, Copy, Clone)]
7676pub struct Elf32_Sym {
7677 pub st_name: Elf32_Word,
7678 pub st_value: Elf32_Addr,
7679 pub st_size: Elf32_Word,
7680 pub st_info: core::ffi::c_uchar,
7681 pub st_other: core::ffi::c_uchar,
7682 pub st_shndx: Elf32_Section,
7683}
7684#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7685const _: () = {
7686 ["Size of Elf32_Sym"][::core::mem::size_of::<Elf32_Sym>() - 16usize];
7687 ["Alignment of Elf32_Sym"][::core::mem::align_of::<Elf32_Sym>() - 4usize];
7688 ["Offset of field: Elf32_Sym::st_name"][::core::mem::offset_of!(Elf32_Sym, st_name) - 0usize];
7689 ["Offset of field: Elf32_Sym::st_value"][::core::mem::offset_of!(Elf32_Sym, st_value) - 4usize];
7690 ["Offset of field: Elf32_Sym::st_size"][::core::mem::offset_of!(Elf32_Sym, st_size) - 8usize];
7691 ["Offset of field: Elf32_Sym::st_info"][::core::mem::offset_of!(Elf32_Sym, st_info) - 12usize];
7692 ["Offset of field: Elf32_Sym::st_other"]
7693 [::core::mem::offset_of!(Elf32_Sym, st_other) - 13usize];
7694 ["Offset of field: Elf32_Sym::st_shndx"]
7695 [::core::mem::offset_of!(Elf32_Sym, st_shndx) - 14usize];
7696};
7697#[repr(C)]
7698#[derive(Debug, Copy, Clone)]
7699pub struct Elf64_Sym {
7700 pub st_name: Elf64_Word,
7701 pub st_info: core::ffi::c_uchar,
7702 pub st_other: core::ffi::c_uchar,
7703 pub st_shndx: Elf64_Section,
7704 pub st_value: Elf64_Addr,
7705 pub st_size: Elf64_Xword,
7706}
7707#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7708const _: () = {
7709 ["Size of Elf64_Sym"][::core::mem::size_of::<Elf64_Sym>() - 24usize];
7710 ["Alignment of Elf64_Sym"][::core::mem::align_of::<Elf64_Sym>() - 8usize];
7711 ["Offset of field: Elf64_Sym::st_name"][::core::mem::offset_of!(Elf64_Sym, st_name) - 0usize];
7712 ["Offset of field: Elf64_Sym::st_info"][::core::mem::offset_of!(Elf64_Sym, st_info) - 4usize];
7713 ["Offset of field: Elf64_Sym::st_other"][::core::mem::offset_of!(Elf64_Sym, st_other) - 5usize];
7714 ["Offset of field: Elf64_Sym::st_shndx"][::core::mem::offset_of!(Elf64_Sym, st_shndx) - 6usize];
7715 ["Offset of field: Elf64_Sym::st_value"][::core::mem::offset_of!(Elf64_Sym, st_value) - 8usize];
7716 ["Offset of field: Elf64_Sym::st_size"][::core::mem::offset_of!(Elf64_Sym, st_size) - 16usize];
7717};
7718#[repr(C)]
7719#[derive(Debug, Copy, Clone)]
7720pub struct Elf32_Syminfo {
7721 pub si_boundto: Elf32_Half,
7722 pub si_flags: Elf32_Half,
7723}
7724#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7725const _: () = {
7726 ["Size of Elf32_Syminfo"][::core::mem::size_of::<Elf32_Syminfo>() - 4usize];
7727 ["Alignment of Elf32_Syminfo"][::core::mem::align_of::<Elf32_Syminfo>() - 2usize];
7728 ["Offset of field: Elf32_Syminfo::si_boundto"]
7729 [::core::mem::offset_of!(Elf32_Syminfo, si_boundto) - 0usize];
7730 ["Offset of field: Elf32_Syminfo::si_flags"]
7731 [::core::mem::offset_of!(Elf32_Syminfo, si_flags) - 2usize];
7732};
7733#[repr(C)]
7734#[derive(Debug, Copy, Clone)]
7735pub struct Elf64_Syminfo {
7736 pub si_boundto: Elf64_Half,
7737 pub si_flags: Elf64_Half,
7738}
7739#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7740const _: () = {
7741 ["Size of Elf64_Syminfo"][::core::mem::size_of::<Elf64_Syminfo>() - 4usize];
7742 ["Alignment of Elf64_Syminfo"][::core::mem::align_of::<Elf64_Syminfo>() - 2usize];
7743 ["Offset of field: Elf64_Syminfo::si_boundto"]
7744 [::core::mem::offset_of!(Elf64_Syminfo, si_boundto) - 0usize];
7745 ["Offset of field: Elf64_Syminfo::si_flags"]
7746 [::core::mem::offset_of!(Elf64_Syminfo, si_flags) - 2usize];
7747};
7748#[repr(C)]
7749#[derive(Debug, Copy, Clone)]
7750pub struct Elf32_Rel {
7751 pub r_offset: Elf32_Addr,
7752 pub r_info: Elf32_Word,
7753}
7754#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7755const _: () = {
7756 ["Size of Elf32_Rel"][::core::mem::size_of::<Elf32_Rel>() - 8usize];
7757 ["Alignment of Elf32_Rel"][::core::mem::align_of::<Elf32_Rel>() - 4usize];
7758 ["Offset of field: Elf32_Rel::r_offset"][::core::mem::offset_of!(Elf32_Rel, r_offset) - 0usize];
7759 ["Offset of field: Elf32_Rel::r_info"][::core::mem::offset_of!(Elf32_Rel, r_info) - 4usize];
7760};
7761#[repr(C)]
7762#[derive(Debug, Copy, Clone)]
7763pub struct Elf64_Rel {
7764 pub r_offset: Elf64_Addr,
7765 pub r_info: Elf64_Xword,
7766}
7767#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7768const _: () = {
7769 ["Size of Elf64_Rel"][::core::mem::size_of::<Elf64_Rel>() - 16usize];
7770 ["Alignment of Elf64_Rel"][::core::mem::align_of::<Elf64_Rel>() - 8usize];
7771 ["Offset of field: Elf64_Rel::r_offset"][::core::mem::offset_of!(Elf64_Rel, r_offset) - 0usize];
7772 ["Offset of field: Elf64_Rel::r_info"][::core::mem::offset_of!(Elf64_Rel, r_info) - 8usize];
7773};
7774#[repr(C)]
7775#[derive(Debug, Copy, Clone)]
7776pub struct Elf32_Rela {
7777 pub r_offset: Elf32_Addr,
7778 pub r_info: Elf32_Word,
7779 pub r_addend: Elf32_Sword,
7780}
7781#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7782const _: () = {
7783 ["Size of Elf32_Rela"][::core::mem::size_of::<Elf32_Rela>() - 12usize];
7784 ["Alignment of Elf32_Rela"][::core::mem::align_of::<Elf32_Rela>() - 4usize];
7785 ["Offset of field: Elf32_Rela::r_offset"]
7786 [::core::mem::offset_of!(Elf32_Rela, r_offset) - 0usize];
7787 ["Offset of field: Elf32_Rela::r_info"][::core::mem::offset_of!(Elf32_Rela, r_info) - 4usize];
7788 ["Offset of field: Elf32_Rela::r_addend"]
7789 [::core::mem::offset_of!(Elf32_Rela, r_addend) - 8usize];
7790};
7791#[repr(C)]
7792#[derive(Debug, Copy, Clone)]
7793pub struct Elf64_Rela {
7794 pub r_offset: Elf64_Addr,
7795 pub r_info: Elf64_Xword,
7796 pub r_addend: Elf64_Sxword,
7797}
7798#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7799const _: () = {
7800 ["Size of Elf64_Rela"][::core::mem::size_of::<Elf64_Rela>() - 24usize];
7801 ["Alignment of Elf64_Rela"][::core::mem::align_of::<Elf64_Rela>() - 8usize];
7802 ["Offset of field: Elf64_Rela::r_offset"]
7803 [::core::mem::offset_of!(Elf64_Rela, r_offset) - 0usize];
7804 ["Offset of field: Elf64_Rela::r_info"][::core::mem::offset_of!(Elf64_Rela, r_info) - 8usize];
7805 ["Offset of field: Elf64_Rela::r_addend"]
7806 [::core::mem::offset_of!(Elf64_Rela, r_addend) - 16usize];
7807};
7808#[repr(C)]
7809#[derive(Debug, Copy, Clone)]
7810pub struct Elf32_Phdr {
7811 pub p_type: Elf32_Word,
7812 pub p_offset: Elf32_Off,
7813 pub p_vaddr: Elf32_Addr,
7814 pub p_paddr: Elf32_Addr,
7815 pub p_filesz: Elf32_Word,
7816 pub p_memsz: Elf32_Word,
7817 pub p_flags: Elf32_Word,
7818 pub p_align: Elf32_Word,
7819}
7820#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7821const _: () = {
7822 ["Size of Elf32_Phdr"][::core::mem::size_of::<Elf32_Phdr>() - 32usize];
7823 ["Alignment of Elf32_Phdr"][::core::mem::align_of::<Elf32_Phdr>() - 4usize];
7824 ["Offset of field: Elf32_Phdr::p_type"][::core::mem::offset_of!(Elf32_Phdr, p_type) - 0usize];
7825 ["Offset of field: Elf32_Phdr::p_offset"]
7826 [::core::mem::offset_of!(Elf32_Phdr, p_offset) - 4usize];
7827 ["Offset of field: Elf32_Phdr::p_vaddr"][::core::mem::offset_of!(Elf32_Phdr, p_vaddr) - 8usize];
7828 ["Offset of field: Elf32_Phdr::p_paddr"]
7829 [::core::mem::offset_of!(Elf32_Phdr, p_paddr) - 12usize];
7830 ["Offset of field: Elf32_Phdr::p_filesz"]
7831 [::core::mem::offset_of!(Elf32_Phdr, p_filesz) - 16usize];
7832 ["Offset of field: Elf32_Phdr::p_memsz"]
7833 [::core::mem::offset_of!(Elf32_Phdr, p_memsz) - 20usize];
7834 ["Offset of field: Elf32_Phdr::p_flags"]
7835 [::core::mem::offset_of!(Elf32_Phdr, p_flags) - 24usize];
7836 ["Offset of field: Elf32_Phdr::p_align"]
7837 [::core::mem::offset_of!(Elf32_Phdr, p_align) - 28usize];
7838};
7839#[repr(C)]
7840#[derive(Debug, Copy, Clone)]
7841pub struct Elf64_Phdr {
7842 pub p_type: Elf64_Word,
7843 pub p_flags: Elf64_Word,
7844 pub p_offset: Elf64_Off,
7845 pub p_vaddr: Elf64_Addr,
7846 pub p_paddr: Elf64_Addr,
7847 pub p_filesz: Elf64_Xword,
7848 pub p_memsz: Elf64_Xword,
7849 pub p_align: Elf64_Xword,
7850}
7851#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7852const _: () = {
7853 ["Size of Elf64_Phdr"][::core::mem::size_of::<Elf64_Phdr>() - 56usize];
7854 ["Alignment of Elf64_Phdr"][::core::mem::align_of::<Elf64_Phdr>() - 8usize];
7855 ["Offset of field: Elf64_Phdr::p_type"][::core::mem::offset_of!(Elf64_Phdr, p_type) - 0usize];
7856 ["Offset of field: Elf64_Phdr::p_flags"][::core::mem::offset_of!(Elf64_Phdr, p_flags) - 4usize];
7857 ["Offset of field: Elf64_Phdr::p_offset"]
7858 [::core::mem::offset_of!(Elf64_Phdr, p_offset) - 8usize];
7859 ["Offset of field: Elf64_Phdr::p_vaddr"]
7860 [::core::mem::offset_of!(Elf64_Phdr, p_vaddr) - 16usize];
7861 ["Offset of field: Elf64_Phdr::p_paddr"]
7862 [::core::mem::offset_of!(Elf64_Phdr, p_paddr) - 24usize];
7863 ["Offset of field: Elf64_Phdr::p_filesz"]
7864 [::core::mem::offset_of!(Elf64_Phdr, p_filesz) - 32usize];
7865 ["Offset of field: Elf64_Phdr::p_memsz"]
7866 [::core::mem::offset_of!(Elf64_Phdr, p_memsz) - 40usize];
7867 ["Offset of field: Elf64_Phdr::p_align"]
7868 [::core::mem::offset_of!(Elf64_Phdr, p_align) - 48usize];
7869};
7870#[repr(C)]
7871#[derive(Copy, Clone)]
7872pub struct Elf32_Dyn {
7873 pub d_tag: Elf32_Sword,
7874 pub d_un: Elf32_Dyn__bindgen_ty_1,
7875}
7876#[repr(C)]
7877#[derive(Copy, Clone)]
7878pub union Elf32_Dyn__bindgen_ty_1 {
7879 pub d_val: Elf32_Word,
7880 pub d_ptr: Elf32_Addr,
7881}
7882#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7883const _: () = {
7884 ["Size of Elf32_Dyn__bindgen_ty_1"][::core::mem::size_of::<Elf32_Dyn__bindgen_ty_1>() - 4usize];
7885 ["Alignment of Elf32_Dyn__bindgen_ty_1"]
7886 [::core::mem::align_of::<Elf32_Dyn__bindgen_ty_1>() - 4usize];
7887 ["Offset of field: Elf32_Dyn__bindgen_ty_1::d_val"]
7888 [::core::mem::offset_of!(Elf32_Dyn__bindgen_ty_1, d_val) - 0usize];
7889 ["Offset of field: Elf32_Dyn__bindgen_ty_1::d_ptr"]
7890 [::core::mem::offset_of!(Elf32_Dyn__bindgen_ty_1, d_ptr) - 0usize];
7891};
7892#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7893const _: () = {
7894 ["Size of Elf32_Dyn"][::core::mem::size_of::<Elf32_Dyn>() - 8usize];
7895 ["Alignment of Elf32_Dyn"][::core::mem::align_of::<Elf32_Dyn>() - 4usize];
7896 ["Offset of field: Elf32_Dyn::d_tag"][::core::mem::offset_of!(Elf32_Dyn, d_tag) - 0usize];
7897 ["Offset of field: Elf32_Dyn::d_un"][::core::mem::offset_of!(Elf32_Dyn, d_un) - 4usize];
7898};
7899#[repr(C)]
7900#[derive(Copy, Clone)]
7901pub struct Elf64_Dyn {
7902 pub d_tag: Elf64_Sxword,
7903 pub d_un: Elf64_Dyn__bindgen_ty_1,
7904}
7905#[repr(C)]
7906#[derive(Copy, Clone)]
7907pub union Elf64_Dyn__bindgen_ty_1 {
7908 pub d_val: Elf64_Xword,
7909 pub d_ptr: Elf64_Addr,
7910}
7911#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7912const _: () = {
7913 ["Size of Elf64_Dyn__bindgen_ty_1"][::core::mem::size_of::<Elf64_Dyn__bindgen_ty_1>() - 8usize];
7914 ["Alignment of Elf64_Dyn__bindgen_ty_1"]
7915 [::core::mem::align_of::<Elf64_Dyn__bindgen_ty_1>() - 8usize];
7916 ["Offset of field: Elf64_Dyn__bindgen_ty_1::d_val"]
7917 [::core::mem::offset_of!(Elf64_Dyn__bindgen_ty_1, d_val) - 0usize];
7918 ["Offset of field: Elf64_Dyn__bindgen_ty_1::d_ptr"]
7919 [::core::mem::offset_of!(Elf64_Dyn__bindgen_ty_1, d_ptr) - 0usize];
7920};
7921#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7922const _: () = {
7923 ["Size of Elf64_Dyn"][::core::mem::size_of::<Elf64_Dyn>() - 16usize];
7924 ["Alignment of Elf64_Dyn"][::core::mem::align_of::<Elf64_Dyn>() - 8usize];
7925 ["Offset of field: Elf64_Dyn::d_tag"][::core::mem::offset_of!(Elf64_Dyn, d_tag) - 0usize];
7926 ["Offset of field: Elf64_Dyn::d_un"][::core::mem::offset_of!(Elf64_Dyn, d_un) - 8usize];
7927};
7928#[repr(C)]
7929#[derive(Debug, Copy, Clone)]
7930pub struct Elf32_Verdef {
7931 pub vd_version: Elf32_Half,
7932 pub vd_flags: Elf32_Half,
7933 pub vd_ndx: Elf32_Half,
7934 pub vd_cnt: Elf32_Half,
7935 pub vd_hash: Elf32_Word,
7936 pub vd_aux: Elf32_Word,
7937 pub vd_next: Elf32_Word,
7938}
7939#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7940const _: () = {
7941 ["Size of Elf32_Verdef"][::core::mem::size_of::<Elf32_Verdef>() - 20usize];
7942 ["Alignment of Elf32_Verdef"][::core::mem::align_of::<Elf32_Verdef>() - 4usize];
7943 ["Offset of field: Elf32_Verdef::vd_version"]
7944 [::core::mem::offset_of!(Elf32_Verdef, vd_version) - 0usize];
7945 ["Offset of field: Elf32_Verdef::vd_flags"]
7946 [::core::mem::offset_of!(Elf32_Verdef, vd_flags) - 2usize];
7947 ["Offset of field: Elf32_Verdef::vd_ndx"]
7948 [::core::mem::offset_of!(Elf32_Verdef, vd_ndx) - 4usize];
7949 ["Offset of field: Elf32_Verdef::vd_cnt"]
7950 [::core::mem::offset_of!(Elf32_Verdef, vd_cnt) - 6usize];
7951 ["Offset of field: Elf32_Verdef::vd_hash"]
7952 [::core::mem::offset_of!(Elf32_Verdef, vd_hash) - 8usize];
7953 ["Offset of field: Elf32_Verdef::vd_aux"]
7954 [::core::mem::offset_of!(Elf32_Verdef, vd_aux) - 12usize];
7955 ["Offset of field: Elf32_Verdef::vd_next"]
7956 [::core::mem::offset_of!(Elf32_Verdef, vd_next) - 16usize];
7957};
7958#[repr(C)]
7959#[derive(Debug, Copy, Clone)]
7960pub struct Elf64_Verdef {
7961 pub vd_version: Elf64_Half,
7962 pub vd_flags: Elf64_Half,
7963 pub vd_ndx: Elf64_Half,
7964 pub vd_cnt: Elf64_Half,
7965 pub vd_hash: Elf64_Word,
7966 pub vd_aux: Elf64_Word,
7967 pub vd_next: Elf64_Word,
7968}
7969#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7970const _: () = {
7971 ["Size of Elf64_Verdef"][::core::mem::size_of::<Elf64_Verdef>() - 20usize];
7972 ["Alignment of Elf64_Verdef"][::core::mem::align_of::<Elf64_Verdef>() - 4usize];
7973 ["Offset of field: Elf64_Verdef::vd_version"]
7974 [::core::mem::offset_of!(Elf64_Verdef, vd_version) - 0usize];
7975 ["Offset of field: Elf64_Verdef::vd_flags"]
7976 [::core::mem::offset_of!(Elf64_Verdef, vd_flags) - 2usize];
7977 ["Offset of field: Elf64_Verdef::vd_ndx"]
7978 [::core::mem::offset_of!(Elf64_Verdef, vd_ndx) - 4usize];
7979 ["Offset of field: Elf64_Verdef::vd_cnt"]
7980 [::core::mem::offset_of!(Elf64_Verdef, vd_cnt) - 6usize];
7981 ["Offset of field: Elf64_Verdef::vd_hash"]
7982 [::core::mem::offset_of!(Elf64_Verdef, vd_hash) - 8usize];
7983 ["Offset of field: Elf64_Verdef::vd_aux"]
7984 [::core::mem::offset_of!(Elf64_Verdef, vd_aux) - 12usize];
7985 ["Offset of field: Elf64_Verdef::vd_next"]
7986 [::core::mem::offset_of!(Elf64_Verdef, vd_next) - 16usize];
7987};
7988#[repr(C)]
7989#[derive(Debug, Copy, Clone)]
7990pub struct Elf32_Verdaux {
7991 pub vda_name: Elf32_Word,
7992 pub vda_next: Elf32_Word,
7993}
7994#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7995const _: () = {
7996 ["Size of Elf32_Verdaux"][::core::mem::size_of::<Elf32_Verdaux>() - 8usize];
7997 ["Alignment of Elf32_Verdaux"][::core::mem::align_of::<Elf32_Verdaux>() - 4usize];
7998 ["Offset of field: Elf32_Verdaux::vda_name"]
7999 [::core::mem::offset_of!(Elf32_Verdaux, vda_name) - 0usize];
8000 ["Offset of field: Elf32_Verdaux::vda_next"]
8001 [::core::mem::offset_of!(Elf32_Verdaux, vda_next) - 4usize];
8002};
8003#[repr(C)]
8004#[derive(Debug, Copy, Clone)]
8005pub struct Elf64_Verdaux {
8006 pub vda_name: Elf64_Word,
8007 pub vda_next: Elf64_Word,
8008}
8009#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8010const _: () = {
8011 ["Size of Elf64_Verdaux"][::core::mem::size_of::<Elf64_Verdaux>() - 8usize];
8012 ["Alignment of Elf64_Verdaux"][::core::mem::align_of::<Elf64_Verdaux>() - 4usize];
8013 ["Offset of field: Elf64_Verdaux::vda_name"]
8014 [::core::mem::offset_of!(Elf64_Verdaux, vda_name) - 0usize];
8015 ["Offset of field: Elf64_Verdaux::vda_next"]
8016 [::core::mem::offset_of!(Elf64_Verdaux, vda_next) - 4usize];
8017};
8018#[repr(C)]
8019#[derive(Debug, Copy, Clone)]
8020pub struct Elf32_Verneed {
8021 pub vn_version: Elf32_Half,
8022 pub vn_cnt: Elf32_Half,
8023 pub vn_file: Elf32_Word,
8024 pub vn_aux: Elf32_Word,
8025 pub vn_next: Elf32_Word,
8026}
8027#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8028const _: () = {
8029 ["Size of Elf32_Verneed"][::core::mem::size_of::<Elf32_Verneed>() - 16usize];
8030 ["Alignment of Elf32_Verneed"][::core::mem::align_of::<Elf32_Verneed>() - 4usize];
8031 ["Offset of field: Elf32_Verneed::vn_version"]
8032 [::core::mem::offset_of!(Elf32_Verneed, vn_version) - 0usize];
8033 ["Offset of field: Elf32_Verneed::vn_cnt"]
8034 [::core::mem::offset_of!(Elf32_Verneed, vn_cnt) - 2usize];
8035 ["Offset of field: Elf32_Verneed::vn_file"]
8036 [::core::mem::offset_of!(Elf32_Verneed, vn_file) - 4usize];
8037 ["Offset of field: Elf32_Verneed::vn_aux"]
8038 [::core::mem::offset_of!(Elf32_Verneed, vn_aux) - 8usize];
8039 ["Offset of field: Elf32_Verneed::vn_next"]
8040 [::core::mem::offset_of!(Elf32_Verneed, vn_next) - 12usize];
8041};
8042#[repr(C)]
8043#[derive(Debug, Copy, Clone)]
8044pub struct Elf64_Verneed {
8045 pub vn_version: Elf64_Half,
8046 pub vn_cnt: Elf64_Half,
8047 pub vn_file: Elf64_Word,
8048 pub vn_aux: Elf64_Word,
8049 pub vn_next: Elf64_Word,
8050}
8051#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8052const _: () = {
8053 ["Size of Elf64_Verneed"][::core::mem::size_of::<Elf64_Verneed>() - 16usize];
8054 ["Alignment of Elf64_Verneed"][::core::mem::align_of::<Elf64_Verneed>() - 4usize];
8055 ["Offset of field: Elf64_Verneed::vn_version"]
8056 [::core::mem::offset_of!(Elf64_Verneed, vn_version) - 0usize];
8057 ["Offset of field: Elf64_Verneed::vn_cnt"]
8058 [::core::mem::offset_of!(Elf64_Verneed, vn_cnt) - 2usize];
8059 ["Offset of field: Elf64_Verneed::vn_file"]
8060 [::core::mem::offset_of!(Elf64_Verneed, vn_file) - 4usize];
8061 ["Offset of field: Elf64_Verneed::vn_aux"]
8062 [::core::mem::offset_of!(Elf64_Verneed, vn_aux) - 8usize];
8063 ["Offset of field: Elf64_Verneed::vn_next"]
8064 [::core::mem::offset_of!(Elf64_Verneed, vn_next) - 12usize];
8065};
8066#[repr(C)]
8067#[derive(Debug, Copy, Clone)]
8068pub struct Elf32_Vernaux {
8069 pub vna_hash: Elf32_Word,
8070 pub vna_flags: Elf32_Half,
8071 pub vna_other: Elf32_Half,
8072 pub vna_name: Elf32_Word,
8073 pub vna_next: Elf32_Word,
8074}
8075#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8076const _: () = {
8077 ["Size of Elf32_Vernaux"][::core::mem::size_of::<Elf32_Vernaux>() - 16usize];
8078 ["Alignment of Elf32_Vernaux"][::core::mem::align_of::<Elf32_Vernaux>() - 4usize];
8079 ["Offset of field: Elf32_Vernaux::vna_hash"]
8080 [::core::mem::offset_of!(Elf32_Vernaux, vna_hash) - 0usize];
8081 ["Offset of field: Elf32_Vernaux::vna_flags"]
8082 [::core::mem::offset_of!(Elf32_Vernaux, vna_flags) - 4usize];
8083 ["Offset of field: Elf32_Vernaux::vna_other"]
8084 [::core::mem::offset_of!(Elf32_Vernaux, vna_other) - 6usize];
8085 ["Offset of field: Elf32_Vernaux::vna_name"]
8086 [::core::mem::offset_of!(Elf32_Vernaux, vna_name) - 8usize];
8087 ["Offset of field: Elf32_Vernaux::vna_next"]
8088 [::core::mem::offset_of!(Elf32_Vernaux, vna_next) - 12usize];
8089};
8090#[repr(C)]
8091#[derive(Debug, Copy, Clone)]
8092pub struct Elf64_Vernaux {
8093 pub vna_hash: Elf64_Word,
8094 pub vna_flags: Elf64_Half,
8095 pub vna_other: Elf64_Half,
8096 pub vna_name: Elf64_Word,
8097 pub vna_next: Elf64_Word,
8098}
8099#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8100const _: () = {
8101 ["Size of Elf64_Vernaux"][::core::mem::size_of::<Elf64_Vernaux>() - 16usize];
8102 ["Alignment of Elf64_Vernaux"][::core::mem::align_of::<Elf64_Vernaux>() - 4usize];
8103 ["Offset of field: Elf64_Vernaux::vna_hash"]
8104 [::core::mem::offset_of!(Elf64_Vernaux, vna_hash) - 0usize];
8105 ["Offset of field: Elf64_Vernaux::vna_flags"]
8106 [::core::mem::offset_of!(Elf64_Vernaux, vna_flags) - 4usize];
8107 ["Offset of field: Elf64_Vernaux::vna_other"]
8108 [::core::mem::offset_of!(Elf64_Vernaux, vna_other) - 6usize];
8109 ["Offset of field: Elf64_Vernaux::vna_name"]
8110 [::core::mem::offset_of!(Elf64_Vernaux, vna_name) - 8usize];
8111 ["Offset of field: Elf64_Vernaux::vna_next"]
8112 [::core::mem::offset_of!(Elf64_Vernaux, vna_next) - 12usize];
8113};
8114#[repr(C)]
8115#[derive(Copy, Clone)]
8116pub struct Elf32_auxv_t {
8117 pub a_type: u32,
8118 pub a_un: Elf32_auxv_t__bindgen_ty_1,
8119}
8120#[repr(C)]
8121#[derive(Copy, Clone)]
8122pub union Elf32_auxv_t__bindgen_ty_1 {
8123 pub a_val: u32,
8124}
8125#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8126const _: () = {
8127 ["Size of Elf32_auxv_t__bindgen_ty_1"]
8128 [::core::mem::size_of::<Elf32_auxv_t__bindgen_ty_1>() - 4usize];
8129 ["Alignment of Elf32_auxv_t__bindgen_ty_1"]
8130 [::core::mem::align_of::<Elf32_auxv_t__bindgen_ty_1>() - 4usize];
8131 ["Offset of field: Elf32_auxv_t__bindgen_ty_1::a_val"]
8132 [::core::mem::offset_of!(Elf32_auxv_t__bindgen_ty_1, a_val) - 0usize];
8133};
8134#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8135const _: () = {
8136 ["Size of Elf32_auxv_t"][::core::mem::size_of::<Elf32_auxv_t>() - 8usize];
8137 ["Alignment of Elf32_auxv_t"][::core::mem::align_of::<Elf32_auxv_t>() - 4usize];
8138 ["Offset of field: Elf32_auxv_t::a_type"]
8139 [::core::mem::offset_of!(Elf32_auxv_t, a_type) - 0usize];
8140 ["Offset of field: Elf32_auxv_t::a_un"][::core::mem::offset_of!(Elf32_auxv_t, a_un) - 4usize];
8141};
8142#[repr(C)]
8143#[derive(Copy, Clone)]
8144pub struct Elf64_auxv_t {
8145 pub a_type: u64,
8146 pub a_un: Elf64_auxv_t__bindgen_ty_1,
8147}
8148#[repr(C)]
8149#[derive(Copy, Clone)]
8150pub union Elf64_auxv_t__bindgen_ty_1 {
8151 pub a_val: u64,
8152}
8153#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8154const _: () = {
8155 ["Size of Elf64_auxv_t__bindgen_ty_1"]
8156 [::core::mem::size_of::<Elf64_auxv_t__bindgen_ty_1>() - 8usize];
8157 ["Alignment of Elf64_auxv_t__bindgen_ty_1"]
8158 [::core::mem::align_of::<Elf64_auxv_t__bindgen_ty_1>() - 8usize];
8159 ["Offset of field: Elf64_auxv_t__bindgen_ty_1::a_val"]
8160 [::core::mem::offset_of!(Elf64_auxv_t__bindgen_ty_1, a_val) - 0usize];
8161};
8162#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8163const _: () = {
8164 ["Size of Elf64_auxv_t"][::core::mem::size_of::<Elf64_auxv_t>() - 16usize];
8165 ["Alignment of Elf64_auxv_t"][::core::mem::align_of::<Elf64_auxv_t>() - 8usize];
8166 ["Offset of field: Elf64_auxv_t::a_type"]
8167 [::core::mem::offset_of!(Elf64_auxv_t, a_type) - 0usize];
8168 ["Offset of field: Elf64_auxv_t::a_un"][::core::mem::offset_of!(Elf64_auxv_t, a_un) - 8usize];
8169};
8170#[repr(C)]
8171#[derive(Debug, Copy, Clone)]
8172pub struct Elf32_Nhdr {
8173 pub n_namesz: Elf32_Word,
8174 pub n_descsz: Elf32_Word,
8175 pub n_type: Elf32_Word,
8176}
8177#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8178const _: () = {
8179 ["Size of Elf32_Nhdr"][::core::mem::size_of::<Elf32_Nhdr>() - 12usize];
8180 ["Alignment of Elf32_Nhdr"][::core::mem::align_of::<Elf32_Nhdr>() - 4usize];
8181 ["Offset of field: Elf32_Nhdr::n_namesz"]
8182 [::core::mem::offset_of!(Elf32_Nhdr, n_namesz) - 0usize];
8183 ["Offset of field: Elf32_Nhdr::n_descsz"]
8184 [::core::mem::offset_of!(Elf32_Nhdr, n_descsz) - 4usize];
8185 ["Offset of field: Elf32_Nhdr::n_type"][::core::mem::offset_of!(Elf32_Nhdr, n_type) - 8usize];
8186};
8187#[repr(C)]
8188#[derive(Debug, Copy, Clone)]
8189pub struct Elf64_Nhdr {
8190 pub n_namesz: Elf64_Word,
8191 pub n_descsz: Elf64_Word,
8192 pub n_type: Elf64_Word,
8193}
8194#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8195const _: () = {
8196 ["Size of Elf64_Nhdr"][::core::mem::size_of::<Elf64_Nhdr>() - 12usize];
8197 ["Alignment of Elf64_Nhdr"][::core::mem::align_of::<Elf64_Nhdr>() - 4usize];
8198 ["Offset of field: Elf64_Nhdr::n_namesz"]
8199 [::core::mem::offset_of!(Elf64_Nhdr, n_namesz) - 0usize];
8200 ["Offset of field: Elf64_Nhdr::n_descsz"]
8201 [::core::mem::offset_of!(Elf64_Nhdr, n_descsz) - 4usize];
8202 ["Offset of field: Elf64_Nhdr::n_type"][::core::mem::offset_of!(Elf64_Nhdr, n_type) - 8usize];
8203};
8204#[repr(C)]
8205#[derive(Debug, Copy, Clone)]
8206pub struct Elf32_Move {
8207 pub m_value: Elf32_Xword,
8208 pub m_info: Elf32_Word,
8209 pub m_poffset: Elf32_Word,
8210 pub m_repeat: Elf32_Half,
8211 pub m_stride: Elf32_Half,
8212}
8213#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8214const _: () = {
8215 ["Size of Elf32_Move"][::core::mem::size_of::<Elf32_Move>() - 24usize];
8216 ["Alignment of Elf32_Move"][::core::mem::align_of::<Elf32_Move>() - 8usize];
8217 ["Offset of field: Elf32_Move::m_value"][::core::mem::offset_of!(Elf32_Move, m_value) - 0usize];
8218 ["Offset of field: Elf32_Move::m_info"][::core::mem::offset_of!(Elf32_Move, m_info) - 8usize];
8219 ["Offset of field: Elf32_Move::m_poffset"]
8220 [::core::mem::offset_of!(Elf32_Move, m_poffset) - 12usize];
8221 ["Offset of field: Elf32_Move::m_repeat"]
8222 [::core::mem::offset_of!(Elf32_Move, m_repeat) - 16usize];
8223 ["Offset of field: Elf32_Move::m_stride"]
8224 [::core::mem::offset_of!(Elf32_Move, m_stride) - 18usize];
8225};
8226#[repr(C)]
8227#[derive(Debug, Copy, Clone)]
8228pub struct Elf64_Move {
8229 pub m_value: Elf64_Xword,
8230 pub m_info: Elf64_Xword,
8231 pub m_poffset: Elf64_Xword,
8232 pub m_repeat: Elf64_Half,
8233 pub m_stride: Elf64_Half,
8234}
8235#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8236const _: () = {
8237 ["Size of Elf64_Move"][::core::mem::size_of::<Elf64_Move>() - 32usize];
8238 ["Alignment of Elf64_Move"][::core::mem::align_of::<Elf64_Move>() - 8usize];
8239 ["Offset of field: Elf64_Move::m_value"][::core::mem::offset_of!(Elf64_Move, m_value) - 0usize];
8240 ["Offset of field: Elf64_Move::m_info"][::core::mem::offset_of!(Elf64_Move, m_info) - 8usize];
8241 ["Offset of field: Elf64_Move::m_poffset"]
8242 [::core::mem::offset_of!(Elf64_Move, m_poffset) - 16usize];
8243 ["Offset of field: Elf64_Move::m_repeat"]
8244 [::core::mem::offset_of!(Elf64_Move, m_repeat) - 24usize];
8245 ["Offset of field: Elf64_Move::m_stride"]
8246 [::core::mem::offset_of!(Elf64_Move, m_stride) - 26usize];
8247};
8248#[repr(C)]
8249#[derive(Copy, Clone)]
8250pub union Elf32_gptab {
8251 pub gt_header: Elf32_gptab__bindgen_ty_1,
8252 pub gt_entry: Elf32_gptab__bindgen_ty_2,
8253}
8254#[repr(C)]
8255#[derive(Debug, Copy, Clone)]
8256pub struct Elf32_gptab__bindgen_ty_1 {
8257 pub gt_current_g_value: Elf32_Word,
8258 pub gt_unused: Elf32_Word,
8259}
8260#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8261const _: () = {
8262 ["Size of Elf32_gptab__bindgen_ty_1"]
8263 [::core::mem::size_of::<Elf32_gptab__bindgen_ty_1>() - 8usize];
8264 ["Alignment of Elf32_gptab__bindgen_ty_1"]
8265 [::core::mem::align_of::<Elf32_gptab__bindgen_ty_1>() - 4usize];
8266 ["Offset of field: Elf32_gptab__bindgen_ty_1::gt_current_g_value"]
8267 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_1, gt_current_g_value) - 0usize];
8268 ["Offset of field: Elf32_gptab__bindgen_ty_1::gt_unused"]
8269 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_1, gt_unused) - 4usize];
8270};
8271#[repr(C)]
8272#[derive(Debug, Copy, Clone)]
8273pub struct Elf32_gptab__bindgen_ty_2 {
8274 pub gt_g_value: Elf32_Word,
8275 pub gt_bytes: Elf32_Word,
8276}
8277#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8278const _: () = {
8279 ["Size of Elf32_gptab__bindgen_ty_2"]
8280 [::core::mem::size_of::<Elf32_gptab__bindgen_ty_2>() - 8usize];
8281 ["Alignment of Elf32_gptab__bindgen_ty_2"]
8282 [::core::mem::align_of::<Elf32_gptab__bindgen_ty_2>() - 4usize];
8283 ["Offset of field: Elf32_gptab__bindgen_ty_2::gt_g_value"]
8284 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_2, gt_g_value) - 0usize];
8285 ["Offset of field: Elf32_gptab__bindgen_ty_2::gt_bytes"]
8286 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_2, gt_bytes) - 4usize];
8287};
8288#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8289const _: () = {
8290 ["Size of Elf32_gptab"][::core::mem::size_of::<Elf32_gptab>() - 8usize];
8291 ["Alignment of Elf32_gptab"][::core::mem::align_of::<Elf32_gptab>() - 4usize];
8292 ["Offset of field: Elf32_gptab::gt_header"]
8293 [::core::mem::offset_of!(Elf32_gptab, gt_header) - 0usize];
8294 ["Offset of field: Elf32_gptab::gt_entry"]
8295 [::core::mem::offset_of!(Elf32_gptab, gt_entry) - 0usize];
8296};
8297#[repr(C)]
8298#[derive(Debug, Copy, Clone)]
8299pub struct Elf32_RegInfo {
8300 pub ri_gprmask: Elf32_Word,
8301 pub ri_cprmask: [Elf32_Word; 4usize],
8302 pub ri_gp_value: Elf32_Sword,
8303}
8304#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8305const _: () = {
8306 ["Size of Elf32_RegInfo"][::core::mem::size_of::<Elf32_RegInfo>() - 24usize];
8307 ["Alignment of Elf32_RegInfo"][::core::mem::align_of::<Elf32_RegInfo>() - 4usize];
8308 ["Offset of field: Elf32_RegInfo::ri_gprmask"]
8309 [::core::mem::offset_of!(Elf32_RegInfo, ri_gprmask) - 0usize];
8310 ["Offset of field: Elf32_RegInfo::ri_cprmask"]
8311 [::core::mem::offset_of!(Elf32_RegInfo, ri_cprmask) - 4usize];
8312 ["Offset of field: Elf32_RegInfo::ri_gp_value"]
8313 [::core::mem::offset_of!(Elf32_RegInfo, ri_gp_value) - 20usize];
8314};
8315#[repr(C)]
8316#[derive(Debug, Copy, Clone)]
8317pub struct Elf_Options {
8318 pub kind: core::ffi::c_uchar,
8319 pub size: core::ffi::c_uchar,
8320 pub section: Elf32_Section,
8321 pub info: Elf32_Word,
8322}
8323#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8324const _: () = {
8325 ["Size of Elf_Options"][::core::mem::size_of::<Elf_Options>() - 8usize];
8326 ["Alignment of Elf_Options"][::core::mem::align_of::<Elf_Options>() - 4usize];
8327 ["Offset of field: Elf_Options::kind"][::core::mem::offset_of!(Elf_Options, kind) - 0usize];
8328 ["Offset of field: Elf_Options::size"][::core::mem::offset_of!(Elf_Options, size) - 1usize];
8329 ["Offset of field: Elf_Options::section"]
8330 [::core::mem::offset_of!(Elf_Options, section) - 2usize];
8331 ["Offset of field: Elf_Options::info"][::core::mem::offset_of!(Elf_Options, info) - 4usize];
8332};
8333#[repr(C)]
8334#[derive(Debug, Copy, Clone)]
8335pub struct Elf_Options_Hw {
8336 pub hwp_flags1: Elf32_Word,
8337 pub hwp_flags2: Elf32_Word,
8338}
8339#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8340const _: () = {
8341 ["Size of Elf_Options_Hw"][::core::mem::size_of::<Elf_Options_Hw>() - 8usize];
8342 ["Alignment of Elf_Options_Hw"][::core::mem::align_of::<Elf_Options_Hw>() - 4usize];
8343 ["Offset of field: Elf_Options_Hw::hwp_flags1"]
8344 [::core::mem::offset_of!(Elf_Options_Hw, hwp_flags1) - 0usize];
8345 ["Offset of field: Elf_Options_Hw::hwp_flags2"]
8346 [::core::mem::offset_of!(Elf_Options_Hw, hwp_flags2) - 4usize];
8347};
8348#[repr(C)]
8349#[derive(Debug, Copy, Clone)]
8350pub struct Elf32_Lib {
8351 pub l_name: Elf32_Word,
8352 pub l_time_stamp: Elf32_Word,
8353 pub l_checksum: Elf32_Word,
8354 pub l_version: Elf32_Word,
8355 pub l_flags: Elf32_Word,
8356}
8357#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8358const _: () = {
8359 ["Size of Elf32_Lib"][::core::mem::size_of::<Elf32_Lib>() - 20usize];
8360 ["Alignment of Elf32_Lib"][::core::mem::align_of::<Elf32_Lib>() - 4usize];
8361 ["Offset of field: Elf32_Lib::l_name"][::core::mem::offset_of!(Elf32_Lib, l_name) - 0usize];
8362 ["Offset of field: Elf32_Lib::l_time_stamp"]
8363 [::core::mem::offset_of!(Elf32_Lib, l_time_stamp) - 4usize];
8364 ["Offset of field: Elf32_Lib::l_checksum"]
8365 [::core::mem::offset_of!(Elf32_Lib, l_checksum) - 8usize];
8366 ["Offset of field: Elf32_Lib::l_version"]
8367 [::core::mem::offset_of!(Elf32_Lib, l_version) - 12usize];
8368 ["Offset of field: Elf32_Lib::l_flags"][::core::mem::offset_of!(Elf32_Lib, l_flags) - 16usize];
8369};
8370#[repr(C)]
8371#[derive(Debug, Copy, Clone)]
8372pub struct Elf64_Lib {
8373 pub l_name: Elf64_Word,
8374 pub l_time_stamp: Elf64_Word,
8375 pub l_checksum: Elf64_Word,
8376 pub l_version: Elf64_Word,
8377 pub l_flags: Elf64_Word,
8378}
8379#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8380const _: () = {
8381 ["Size of Elf64_Lib"][::core::mem::size_of::<Elf64_Lib>() - 20usize];
8382 ["Alignment of Elf64_Lib"][::core::mem::align_of::<Elf64_Lib>() - 4usize];
8383 ["Offset of field: Elf64_Lib::l_name"][::core::mem::offset_of!(Elf64_Lib, l_name) - 0usize];
8384 ["Offset of field: Elf64_Lib::l_time_stamp"]
8385 [::core::mem::offset_of!(Elf64_Lib, l_time_stamp) - 4usize];
8386 ["Offset of field: Elf64_Lib::l_checksum"]
8387 [::core::mem::offset_of!(Elf64_Lib, l_checksum) - 8usize];
8388 ["Offset of field: Elf64_Lib::l_version"]
8389 [::core::mem::offset_of!(Elf64_Lib, l_version) - 12usize];
8390 ["Offset of field: Elf64_Lib::l_flags"][::core::mem::offset_of!(Elf64_Lib, l_flags) - 16usize];
8391};
8392pub type Elf32_Conflict = Elf32_Addr;
8393#[repr(C)]
8394#[derive(Debug, Copy, Clone)]
8395pub struct Elf_MIPS_ABIFlags_v0 {
8396 pub version: Elf32_Half,
8397 pub isa_level: core::ffi::c_uchar,
8398 pub isa_rev: core::ffi::c_uchar,
8399 pub gpr_size: core::ffi::c_uchar,
8400 pub cpr1_size: core::ffi::c_uchar,
8401 pub cpr2_size: core::ffi::c_uchar,
8402 pub fp_abi: core::ffi::c_uchar,
8403 pub isa_ext: Elf32_Word,
8404 pub ases: Elf32_Word,
8405 pub flags1: Elf32_Word,
8406 pub flags2: Elf32_Word,
8407}
8408#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8409const _: () = {
8410 ["Size of Elf_MIPS_ABIFlags_v0"][::core::mem::size_of::<Elf_MIPS_ABIFlags_v0>() - 24usize];
8411 ["Alignment of Elf_MIPS_ABIFlags_v0"][::core::mem::align_of::<Elf_MIPS_ABIFlags_v0>() - 4usize];
8412 ["Offset of field: Elf_MIPS_ABIFlags_v0::version"]
8413 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, version) - 0usize];
8414 ["Offset of field: Elf_MIPS_ABIFlags_v0::isa_level"]
8415 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, isa_level) - 2usize];
8416 ["Offset of field: Elf_MIPS_ABIFlags_v0::isa_rev"]
8417 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, isa_rev) - 3usize];
8418 ["Offset of field: Elf_MIPS_ABIFlags_v0::gpr_size"]
8419 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, gpr_size) - 4usize];
8420 ["Offset of field: Elf_MIPS_ABIFlags_v0::cpr1_size"]
8421 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, cpr1_size) - 5usize];
8422 ["Offset of field: Elf_MIPS_ABIFlags_v0::cpr2_size"]
8423 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, cpr2_size) - 6usize];
8424 ["Offset of field: Elf_MIPS_ABIFlags_v0::fp_abi"]
8425 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, fp_abi) - 7usize];
8426 ["Offset of field: Elf_MIPS_ABIFlags_v0::isa_ext"]
8427 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, isa_ext) - 8usize];
8428 ["Offset of field: Elf_MIPS_ABIFlags_v0::ases"]
8429 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, ases) - 12usize];
8430 ["Offset of field: Elf_MIPS_ABIFlags_v0::flags1"]
8431 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, flags1) - 16usize];
8432 ["Offset of field: Elf_MIPS_ABIFlags_v0::flags2"]
8433 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, flags2) - 20usize];
8434};
8435#[doc = "Interface for ELF loader to resolve symbols"]
8436#[repr(C)]
8437#[derive(Debug, Copy, Clone)]
8438pub struct ElfApiInterface {
8439 pub api_version_major: u16,
8440 pub api_version_minor: u16,
8441 pub resolver_callback: ::core::option::Option<
8442 unsafe extern "C" fn(
8443 interface: *const ElfApiInterface,
8444 hash: u32,
8445 address: *mut Elf32_Addr,
8446 ) -> bool,
8447 >,
8448}
8449#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8450const _: () = {
8451 ["Size of ElfApiInterface"][::core::mem::size_of::<ElfApiInterface>() - 8usize];
8452 ["Alignment of ElfApiInterface"][::core::mem::align_of::<ElfApiInterface>() - 4usize];
8453 ["Offset of field: ElfApiInterface::api_version_major"]
8454 [::core::mem::offset_of!(ElfApiInterface, api_version_major) - 0usize];
8455 ["Offset of field: ElfApiInterface::api_version_minor"]
8456 [::core::mem::offset_of!(ElfApiInterface, api_version_minor) - 2usize];
8457 ["Offset of field: ElfApiInterface::resolver_callback"]
8458 [::core::mem::offset_of!(ElfApiInterface, resolver_callback) - 4usize];
8459};
8460#[repr(C, packed)]
8461#[derive(Copy, Clone)]
8462pub struct FlipperApplicationManifestBase {
8463 pub manifest_magic: u32,
8464 pub manifest_version: u32,
8465 pub api_version: FlipperApplicationManifestBase__bindgen_ty_1,
8466 pub hardware_target_id: u16,
8467}
8468#[repr(C, packed)]
8469#[derive(Copy, Clone)]
8470pub union FlipperApplicationManifestBase__bindgen_ty_1 {
8471 pub __bindgen_anon_1: FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8472 pub version: u32,
8473}
8474#[repr(C, packed)]
8475#[derive(Debug, Copy, Clone)]
8476pub struct FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1 {
8477 pub minor: u16,
8478 pub major: u16,
8479}
8480#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8481const _: () = {
8482 ["Size of FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1"][::core::mem::size_of::<
8483 FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8484 >() - 4usize];
8485 ["Alignment of FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1"]
8486 [::core::mem::align_of::<FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1>()
8487 - 1usize];
8488 ["Offset of field: FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1::minor"][::core::mem::offset_of!(
8489 FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8490 minor
8491 )
8492 - 0usize];
8493 ["Offset of field: FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1::major"][::core::mem::offset_of!(
8494 FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8495 major
8496 )
8497 - 2usize];
8498};
8499#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8500const _: () = {
8501 ["Size of FlipperApplicationManifestBase__bindgen_ty_1"]
8502 [::core::mem::size_of::<FlipperApplicationManifestBase__bindgen_ty_1>() - 4usize];
8503 ["Alignment of FlipperApplicationManifestBase__bindgen_ty_1"]
8504 [::core::mem::align_of::<FlipperApplicationManifestBase__bindgen_ty_1>() - 1usize];
8505 ["Offset of field: FlipperApplicationManifestBase__bindgen_ty_1::version"]
8506 [::core::mem::offset_of!(FlipperApplicationManifestBase__bindgen_ty_1, version) - 0usize];
8507};
8508#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8509const _: () = {
8510 ["Size of FlipperApplicationManifestBase"]
8511 [::core::mem::size_of::<FlipperApplicationManifestBase>() - 14usize];
8512 ["Alignment of FlipperApplicationManifestBase"]
8513 [::core::mem::align_of::<FlipperApplicationManifestBase>() - 1usize];
8514 ["Offset of field: FlipperApplicationManifestBase::manifest_magic"]
8515 [::core::mem::offset_of!(FlipperApplicationManifestBase, manifest_magic) - 0usize];
8516 ["Offset of field: FlipperApplicationManifestBase::manifest_version"]
8517 [::core::mem::offset_of!(FlipperApplicationManifestBase, manifest_version) - 4usize];
8518 ["Offset of field: FlipperApplicationManifestBase::api_version"]
8519 [::core::mem::offset_of!(FlipperApplicationManifestBase, api_version) - 8usize];
8520 ["Offset of field: FlipperApplicationManifestBase::hardware_target_id"]
8521 [::core::mem::offset_of!(FlipperApplicationManifestBase, hardware_target_id) - 12usize];
8522};
8523#[repr(C, packed)]
8524#[derive(Copy, Clone)]
8525pub struct FlipperApplicationManifestV1 {
8526 pub base: FlipperApplicationManifestBase,
8527 pub stack_size: u16,
8528 pub app_version: u32,
8529 pub name: [core::ffi::c_char; 32usize],
8530 pub has_icon: core::ffi::c_char,
8531 pub icon: [core::ffi::c_char; 32usize],
8532}
8533#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8534const _: () = {
8535 ["Size of FlipperApplicationManifestV1"]
8536 [::core::mem::size_of::<FlipperApplicationManifestV1>() - 85usize];
8537 ["Alignment of FlipperApplicationManifestV1"]
8538 [::core::mem::align_of::<FlipperApplicationManifestV1>() - 1usize];
8539 ["Offset of field: FlipperApplicationManifestV1::base"]
8540 [::core::mem::offset_of!(FlipperApplicationManifestV1, base) - 0usize];
8541 ["Offset of field: FlipperApplicationManifestV1::stack_size"]
8542 [::core::mem::offset_of!(FlipperApplicationManifestV1, stack_size) - 14usize];
8543 ["Offset of field: FlipperApplicationManifestV1::app_version"]
8544 [::core::mem::offset_of!(FlipperApplicationManifestV1, app_version) - 16usize];
8545 ["Offset of field: FlipperApplicationManifestV1::name"]
8546 [::core::mem::offset_of!(FlipperApplicationManifestV1, name) - 20usize];
8547 ["Offset of field: FlipperApplicationManifestV1::has_icon"]
8548 [::core::mem::offset_of!(FlipperApplicationManifestV1, has_icon) - 52usize];
8549 ["Offset of field: FlipperApplicationManifestV1::icon"]
8550 [::core::mem::offset_of!(FlipperApplicationManifestV1, icon) - 53usize];
8551};
8552pub type FlipperApplicationManifest = FlipperApplicationManifestV1;
8553unsafe extern "C" {
8554 #[doc = "Check if manifest is valid\n\n # Arguments\n\n* `manifest` -\n # Returns\n\nbool"]
8555 pub fn flipper_application_manifest_is_valid(
8556 manifest: *const FlipperApplicationManifest,
8557 ) -> bool;
8558}
8559unsafe extern "C" {
8560 #[doc = "Check if API Version declared in manifest is older than firmware ELF API interface\n\n # Arguments\n\n* `manifest` - The manifest\n * `api_interface` - The api interface\n\n # Returns\n\nbool"]
8561 pub fn flipper_application_manifest_is_too_old(
8562 manifest: *const FlipperApplicationManifest,
8563 api_interface: *const ElfApiInterface,
8564 ) -> bool;
8565}
8566unsafe extern "C" {
8567 #[doc = "Check if API Version declared in manifest is newer than firmware ELF API interface\n\n # Arguments\n\n* `manifest` - The manifest\n * `api_interface` - The api interface\n\n # Returns\n\nbool"]
8568 pub fn flipper_application_manifest_is_too_new(
8569 manifest: *const FlipperApplicationManifest,
8570 api_interface: *const ElfApiInterface,
8571 ) -> bool;
8572}
8573unsafe extern "C" {
8574 #[doc = "Check if application is compatible with current hardware\n\n # Arguments\n\n* `manifest` -\n # Returns\n\nbool"]
8575 pub fn flipper_application_manifest_is_target_compatible(
8576 manifest: *const FlipperApplicationManifest,
8577 ) -> bool;
8578}
8579#[doc = "< Read access"]
8580pub const FSAM_READ: FS_AccessMode = FS_AccessMode(1);
8581#[doc = "< Write access"]
8582pub const FSAM_WRITE: FS_AccessMode = FS_AccessMode(2);
8583#[doc = "< Read and write access"]
8584pub const FSAM_READ_WRITE: FS_AccessMode = FS_AccessMode(3);
8585#[repr(transparent)]
8586#[doc = "Access mode flags"]
8587#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8588pub struct FS_AccessMode(pub core::ffi::c_uchar);
8589#[doc = "< Open file, fail if file doesn't exist"]
8590pub const FSOM_OPEN_EXISTING: FS_OpenMode = FS_OpenMode(1);
8591#[doc = "< Open file. Create new file if not exist"]
8592pub const FSOM_OPEN_ALWAYS: FS_OpenMode = FS_OpenMode(2);
8593#[doc = "< Open file. Create new file if not exist. Set R/W pointer to EOF"]
8594pub const FSOM_OPEN_APPEND: FS_OpenMode = FS_OpenMode(4);
8595#[doc = "< Creates a new file. Fails if the file is exist"]
8596pub const FSOM_CREATE_NEW: FS_OpenMode = FS_OpenMode(8);
8597#[doc = "< Creates a new file. If file exist, truncate to zero size"]
8598pub const FSOM_CREATE_ALWAYS: FS_OpenMode = FS_OpenMode(16);
8599#[repr(transparent)]
8600#[doc = "Open mode flags"]
8601#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8602pub struct FS_OpenMode(pub core::ffi::c_uchar);
8603#[doc = "< No error"]
8604pub const FSE_OK: FS_Error = FS_Error(0);
8605#[doc = "< FS not ready"]
8606pub const FSE_NOT_READY: FS_Error = FS_Error(1);
8607#[doc = "< File/Dir already exist"]
8608pub const FSE_EXIST: FS_Error = FS_Error(2);
8609#[doc = "< File/Dir does not exist"]
8610pub const FSE_NOT_EXIST: FS_Error = FS_Error(3);
8611#[doc = "< Invalid API parameter"]
8612pub const FSE_INVALID_PARAMETER: FS_Error = FS_Error(4);
8613#[doc = "< Access denied"]
8614pub const FSE_DENIED: FS_Error = FS_Error(5);
8615#[doc = "< Invalid name/path"]
8616pub const FSE_INVALID_NAME: FS_Error = FS_Error(6);
8617#[doc = "< Internal error"]
8618pub const FSE_INTERNAL: FS_Error = FS_Error(7);
8619#[doc = "< Function not implemented"]
8620pub const FSE_NOT_IMPLEMENTED: FS_Error = FS_Error(8);
8621#[doc = "< File/Dir already opened"]
8622pub const FSE_ALREADY_OPEN: FS_Error = FS_Error(9);
8623#[repr(transparent)]
8624#[doc = "API errors enumeration"]
8625#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8626pub struct FS_Error(pub core::ffi::c_uchar);
8627#[doc = "< Directory"]
8628pub const FSF_DIRECTORY: FS_Flags = FS_Flags(1);
8629#[repr(transparent)]
8630#[doc = "FileInfo flags"]
8631#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8632pub struct FS_Flags(pub core::ffi::c_uchar);
8633#[repr(C)]
8634#[derive(Debug, Copy, Clone)]
8635pub struct File {
8636 _unused: [u8; 0],
8637}
8638#[doc = "Structure that hold file info"]
8639#[repr(C)]
8640#[derive(Debug, Copy, Clone)]
8641pub struct FileInfo {
8642 #[doc = "< flags from FS_Flags enum"]
8643 pub flags: u8,
8644 #[doc = "< file size"]
8645 pub size: u64,
8646}
8647#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8648const _: () = {
8649 ["Size of FileInfo"][::core::mem::size_of::<FileInfo>() - 16usize];
8650 ["Alignment of FileInfo"][::core::mem::align_of::<FileInfo>() - 8usize];
8651 ["Offset of field: FileInfo::flags"][::core::mem::offset_of!(FileInfo, flags) - 0usize];
8652 ["Offset of field: FileInfo::size"][::core::mem::offset_of!(FileInfo, size) - 8usize];
8653};
8654unsafe extern "C" {
8655 #[doc = "Gets the error text from FS_Error\n # Arguments\n\n* `error_id` - error id\n # Returns\n\nconst char* error text"]
8656 pub fn filesystem_api_error_get_desc(error_id: FS_Error) -> *const core::ffi::c_char;
8657}
8658unsafe extern "C" {
8659 #[doc = "Checks if file info is directory\n # Arguments\n\n* `file_info` - file info pointer\n # Returns\n\nbool is directory"]
8660 pub fn file_info_is_dir(file_info: *const FileInfo) -> bool;
8661}
8662pub const FST_UNKNOWN: SDFsType = SDFsType(0);
8663pub const FST_FAT12: SDFsType = SDFsType(1);
8664pub const FST_FAT16: SDFsType = SDFsType(2);
8665pub const FST_FAT32: SDFsType = SDFsType(3);
8666pub const FST_EXFAT: SDFsType = SDFsType(4);
8667#[repr(transparent)]
8668#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8669pub struct SDFsType(pub core::ffi::c_uchar);
8670#[repr(C)]
8671#[derive(Debug, Copy, Clone)]
8672pub struct SDInfo {
8673 pub fs_type: SDFsType,
8674 pub kb_total: u32,
8675 pub kb_free: u32,
8676 pub cluster_size: u16,
8677 pub sector_size: u16,
8678 pub label: [core::ffi::c_char; 34usize],
8679 pub manufacturer_id: u8,
8680 pub oem_id: [core::ffi::c_char; 3usize],
8681 pub product_name: [core::ffi::c_char; 6usize],
8682 pub product_revision_major: u8,
8683 pub product_revision_minor: u8,
8684 pub product_serial_number: u32,
8685 pub manufacturing_month: u8,
8686 pub manufacturing_year: u16,
8687}
8688#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8689const _: () = {
8690 ["Size of SDInfo"][::core::mem::size_of::<SDInfo>() - 72usize];
8691 ["Alignment of SDInfo"][::core::mem::align_of::<SDInfo>() - 4usize];
8692 ["Offset of field: SDInfo::fs_type"][::core::mem::offset_of!(SDInfo, fs_type) - 0usize];
8693 ["Offset of field: SDInfo::kb_total"][::core::mem::offset_of!(SDInfo, kb_total) - 4usize];
8694 ["Offset of field: SDInfo::kb_free"][::core::mem::offset_of!(SDInfo, kb_free) - 8usize];
8695 ["Offset of field: SDInfo::cluster_size"]
8696 [::core::mem::offset_of!(SDInfo, cluster_size) - 12usize];
8697 ["Offset of field: SDInfo::sector_size"]
8698 [::core::mem::offset_of!(SDInfo, sector_size) - 14usize];
8699 ["Offset of field: SDInfo::label"][::core::mem::offset_of!(SDInfo, label) - 16usize];
8700 ["Offset of field: SDInfo::manufacturer_id"]
8701 [::core::mem::offset_of!(SDInfo, manufacturer_id) - 50usize];
8702 ["Offset of field: SDInfo::oem_id"][::core::mem::offset_of!(SDInfo, oem_id) - 51usize];
8703 ["Offset of field: SDInfo::product_name"]
8704 [::core::mem::offset_of!(SDInfo, product_name) - 54usize];
8705 ["Offset of field: SDInfo::product_revision_major"]
8706 [::core::mem::offset_of!(SDInfo, product_revision_major) - 60usize];
8707 ["Offset of field: SDInfo::product_revision_minor"]
8708 [::core::mem::offset_of!(SDInfo, product_revision_minor) - 61usize];
8709 ["Offset of field: SDInfo::product_serial_number"]
8710 [::core::mem::offset_of!(SDInfo, product_serial_number) - 64usize];
8711 ["Offset of field: SDInfo::manufacturing_month"]
8712 [::core::mem::offset_of!(SDInfo, manufacturing_month) - 68usize];
8713 ["Offset of field: SDInfo::manufacturing_year"]
8714 [::core::mem::offset_of!(SDInfo, manufacturing_year) - 70usize];
8715};
8716unsafe extern "C" {
8717 pub fn sd_api_get_fs_type_text(fs_type: SDFsType) -> *const core::ffi::c_char;
8718}
8719#[repr(C)]
8720#[derive(Debug, Copy, Clone)]
8721pub struct Storage {
8722 _unused: [u8; 0],
8723}
8724unsafe extern "C" {
8725 #[doc = "Allocate and initialize a file instance.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n # Returns\n\npointer to the created instance."]
8726 pub fn storage_file_alloc(storage: *mut Storage) -> *mut File;
8727}
8728unsafe extern "C" {
8729 #[doc = "Free the file instance.\n\n If the file was open, calling this function will close it automatically.\n # Arguments\n\n* `file` - pointer to the file instance to be freed."]
8730 pub fn storage_file_free(file: *mut File);
8731}
8732#[doc = "< SD card was mounted."]
8733pub const StorageEventTypeCardMount: StorageEventType = StorageEventType(0);
8734#[doc = "< SD card was unmounted."]
8735pub const StorageEventTypeCardUnmount: StorageEventType = StorageEventType(1);
8736#[doc = "< An error occurred during mounting of an SD card."]
8737pub const StorageEventTypeCardMountError: StorageEventType = StorageEventType(2);
8738#[doc = "< A file was closed."]
8739pub const StorageEventTypeFileClose: StorageEventType = StorageEventType(3);
8740#[doc = "< A directory was closed."]
8741pub const StorageEventTypeDirClose: StorageEventType = StorageEventType(4);
8742#[repr(transparent)]
8743#[doc = "Enumeration of events emitted by the storage through the PubSub system."]
8744#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8745pub struct StorageEventType(pub core::ffi::c_uchar);
8746#[doc = "Storage event (passed to the PubSub callback)."]
8747#[repr(C)]
8748#[derive(Debug, Copy, Clone)]
8749pub struct StorageEvent {
8750 #[doc = "< Type of the event."]
8751 pub type_: StorageEventType,
8752}
8753#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8754const _: () = {
8755 ["Size of StorageEvent"][::core::mem::size_of::<StorageEvent>() - 1usize];
8756 ["Alignment of StorageEvent"][::core::mem::align_of::<StorageEvent>() - 1usize];
8757 ["Offset of field: StorageEvent::type_"][::core::mem::offset_of!(StorageEvent, type_) - 0usize];
8758};
8759unsafe extern "C" {
8760 #[doc = "Get the storage pubsub instance.\n\n Storage will send StorageEvent messages.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n # Returns\n\npointer to the pubsub instance."]
8761 pub fn storage_get_pubsub(storage: *mut Storage) -> *mut FuriPubSub;
8762}
8763unsafe extern "C" {
8764 #[doc = "Open an existing file or create a new one.\n\n The calling code MUST call storage_file_close() even if the open operation had failed.\n\n # Arguments\n\n* `file` - pointer to the file instance to be opened.\n * `path` - pointer to a zero-terminated string containing the path to the file to be opened.\n * `access_mode` - access mode from FS_AccessMode.\n * `open_mode` - open mode from FS_OpenMode\n # Returns\n\ntrue if the file was successfully opened, false otherwise."]
8765 pub fn storage_file_open(
8766 file: *mut File,
8767 path: *const core::ffi::c_char,
8768 access_mode: FS_AccessMode,
8769 open_mode: FS_OpenMode,
8770 ) -> bool;
8771}
8772unsafe extern "C" {
8773 #[doc = "Close the file.\n\n # Arguments\n\n* `file` - pointer to the file instance to be closed.\n # Returns\n\ntrue if the file was successfully closed, false otherwise."]
8774 pub fn storage_file_close(file: *mut File) -> bool;
8775}
8776unsafe extern "C" {
8777 #[doc = "Check whether the file is open.\n\n # Arguments\n\n* `file` - pointer to the file instance in question.\n # Returns\n\ntrue if the file is open, false otherwise."]
8778 pub fn storage_file_is_open(file: *mut File) -> bool;
8779}
8780unsafe extern "C" {
8781 #[doc = "Check whether a file instance represents a directory.\n\n # Arguments\n\n* `file` - pointer to the file instance in question.\n # Returns\n\ntrue if the file instance represents a directory, false otherwise."]
8782 pub fn storage_file_is_dir(file: *mut File) -> bool;
8783}
8784unsafe extern "C" {
8785 #[doc = "Read bytes from a file into a buffer.\n\n # Arguments\n\n* `file` - pointer to the file instance to read from.\n * `buff` - pointer to the buffer to be filled with read data.\n * `bytes_to_read` - number of bytes to read. Must be less than or equal to the size of the buffer.\n # Returns\n\nactual number of bytes read (may be fewer than requested)."]
8786 pub fn storage_file_read(
8787 file: *mut File,
8788 buff: *mut core::ffi::c_void,
8789 bytes_to_read: usize,
8790 ) -> usize;
8791}
8792unsafe extern "C" {
8793 #[doc = "Write bytes from a buffer to a file.\n\n # Arguments\n\n* `file` - pointer to the file instance to write into.\n * `buff` - pointer to the buffer containing the data to be written.\n * `bytes_to_write` - number of bytes to write. Must be less than or equal to the size of the buffer.\n # Returns\n\nactual number of bytes written (may be fewer than requested)."]
8794 pub fn storage_file_write(
8795 file: *mut File,
8796 buff: *const core::ffi::c_void,
8797 bytes_to_write: usize,
8798 ) -> usize;
8799}
8800unsafe extern "C" {
8801 #[doc = "Change the current access position in a file.\n\n # Arguments\n\n* `file` - pointer to the file instance in question.\n * `offset` - access position offset (meaning depends on from_start parameter).\n * `from_start` - if true, set the access position relative to the file start, otherwise relative to the current position.\n # Returns\n\nsuccess flag"]
8802 pub fn storage_file_seek(file: *mut File, offset: u32, from_start: bool) -> bool;
8803}
8804unsafe extern "C" {
8805 #[doc = "Get the current access position.\n\n # Arguments\n\n* `file` - pointer to the file instance in question.\n # Returns\n\ncurrent access position."]
8806 pub fn storage_file_tell(file: *mut File) -> u64;
8807}
8808unsafe extern "C" {
8809 #[doc = "Truncate the file size to the current access position.\n\n # Arguments\n\n* `file` - pointer to the file instance to be truncated.\n # Returns\n\ntrue if the file was successfully truncated, false otherwise."]
8810 pub fn storage_file_truncate(file: *mut File) -> bool;
8811}
8812unsafe extern "C" {
8813 #[doc = "Get the file size.\n\n # Arguments\n\n* `file` - pointer to the file instance in question.\n # Returns\n\nsize of the file, in bytes."]
8814 pub fn storage_file_size(file: *mut File) -> u64;
8815}
8816unsafe extern "C" {
8817 #[doc = "Synchronise the file cache with the actual storage.\n\n # Arguments\n\n* `file` - pointer to the file instance in question.\n # Returns\n\ntrue if the file was successfully synchronised, false otherwise."]
8818 pub fn storage_file_sync(file: *mut File) -> bool;
8819}
8820unsafe extern "C" {
8821 #[doc = "Check whether the current access position is at the end of the file.\n\n # Arguments\n\n* `file` - pointer to a file instance in question.\n # Returns\n\nbool true if the current access position is at the end of the file, false otherwise."]
8822 pub fn storage_file_eof(file: *mut File) -> bool;
8823}
8824unsafe extern "C" {
8825 #[doc = "Check whether a file exists.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path to the file in question.\n # Returns\n\ntrue if the file exists, false otherwise."]
8826 pub fn storage_file_exists(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8827}
8828unsafe extern "C" {
8829 #[doc = "Copy data from a source file to the destination file.\n\n Both files must be opened prior to calling this function.\n\n The requested amount of bytes will be copied from the current access position\n in the source file to the current access position in the destination file.\n\n # Arguments\n\n* `source` - pointer to a source file instance.\n * `destination` - pointer to a destination file instance.\n * `size` - data size to be copied, in bytes.\n # Returns\n\ntrue if the data was successfully copied, false otherwise."]
8830 pub fn storage_file_copy_to_file(
8831 source: *mut File,
8832 destination: *mut File,
8833 size: usize,
8834 ) -> bool;
8835}
8836unsafe extern "C" {
8837 #[doc = "Open a directory.\n\n Opening a directory is necessary to be able to read its contents with storage_dir_read().\n\n The calling code MUST call storage_dir_close() even if the open operation had failed.\n\n # Arguments\n\n* `file` - pointer to a file instance representing the directory in question.\n * `path` - pointer to a zero-terminated string containing the path of the directory in question.\n # Returns\n\ntrue if the directory was successfully opened, false otherwise."]
8838 pub fn storage_dir_open(file: *mut File, path: *const core::ffi::c_char) -> bool;
8839}
8840unsafe extern "C" {
8841 #[doc = "Close the directory.\n\n # Arguments\n\n* `file` - pointer to a file instance representing the directory in question.\n # Returns\n\ntrue if the directory was successfully closed, false otherwise."]
8842 pub fn storage_dir_close(file: *mut File) -> bool;
8843}
8844unsafe extern "C" {
8845 #[doc = "Get the next item in the directory.\n\n If the next object does not exist, this function returns false as well\n and sets the file error id to FSE_NOT_EXIST.\n\n # Arguments\n\n* `file` - pointer to a file instance representing the directory in question.\n * `fileinfo` - pointer to the FileInfo structure to contain the info (may be NULL).\n * `name` - pointer to the buffer to contain the name (may be NULL).\n * `name_length` - maximum capacity of the name buffer, in bytes.\n # Returns\n\ntrue if the next item was successfully read, false otherwise."]
8846 pub fn storage_dir_read(
8847 file: *mut File,
8848 fileinfo: *mut FileInfo,
8849 name: *mut core::ffi::c_char,
8850 name_length: u16,
8851 ) -> bool;
8852}
8853unsafe extern "C" {
8854 #[doc = "Check whether a directory exists.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path of the directory in question.\n # Returns\n\ntrue if the directory exists, false otherwise."]
8855 pub fn storage_dir_exists(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8856}
8857unsafe extern "C" {
8858 #[doc = "Get the last access time in UNIX format.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path of the item in question.\n * `timestamp` - pointer to a value to contain the timestamp.\n # Returns\n\nFSE_OK if the timestamp has been successfully received, any other error code on failure."]
8859 pub fn storage_common_timestamp(
8860 storage: *mut Storage,
8861 path: *const core::ffi::c_char,
8862 timestamp: *mut u32,
8863 ) -> FS_Error;
8864}
8865unsafe extern "C" {
8866 #[doc = "Get information about a file or a directory.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path of the item in question.\n * `fileinfo` - pointer to the FileInfo structure to contain the info (may be NULL).\n # Returns\n\nFSE_OK if the info has been successfully received, any other error code on failure."]
8867 pub fn storage_common_stat(
8868 storage: *mut Storage,
8869 path: *const core::ffi::c_char,
8870 fileinfo: *mut FileInfo,
8871 ) -> FS_Error;
8872}
8873unsafe extern "C" {
8874 #[doc = "Remove a file or a directory.\n\n The directory must be empty.\n The file or the directory must NOT be open.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path of the item to be removed.\n # Returns\n\nFSE_OK if the file or directory has been successfully removed, any other error code on failure."]
8875 pub fn storage_common_remove(storage: *mut Storage, path: *const core::ffi::c_char)
8876 -> FS_Error;
8877}
8878unsafe extern "C" {
8879 #[doc = "Rename a file or a directory.\n\n The file or the directory must NOT be open.\n Will overwrite the destination file if it already exists.\n\n Renaming a regular file to itself does nothing and always succeeds.\n Renaming a directory to itself or to a subdirectory of itself always fails.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `old_path` - pointer to a zero-terminated string containing the source path.\n * `new_path` - pointer to a zero-terminated string containing the destination path.\n # Returns\n\nFSE_OK if the file or directory has been successfully renamed, any other error code on failure."]
8880 pub fn storage_common_rename(
8881 storage: *mut Storage,
8882 old_path: *const core::ffi::c_char,
8883 new_path: *const core::ffi::c_char,
8884 ) -> FS_Error;
8885}
8886unsafe extern "C" {
8887 #[doc = "Copy the file to a new location.\n\n The file must NOT be open at the time of calling this function.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `old_path` - pointer to a zero-terminated string containing the source path.\n * `new_path` - pointer to a zero-terminated string containing the destination path.\n # Returns\n\nFSE_OK if the file has been successfully copied, any other error code on failure."]
8888 pub fn storage_common_copy(
8889 storage: *mut Storage,
8890 old_path: *const core::ffi::c_char,
8891 new_path: *const core::ffi::c_char,
8892 ) -> FS_Error;
8893}
8894unsafe extern "C" {
8895 #[doc = "Copy the contents of one directory into another and rename all conflicting files.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `old_path` - pointer to a zero-terminated string containing the source path.\n * `new_path` - pointer to a zero-terminated string containing the destination path.\n # Returns\n\nFSE_OK if the directories have been successfully merged, any other error code on failure."]
8896 pub fn storage_common_merge(
8897 storage: *mut Storage,
8898 old_path: *const core::ffi::c_char,
8899 new_path: *const core::ffi::c_char,
8900 ) -> FS_Error;
8901}
8902unsafe extern "C" {
8903 #[doc = "Create a directory.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the directory path.\n # Returns\n\nFSE_OK if the directory has been successfully created, any other error code on failure."]
8904 pub fn storage_common_mkdir(storage: *mut Storage, path: *const core::ffi::c_char) -> FS_Error;
8905}
8906unsafe extern "C" {
8907 #[doc = "Get the general information about the storage.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `fs_path` - pointer to a zero-terminated string containing the path to the storage question.\n * `total_space` - pointer to the value to contain the total capacity, in bytes.\n * `free_space` - pointer to the value to contain the available space, in bytes.\n # Returns\n\nFSE_OK if the information has been successfully received, any other error code on failure."]
8908 pub fn storage_common_fs_info(
8909 storage: *mut Storage,
8910 fs_path: *const core::ffi::c_char,
8911 total_space: *mut u64,
8912 free_space: *mut u64,
8913 ) -> FS_Error;
8914}
8915unsafe extern "C" {
8916 #[doc = "Parse aliases in a path and replace them with the real path.\n\n Necessary special directories will be created automatically if they did not exist.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path in question."]
8917 pub fn storage_common_resolve_path_and_ensure_app_directory(
8918 storage: *mut Storage,
8919 path: *mut FuriString,
8920 );
8921}
8922unsafe extern "C" {
8923 #[doc = "Move the contents of source folder to destination one and rename all conflicting files.\n\n Source folder will be deleted if the migration was successful.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `source` - pointer to a zero-terminated string containing the source path.\n * `dest` - pointer to a zero-terminated string containing the destination path.\n # Returns\n\nFSE_OK if the migration was successfully completed, any other error code on failure."]
8924 pub fn storage_common_migrate(
8925 storage: *mut Storage,
8926 source: *const core::ffi::c_char,
8927 dest: *const core::ffi::c_char,
8928 ) -> FS_Error;
8929}
8930unsafe extern "C" {
8931 #[doc = "Check whether a file or a directory exists.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the path in question.\n # Returns\n\ntrue if a file or a directory exists, false otherwise."]
8932 pub fn storage_common_exists(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8933}
8934unsafe extern "C" {
8935 #[doc = "Check whether two paths are equivalent.\n\n This function will resolve aliases and apply filesystem-specific\n rules to determine whether the two given paths are equivalent.\n\n Examples:\n - /int/text and /ext/test -> false (Different storages),\n - /int/Test and /int/test -> false (Case-sensitive storage),\n - /ext/Test and /ext/test -> true (Case-insensitive storage).\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path1` - pointer to a zero-terminated string containing the first path.\n * `path2` - pointer to a zero-terminated string containing the second path.\n # Returns\n\ntrue if paths are equivalent, false otherwise."]
8936 pub fn storage_common_equivalent_path(
8937 storage: *mut Storage,
8938 path1: *const core::ffi::c_char,
8939 path2: *const core::ffi::c_char,
8940 ) -> bool;
8941}
8942unsafe extern "C" {
8943 #[doc = "Check whether a path is a subpath of another path.\n\n This function respects storage-defined equivalence rules\n (see `storage_common_equivalent_path`).\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `parent` - pointer to a zero-terminated string containing the parent path.\n * `child` - pointer to a zero-terminated string containing the child path.\n # Returns\n\ntrue if `child` is a subpath of `parent`, or if `child` is equivalent\n to `parent`; false otherwise."]
8944 pub fn storage_common_is_subdir(
8945 storage: *mut Storage,
8946 parent: *const core::ffi::c_char,
8947 child: *const core::ffi::c_char,
8948 ) -> bool;
8949}
8950unsafe extern "C" {
8951 #[doc = "Get the textual description of a numeric error identifier.\n\n # Arguments\n\n* `error_id` - numeric identifier of the error in question.\n # Returns\n\npointer to a statically allocated zero-terminated string containing the respective error text."]
8952 pub fn storage_error_get_desc(error_id: FS_Error) -> *const core::ffi::c_char;
8953}
8954unsafe extern "C" {
8955 #[doc = "Get the numeric error identifier from a file instance.\n\n It is not possible to get the error identifier after the file has been closed.\n\n # Arguments\n\n* `file` - pointer to the file instance in question (must NOT be NULL).\n # Returns\n\nnumeric identifier of the last error associated with the file instance."]
8956 pub fn storage_file_get_error(file: *mut File) -> FS_Error;
8957}
8958unsafe extern "C" {
8959 #[doc = "Get the textual description of a the last error associated with a file instance.\n\n It is not possible to get the error text after the file has been closed.\n\n # Arguments\n\n* `file` - pointer to the file instance in question (must NOT be NULL).\n # Returns\n\npointer to a statically allocated zero-terminated string containing the respective error text."]
8960 pub fn storage_file_get_error_desc(file: *mut File) -> *const core::ffi::c_char;
8961}
8962unsafe extern "C" {
8963 #[doc = "Format the SD Card.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n # Returns\n\nFSE_OK if the card was successfully formatted, any other error code on failure."]
8964 pub fn storage_sd_format(storage: *mut Storage) -> FS_Error;
8965}
8966unsafe extern "C" {
8967 #[doc = "Unmount the SD card.\n\n These return values have special meaning:\n - FSE_NOT_READY if the SD card is not mounted.\n - FSE_DENIED if there are open files on the SD card.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n # Returns\n\nFSE_OK if the card was successfully formatted, any other error code on failure."]
8968 pub fn storage_sd_unmount(storage: *mut Storage) -> FS_Error;
8969}
8970unsafe extern "C" {
8971 #[doc = "Mount the SD card.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n # Returns\n\nFSE_OK if the card was successfully mounted, any other error code on failure."]
8972 pub fn storage_sd_mount(storage: *mut Storage) -> FS_Error;
8973}
8974unsafe extern "C" {
8975 #[doc = "Get SD card information.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `info` - pointer to the info object to contain the requested information.\n # Returns\n\nFSE_OK if the info was successfully received, any other error code on failure."]
8976 pub fn storage_sd_info(storage: *mut Storage, info: *mut SDInfo) -> FS_Error;
8977}
8978unsafe extern "C" {
8979 #[doc = "Get SD card status.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n # Returns\n\nstorage status in the form of a numeric error identifier."]
8980 pub fn storage_sd_status(storage: *mut Storage) -> FS_Error;
8981}
8982#[doc = "Internal Storage Backup/Restore"]
8983pub type StorageNameConverter = ::core::option::Option<unsafe extern "C" fn(arg1: *mut FuriString)>;
8984unsafe extern "C" {
8985 #[doc = "Back up the internal storage contents to a *.tar archive.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `dstname` - pointer to a zero-terminated string containing the archive file path.\n # Returns\n\nFSE_OK if the storage was successfully backed up, any other error code on failure."]
8986 pub fn storage_int_backup(storage: *mut Storage, dstname: *const core::ffi::c_char)
8987 -> FS_Error;
8988}
8989unsafe extern "C" {
8990 #[doc = "Restore the internal storage contents from a *.tar archive.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `dstname` - pointer to a zero-terminated string containing the archive file path.\n * `converter` - pointer to a filename conversion function (may be NULL).\n # Returns\n\nFSE_OK if the storage was successfully restored, any other error code on failure."]
8991 pub fn storage_int_restore(
8992 storage: *mut Storage,
8993 dstname: *const core::ffi::c_char,
8994 converter: StorageNameConverter,
8995 ) -> FS_Error;
8996}
8997unsafe extern "C" {
8998 #[doc = "Remove a file or a directory.\n\n The following conditions must be met:\n - the directory must be empty.\n - the file or the directory must NOT be open.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the item path.\n # Returns\n\ntrue on success or if the item does not exist, false otherwise."]
8999 pub fn storage_simply_remove(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
9000}
9001unsafe extern "C" {
9002 #[doc = "Recursively remove a file or a directory.\n\n Unlike storage_simply_remove(), the directory does not need to be empty.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the item path.\n # Returns\n\ntrue on success or if the item does not exist, false otherwise."]
9003 pub fn storage_simply_remove_recursive(
9004 storage: *mut Storage,
9005 path: *const core::ffi::c_char,
9006 ) -> bool;
9007}
9008unsafe extern "C" {
9009 #[doc = "Create a directory.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `path` - pointer to a zero-terminated string containing the directory path.\n # Returns\n\ntrue on success or if directory does already exist, false otherwise."]
9010 pub fn storage_simply_mkdir(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
9011}
9012unsafe extern "C" {
9013 #[doc = "Get the next free filename in a directory.\n\n Usage example:\n ```c\n FuriString* file_name = furi_string_alloc();\n Storage* storage = furi_record_open(RECORD_STORAGE);\n\n storage_get_next_filename(storage,\n \"/ext/test\",\n \"cookies\",\n \".yum\",\n 20);\n\n furi_record_close(RECORD_STORAGE);\n\n use_file_name(file_name);\n\n furi_string_free(file_name);\n ```\n Possible file_name values after calling storage_get_next_filename():\n \"cookies\", \"cookies1\", \"cookies2\", ... etc depending on whether any of\n these files have already existed in the directory.\n\n > **Note:** If the resulting next file name length is greater than set by the max_len\n parameter, the original filename will be returned instead.\n\n # Arguments\n\n* `storage` - pointer to a storage API instance.\n * `dirname` - pointer to a zero-terminated string containing the directory path.\n * `filename` - pointer to a zero-terminated string containing the file name.\n * `fileextension` - pointer to a zero-terminated string containing the file extension.\n * `nextfilename` - pointer to a dynamic string containing the resulting file name.\n * `max_len` - maximum length of the new name."]
9014 pub fn storage_get_next_filename(
9015 storage: *mut Storage,
9016 dirname: *const core::ffi::c_char,
9017 filename: *const core::ffi::c_char,
9018 fileextension: *const core::ffi::c_char,
9019 nextfilename: *mut FuriString,
9020 max_len: u8,
9021 );
9022}
9023pub const FlipperApplicationPreloadStatusSuccess: FlipperApplicationPreloadStatus =
9024 FlipperApplicationPreloadStatus(0);
9025pub const FlipperApplicationPreloadStatusInvalidFile: FlipperApplicationPreloadStatus =
9026 FlipperApplicationPreloadStatus(1);
9027pub const FlipperApplicationPreloadStatusNotEnoughMemory: FlipperApplicationPreloadStatus =
9028 FlipperApplicationPreloadStatus(2);
9029pub const FlipperApplicationPreloadStatusInvalidManifest: FlipperApplicationPreloadStatus =
9030 FlipperApplicationPreloadStatus(3);
9031pub const FlipperApplicationPreloadStatusApiTooOld: FlipperApplicationPreloadStatus =
9032 FlipperApplicationPreloadStatus(4);
9033pub const FlipperApplicationPreloadStatusApiTooNew: FlipperApplicationPreloadStatus =
9034 FlipperApplicationPreloadStatus(5);
9035pub const FlipperApplicationPreloadStatusTargetMismatch: FlipperApplicationPreloadStatus =
9036 FlipperApplicationPreloadStatus(6);
9037#[repr(transparent)]
9038#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9039pub struct FlipperApplicationPreloadStatus(pub core::ffi::c_uchar);
9040pub const FlipperApplicationLoadStatusSuccess: FlipperApplicationLoadStatus =
9041 FlipperApplicationLoadStatus(0);
9042pub const FlipperApplicationLoadStatusUnspecifiedError: FlipperApplicationLoadStatus =
9043 FlipperApplicationLoadStatus(1);
9044pub const FlipperApplicationLoadStatusMissingImports: FlipperApplicationLoadStatus =
9045 FlipperApplicationLoadStatus(2);
9046#[repr(transparent)]
9047#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9048pub struct FlipperApplicationLoadStatus(pub core::ffi::c_uchar);
9049unsafe extern "C" {
9050 #[doc = "Get text description of preload status\n # Arguments\n\n* `status` - Status code\n # Returns\n\nString pointer to description"]
9051 pub fn flipper_application_preload_status_to_string(
9052 status: FlipperApplicationPreloadStatus,
9053 ) -> *const core::ffi::c_char;
9054}
9055unsafe extern "C" {
9056 #[doc = "Get text description of load status\n # Arguments\n\n* `status` - Status code\n # Returns\n\nString pointer to description"]
9057 pub fn flipper_application_load_status_to_string(
9058 status: FlipperApplicationLoadStatus,
9059 ) -> *const core::ffi::c_char;
9060}
9061#[repr(C)]
9062#[derive(Debug, Copy, Clone)]
9063pub struct FlipperApplication {
9064 _unused: [u8; 0],
9065}
9066#[repr(C)]
9067#[derive(Debug, Copy, Clone)]
9068pub struct FlipperApplicationMemoryMapEntry {
9069 pub name: *const core::ffi::c_char,
9070 pub address: u32,
9071}
9072#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9073const _: () = {
9074 ["Size of FlipperApplicationMemoryMapEntry"]
9075 [::core::mem::size_of::<FlipperApplicationMemoryMapEntry>() - 8usize];
9076 ["Alignment of FlipperApplicationMemoryMapEntry"]
9077 [::core::mem::align_of::<FlipperApplicationMemoryMapEntry>() - 4usize];
9078 ["Offset of field: FlipperApplicationMemoryMapEntry::name"]
9079 [::core::mem::offset_of!(FlipperApplicationMemoryMapEntry, name) - 0usize];
9080 ["Offset of field: FlipperApplicationMemoryMapEntry::address"]
9081 [::core::mem::offset_of!(FlipperApplicationMemoryMapEntry, address) - 4usize];
9082};
9083#[repr(C)]
9084#[derive(Debug, Copy, Clone)]
9085pub struct FlipperApplicationState {
9086 pub mmap_entry_count: u32,
9087 pub mmap_entries: *mut FlipperApplicationMemoryMapEntry,
9088 pub debug_link_size: u32,
9089 pub debug_link: *mut u8,
9090}
9091#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9092const _: () = {
9093 ["Size of FlipperApplicationState"]
9094 [::core::mem::size_of::<FlipperApplicationState>() - 16usize];
9095 ["Alignment of FlipperApplicationState"]
9096 [::core::mem::align_of::<FlipperApplicationState>() - 4usize];
9097 ["Offset of field: FlipperApplicationState::mmap_entry_count"]
9098 [::core::mem::offset_of!(FlipperApplicationState, mmap_entry_count) - 0usize];
9099 ["Offset of field: FlipperApplicationState::mmap_entries"]
9100 [::core::mem::offset_of!(FlipperApplicationState, mmap_entries) - 4usize];
9101 ["Offset of field: FlipperApplicationState::debug_link_size"]
9102 [::core::mem::offset_of!(FlipperApplicationState, debug_link_size) - 8usize];
9103 ["Offset of field: FlipperApplicationState::debug_link"]
9104 [::core::mem::offset_of!(FlipperApplicationState, debug_link) - 12usize];
9105};
9106unsafe extern "C" {
9107 #[doc = "Initialize FlipperApplication object\n # Arguments\n\n* `storage` - Storage instance\n * `api_interface` - ELF API interface to use for pre-loading and symbol resolving\n # Returns\n\nApplication instance"]
9108 pub fn flipper_application_alloc(
9109 storage: *mut Storage,
9110 api_interface: *const ElfApiInterface,
9111 ) -> *mut FlipperApplication;
9112}
9113unsafe extern "C" {
9114 #[doc = "Destroy FlipperApplication object\n # Arguments\n\n* `app` - Application pointer"]
9115 pub fn flipper_application_free(app: *mut FlipperApplication);
9116}
9117unsafe extern "C" {
9118 #[doc = "Validate elf file and load application metadata\n\n # Arguments\n\n* `app` - Application pointer\n * `path` (direction in) - The path to fap file\n\n # Returns\n\nPreload result code"]
9119 pub fn flipper_application_preload(
9120 app: *mut FlipperApplication,
9121 path: *const core::ffi::c_char,
9122 ) -> FlipperApplicationPreloadStatus;
9123}
9124unsafe extern "C" {
9125 #[doc = "Validate elf file and load application manifest\n\n # Arguments\n\n* `app` - Application pointer\n * `path` (direction in) - The path to fap file\n\n # Returns\n\nPreload result code"]
9126 pub fn flipper_application_preload_manifest(
9127 app: *mut FlipperApplication,
9128 path: *const core::ffi::c_char,
9129 ) -> FlipperApplicationPreloadStatus;
9130}
9131unsafe extern "C" {
9132 #[doc = "Get pointer to application manifest for preloaded application\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\nPointer to application manifest"]
9133 pub fn flipper_application_get_manifest(
9134 app: *mut FlipperApplication,
9135 ) -> *const FlipperApplicationManifest;
9136}
9137unsafe extern "C" {
9138 #[doc = "Load sections and process relocations for already pre-loaded application\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\nLoad result code"]
9139 pub fn flipper_application_map_to_memory(
9140 app: *mut FlipperApplication,
9141 ) -> FlipperApplicationLoadStatus;
9142}
9143unsafe extern "C" {
9144 #[doc = "Allocate application thread at entry point address, using app name and\n stack size from metadata. Returned thread isn't started yet.\n Can be only called once for application instance.\n # Arguments\n\n* `app` - Applicaiton pointer\n * `args` - Args to pass to app's entry point\n # Returns\n\nCreated thread"]
9145 pub fn flipper_application_alloc_thread(
9146 app: *mut FlipperApplication,
9147 args: *const core::ffi::c_char,
9148 ) -> *mut FuriThread;
9149}
9150unsafe extern "C" {
9151 #[doc = "Check if application is a plugin (not a runnable standalone app)\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\ntrue if application is a plugin, false otherwise"]
9152 pub fn flipper_application_is_plugin(app: *mut FlipperApplication) -> bool;
9153}
9154#[doc = "Entry point prototype for standalone applications"]
9155pub type FlipperApplicationEntryPoint =
9156 ::core::option::Option<unsafe extern "C" fn(arg1: *mut core::ffi::c_void) -> i32>;
9157#[doc = "An object that describes a plugin - must be returned by plugin's entry point"]
9158#[repr(C)]
9159#[derive(Debug, Copy, Clone)]
9160pub struct FlipperAppPluginDescriptor {
9161 pub appid: *const core::ffi::c_char,
9162 pub ep_api_version: u32,
9163 pub entry_point: *const core::ffi::c_void,
9164}
9165#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9166const _: () = {
9167 ["Size of FlipperAppPluginDescriptor"]
9168 [::core::mem::size_of::<FlipperAppPluginDescriptor>() - 12usize];
9169 ["Alignment of FlipperAppPluginDescriptor"]
9170 [::core::mem::align_of::<FlipperAppPluginDescriptor>() - 4usize];
9171 ["Offset of field: FlipperAppPluginDescriptor::appid"]
9172 [::core::mem::offset_of!(FlipperAppPluginDescriptor, appid) - 0usize];
9173 ["Offset of field: FlipperAppPluginDescriptor::ep_api_version"]
9174 [::core::mem::offset_of!(FlipperAppPluginDescriptor, ep_api_version) - 4usize];
9175 ["Offset of field: FlipperAppPluginDescriptor::entry_point"]
9176 [::core::mem::offset_of!(FlipperAppPluginDescriptor, entry_point) - 8usize];
9177};
9178#[doc = "Entry point prototype for plugins"]
9179pub type FlipperApplicationPluginEntryPoint =
9180 ::core::option::Option<unsafe extern "C" fn() -> *const FlipperAppPluginDescriptor>;
9181unsafe extern "C" {
9182 #[doc = "Get plugin descriptor for preloaded plugin\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\nPointer to plugin descriptor"]
9183 pub fn flipper_application_plugin_get_descriptor(
9184 app: *mut FlipperApplication,
9185 ) -> *const FlipperAppPluginDescriptor;
9186}
9187unsafe extern "C" {
9188 #[doc = "Load name and icon from FAP file.\n\n # Arguments\n\n* `path` - Path to FAP file.\n * `storage` - Storage instance.\n * `icon_ptr` - Icon pointer.\n * `item_name` - Application name.\n # Returns\n\ntrue if icon and name were loaded successfully."]
9189 pub fn flipper_application_load_name_and_icon(
9190 path: *mut FuriString,
9191 storage: *mut Storage,
9192 icon_ptr: *mut *mut u8,
9193 item_name: *mut FuriString,
9194 ) -> bool;
9195}
9196#[repr(C)]
9197#[derive(Debug, Copy, Clone)]
9198pub struct SubGhzDeviceRegistry {
9199 _unused: [u8; 0],
9200}
9201pub type SubGhzBegin = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9202pub type SubGhzEnd = ::core::option::Option<unsafe extern "C" fn()>;
9203pub type SubGhzIsConnect = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9204pub type SubGhzReset = ::core::option::Option<unsafe extern "C" fn()>;
9205pub type SubGhzSleep = ::core::option::Option<unsafe extern "C" fn()>;
9206pub type SubGhzIdle = ::core::option::Option<unsafe extern "C" fn()>;
9207pub type SubGhzLoadPreset =
9208 ::core::option::Option<unsafe extern "C" fn(preset: FuriHalSubGhzPreset, preset_data: *mut u8)>;
9209pub type SubGhzSetFrequency = ::core::option::Option<unsafe extern "C" fn(frequency: u32) -> u32>;
9210pub type SubGhzIsFrequencyValid =
9211 ::core::option::Option<unsafe extern "C" fn(frequency: u32) -> bool>;
9212pub type SubGhzSetAsyncMirrorPin =
9213 ::core::option::Option<unsafe extern "C" fn(gpio: *const GpioPin)>;
9214pub type SubGhzGetDataGpio = ::core::option::Option<unsafe extern "C" fn() -> *const GpioPin>;
9215pub type SubGhzSetTx = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9216pub type SubGhzFlushTx = ::core::option::Option<unsafe extern "C" fn()>;
9217pub type SubGhzStartAsyncTx = ::core::option::Option<
9218 unsafe extern "C" fn(callback: *mut core::ffi::c_void, context: *mut core::ffi::c_void) -> bool,
9219>;
9220pub type SubGhzIsAsyncCompleteTx = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9221pub type SubGhzStopAsyncTx = ::core::option::Option<unsafe extern "C" fn()>;
9222pub type SubGhzSetRx = ::core::option::Option<unsafe extern "C" fn()>;
9223pub type SubGhzFlushRx = ::core::option::Option<unsafe extern "C" fn()>;
9224pub type SubGhzStartAsyncRx = ::core::option::Option<
9225 unsafe extern "C" fn(callback: *mut core::ffi::c_void, context: *mut core::ffi::c_void),
9226>;
9227pub type SubGhzStopAsyncRx = ::core::option::Option<unsafe extern "C" fn()>;
9228pub type SubGhzGetRSSI = ::core::option::Option<unsafe extern "C" fn() -> f32>;
9229pub type SubGhzGetLQI = ::core::option::Option<unsafe extern "C" fn() -> u8>;
9230pub type SubGhzRxPipeNotEmpty = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9231pub type SubGhzRxIsDataCrcValid = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9232pub type SubGhzReadPacket =
9233 ::core::option::Option<unsafe extern "C" fn(data: *mut u8, size: *mut u8)>;
9234pub type SubGhzWritePacket =
9235 ::core::option::Option<unsafe extern "C" fn(data: *const u8, size: u8)>;
9236#[repr(C)]
9237#[derive(Debug, Copy, Clone)]
9238pub struct SubGhzDeviceInterconnect {
9239 pub begin: SubGhzBegin,
9240 pub end: SubGhzEnd,
9241 pub is_connect: SubGhzIsConnect,
9242 pub reset: SubGhzReset,
9243 pub sleep: SubGhzSleep,
9244 pub idle: SubGhzIdle,
9245 pub load_preset: SubGhzLoadPreset,
9246 pub set_frequency: SubGhzSetFrequency,
9247 pub is_frequency_valid: SubGhzIsFrequencyValid,
9248 pub set_async_mirror_pin: SubGhzSetAsyncMirrorPin,
9249 pub get_data_gpio: SubGhzGetDataGpio,
9250 pub set_tx: SubGhzSetTx,
9251 pub flush_tx: SubGhzFlushTx,
9252 pub start_async_tx: SubGhzStartAsyncTx,
9253 pub is_async_complete_tx: SubGhzIsAsyncCompleteTx,
9254 pub stop_async_tx: SubGhzStopAsyncTx,
9255 pub set_rx: SubGhzSetRx,
9256 pub flush_rx: SubGhzFlushRx,
9257 pub start_async_rx: SubGhzStartAsyncRx,
9258 pub stop_async_rx: SubGhzStopAsyncRx,
9259 pub get_rssi: SubGhzGetRSSI,
9260 pub get_lqi: SubGhzGetLQI,
9261 pub rx_pipe_not_empty: SubGhzRxPipeNotEmpty,
9262 pub is_rx_data_crc_valid: SubGhzRxIsDataCrcValid,
9263 pub read_packet: SubGhzReadPacket,
9264 pub write_packet: SubGhzWritePacket,
9265}
9266#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9267const _: () = {
9268 ["Size of SubGhzDeviceInterconnect"]
9269 [::core::mem::size_of::<SubGhzDeviceInterconnect>() - 104usize];
9270 ["Alignment of SubGhzDeviceInterconnect"]
9271 [::core::mem::align_of::<SubGhzDeviceInterconnect>() - 4usize];
9272 ["Offset of field: SubGhzDeviceInterconnect::begin"]
9273 [::core::mem::offset_of!(SubGhzDeviceInterconnect, begin) - 0usize];
9274 ["Offset of field: SubGhzDeviceInterconnect::end"]
9275 [::core::mem::offset_of!(SubGhzDeviceInterconnect, end) - 4usize];
9276 ["Offset of field: SubGhzDeviceInterconnect::is_connect"]
9277 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_connect) - 8usize];
9278 ["Offset of field: SubGhzDeviceInterconnect::reset"]
9279 [::core::mem::offset_of!(SubGhzDeviceInterconnect, reset) - 12usize];
9280 ["Offset of field: SubGhzDeviceInterconnect::sleep"]
9281 [::core::mem::offset_of!(SubGhzDeviceInterconnect, sleep) - 16usize];
9282 ["Offset of field: SubGhzDeviceInterconnect::idle"]
9283 [::core::mem::offset_of!(SubGhzDeviceInterconnect, idle) - 20usize];
9284 ["Offset of field: SubGhzDeviceInterconnect::load_preset"]
9285 [::core::mem::offset_of!(SubGhzDeviceInterconnect, load_preset) - 24usize];
9286 ["Offset of field: SubGhzDeviceInterconnect::set_frequency"]
9287 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_frequency) - 28usize];
9288 ["Offset of field: SubGhzDeviceInterconnect::is_frequency_valid"]
9289 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_frequency_valid) - 32usize];
9290 ["Offset of field: SubGhzDeviceInterconnect::set_async_mirror_pin"]
9291 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_async_mirror_pin) - 36usize];
9292 ["Offset of field: SubGhzDeviceInterconnect::get_data_gpio"]
9293 [::core::mem::offset_of!(SubGhzDeviceInterconnect, get_data_gpio) - 40usize];
9294 ["Offset of field: SubGhzDeviceInterconnect::set_tx"]
9295 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_tx) - 44usize];
9296 ["Offset of field: SubGhzDeviceInterconnect::flush_tx"]
9297 [::core::mem::offset_of!(SubGhzDeviceInterconnect, flush_tx) - 48usize];
9298 ["Offset of field: SubGhzDeviceInterconnect::start_async_tx"]
9299 [::core::mem::offset_of!(SubGhzDeviceInterconnect, start_async_tx) - 52usize];
9300 ["Offset of field: SubGhzDeviceInterconnect::is_async_complete_tx"]
9301 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_async_complete_tx) - 56usize];
9302 ["Offset of field: SubGhzDeviceInterconnect::stop_async_tx"]
9303 [::core::mem::offset_of!(SubGhzDeviceInterconnect, stop_async_tx) - 60usize];
9304 ["Offset of field: SubGhzDeviceInterconnect::set_rx"]
9305 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_rx) - 64usize];
9306 ["Offset of field: SubGhzDeviceInterconnect::flush_rx"]
9307 [::core::mem::offset_of!(SubGhzDeviceInterconnect, flush_rx) - 68usize];
9308 ["Offset of field: SubGhzDeviceInterconnect::start_async_rx"]
9309 [::core::mem::offset_of!(SubGhzDeviceInterconnect, start_async_rx) - 72usize];
9310 ["Offset of field: SubGhzDeviceInterconnect::stop_async_rx"]
9311 [::core::mem::offset_of!(SubGhzDeviceInterconnect, stop_async_rx) - 76usize];
9312 ["Offset of field: SubGhzDeviceInterconnect::get_rssi"]
9313 [::core::mem::offset_of!(SubGhzDeviceInterconnect, get_rssi) - 80usize];
9314 ["Offset of field: SubGhzDeviceInterconnect::get_lqi"]
9315 [::core::mem::offset_of!(SubGhzDeviceInterconnect, get_lqi) - 84usize];
9316 ["Offset of field: SubGhzDeviceInterconnect::rx_pipe_not_empty"]
9317 [::core::mem::offset_of!(SubGhzDeviceInterconnect, rx_pipe_not_empty) - 88usize];
9318 ["Offset of field: SubGhzDeviceInterconnect::is_rx_data_crc_valid"]
9319 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_rx_data_crc_valid) - 92usize];
9320 ["Offset of field: SubGhzDeviceInterconnect::read_packet"]
9321 [::core::mem::offset_of!(SubGhzDeviceInterconnect, read_packet) - 96usize];
9322 ["Offset of field: SubGhzDeviceInterconnect::write_packet"]
9323 [::core::mem::offset_of!(SubGhzDeviceInterconnect, write_packet) - 100usize];
9324};
9325#[repr(C)]
9326#[derive(Debug, Copy, Clone)]
9327pub struct SubGhzDevice {
9328 pub name: *const core::ffi::c_char,
9329 pub interconnect: *const SubGhzDeviceInterconnect,
9330}
9331#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9332const _: () = {
9333 ["Size of SubGhzDevice"][::core::mem::size_of::<SubGhzDevice>() - 8usize];
9334 ["Alignment of SubGhzDevice"][::core::mem::align_of::<SubGhzDevice>() - 4usize];
9335 ["Offset of field: SubGhzDevice::name"][::core::mem::offset_of!(SubGhzDevice, name) - 0usize];
9336 ["Offset of field: SubGhzDevice::interconnect"]
9337 [::core::mem::offset_of!(SubGhzDevice, interconnect) - 4usize];
9338};
9339#[repr(C)]
9340#[derive(Debug, Copy, Clone)]
9341pub struct SubGhzDeviceCC1101Ext {
9342 _unused: [u8; 0],
9343}
9344#[repr(C)]
9345#[derive(Debug, Copy, Clone)]
9346pub struct Bt {
9347 _unused: [u8; 0],
9348}
9349pub const BtStatusUnavailable: BtStatus = BtStatus(0);
9350pub const BtStatusOff: BtStatus = BtStatus(1);
9351pub const BtStatusAdvertising: BtStatus = BtStatus(2);
9352pub const BtStatusConnected: BtStatus = BtStatus(3);
9353#[repr(transparent)]
9354#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9355pub struct BtStatus(pub core::ffi::c_uchar);
9356pub type BtStatusChangedCallback =
9357 ::core::option::Option<unsafe extern "C" fn(status: BtStatus, context: *mut core::ffi::c_void)>;
9358unsafe extern "C" {
9359 #[doc = "Change BLE Profile\n > **Note:** Call of this function leads to 2nd core restart\n\n # Arguments\n\n* `bt` - Bt instance\n * `profile_template` - Profile template to change to\n * `params` - Profile parameters. Can be NULL\n\n # Returns\n\ntrue on success"]
9360 pub fn bt_profile_start(
9361 bt: *mut Bt,
9362 profile_template: *const FuriHalBleProfileTemplate,
9363 params: FuriHalBleProfileParams,
9364 ) -> *mut FuriHalBleProfileBase;
9365}
9366unsafe extern "C" {
9367 #[doc = "Stop current BLE Profile and restore default profile\n > **Note:** Call of this function leads to 2nd core restart\n\n # Arguments\n\n* `bt` - Bt instance\n\n # Returns\n\ntrue on success"]
9368 pub fn bt_profile_restore_default(bt: *mut Bt) -> bool;
9369}
9370unsafe extern "C" {
9371 #[doc = "Disconnect from Central\n\n # Arguments\n\n* `bt` - Bt instance"]
9372 pub fn bt_disconnect(bt: *mut Bt);
9373}
9374unsafe extern "C" {
9375 #[doc = "Set callback for Bluetooth status change notification\n\n # Arguments\n\n* `bt` - Bt instance\n * `callback` - BtStatusChangedCallback instance\n * `context` - pointer to context"]
9376 pub fn bt_set_status_changed_callback(
9377 bt: *mut Bt,
9378 callback: BtStatusChangedCallback,
9379 context: *mut core::ffi::c_void,
9380 );
9381}
9382unsafe extern "C" {
9383 #[doc = "Forget bonded devices\n > **Note:** Leads to wipe ble key storage and deleting bt.keys\n\n # Arguments\n\n* `bt` - Bt instance"]
9384 pub fn bt_forget_bonded_devices(bt: *mut Bt);
9385}
9386unsafe extern "C" {
9387 #[doc = "Set keys storage file path\n\n # Arguments\n\n* `bt` - Bt instance\n * `keys_storage_path` - Path to file with saved keys"]
9388 pub fn bt_keys_storage_set_storage_path(
9389 bt: *mut Bt,
9390 keys_storage_path: *const core::ffi::c_char,
9391 );
9392}
9393unsafe extern "C" {
9394 #[doc = "Set default keys storage file path\n\n # Arguments\n\n* `bt` - Bt instance"]
9395 pub fn bt_keys_storage_set_default_path(bt: *mut Bt);
9396}
9397#[repr(C)]
9398#[derive(Debug, Copy, Clone)]
9399pub struct BtKeysStorage {
9400 _unused: [u8; 0],
9401}
9402unsafe extern "C" {
9403 pub fn bt_keys_storage_alloc(keys_storage_path: *const core::ffi::c_char)
9404 -> *mut BtKeysStorage;
9405}
9406unsafe extern "C" {
9407 pub fn bt_keys_storage_free(instance: *mut BtKeysStorage);
9408}
9409unsafe extern "C" {
9410 pub fn bt_keys_storage_set_file_path(
9411 instance: *mut BtKeysStorage,
9412 path: *const core::ffi::c_char,
9413 );
9414}
9415unsafe extern "C" {
9416 pub fn bt_keys_storage_set_ram_params(instance: *mut BtKeysStorage, buff: *mut u8, size: u16);
9417}
9418unsafe extern "C" {
9419 pub fn bt_keys_storage_is_changed(instance: *mut BtKeysStorage) -> bool;
9420}
9421unsafe extern "C" {
9422 pub fn bt_keys_storage_get_root_keys(
9423 instance: *mut BtKeysStorage,
9424 ) -> *const GapRootSecurityKeys;
9425}
9426unsafe extern "C" {
9427 pub fn bt_keys_storage_load(instance: *mut BtKeysStorage) -> bool;
9428}
9429unsafe extern "C" {
9430 pub fn bt_keys_storage_update(
9431 instance: *mut BtKeysStorage,
9432 start_addr: *mut u8,
9433 size: u32,
9434 ) -> bool;
9435}
9436unsafe extern "C" {
9437 pub fn bt_keys_storage_delete(instance: *mut BtKeysStorage) -> bool;
9438}
9439pub const PipeRoleAlice: PipeRole = PipeRole(0);
9440pub const PipeRoleBob: PipeRole = PipeRole(1);
9441#[repr(transparent)]
9442#[doc = "The role of a pipe side\n\n Both roles are equal, as they can both read and write the data. This status\n might be helpful in determining the role of a thread w.r.t. another thread in\n an application that builds on the pipe."]
9443#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9444pub struct PipeRole(pub core::ffi::c_uchar);
9445pub const PipeStateOpen: PipeState = PipeState(0);
9446pub const PipeStateBroken: PipeState = PipeState(1);
9447#[repr(transparent)]
9448#[doc = "The state of a pipe\n\n - `PipeStateOpen`: Both pipe sides are in place, meaning data that is sent\n down the pipe _might_ be read by the peer, and new data sent by the peer\n _might_ arrive.\n - `PipeStateBroken`: The other side of the pipe has been freed, meaning\n data that is written will never reach its destination, and no new data\n will appear in the buffer.\n\n A broken pipe can never become open again, because there's no way to connect\n a side of a pipe to another side of a pipe."]
9449#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9450pub struct PipeState(pub core::ffi::c_uchar);
9451#[repr(C)]
9452#[derive(Debug, Copy, Clone)]
9453pub struct PipeSide {
9454 _unused: [u8; 0],
9455}
9456#[repr(C)]
9457#[derive(Debug, Copy, Clone)]
9458pub struct PipeSideBundle {
9459 pub alices_side: *mut PipeSide,
9460 pub bobs_side: *mut PipeSide,
9461}
9462#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9463const _: () = {
9464 ["Size of PipeSideBundle"][::core::mem::size_of::<PipeSideBundle>() - 8usize];
9465 ["Alignment of PipeSideBundle"][::core::mem::align_of::<PipeSideBundle>() - 4usize];
9466 ["Offset of field: PipeSideBundle::alices_side"]
9467 [::core::mem::offset_of!(PipeSideBundle, alices_side) - 0usize];
9468 ["Offset of field: PipeSideBundle::bobs_side"]
9469 [::core::mem::offset_of!(PipeSideBundle, bobs_side) - 4usize];
9470};
9471#[repr(C)]
9472#[derive(Debug, Copy, Clone)]
9473pub struct PipeSideReceiveSettings {
9474 pub capacity: usize,
9475 pub trigger_level: usize,
9476}
9477#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9478const _: () = {
9479 ["Size of PipeSideReceiveSettings"][::core::mem::size_of::<PipeSideReceiveSettings>() - 8usize];
9480 ["Alignment of PipeSideReceiveSettings"]
9481 [::core::mem::align_of::<PipeSideReceiveSettings>() - 4usize];
9482 ["Offset of field: PipeSideReceiveSettings::capacity"]
9483 [::core::mem::offset_of!(PipeSideReceiveSettings, capacity) - 0usize];
9484 ["Offset of field: PipeSideReceiveSettings::trigger_level"]
9485 [::core::mem::offset_of!(PipeSideReceiveSettings, trigger_level) - 4usize];
9486};
9487unsafe extern "C" {
9488 #[doc = "Allocates two connected sides of one pipe.\n\n Creating a pair of sides using this function is the only way to connect two\n pipe sides together. Two unrelated orphaned sides may never be connected back\n together.\n\n The capacity and trigger level for both directions are the same when the pipe\n is created using this function. Use `pipe_alloc_ex` if you want more\n control.\n\n # Arguments\n\n* `capacity` - Maximum number of bytes buffered in one direction\n * `trigger_level` - Number of bytes that need to be available in the buffer\n in order for a blocked thread to unblock\n # Returns\n\nBundle with both sides of the pipe"]
9489 pub fn pipe_alloc(capacity: usize, trigger_level: usize) -> PipeSideBundle;
9490}
9491unsafe extern "C" {
9492 #[doc = "Allocates two connected sides of one pipe.\n\n Creating a pair of sides using this function is the only way to connect two\n pipe sides together. Two unrelated orphaned sides may never be connected back\n together.\n\n The capacity and trigger level may be different for the two directions when\n the pipe is created using this function. Use `pipe_alloc` if you don't\n need control this fine.\n\n # Arguments\n\n* `alice` - `capacity` and `trigger_level` settings for Alice's receiving\n buffer\n * `bob` - `capacity` and `trigger_level` settings for Bob's receiving buffer\n # Returns\n\nBundle with both sides of the pipe"]
9493 pub fn pipe_alloc_ex(
9494 alice: PipeSideReceiveSettings,
9495 bob: PipeSideReceiveSettings,
9496 ) -> PipeSideBundle;
9497}
9498unsafe extern "C" {
9499 #[doc = "Gets the role of a pipe side.\n\n The roles (Alice and Bob) are equal, as both can send and receive data. This\n status might be helpful in determining the role of a thread w.r.t. another\n thread.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to query\n # Returns\n\nRole of provided pipe side"]
9500 pub fn pipe_role(pipe: *mut PipeSide) -> PipeRole;
9501}
9502unsafe extern "C" {
9503 #[doc = "Gets the state of a pipe.\n\n When the state is `PipeStateOpen`, both sides are active and may send or\n receive data. When the state is `PipeStateBroken`, only one side is active\n (the one that this method has been called on). If you find yourself in that\n state, the data that you send will never be heard by anyone, and the data you\n receive are leftovers in the buffer.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to query\n # Returns\n\nState of the pipe"]
9504 pub fn pipe_state(pipe: *mut PipeSide) -> PipeState;
9505}
9506unsafe extern "C" {
9507 #[doc = "Frees a side of a pipe.\n\n When only one of the sides is freed, the pipe is transitioned from the \"Open\"\n state into the \"Broken\" state. When both sides are freed, the underlying data\n structures are freed too.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to free"]
9508 pub fn pipe_free(pipe: *mut PipeSide);
9509}
9510unsafe extern "C" {
9511 #[doc = "Connects the pipe to the `stdin` and `stdout` of the current thread.\n\n After performing this operation, you can use `getc`, `puts`, etc. to send and\n receive data to and from the pipe. If the pipe becomes broken, C stdlib calls\n will return `EOF` wherever possible.\n\n You can disconnect the pipe by manually calling\n `furi_thread_set_stdout_callback` and `furi_thread_set_stdin_callback` with\n `NULL`.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to connect to the stdio"]
9512 pub fn pipe_install_as_stdio(pipe: *mut PipeSide);
9513}
9514unsafe extern "C" {
9515 #[doc = "Sets the state check period for `send` and `receive` operations\n\n > **Note:** This value is set to 100 ms when the pipe is created\n\n `send` and `receive` will check the state of the pipe if exactly 0 bytes were\n sent or received during any given `check_period`. Read the documentation for\n `pipe_send` and `pipe_receive` for more info.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to set the check period of\n * `[in]` - check_period Period in ticks"]
9516 pub fn pipe_set_state_check_period(pipe: *mut PipeSide, check_period: FuriWait);
9517}
9518unsafe extern "C" {
9519 #[doc = "Receives data from the pipe.\n\n This function will try to receive all of the requested bytes from the pipe.\n If at some point during the operation the pipe becomes broken, this function\n will return prematurely, in which case the return value will be less than the\n requested `length`.\n\n # Arguments\n\n* `[in]` - pipe The pipe side to read data out of\n * `[out]` - data The buffer to fill with data\n * `length` - Maximum length of data to read\n # Returns\n\nThe number of bytes actually written into the provided buffer"]
9520 pub fn pipe_receive(pipe: *mut PipeSide, data: *mut core::ffi::c_void, length: usize) -> usize;
9521}
9522unsafe extern "C" {
9523 #[doc = "Sends data into the pipe.\n\n This function will try to send all of the requested bytes to the pipe.\n If at some point during the operation the pipe becomes broken, this function\n will return prematurely, in which case the return value will be less than the\n requested `length`.\n\n # Arguments\n\n* `[in]` - pipe The pipe side to send data into\n * `[out]` - data The buffer to get data from\n * `length` - Maximum length of data to send\n # Returns\n\nThe number of bytes actually read from the provided buffer"]
9524 pub fn pipe_send(pipe: *mut PipeSide, data: *const core::ffi::c_void, length: usize) -> usize;
9525}
9526unsafe extern "C" {
9527 #[doc = "Determines how many bytes there are in the pipe available to be read.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to query\n # Returns\n\nNumber of bytes available to be read out from that side of the pipe"]
9528 pub fn pipe_bytes_available(pipe: *mut PipeSide) -> usize;
9529}
9530unsafe extern "C" {
9531 #[doc = "Determines how many space there is in the pipe for data to be written\n into.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to query\n # Returns\n\nNumber of bytes available to be written into that side of the pipe"]
9532 pub fn pipe_spaces_available(pipe: *mut PipeSide) -> usize;
9533}
9534unsafe extern "C" {
9535 #[doc = "Attaches a `PipeSide` to a `FuriEventLoop`, allowing to attach\n callbacks to the PipeSide.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to attach to the event loop\n * `[in]` - event_loop Event loop to attach the pipe side to"]
9536 pub fn pipe_attach_to_event_loop(pipe: *mut PipeSide, event_loop: *mut FuriEventLoop);
9537}
9538unsafe extern "C" {
9539 #[doc = "Detaches a `PipeSide` from the `FuriEventLoop` that it was previously\n attached to.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to detach to the event loop"]
9540 pub fn pipe_detach_from_event_loop(pipe: *mut PipeSide);
9541}
9542#[doc = "Callback for when data arrives to a `PipeSide`.\n\n # Arguments\n\n* `[in]` - pipe Pipe side that called the callback\n * `[inout]` - context Custom context"]
9543pub type PipeSideDataArrivedCallback = ::core::option::Option<
9544 unsafe extern "C" fn(pipe: *mut PipeSide, context: *mut core::ffi::c_void),
9545>;
9546#[doc = "Callback for when data is read out of the opposite `PipeSide`.\n\n # Arguments\n\n* `[in]` - pipe Pipe side that called the callback\n * `[inout]` - context Custom context"]
9547pub type PipeSideSpaceFreedCallback = ::core::option::Option<
9548 unsafe extern "C" fn(pipe: *mut PipeSide, context: *mut core::ffi::c_void),
9549>;
9550#[doc = "Callback for when the opposite `PipeSide` is freed, making the pipe\n broken.\n\n # Arguments\n\n* `[in]` - pipe Pipe side that called the callback\n * `[inout]` - context Custom context"]
9551pub type PipeSideBrokenCallback = ::core::option::Option<
9552 unsafe extern "C" fn(pipe: *mut PipeSide, context: *mut core::ffi::c_void),
9553>;
9554unsafe extern "C" {
9555 #[doc = "Sets the custom context for all callbacks.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to set the context of\n * `[inout]` - context Custom context that will be passed to callbacks"]
9556 pub fn pipe_set_callback_context(pipe: *mut PipeSide, context: *mut core::ffi::c_void);
9557}
9558unsafe extern "C" {
9559 #[doc = "Sets the callback for when data arrives.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to assign the callback to\n * `[in]` - callback Callback to assign to the pipe side. Set to NULL to\n unsubscribe.\n * `[in]` - event Additional event loop flags (e.g. `Edge`, `Once`, etc.).\n Non-flag values of the enum are not allowed.\n\n Attach the pipe side to an event loop first using\n `pipe_attach_to_event_loop`."]
9560 pub fn pipe_set_data_arrived_callback(
9561 pipe: *mut PipeSide,
9562 callback: PipeSideDataArrivedCallback,
9563 event: FuriEventLoopEvent,
9564 );
9565}
9566unsafe extern "C" {
9567 #[doc = "Sets the callback for when data is read out of the opposite `PipeSide`.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to assign the callback to\n * `[in]` - callback Callback to assign to the pipe side. Set to NULL to\n unsubscribe.\n * `[in]` - event Additional event loop flags (e.g. `Edge`, `Once`, etc.).\n Non-flag values of the enum are not allowed.\n\n Attach the pipe side to an event loop first using\n `pipe_attach_to_event_loop`."]
9568 pub fn pipe_set_space_freed_callback(
9569 pipe: *mut PipeSide,
9570 callback: PipeSideSpaceFreedCallback,
9571 event: FuriEventLoopEvent,
9572 );
9573}
9574unsafe extern "C" {
9575 #[doc = "Sets the callback for when the opposite `PipeSide` is freed, making\n the pipe broken.\n\n # Arguments\n\n* `[in]` - pipe Pipe side to assign the callback to\n * `[in]` - callback Callback to assign to the pipe side. Set to NULL to\n unsubscribe.\n * `[in]` - event Additional event loop flags (e.g. `Edge`, `Once`, etc.).\n Non-flag values of the enum are not allowed.\n\n Attach the pipe side to an event loop first using\n `pipe_attach_to_event_loop`."]
9576 pub fn pipe_set_broken_callback(
9577 pipe: *mut PipeSide,
9578 callback: PipeSideBrokenCallback,
9579 event: FuriEventLoopEvent,
9580 );
9581}
9582#[doc = "< Default"]
9583pub const CliCommandFlagDefault: CliCommandFlag = CliCommandFlag(0);
9584#[doc = "< Safe to run in parallel with other apps"]
9585pub const CliCommandFlagParallelSafe: CliCommandFlag = CliCommandFlag(1);
9586#[doc = "< Safe to run with insomnia mode on"]
9587pub const CliCommandFlagInsomniaSafe: CliCommandFlag = CliCommandFlag(2);
9588#[doc = "< Do no attach I/O pipe to thread stdio"]
9589pub const CliCommandFlagDontAttachStdio: CliCommandFlag = CliCommandFlag(4);
9590pub const CliCommandFlagUseShellThread: CliCommandFlag = CliCommandFlag(8);
9591#[doc = "< The command comes from a .fal file"]
9592pub const CliCommandFlagExternal: CliCommandFlag = CliCommandFlag(16);
9593#[repr(transparent)]
9594#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9595pub struct CliCommandFlag(pub core::ffi::c_uchar);
9596#[doc = "CLI command execution callback pointer\n\n This callback will be called from a separate thread spawned just for your\n command. The pipe will be installed as the thread's stdio, so you can use\n `printf`, `getchar` and other standard functions to communicate with the\n user.\n\n # Arguments\n\n* `[in]` - pipe Pipe that can be used to send and receive data. If\n `CliCommandFlagDontAttachStdio` was not set, you can\n also use standard C functions (printf, getc, etc.) to\n access this pipe.\n * `[in]` - args String with what was passed after the command\n * `[in]` - context Whatever you provided to `cli_add_command`"]
9597pub type CliCommandExecuteCallback = ::core::option::Option<
9598 unsafe extern "C" fn(
9599 pipe: *mut PipeSide,
9600 args: *mut FuriString,
9601 context: *mut core::ffi::c_void,
9602 ),
9603>;
9604#[repr(C)]
9605#[derive(Debug, Copy, Clone)]
9606pub struct CliCommandDescriptor {
9607 pub name: *mut core::ffi::c_char,
9608 pub execute_callback: CliCommandExecuteCallback,
9609 pub flags: CliCommandFlag,
9610 pub stack_depth: usize,
9611}
9612#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9613const _: () = {
9614 ["Size of CliCommandDescriptor"][::core::mem::size_of::<CliCommandDescriptor>() - 16usize];
9615 ["Alignment of CliCommandDescriptor"][::core::mem::align_of::<CliCommandDescriptor>() - 4usize];
9616 ["Offset of field: CliCommandDescriptor::name"]
9617 [::core::mem::offset_of!(CliCommandDescriptor, name) - 0usize];
9618 ["Offset of field: CliCommandDescriptor::execute_callback"]
9619 [::core::mem::offset_of!(CliCommandDescriptor, execute_callback) - 4usize];
9620 ["Offset of field: CliCommandDescriptor::flags"]
9621 [::core::mem::offset_of!(CliCommandDescriptor, flags) - 8usize];
9622 ["Offset of field: CliCommandDescriptor::stack_depth"]
9623 [::core::mem::offset_of!(CliCommandDescriptor, stack_depth) - 12usize];
9624};
9625#[doc = "Configuration for locating external commands"]
9626#[repr(C)]
9627#[derive(Debug, Copy, Clone)]
9628pub struct CliCommandExternalConfig {
9629 pub search_directory: *const core::ffi::c_char,
9630 pub fal_prefix: *const core::ffi::c_char,
9631 pub appid: *const core::ffi::c_char,
9632}
9633#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9634const _: () = {
9635 ["Size of CliCommandExternalConfig"]
9636 [::core::mem::size_of::<CliCommandExternalConfig>() - 12usize];
9637 ["Alignment of CliCommandExternalConfig"]
9638 [::core::mem::align_of::<CliCommandExternalConfig>() - 4usize];
9639 ["Offset of field: CliCommandExternalConfig::search_directory"]
9640 [::core::mem::offset_of!(CliCommandExternalConfig, search_directory) - 0usize];
9641 ["Offset of field: CliCommandExternalConfig::fal_prefix"]
9642 [::core::mem::offset_of!(CliCommandExternalConfig, fal_prefix) - 4usize];
9643 ["Offset of field: CliCommandExternalConfig::appid"]
9644 [::core::mem::offset_of!(CliCommandExternalConfig, appid) - 8usize];
9645};
9646unsafe extern "C" {
9647 #[doc = "Detects if Ctrl+C has been pressed or session has been terminated\n\n # Arguments\n\n* `[in]` - side Pointer to pipe side given to the command thread\n This function also assumes that the pipe is installed as the\n thread's stdio\n This function will consume 0 or 1 bytes from the pipe"]
9648 pub fn cli_is_pipe_broken_or_is_etx_next_char(side: *mut PipeSide) -> bool;
9649}
9650unsafe extern "C" {
9651 #[doc = "Print unified cmd usage tip\n\n # Arguments\n\n* `cmd` - cmd name\n * `usage` - usage tip\n * `arg` - arg passed by user"]
9652 pub fn cli_print_usage(
9653 cmd: *const core::ffi::c_char,
9654 usage: *const core::ffi::c_char,
9655 arg: *const core::ffi::c_char,
9656 );
9657}
9658unsafe extern "C" {
9659 #[doc = "Pause for a specified duration or until Ctrl+C is pressed or the\n session is terminated.\n\n # Arguments\n\n* `[in]` - side Pointer to pipe side given to the command thread.\n * `[in]` - duration_in_ms Duration of sleep in milliseconds.\n # Returns\n\n`true` if the sleep completed without interruption.\n `false` if interrupted.\n\n This function also assumes that the pipe is installed as the\n thread's stdio.\n This function will consume 0 or 1 bytes from the pipe."]
9660 pub fn cli_sleep(side: *mut PipeSide, duration_in_ms: u32) -> bool;
9661}
9662#[repr(C)]
9663#[derive(Debug, Copy, Clone)]
9664pub struct CliRegistry {
9665 _unused: [u8; 0],
9666}
9667unsafe extern "C" {
9668 #[doc = "Allocates a `CliRegistry`."]
9669 pub fn cli_registry_alloc() -> *mut CliRegistry;
9670}
9671unsafe extern "C" {
9672 #[doc = "Frees a `CliRegistry`."]
9673 pub fn cli_registry_free(registry: *mut CliRegistry);
9674}
9675unsafe extern "C" {
9676 #[doc = "Registers a command with the registry. Provides less options than the\n `_ex` counterpart.\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance\n * `[in]` - name Command name\n * `[in]` - flags see CliCommandFlag\n * `[in]` - callback Callback function\n * `[in]` - context Custom context"]
9677 pub fn cli_registry_add_command(
9678 registry: *mut CliRegistry,
9679 name: *const core::ffi::c_char,
9680 flags: CliCommandFlag,
9681 callback: CliCommandExecuteCallback,
9682 context: *mut core::ffi::c_void,
9683 );
9684}
9685unsafe extern "C" {
9686 #[doc = "Registers a command with the registry. Provides more options than the\n non-`_ex` counterpart.\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance\n * `[in]` - name Command name\n * `[in]` - flags see CliCommandFlag\n * `[in]` - callback Callback function\n * `[in]` - context Custom context\n * `[in]` - stack_size Thread stack size"]
9687 pub fn cli_registry_add_command_ex(
9688 registry: *mut CliRegistry,
9689 name: *const core::ffi::c_char,
9690 flags: CliCommandFlag,
9691 callback: CliCommandExecuteCallback,
9692 context: *mut core::ffi::c_void,
9693 stack_size: usize,
9694 );
9695}
9696unsafe extern "C" {
9697 #[doc = "Deletes a cli command\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance\n * `[in]` - name Command name"]
9698 pub fn cli_registry_delete_command(registry: *mut CliRegistry, name: *const core::ffi::c_char);
9699}
9700unsafe extern "C" {
9701 #[doc = "Unregisters all external commands\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance"]
9702 pub fn cli_registry_remove_external_commands(registry: *mut CliRegistry);
9703}
9704unsafe extern "C" {
9705 #[doc = "Reloads the list of externally available commands\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance\n * `[in]` - config See `CliCommandExternalConfig`"]
9706 pub fn cli_registry_reload_external_commands(
9707 registry: *mut CliRegistry,
9708 config: *const CliCommandExternalConfig,
9709 );
9710}
9711#[repr(C)]
9712#[derive(Debug, Copy, Clone)]
9713pub struct CliVcp {
9714 _unused: [u8; 0],
9715}
9716unsafe extern "C" {
9717 pub fn cli_vcp_enable(cli_vcp: *mut CliVcp);
9718}
9719unsafe extern "C" {
9720 pub fn cli_vcp_disable(cli_vcp: *mut CliVcp);
9721}
9722unsafe extern "C" {
9723 #[doc = "Get icon width\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\nwidth in pixels"]
9724 pub fn icon_get_width(instance: *const Icon) -> u16;
9725}
9726unsafe extern "C" {
9727 #[doc = "Get icon height\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\nheight in pixels"]
9728 pub fn icon_get_height(instance: *const Icon) -> u16;
9729}
9730unsafe extern "C" {
9731 #[doc = "Get Icon XBM bitmap data for the first frame\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\npointer to compressed XBM bitmap data"]
9732 pub fn icon_get_data(instance: *const Icon) -> *const u8;
9733}
9734unsafe extern "C" {
9735 #[doc = "Get Icon frame count\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\nframe count"]
9736 pub fn icon_get_frame_count(instance: *const Icon) -> u32;
9737}
9738unsafe extern "C" {
9739 #[doc = "Get Icon XBM bitmap data for a particular frame\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n * `frame` (direction in) - frame index\n\n # Returns\n\npointer to compressed XBM bitmap data"]
9740 pub fn icon_get_frame_data(instance: *const Icon, frame: u32) -> *const u8;
9741}
9742#[repr(C)]
9743#[derive(Debug, Copy, Clone)]
9744pub struct IconAnimation {
9745 _unused: [u8; 0],
9746}
9747#[doc = "Icon Animation Callback. Used for update notification"]
9748pub type IconAnimationCallback = ::core::option::Option<
9749 unsafe extern "C" fn(instance: *mut IconAnimation, context: *mut core::ffi::c_void),
9750>;
9751unsafe extern "C" {
9752 #[doc = "Allocate icon animation instance with const icon data.\n\n always returns Icon or stops system if not enough memory\n\n # Arguments\n\n* `icon` (direction in) - pointer to Icon data\n\n # Returns\n\nIconAnimation instance"]
9753 pub fn icon_animation_alloc(icon: *const Icon) -> *mut IconAnimation;
9754}
9755unsafe extern "C" {
9756 #[doc = "Release icon animation instance\n\n # Arguments\n\n* `instance` - IconAnimation instance"]
9757 pub fn icon_animation_free(instance: *mut IconAnimation);
9758}
9759unsafe extern "C" {
9760 #[doc = "Set IconAnimation update callback\n\n Normally you do not need to use this function, use view_tie_icon_animation\n instead.\n\n # Arguments\n\n* `instance` - IconAnimation instance\n * `callback` (direction in) - IconAnimationCallback\n * `context` - callback context"]
9761 pub fn icon_animation_set_update_callback(
9762 instance: *mut IconAnimation,
9763 callback: IconAnimationCallback,
9764 context: *mut core::ffi::c_void,
9765 );
9766}
9767unsafe extern "C" {
9768 #[doc = "Get icon animation width\n\n # Arguments\n\n* `instance` - IconAnimation instance\n\n # Returns\n\nwidth in pixels"]
9769 pub fn icon_animation_get_width(instance: *const IconAnimation) -> u8;
9770}
9771unsafe extern "C" {
9772 #[doc = "Get icon animation height\n\n # Arguments\n\n* `instance` - IconAnimation instance\n\n # Returns\n\nheight in pixels"]
9773 pub fn icon_animation_get_height(instance: *const IconAnimation) -> u8;
9774}
9775unsafe extern "C" {
9776 #[doc = "Start icon animation\n\n # Arguments\n\n* `instance` - IconAnimation instance"]
9777 pub fn icon_animation_start(instance: *mut IconAnimation);
9778}
9779unsafe extern "C" {
9780 #[doc = "Stop icon animation\n\n # Arguments\n\n* `instance` - IconAnimation instance"]
9781 pub fn icon_animation_stop(instance: *mut IconAnimation);
9782}
9783unsafe extern "C" {
9784 #[doc = "Returns true if current frame is a last one\n\n # Arguments\n\n* `instance` - IconAnimation instance\n\n # Returns\n\ntrue if last frame"]
9785 pub fn icon_animation_is_last_frame(instance: *const IconAnimation) -> bool;
9786}
9787pub const ColorWhite: Color = Color(0);
9788pub const ColorBlack: Color = Color(1);
9789pub const ColorXOR: Color = Color(2);
9790#[repr(transparent)]
9791#[doc = "Color enumeration"]
9792#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9793pub struct Color(pub core::ffi::c_uchar);
9794pub const FontPrimary: Font = Font(0);
9795pub const FontSecondary: Font = Font(1);
9796pub const FontKeyboard: Font = Font(2);
9797pub const FontBigNumbers: Font = Font(3);
9798pub const FontTotalNumber: Font = Font(4);
9799#[repr(transparent)]
9800#[doc = "Fonts enumeration"]
9801#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9802pub struct Font(pub core::ffi::c_uchar);
9803pub const AlignLeft: Align = Align(0);
9804pub const AlignRight: Align = Align(1);
9805pub const AlignTop: Align = Align(2);
9806pub const AlignBottom: Align = Align(3);
9807pub const AlignCenter: Align = Align(4);
9808#[repr(transparent)]
9809#[doc = "Alignment enumeration"]
9810#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9811pub struct Align(pub core::ffi::c_uchar);
9812pub const CanvasOrientationHorizontal: CanvasOrientation = CanvasOrientation(0);
9813pub const CanvasOrientationHorizontalFlip: CanvasOrientation = CanvasOrientation(1);
9814pub const CanvasOrientationVertical: CanvasOrientation = CanvasOrientation(2);
9815pub const CanvasOrientationVerticalFlip: CanvasOrientation = CanvasOrientation(3);
9816#[repr(transparent)]
9817#[doc = "Canvas Orientation"]
9818#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9819pub struct CanvasOrientation(pub core::ffi::c_uchar);
9820pub const CanvasDirectionLeftToRight: CanvasDirection = CanvasDirection(0);
9821pub const CanvasDirectionTopToBottom: CanvasDirection = CanvasDirection(1);
9822pub const CanvasDirectionRightToLeft: CanvasDirection = CanvasDirection(2);
9823pub const CanvasDirectionBottomToTop: CanvasDirection = CanvasDirection(3);
9824#[repr(transparent)]
9825#[doc = "Font Direction"]
9826#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9827pub struct CanvasDirection(pub core::ffi::c_uchar);
9828#[doc = "Font parameters"]
9829#[repr(C)]
9830#[derive(Debug, Copy, Clone)]
9831pub struct CanvasFontParameters {
9832 pub leading_default: u8,
9833 pub leading_min: u8,
9834 pub height: u8,
9835 pub descender: u8,
9836}
9837#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9838const _: () = {
9839 ["Size of CanvasFontParameters"][::core::mem::size_of::<CanvasFontParameters>() - 4usize];
9840 ["Alignment of CanvasFontParameters"][::core::mem::align_of::<CanvasFontParameters>() - 1usize];
9841 ["Offset of field: CanvasFontParameters::leading_default"]
9842 [::core::mem::offset_of!(CanvasFontParameters, leading_default) - 0usize];
9843 ["Offset of field: CanvasFontParameters::leading_min"]
9844 [::core::mem::offset_of!(CanvasFontParameters, leading_min) - 1usize];
9845 ["Offset of field: CanvasFontParameters::height"]
9846 [::core::mem::offset_of!(CanvasFontParameters, height) - 2usize];
9847 ["Offset of field: CanvasFontParameters::descender"]
9848 [::core::mem::offset_of!(CanvasFontParameters, descender) - 3usize];
9849};
9850pub const IconFlipNone: IconFlip = IconFlip(0);
9851pub const IconFlipHorizontal: IconFlip = IconFlip(1);
9852pub const IconFlipVertical: IconFlip = IconFlip(2);
9853pub const IconFlipBoth: IconFlip = IconFlip(3);
9854#[repr(transparent)]
9855#[doc = "Icon flip"]
9856#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9857pub struct IconFlip(pub core::ffi::c_uchar);
9858pub const IconRotation0: IconRotation = IconRotation(0);
9859pub const IconRotation90: IconRotation = IconRotation(1);
9860pub const IconRotation180: IconRotation = IconRotation(2);
9861pub const IconRotation270: IconRotation = IconRotation(3);
9862#[repr(transparent)]
9863#[doc = "Icon rotation"]
9864#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9865pub struct IconRotation(pub core::ffi::c_uchar);
9866#[repr(C)]
9867#[derive(Debug, Copy, Clone)]
9868pub struct Canvas {
9869 _unused: [u8; 0],
9870}
9871unsafe extern "C" {
9872 #[doc = "Reset canvas drawing tools configuration\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9873 pub fn canvas_reset(canvas: *mut Canvas);
9874}
9875unsafe extern "C" {
9876 #[doc = "Commit canvas. Send buffer to display\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9877 pub fn canvas_commit(canvas: *mut Canvas);
9878}
9879unsafe extern "C" {
9880 #[doc = "Get Canvas width\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nwidth in pixels."]
9881 pub fn canvas_width(canvas: *const Canvas) -> usize;
9882}
9883unsafe extern "C" {
9884 #[doc = "Get Canvas height\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nheight in pixels."]
9885 pub fn canvas_height(canvas: *const Canvas) -> usize;
9886}
9887unsafe extern "C" {
9888 #[doc = "Get current font height\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nheight in pixels."]
9889 pub fn canvas_current_font_height(canvas: *const Canvas) -> usize;
9890}
9891unsafe extern "C" {
9892 #[doc = "Get font parameters\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `font` - Font\n\n # Returns\n\npointer to CanvasFontParameters structure"]
9893 pub fn canvas_get_font_params(canvas: *const Canvas, font: Font)
9894 -> *const CanvasFontParameters;
9895}
9896unsafe extern "C" {
9897 #[doc = "Clear canvas\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9898 pub fn canvas_clear(canvas: *mut Canvas);
9899}
9900unsafe extern "C" {
9901 #[doc = "Set drawing color\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `color` - Color"]
9902 pub fn canvas_set_color(canvas: *mut Canvas, color: Color);
9903}
9904unsafe extern "C" {
9905 #[doc = "Set font swap Argument String Rotation Description\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `dir` - Direction font"]
9906 pub fn canvas_set_font_direction(canvas: *mut Canvas, dir: CanvasDirection);
9907}
9908unsafe extern "C" {
9909 #[doc = "Invert drawing color\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9910 pub fn canvas_invert_color(canvas: *mut Canvas);
9911}
9912unsafe extern "C" {
9913 #[doc = "Set drawing font\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `font` - Font"]
9914 pub fn canvas_set_font(canvas: *mut Canvas, font: Font);
9915}
9916unsafe extern "C" {
9917 #[doc = "Set custom drawing font\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `font` - Pointer to u8g2 const uint8_t* font array"]
9918 pub fn canvas_set_custom_u8g2_font(canvas: *mut Canvas, font: *const u8);
9919}
9920unsafe extern "C" {
9921 #[doc = "Draw string at position of baseline defined by x, y.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - anchor point x coordinate\n * `y` - anchor point y coordinate\n * `str` - C-string"]
9922 pub fn canvas_draw_str(canvas: *mut Canvas, x: i32, y: i32, str_: *const core::ffi::c_char);
9923}
9924unsafe extern "C" {
9925 #[doc = "Draw aligned string defined by x, y.\n\n Align calculated from position of baseline, string width and ascent (height\n of the glyphs above the baseline)\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - anchor point x coordinate\n * `y` - anchor point y coordinate\n * `horizontal` - horizontal alignment\n * `vertical` - vertical alignment\n * `str` - C-string"]
9926 pub fn canvas_draw_str_aligned(
9927 canvas: *mut Canvas,
9928 x: i32,
9929 y: i32,
9930 horizontal: Align,
9931 vertical: Align,
9932 str_: *const core::ffi::c_char,
9933 );
9934}
9935unsafe extern "C" {
9936 #[doc = "Get string width\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - C-string\n\n # Returns\n\nwidth in pixels."]
9937 pub fn canvas_string_width(canvas: *mut Canvas, str_: *const core::ffi::c_char) -> u16;
9938}
9939unsafe extern "C" {
9940 #[doc = "Get glyph width\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `symbol` (direction in) - character\n\n # Returns\n\nwidth in pixels"]
9941 pub fn canvas_glyph_width(canvas: *mut Canvas, symbol: u16) -> usize;
9942}
9943unsafe extern "C" {
9944 #[doc = "Draw bitmap picture at position defined by x,y.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - width of bitmap\n * `height` - height of bitmap\n * `compressed_bitmap_data` - compressed bitmap data"]
9945 pub fn canvas_draw_bitmap(
9946 canvas: *mut Canvas,
9947 x: i32,
9948 y: i32,
9949 width: usize,
9950 height: usize,
9951 compressed_bitmap_data: *const u8,
9952 );
9953}
9954unsafe extern "C" {
9955 #[doc = "Draw icon at position defined by x,y with rotation and flip.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `icon` - Icon instance\n * `rotation` - IconRotation"]
9956 pub fn canvas_draw_icon_ex(
9957 canvas: *mut Canvas,
9958 x: i32,
9959 y: i32,
9960 icon: *const Icon,
9961 rotation: IconRotation,
9962 );
9963}
9964unsafe extern "C" {
9965 #[doc = "Draw animation at position defined by x,y.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `icon_animation` - IconAnimation instance"]
9966 pub fn canvas_draw_icon_animation(
9967 canvas: *mut Canvas,
9968 x: i32,
9969 y: i32,
9970 icon_animation: *mut IconAnimation,
9971 );
9972}
9973unsafe extern "C" {
9974 #[doc = "Draw icon at position defined by x,y.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `icon` - Icon instance"]
9975 pub fn canvas_draw_icon(canvas: *mut Canvas, x: i32, y: i32, icon: *const Icon);
9976}
9977unsafe extern "C" {
9978 #[doc = "Draw XBM bitmap\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` (direction in) - bitmap width\n * `height` (direction in) - bitmap height\n * `bitmap` - pointer to XBM bitmap data"]
9979 pub fn canvas_draw_xbm(
9980 canvas: *mut Canvas,
9981 x: i32,
9982 y: i32,
9983 width: usize,
9984 height: usize,
9985 bitmap: *const u8,
9986 );
9987}
9988unsafe extern "C" {
9989 #[doc = "Draw rotated XBM bitmap\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` (direction in) - bitmap width\n * `height` (direction in) - bitmap height\n * `rotation` (direction in) - bitmap rotation\n * `bitmap_data` - pointer to XBM bitmap data"]
9990 pub fn canvas_draw_xbm_ex(
9991 canvas: *mut Canvas,
9992 x: i32,
9993 y: i32,
9994 width: usize,
9995 height: usize,
9996 rotation: IconRotation,
9997 bitmap_data: *const u8,
9998 );
9999}
10000unsafe extern "C" {
10001 #[doc = "Draw dot at x,y\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate"]
10002 pub fn canvas_draw_dot(canvas: *mut Canvas, x: i32, y: i32);
10003}
10004unsafe extern "C" {
10005 #[doc = "Draw box of width, height at x,y\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - box width\n * `height` - box height"]
10006 pub fn canvas_draw_box(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
10007}
10008unsafe extern "C" {
10009 #[doc = "Draw frame of width, height at x,y\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - frame width\n * `height` - frame height"]
10010 pub fn canvas_draw_frame(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
10011}
10012unsafe extern "C" {
10013 #[doc = "Draw line from x1,y1 to x2,y2\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x1` - x1 coordinate\n * `y1` - y1 coordinate\n * `x2` - x2 coordinate\n * `y2` - y2 coordinate"]
10014 pub fn canvas_draw_line(canvas: *mut Canvas, x1: i32, y1: i32, x2: i32, y2: i32);
10015}
10016unsafe extern "C" {
10017 #[doc = "Draw circle at x,y with radius r\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `radius` - radius"]
10018 pub fn canvas_draw_circle(canvas: *mut Canvas, x: i32, y: i32, radius: usize);
10019}
10020unsafe extern "C" {
10021 #[doc = "Draw disc at x,y with radius r\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `radius` - radius"]
10022 pub fn canvas_draw_disc(canvas: *mut Canvas, x: i32, y: i32, radius: usize);
10023}
10024unsafe extern "C" {
10025 #[doc = "Draw triangle with given base and height lengths and their intersection\n coordinate\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate of base and height intersection\n * `y` - y coordinate of base and height intersection\n * `base` - length of triangle side\n * `height` - length of triangle height\n * `dir` - CanvasDirection triangle orientation"]
10026 pub fn canvas_draw_triangle(
10027 canvas: *mut Canvas,
10028 x: i32,
10029 y: i32,
10030 base: usize,
10031 height: usize,
10032 dir: CanvasDirection,
10033 );
10034}
10035unsafe extern "C" {
10036 #[doc = "Draw glyph\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `ch` - character"]
10037 pub fn canvas_draw_glyph(canvas: *mut Canvas, x: i32, y: i32, ch: u16);
10038}
10039unsafe extern "C" {
10040 #[doc = "Set transparency mode\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `alpha` - transparency mode"]
10041 pub fn canvas_set_bitmap_mode(canvas: *mut Canvas, alpha: bool);
10042}
10043unsafe extern "C" {
10044 #[doc = "Draw rounded-corner frame of width, height at x,y, with round value radius\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - frame width\n * `height` - frame height\n * `radius` - frame corner radius"]
10045 pub fn canvas_draw_rframe(
10046 canvas: *mut Canvas,
10047 x: i32,
10048 y: i32,
10049 width: usize,
10050 height: usize,
10051 radius: usize,
10052 );
10053}
10054unsafe extern "C" {
10055 #[doc = "Draw rounded-corner box of width, height at x,y, with round value raduis\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - box width\n * `height` - box height\n * `radius` - box corner radius"]
10056 pub fn canvas_draw_rbox(
10057 canvas: *mut Canvas,
10058 x: i32,
10059 y: i32,
10060 width: usize,
10061 height: usize,
10062 radius: usize,
10063 );
10064}
10065#[doc = "< Press event, emitted after debounce"]
10066pub const InputTypePress: InputType = InputType(0);
10067#[doc = "< Release event, emitted after debounce"]
10068pub const InputTypeRelease: InputType = InputType(1);
10069#[doc = "< Short event, emitted after InputTypeRelease done within INPUT_LONG_PRESS interval"]
10070pub const InputTypeShort: InputType = InputType(2);
10071#[doc = "< Long event, emitted after INPUT_LONG_PRESS_COUNTS interval, asynchronous to InputTypeRelease"]
10072pub const InputTypeLong: InputType = InputType(3);
10073#[doc = "< Repeat event, emitted with INPUT_LONG_PRESS_COUNTS period after InputTypeLong event"]
10074pub const InputTypeRepeat: InputType = InputType(4);
10075#[doc = "< Special value for exceptional"]
10076pub const InputTypeMAX: InputType = InputType(5);
10077#[repr(transparent)]
10078#[doc = "Input Types\n Some of them are physical events and some logical"]
10079#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10080pub struct InputType(pub core::ffi::c_uchar);
10081#[doc = "Input Event, dispatches with FuriPubSub"]
10082#[repr(C)]
10083#[derive(Copy, Clone)]
10084pub struct InputEvent {
10085 pub __bindgen_anon_1: InputEvent__bindgen_ty_1,
10086 pub key: InputKey,
10087 pub type_: InputType,
10088}
10089#[repr(C)]
10090#[derive(Copy, Clone)]
10091pub union InputEvent__bindgen_ty_1 {
10092 pub sequence: u32,
10093 pub __bindgen_anon_1: InputEvent__bindgen_ty_1__bindgen_ty_1,
10094}
10095#[repr(C)]
10096#[derive(Debug, Copy, Clone)]
10097pub struct InputEvent__bindgen_ty_1__bindgen_ty_1 {
10098 pub _bitfield_align_1: [u32; 0],
10099 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
10100}
10101#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10102const _: () = {
10103 ["Size of InputEvent__bindgen_ty_1__bindgen_ty_1"]
10104 [::core::mem::size_of::<InputEvent__bindgen_ty_1__bindgen_ty_1>() - 4usize];
10105 ["Alignment of InputEvent__bindgen_ty_1__bindgen_ty_1"]
10106 [::core::mem::align_of::<InputEvent__bindgen_ty_1__bindgen_ty_1>() - 4usize];
10107};
10108impl InputEvent__bindgen_ty_1__bindgen_ty_1 {
10109 #[inline]
10110 pub fn sequence_source(&self) -> u8 {
10111 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
10112 }
10113 #[inline]
10114 pub fn set_sequence_source(&mut self, val: u8) {
10115 unsafe {
10116 let val: u8 = ::core::mem::transmute(val);
10117 self._bitfield_1.set(0usize, 2u8, val as u64)
10118 }
10119 }
10120 #[inline]
10121 pub unsafe fn sequence_source_raw(this: *const Self) -> u8 {
10122 unsafe {
10123 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
10124 ::core::ptr::addr_of!((*this)._bitfield_1),
10125 0usize,
10126 2u8,
10127 ) as u8)
10128 }
10129 }
10130 #[inline]
10131 pub unsafe fn set_sequence_source_raw(this: *mut Self, val: u8) {
10132 unsafe {
10133 let val: u8 = ::core::mem::transmute(val);
10134 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
10135 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
10136 0usize,
10137 2u8,
10138 val as u64,
10139 )
10140 }
10141 }
10142 #[inline]
10143 pub fn sequence_counter(&self) -> u32 {
10144 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) }
10145 }
10146 #[inline]
10147 pub fn set_sequence_counter(&mut self, val: u32) {
10148 unsafe {
10149 let val: u32 = ::core::mem::transmute(val);
10150 self._bitfield_1.set(2usize, 30u8, val as u64)
10151 }
10152 }
10153 #[inline]
10154 pub unsafe fn sequence_counter_raw(this: *const Self) -> u32 {
10155 unsafe {
10156 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
10157 ::core::ptr::addr_of!((*this)._bitfield_1),
10158 2usize,
10159 30u8,
10160 ) as u32)
10161 }
10162 }
10163 #[inline]
10164 pub unsafe fn set_sequence_counter_raw(this: *mut Self, val: u32) {
10165 unsafe {
10166 let val: u32 = ::core::mem::transmute(val);
10167 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
10168 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
10169 2usize,
10170 30u8,
10171 val as u64,
10172 )
10173 }
10174 }
10175 #[inline]
10176 pub fn new_bitfield_1(
10177 sequence_source: u8,
10178 sequence_counter: u32,
10179 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
10180 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
10181 __bindgen_bitfield_unit.set(0usize, 2u8, {
10182 let sequence_source: u8 = unsafe { ::core::mem::transmute(sequence_source) };
10183 sequence_source as u64
10184 });
10185 __bindgen_bitfield_unit.set(2usize, 30u8, {
10186 let sequence_counter: u32 = unsafe { ::core::mem::transmute(sequence_counter) };
10187 sequence_counter as u64
10188 });
10189 __bindgen_bitfield_unit
10190 }
10191}
10192#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10193const _: () = {
10194 ["Size of InputEvent__bindgen_ty_1"]
10195 [::core::mem::size_of::<InputEvent__bindgen_ty_1>() - 4usize];
10196 ["Alignment of InputEvent__bindgen_ty_1"]
10197 [::core::mem::align_of::<InputEvent__bindgen_ty_1>() - 4usize];
10198 ["Offset of field: InputEvent__bindgen_ty_1::sequence"]
10199 [::core::mem::offset_of!(InputEvent__bindgen_ty_1, sequence) - 0usize];
10200};
10201#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10202const _: () = {
10203 ["Size of InputEvent"][::core::mem::size_of::<InputEvent>() - 8usize];
10204 ["Alignment of InputEvent"][::core::mem::align_of::<InputEvent>() - 4usize];
10205 ["Offset of field: InputEvent::key"][::core::mem::offset_of!(InputEvent, key) - 4usize];
10206 ["Offset of field: InputEvent::type_"][::core::mem::offset_of!(InputEvent, type_) - 5usize];
10207};
10208unsafe extern "C" {
10209 #[doc = "Get human readable input key name\n # Arguments\n\n* `key` - - InputKey\n # Returns\n\nstring"]
10210 pub fn input_get_key_name(key: InputKey) -> *const core::ffi::c_char;
10211}
10212unsafe extern "C" {
10213 #[doc = "Get human readable input type name\n # Arguments\n\n* `type` - - InputType\n # Returns\n\nstring"]
10214 pub fn input_get_type_name(type_: InputType) -> *const core::ffi::c_char;
10215}
10216pub const ViewOrientationHorizontal: ViewOrientation = ViewOrientation(0);
10217pub const ViewOrientationHorizontalFlip: ViewOrientation = ViewOrientation(1);
10218pub const ViewOrientationVertical: ViewOrientation = ViewOrientation(2);
10219pub const ViewOrientationVerticalFlip: ViewOrientation = ViewOrientation(3);
10220#[repr(transparent)]
10221#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10222pub struct ViewOrientation(pub core::ffi::c_uchar);
10223#[repr(C)]
10224#[derive(Debug, Copy, Clone)]
10225pub struct View {
10226 _unused: [u8; 0],
10227}
10228#[doc = "View Draw callback\n # Arguments\n\n* `canvas` - pointer to canvas\n * `model` - pointer to model\n called from GUI thread"]
10229pub type ViewDrawCallback = ::core::option::Option<
10230 unsafe extern "C" fn(canvas: *mut Canvas, model: *mut core::ffi::c_void),
10231>;
10232#[doc = "View Input callback\n # Arguments\n\n* `event` - pointer to input event data\n * `context` - pointer to context\n # Returns\n\ntrue if event handled, false if event ignored\n called from GUI thread"]
10233pub type ViewInputCallback = ::core::option::Option<
10234 unsafe extern "C" fn(event: *mut InputEvent, context: *mut core::ffi::c_void) -> bool,
10235>;
10236#[doc = "View Custom callback\n # Arguments\n\n* `event` - number of custom event\n * `context` - pointer to context\n # Returns\n\ntrue if event handled, false if event ignored"]
10237pub type ViewCustomCallback = ::core::option::Option<
10238 unsafe extern "C" fn(event: u32, context: *mut core::ffi::c_void) -> bool,
10239>;
10240#[doc = "View navigation callback\n # Arguments\n\n* `context` - pointer to context\n # Returns\n\nnext view id\n called from GUI thread"]
10241pub type ViewNavigationCallback =
10242 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> u32>;
10243#[doc = "View callback\n # Arguments\n\n* `context` - pointer to context\n called from GUI thread"]
10244pub type ViewCallback =
10245 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
10246#[doc = "View Update Callback Called upon model change, need to be propagated to GUI\n throw ViewPort update\n # Arguments\n\n* `view` - pointer to view\n * `context` - pointer to context\n called from GUI thread"]
10247pub type ViewUpdateCallback =
10248 ::core::option::Option<unsafe extern "C" fn(view: *mut View, context: *mut core::ffi::c_void)>;
10249#[doc = "Model is not allocated"]
10250pub const ViewModelTypeNone: ViewModelType = ViewModelType(0);
10251#[doc = "Model consist of atomic types and/or partial update is not critical for rendering.\n Lock free."]
10252pub const ViewModelTypeLockFree: ViewModelType = ViewModelType(1);
10253#[doc = "Model access is guarded with mutex.\n Locking gui thread."]
10254pub const ViewModelTypeLocking: ViewModelType = ViewModelType(2);
10255#[repr(transparent)]
10256#[doc = "View model types"]
10257#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10258pub struct ViewModelType(pub core::ffi::c_uchar);
10259unsafe extern "C" {
10260 #[doc = "Allocate and init View\n # Returns\n\nView instance"]
10261 pub fn view_alloc() -> *mut View;
10262}
10263unsafe extern "C" {
10264 #[doc = "Free View\n\n # Arguments\n\n* `view` - instance"]
10265 pub fn view_free(view: *mut View);
10266}
10267unsafe extern "C" {
10268 #[doc = "Tie IconAnimation with View\n\n # Arguments\n\n* `view` - View instance\n * `icon_animation` - IconAnimation instance"]
10269 pub fn view_tie_icon_animation(view: *mut View, icon_animation: *mut IconAnimation);
10270}
10271unsafe extern "C" {
10272 #[doc = "Set View Draw callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - draw callback"]
10273 pub fn view_set_draw_callback(view: *mut View, callback: ViewDrawCallback);
10274}
10275unsafe extern "C" {
10276 #[doc = "Set View Input callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - input callback"]
10277 pub fn view_set_input_callback(view: *mut View, callback: ViewInputCallback);
10278}
10279unsafe extern "C" {
10280 #[doc = "Set View Custom callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - input callback"]
10281 pub fn view_set_custom_callback(view: *mut View, callback: ViewCustomCallback);
10282}
10283unsafe extern "C" {
10284 #[doc = "Set Navigation Previous callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - input callback"]
10285 pub fn view_set_previous_callback(view: *mut View, callback: ViewNavigationCallback);
10286}
10287unsafe extern "C" {
10288 #[doc = "Set Enter callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - callback"]
10289 pub fn view_set_enter_callback(view: *mut View, callback: ViewCallback);
10290}
10291unsafe extern "C" {
10292 #[doc = "Set Exit callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - callback"]
10293 pub fn view_set_exit_callback(view: *mut View, callback: ViewCallback);
10294}
10295unsafe extern "C" {
10296 #[doc = "Set Update callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - callback"]
10297 pub fn view_set_update_callback(view: *mut View, callback: ViewUpdateCallback);
10298}
10299unsafe extern "C" {
10300 #[doc = "Set View Draw callback\n\n # Arguments\n\n* `view` - View instance\n * `context` - context for callbacks"]
10301 pub fn view_set_update_callback_context(view: *mut View, context: *mut core::ffi::c_void);
10302}
10303unsafe extern "C" {
10304 #[doc = "Set View Draw callback\n\n # Arguments\n\n* `view` - View instance\n * `context` - context for callbacks"]
10305 pub fn view_set_context(view: *mut View, context: *mut core::ffi::c_void);
10306}
10307unsafe extern "C" {
10308 #[doc = "Set View Orientation\n\n # Arguments\n\n* `view` - View instance\n * `orientation` - either vertical or horizontal"]
10309 pub fn view_set_orientation(view: *mut View, orientation: ViewOrientation);
10310}
10311unsafe extern "C" {
10312 #[doc = "Allocate view model.\n\n # Arguments\n\n* `view` - View instance\n * `type` - View Model Type\n * `size` - size"]
10313 pub fn view_allocate_model(view: *mut View, type_: ViewModelType, size: usize);
10314}
10315unsafe extern "C" {
10316 #[doc = "Free view model data memory.\n\n # Arguments\n\n* `view` - View instance"]
10317 pub fn view_free_model(view: *mut View);
10318}
10319unsafe extern "C" {
10320 #[doc = "Get view model data\n\n # Arguments\n\n* `view` - View instance\n\n # Returns\n\npointer to model data\n Don't forget to commit model changes"]
10321 pub fn view_get_model(view: *mut View) -> *mut core::ffi::c_void;
10322}
10323unsafe extern "C" {
10324 #[doc = "Commit view model\n\n # Arguments\n\n* `view` - View instance\n * `update` - true if you want to emit view update, false otherwise"]
10325 pub fn view_commit_model(view: *mut View, update: bool);
10326}
10327#[repr(C)]
10328#[derive(Debug, Copy, Clone)]
10329pub struct FileBrowser {
10330 _unused: [u8; 0],
10331}
10332pub type FileBrowserCallback =
10333 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
10334pub type FileBrowserLoadItemCallback = ::core::option::Option<
10335 unsafe extern "C" fn(
10336 path: *mut FuriString,
10337 context: *mut core::ffi::c_void,
10338 icon: *mut *mut u8,
10339 item_name: *mut FuriString,
10340 ) -> bool,
10341>;
10342unsafe extern "C" {
10343 pub fn file_browser_alloc(result_path: *mut FuriString) -> *mut FileBrowser;
10344}
10345unsafe extern "C" {
10346 pub fn file_browser_free(browser: *mut FileBrowser);
10347}
10348unsafe extern "C" {
10349 pub fn file_browser_get_view(browser: *mut FileBrowser) -> *mut View;
10350}
10351unsafe extern "C" {
10352 pub fn file_browser_configure(
10353 browser: *mut FileBrowser,
10354 extension: *const core::ffi::c_char,
10355 base_path: *const core::ffi::c_char,
10356 skip_assets: bool,
10357 hide_dot_files: bool,
10358 file_icon: *const Icon,
10359 hide_ext: bool,
10360 );
10361}
10362unsafe extern "C" {
10363 pub fn file_browser_start(browser: *mut FileBrowser, path: *mut FuriString);
10364}
10365unsafe extern "C" {
10366 pub fn file_browser_stop(browser: *mut FileBrowser);
10367}
10368unsafe extern "C" {
10369 pub fn file_browser_set_callback(
10370 browser: *mut FileBrowser,
10371 callback: FileBrowserCallback,
10372 context: *mut core::ffi::c_void,
10373 );
10374}
10375unsafe extern "C" {
10376 pub fn file_browser_set_item_callback(
10377 browser: *mut FileBrowser,
10378 callback: FileBrowserLoadItemCallback,
10379 context: *mut core::ffi::c_void,
10380 );
10381}
10382#[repr(C)]
10383#[derive(Debug, Copy, Clone)]
10384pub struct DialogsApp {
10385 _unused: [u8; 0],
10386}
10387#[doc = "File browser dialog extra options.\n This can be default-initialized using {dialog_file_browser_set_basic_options}.\n # Arguments\n\n* `extension` - file extension to be offered for selection\n * `base_path` - root folder path for navigation with back key\n * `skip_assets` - true - do not show assets folders\n * `hide_dot_files` - true - hide dot files\n * `icon` - file icon pointer, NULL for default icon\n * `hide_ext` - true - hide extensions for files\n * `item_loader_callback` - callback function for providing custom icon & entry name\n * `hide_ext` - callback context"]
10388#[repr(C)]
10389#[derive(Debug, Copy, Clone)]
10390pub struct DialogsFileBrowserOptions {
10391 pub extension: *const core::ffi::c_char,
10392 pub base_path: *const core::ffi::c_char,
10393 pub skip_assets: bool,
10394 pub hide_dot_files: bool,
10395 pub icon: *const Icon,
10396 pub hide_ext: bool,
10397 pub item_loader_callback: FileBrowserLoadItemCallback,
10398 pub item_loader_context: *mut core::ffi::c_void,
10399}
10400#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10401const _: () = {
10402 ["Size of DialogsFileBrowserOptions"]
10403 [::core::mem::size_of::<DialogsFileBrowserOptions>() - 28usize];
10404 ["Alignment of DialogsFileBrowserOptions"]
10405 [::core::mem::align_of::<DialogsFileBrowserOptions>() - 4usize];
10406 ["Offset of field: DialogsFileBrowserOptions::extension"]
10407 [::core::mem::offset_of!(DialogsFileBrowserOptions, extension) - 0usize];
10408 ["Offset of field: DialogsFileBrowserOptions::base_path"]
10409 [::core::mem::offset_of!(DialogsFileBrowserOptions, base_path) - 4usize];
10410 ["Offset of field: DialogsFileBrowserOptions::skip_assets"]
10411 [::core::mem::offset_of!(DialogsFileBrowserOptions, skip_assets) - 8usize];
10412 ["Offset of field: DialogsFileBrowserOptions::hide_dot_files"]
10413 [::core::mem::offset_of!(DialogsFileBrowserOptions, hide_dot_files) - 9usize];
10414 ["Offset of field: DialogsFileBrowserOptions::icon"]
10415 [::core::mem::offset_of!(DialogsFileBrowserOptions, icon) - 12usize];
10416 ["Offset of field: DialogsFileBrowserOptions::hide_ext"]
10417 [::core::mem::offset_of!(DialogsFileBrowserOptions, hide_ext) - 16usize];
10418 ["Offset of field: DialogsFileBrowserOptions::item_loader_callback"]
10419 [::core::mem::offset_of!(DialogsFileBrowserOptions, item_loader_callback) - 20usize];
10420 ["Offset of field: DialogsFileBrowserOptions::item_loader_context"]
10421 [::core::mem::offset_of!(DialogsFileBrowserOptions, item_loader_context) - 24usize];
10422};
10423unsafe extern "C" {
10424 #[doc = "Initialize file browser dialog options and set default values.\n This is guaranteed to initialize all fields\n so it is safe to pass pointer to uninitialized {options}\n and assume that the data behind it becomes fully initialized after the call.\n # Arguments\n\n* `options` - pointer to options structure\n * `extension` - file extension to filter\n * `icon` - file icon pointer, NULL for default icon"]
10425 pub fn dialog_file_browser_set_basic_options(
10426 options: *mut DialogsFileBrowserOptions,
10427 extension: *const core::ffi::c_char,
10428 icon: *const Icon,
10429 );
10430}
10431unsafe extern "C" {
10432 #[doc = "Shows and processes the file browser dialog\n # Arguments\n\n* `context` - api pointer\n * `result_path` - selected file path string pointer\n * `path` - preselected file path string pointer\n * `options` - file browser dialog extra options, may be null\n # Returns\n\nbool whether a file was selected"]
10433 pub fn dialog_file_browser_show(
10434 context: *mut DialogsApp,
10435 result_path: *mut FuriString,
10436 path: *mut FuriString,
10437 options: *const DialogsFileBrowserOptions,
10438 ) -> bool;
10439}
10440pub const DialogMessageButtonBack: DialogMessageButton = DialogMessageButton(0);
10441pub const DialogMessageButtonLeft: DialogMessageButton = DialogMessageButton(1);
10442pub const DialogMessageButtonCenter: DialogMessageButton = DialogMessageButton(2);
10443pub const DialogMessageButtonRight: DialogMessageButton = DialogMessageButton(3);
10444#[repr(transparent)]
10445#[doc = "Message result type"]
10446#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10447pub struct DialogMessageButton(pub core::ffi::c_uchar);
10448#[repr(C)]
10449#[derive(Debug, Copy, Clone)]
10450pub struct DialogMessage {
10451 _unused: [u8; 0],
10452}
10453unsafe extern "C" {
10454 #[doc = "Allocate and fill message\n # Returns\n\nDialogMessage*"]
10455 pub fn dialog_message_alloc() -> *mut DialogMessage;
10456}
10457unsafe extern "C" {
10458 #[doc = "Free message struct\n # Arguments\n\n* `message` - message pointer"]
10459 pub fn dialog_message_free(message: *mut DialogMessage);
10460}
10461unsafe extern "C" {
10462 #[doc = "Set message text\n # Arguments\n\n* `message` - message pointer\n * `text` - text, can be NULL if you don't want to display the text\n * `x` - x position\n * `y` - y position\n * `horizontal` - horizontal alignment\n * `vertical` - vertical alignment"]
10463 pub fn dialog_message_set_text(
10464 message: *mut DialogMessage,
10465 text: *const core::ffi::c_char,
10466 x: u8,
10467 y: u8,
10468 horizontal: Align,
10469 vertical: Align,
10470 );
10471}
10472unsafe extern "C" {
10473 #[doc = "Set message header\n # Arguments\n\n* `message` - message pointer\n * `text` - text, can be NULL if you don't want to display the header\n * `x` - x position\n * `y` - y position\n * `horizontal` - horizontal alignment\n * `vertical` - vertical alignment"]
10474 pub fn dialog_message_set_header(
10475 message: *mut DialogMessage,
10476 text: *const core::ffi::c_char,
10477 x: u8,
10478 y: u8,
10479 horizontal: Align,
10480 vertical: Align,
10481 );
10482}
10483unsafe extern "C" {
10484 #[doc = "Set message icon\n # Arguments\n\n* `message` - message pointer\n * `icon` - icon pointer, can be NULL if you don't want to display the icon\n * `x` - x position\n * `y` - y position"]
10485 pub fn dialog_message_set_icon(message: *mut DialogMessage, icon: *const Icon, x: u8, y: u8);
10486}
10487unsafe extern "C" {
10488 #[doc = "Set message buttons text, button text can be NULL if you don't want to display and process some buttons\n # Arguments\n\n* `message` - message pointer\n * `left` - left button text, can be NULL if you don't want to display the left button\n * `center` - center button text, can be NULL if you don't want to display the center button\n * `right` - right button text, can be NULL if you don't want to display the right button"]
10489 pub fn dialog_message_set_buttons(
10490 message: *mut DialogMessage,
10491 left: *const core::ffi::c_char,
10492 center: *const core::ffi::c_char,
10493 right: *const core::ffi::c_char,
10494 );
10495}
10496unsafe extern "C" {
10497 #[doc = "Show message from filled struct\n # Arguments\n\n* `context` - api pointer\n * `message` - message struct pointer to be shown\n # Returns\n\nDialogMessageButton type"]
10498 pub fn dialog_message_show(
10499 context: *mut DialogsApp,
10500 message: *const DialogMessage,
10501 ) -> DialogMessageButton;
10502}
10503unsafe extern "C" {
10504 #[doc = "Show SD error message (with question sign)\n # Arguments\n\n* `context` -\n * `error_text` -"]
10505 pub fn dialog_message_show_storage_error(
10506 context: *mut DialogsApp,
10507 error_text: *const core::ffi::c_char,
10508 );
10509}
10510pub const DolphinAppSubGhz: DolphinApp = DolphinApp(0);
10511pub const DolphinAppRfid: DolphinApp = DolphinApp(1);
10512pub const DolphinAppNfc: DolphinApp = DolphinApp(2);
10513pub const DolphinAppIr: DolphinApp = DolphinApp(3);
10514pub const DolphinAppIbutton: DolphinApp = DolphinApp(4);
10515pub const DolphinAppBadusb: DolphinApp = DolphinApp(5);
10516pub const DolphinAppPlugin: DolphinApp = DolphinApp(6);
10517pub const DolphinAppMAX: DolphinApp = DolphinApp(7);
10518#[repr(transparent)]
10519#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10520pub struct DolphinApp(pub core::ffi::c_uchar);
10521pub const DolphinDeedSubGhzReceiverInfo: DolphinDeed = DolphinDeed(0);
10522pub const DolphinDeedSubGhzSave: DolphinDeed = DolphinDeed(1);
10523pub const DolphinDeedSubGhzRawRec: DolphinDeed = DolphinDeed(2);
10524pub const DolphinDeedSubGhzAddManually: DolphinDeed = DolphinDeed(3);
10525pub const DolphinDeedSubGhzSend: DolphinDeed = DolphinDeed(4);
10526pub const DolphinDeedSubGhzFrequencyAnalyzer: DolphinDeed = DolphinDeed(5);
10527pub const DolphinDeedRfidRead: DolphinDeed = DolphinDeed(6);
10528pub const DolphinDeedRfidReadSuccess: DolphinDeed = DolphinDeed(7);
10529pub const DolphinDeedRfidSave: DolphinDeed = DolphinDeed(8);
10530pub const DolphinDeedRfidEmulate: DolphinDeed = DolphinDeed(9);
10531pub const DolphinDeedRfidAdd: DolphinDeed = DolphinDeed(10);
10532pub const DolphinDeedNfcRead: DolphinDeed = DolphinDeed(11);
10533pub const DolphinDeedNfcReadSuccess: DolphinDeed = DolphinDeed(12);
10534pub const DolphinDeedNfcSave: DolphinDeed = DolphinDeed(13);
10535pub const DolphinDeedNfcDetectReader: DolphinDeed = DolphinDeed(14);
10536pub const DolphinDeedNfcEmulate: DolphinDeed = DolphinDeed(15);
10537pub const DolphinDeedNfcKeyAdd: DolphinDeed = DolphinDeed(16);
10538pub const DolphinDeedNfcAddSave: DolphinDeed = DolphinDeed(17);
10539pub const DolphinDeedNfcAddEmulate: DolphinDeed = DolphinDeed(18);
10540pub const DolphinDeedIrSend: DolphinDeed = DolphinDeed(19);
10541pub const DolphinDeedIrLearnSuccess: DolphinDeed = DolphinDeed(20);
10542pub const DolphinDeedIrSave: DolphinDeed = DolphinDeed(21);
10543pub const DolphinDeedIbuttonRead: DolphinDeed = DolphinDeed(22);
10544pub const DolphinDeedIbuttonReadSuccess: DolphinDeed = DolphinDeed(23);
10545pub const DolphinDeedIbuttonSave: DolphinDeed = DolphinDeed(24);
10546pub const DolphinDeedIbuttonEmulate: DolphinDeed = DolphinDeed(25);
10547pub const DolphinDeedIbuttonAdd: DolphinDeed = DolphinDeed(26);
10548pub const DolphinDeedBadUsbPlayScript: DolphinDeed = DolphinDeed(27);
10549pub const DolphinDeedU2fAuthorized: DolphinDeed = DolphinDeed(28);
10550pub const DolphinDeedGpioUartBridge: DolphinDeed = DolphinDeed(29);
10551pub const DolphinDeedPluginStart: DolphinDeed = DolphinDeed(30);
10552pub const DolphinDeedPluginGameStart: DolphinDeed = DolphinDeed(31);
10553pub const DolphinDeedPluginGameWin: DolphinDeed = DolphinDeed(32);
10554pub const DolphinDeedMAX: DolphinDeed = DolphinDeed(33);
10555pub const DolphinDeedTestLeft: DolphinDeed = DolphinDeed(34);
10556pub const DolphinDeedTestRight: DolphinDeed = DolphinDeed(35);
10557#[repr(transparent)]
10558#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10559pub struct DolphinDeed(pub core::ffi::c_uchar);
10560#[repr(C)]
10561#[derive(Debug, Copy, Clone)]
10562pub struct DolphinDeedWeight {
10563 pub icounter: u8,
10564 pub app: DolphinApp,
10565}
10566#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10567const _: () = {
10568 ["Size of DolphinDeedWeight"][::core::mem::size_of::<DolphinDeedWeight>() - 2usize];
10569 ["Alignment of DolphinDeedWeight"][::core::mem::align_of::<DolphinDeedWeight>() - 1usize];
10570 ["Offset of field: DolphinDeedWeight::icounter"]
10571 [::core::mem::offset_of!(DolphinDeedWeight, icounter) - 0usize];
10572 ["Offset of field: DolphinDeedWeight::app"]
10573 [::core::mem::offset_of!(DolphinDeedWeight, app) - 1usize];
10574};
10575#[repr(C)]
10576#[derive(Debug, Copy, Clone)]
10577pub struct DolphinDeedLimits {
10578 pub app: DolphinApp,
10579 pub icounter_limit: u8,
10580}
10581#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10582const _: () = {
10583 ["Size of DolphinDeedLimits"][::core::mem::size_of::<DolphinDeedLimits>() - 2usize];
10584 ["Alignment of DolphinDeedLimits"][::core::mem::align_of::<DolphinDeedLimits>() - 1usize];
10585 ["Offset of field: DolphinDeedLimits::app"]
10586 [::core::mem::offset_of!(DolphinDeedLimits, app) - 0usize];
10587 ["Offset of field: DolphinDeedLimits::icounter_limit"]
10588 [::core::mem::offset_of!(DolphinDeedLimits, icounter_limit) - 1usize];
10589};
10590unsafe extern "C" {
10591 pub fn dolphin_deed_get_app(deed: DolphinDeed) -> DolphinApp;
10592}
10593unsafe extern "C" {
10594 pub fn dolphin_deed_get_app_limit(app: DolphinApp) -> u8;
10595}
10596unsafe extern "C" {
10597 pub fn dolphin_deed_get_weight(deed: DolphinDeed) -> u8;
10598}
10599#[repr(C)]
10600#[derive(Debug, Copy, Clone)]
10601pub struct Dolphin {
10602 _unused: [u8; 0],
10603}
10604#[repr(C)]
10605#[derive(Debug, Copy, Clone)]
10606pub struct DolphinStats {
10607 pub icounter: u32,
10608 pub butthurt: u32,
10609 pub timestamp: u64,
10610 pub level: u8,
10611 pub level_up_is_pending: bool,
10612}
10613#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10614const _: () = {
10615 ["Size of DolphinStats"][::core::mem::size_of::<DolphinStats>() - 24usize];
10616 ["Alignment of DolphinStats"][::core::mem::align_of::<DolphinStats>() - 8usize];
10617 ["Offset of field: DolphinStats::icounter"]
10618 [::core::mem::offset_of!(DolphinStats, icounter) - 0usize];
10619 ["Offset of field: DolphinStats::butthurt"]
10620 [::core::mem::offset_of!(DolphinStats, butthurt) - 4usize];
10621 ["Offset of field: DolphinStats::timestamp"]
10622 [::core::mem::offset_of!(DolphinStats, timestamp) - 8usize];
10623 ["Offset of field: DolphinStats::level"]
10624 [::core::mem::offset_of!(DolphinStats, level) - 16usize];
10625 ["Offset of field: DolphinStats::level_up_is_pending"]
10626 [::core::mem::offset_of!(DolphinStats, level_up_is_pending) - 17usize];
10627};
10628#[repr(C)]
10629#[derive(Debug, Copy, Clone)]
10630pub struct DolphinSettings {
10631 pub happy_mode: bool,
10632}
10633#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10634const _: () = {
10635 ["Size of DolphinSettings"][::core::mem::size_of::<DolphinSettings>() - 1usize];
10636 ["Alignment of DolphinSettings"][::core::mem::align_of::<DolphinSettings>() - 1usize];
10637 ["Offset of field: DolphinSettings::happy_mode"]
10638 [::core::mem::offset_of!(DolphinSettings, happy_mode) - 0usize];
10639};
10640pub const DolphinPubsubEventUpdate: DolphinPubsubEvent = DolphinPubsubEvent(0);
10641#[repr(transparent)]
10642#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10643pub struct DolphinPubsubEvent(pub core::ffi::c_uchar);
10644unsafe extern "C" {
10645 #[doc = "Deed complete notification. Call it on deed completion.\n See dolphin_deed.h for available deeds. In futures it will become part of assets.\n Thread safe, async"]
10646 pub fn dolphin_deed(deed: DolphinDeed);
10647}
10648unsafe extern "C" {
10649 pub fn dolphin_get_settings(dolphin: *mut Dolphin, settings: *mut DolphinSettings);
10650}
10651unsafe extern "C" {
10652 pub fn dolphin_set_settings(dolphin: *mut Dolphin, settings: *mut DolphinSettings);
10653}
10654unsafe extern "C" {
10655 #[doc = "Retrieve dolphin stats\n Thread safe, blocking"]
10656 pub fn dolphin_stats(dolphin: *mut Dolphin) -> DolphinStats;
10657}
10658unsafe extern "C" {
10659 #[doc = "Flush dolphin queue and save state\n Thread safe, blocking"]
10660 pub fn dolphin_flush(dolphin: *mut Dolphin);
10661}
10662unsafe extern "C" {
10663 pub fn dolphin_upgrade_level(dolphin: *mut Dolphin);
10664}
10665unsafe extern "C" {
10666 pub fn dolphin_get_pubsub(dolphin: *mut Dolphin) -> *mut FuriPubSub;
10667}
10668#[repr(C)]
10669#[derive(Debug, Copy, Clone)]
10670pub struct Expansion {
10671 _unused: [u8; 0],
10672}
10673unsafe extern "C" {
10674 #[doc = "Enable support for expansion modules.\n\n Calling this function will load user settings and enable\n expansion module support on the serial port specified in said settings.\n\n If expansion module support was disabled in settings, this function\n does nothing.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the Expansion instance."]
10675 pub fn expansion_enable(instance: *mut Expansion);
10676}
10677unsafe extern "C" {
10678 #[doc = "Disable support for expansion modules.\n\n Calling this function will cease all communications with the\n expansion module (if any), release the serial handle and\n reset the respective pins to the default state.\n\n > **Note:** Applications requiring serial port access MUST call\n this function BEFORE calling furi_hal_serial_control_acquire().\n Similarly, an expansion_enable() call MUST be made right AFTER\n a call to furi_hal_serial_control_release() to ensure that\n the user settings are properly restored.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the Expansion instance."]
10679 pub fn expansion_disable(instance: *mut Expansion);
10680}
10681unsafe extern "C" {
10682 #[doc = "Enable support for expansion modules on designated serial port.\n\n Only one serial port can be used to communicate with an expansion\n module at a time.\n\n Calling this function when expansion module support is already enabled\n will first disable the previous setting, then enable the current one.\n\n This function does not respect user settings for expansion modules,\n so calling it might leave the system in inconsistent state. Avoid using it\n unless absolutely necessary.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the Expansion instance.\n * `serial_id` (direction in) - numerical identifier of the serial."]
10683 pub fn expansion_set_listen_serial(instance: *mut Expansion, serial_id: FuriHalSerialId);
10684}
10685unsafe extern "C" {
10686 #[doc = "Draw progress bar.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - progress bar position on X axis\n * `y` - progress bar position on Y axis\n * `width` - progress bar width\n * `progress` - progress (0.0 - 1.0)"]
10687 pub fn elements_progress_bar(canvas: *mut Canvas, x: i32, y: i32, width: usize, progress: f32);
10688}
10689unsafe extern "C" {
10690 #[doc = "Draw progress bar with text.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - progress bar position on X axis\n * `y` - progress bar position on Y axis\n * `width` - progress bar width\n * `progress` - progress (0.0 - 1.0)\n * `text` - text to draw"]
10691 pub fn elements_progress_bar_with_text(
10692 canvas: *mut Canvas,
10693 x: i32,
10694 y: i32,
10695 width: usize,
10696 progress: f32,
10697 text: *const core::ffi::c_char,
10698 );
10699}
10700unsafe extern "C" {
10701 #[doc = "Draw scrollbar on canvas at specific position.\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - scrollbar position on X axis\n * `y` - scrollbar position on Y axis\n * `height` - scrollbar height\n * `pos` - current element\n * `total` - total elements"]
10702 pub fn elements_scrollbar_pos(
10703 canvas: *mut Canvas,
10704 x: i32,
10705 y: i32,
10706 height: usize,
10707 pos: usize,
10708 total: usize,
10709 );
10710}
10711unsafe extern "C" {
10712 #[doc = "Draw scrollbar on canvas.\n > **Note:** width 3px, height equal to canvas height\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `pos` - current element of total elements\n * `total` - total elements"]
10713 pub fn elements_scrollbar(canvas: *mut Canvas, pos: usize, total: usize);
10714}
10715unsafe extern "C" {
10716 #[doc = "Draw rounded frame\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x,` - y top left corner coordinates\n * `width,` - height frame width and height"]
10717 pub fn elements_frame(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
10718}
10719unsafe extern "C" {
10720 #[doc = "Draw button in left corner\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - button text"]
10721 pub fn elements_button_left(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10722}
10723unsafe extern "C" {
10724 #[doc = "Draw button in right corner\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - button text"]
10725 pub fn elements_button_right(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10726}
10727unsafe extern "C" {
10728 #[doc = "This function draws a button in the top left corner of the canvas with icon and string.\n\n The design and layout of the button is defined within this function.\n\n # Arguments\n\n* `canvas` (direction in) - This is a pointer to the `Canvas` structure where the button will be drawn.\n * `str` (direction in) - This is a pointer to the character string that will be drawn within the button.\n"]
10729 pub fn elements_button_up(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10730}
10731unsafe extern "C" {
10732 #[doc = "This function draws a button in the top right corner of the canvas with icon and string.\n\n The design and layout of the button is defined within this function.\n\n # Arguments\n\n* `canvas` (direction in) - This is a pointer to the `Canvas` structure where the button will be drawn.\n * `str` (direction in) - This is a pointer to the character string that will be drawn within the button.\n"]
10733 pub fn elements_button_down(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10734}
10735unsafe extern "C" {
10736 #[doc = "Draw button in center\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - button text"]
10737 pub fn elements_button_center(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10738}
10739unsafe extern "C" {
10740 #[doc = "Draw aligned multiline text\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x,` - y coordinates based on align param\n * `horizontal,` - vertical alignment of multiline text\n * `text` - string (possible multiline)"]
10741 pub fn elements_multiline_text_aligned(
10742 canvas: *mut Canvas,
10743 x: i32,
10744 y: i32,
10745 horizontal: Align,
10746 vertical: Align,
10747 text: *const core::ffi::c_char,
10748 );
10749}
10750unsafe extern "C" {
10751 #[doc = "Draw multiline text\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - top left corner coordinates\n * `y` - top left corner coordinates\n * `text` - string (possible multiline)"]
10752 pub fn elements_multiline_text(
10753 canvas: *mut Canvas,
10754 x: i32,
10755 y: i32,
10756 text: *const core::ffi::c_char,
10757 );
10758}
10759unsafe extern "C" {
10760 #[doc = "Draw framed multiline text\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - top left corner coordinates\n * `y` - top left corner coordinates\n * `text` - string (possible multiline)"]
10761 pub fn elements_multiline_text_framed(
10762 canvas: *mut Canvas,
10763 x: i32,
10764 y: i32,
10765 text: *const core::ffi::c_char,
10766 );
10767}
10768unsafe extern "C" {
10769 #[doc = "Draw slightly rounded frame\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - top left corner coordinates\n * `y` - top left corner coordinates\n * `width` - width of frame\n * `height` - height of frame"]
10770 pub fn elements_slightly_rounded_frame(
10771 canvas: *mut Canvas,
10772 x: i32,
10773 y: i32,
10774 width: usize,
10775 height: usize,
10776 );
10777}
10778unsafe extern "C" {
10779 #[doc = "Draw slightly rounded box\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - top left corner coordinates\n * `y` - top left corner coordinates\n * `width` - height of box\n * `height` - height of box"]
10780 pub fn elements_slightly_rounded_box(
10781 canvas: *mut Canvas,
10782 x: i32,
10783 y: i32,
10784 width: usize,
10785 height: usize,
10786 );
10787}
10788unsafe extern "C" {
10789 #[doc = "Draw bold rounded frame\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - top left corner coordinates\n * `y` - top left corner coordinates\n * `width` - width of frame\n * `height` - height of frame"]
10790 pub fn elements_bold_rounded_frame(
10791 canvas: *mut Canvas,
10792 x: i32,
10793 y: i32,
10794 width: usize,
10795 height: usize,
10796 );
10797}
10798unsafe extern "C" {
10799 #[doc = "Draw bubble frame for text\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - left x coordinates\n * `y` - top y coordinate\n * `width` - bubble width\n * `height` - bubble height"]
10800 pub fn elements_bubble(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
10801}
10802unsafe extern "C" {
10803 #[doc = "Draw bubble frame for text with corner\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - left x coordinates\n * `y` - top y coordinate\n * `text` - text to display\n * `horizontal` - horizontal aligning\n * `vertical` - aligning"]
10804 pub fn elements_bubble_str(
10805 canvas: *mut Canvas,
10806 x: i32,
10807 y: i32,
10808 text: *const core::ffi::c_char,
10809 horizontal: Align,
10810 vertical: Align,
10811 );
10812}
10813unsafe extern "C" {
10814 #[doc = "Trim string buffer to fit width in pixels\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `string` - string to trim\n * `width` - max width"]
10815 pub fn elements_string_fit_width(canvas: *mut Canvas, string: *mut FuriString, width: usize);
10816}
10817unsafe extern "C" {
10818 #[doc = "Draw scrollable text line\n\n # Arguments\n\n* `canvas` - The canvas\n * `x` (direction in) - X coordinate\n * `y` (direction in) - Y coordinate\n * `width` (direction in) - The width\n * `string` - The string\n * `scroll` (direction in) - The scroll counter: 0 - no scroll, any other number - scroll. Just count up, everything else will be calculated on the inside.\n * `ellipsis` (direction in) - The ellipsis flag: true to add ellipse"]
10819 pub fn elements_scrollable_text_line(
10820 canvas: *mut Canvas,
10821 x: i32,
10822 y: i32,
10823 width: usize,
10824 string: *mut FuriString,
10825 scroll: usize,
10826 ellipsis: bool,
10827 );
10828}
10829unsafe extern "C" {
10830 #[doc = "Draw text box element\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - width to fit text\n * `height` - height to fit text\n * `horizontal` - Align instance\n * `vertical` - Align instance\n * `text` (direction in) - Formatted text. The following formats are available:\n \"text- bold font is used\n \"text- monospaced font is used\n \"text- white text on black background\n * `strip_to_dots` - Strip text to ... if does not fit to width"]
10831 pub fn elements_text_box(
10832 canvas: *mut Canvas,
10833 x: i32,
10834 y: i32,
10835 width: usize,
10836 height: usize,
10837 horizontal: Align,
10838 vertical: Align,
10839 text: *const core::ffi::c_char,
10840 strip_to_dots: bool,
10841 );
10842}
10843#[repr(C)]
10844#[derive(Debug, Copy, Clone)]
10845pub struct ViewPort {
10846 _unused: [u8; 0],
10847}
10848pub const ViewPortOrientationHorizontal: ViewPortOrientation = ViewPortOrientation(0);
10849pub const ViewPortOrientationHorizontalFlip: ViewPortOrientation = ViewPortOrientation(1);
10850pub const ViewPortOrientationVertical: ViewPortOrientation = ViewPortOrientation(2);
10851pub const ViewPortOrientationVerticalFlip: ViewPortOrientation = ViewPortOrientation(3);
10852#[doc = "< Special value, don't use it"]
10853pub const ViewPortOrientationMAX: ViewPortOrientation = ViewPortOrientation(4);
10854#[repr(transparent)]
10855#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10856pub struct ViewPortOrientation(pub core::ffi::c_uchar);
10857#[doc = "ViewPort Draw callback\n called from GUI thread"]
10858pub type ViewPortDrawCallback = ::core::option::Option<
10859 unsafe extern "C" fn(canvas: *mut Canvas, context: *mut core::ffi::c_void),
10860>;
10861#[doc = "ViewPort Input callback\n called from GUI thread"]
10862pub type ViewPortInputCallback = ::core::option::Option<
10863 unsafe extern "C" fn(event: *mut InputEvent, context: *mut core::ffi::c_void),
10864>;
10865unsafe extern "C" {
10866 #[doc = "ViewPort allocator\n\n always returns view_port or stops system if not enough memory.\n\n # Returns\n\nViewPort instance"]
10867 pub fn view_port_alloc() -> *mut ViewPort;
10868}
10869unsafe extern "C" {
10870 #[doc = "ViewPort deallocator\n\n Ensure that view_port was unregistered in GUI system before use.\n\n # Arguments\n\n* `view_port` - ViewPort instance"]
10871 pub fn view_port_free(view_port: *mut ViewPort);
10872}
10873unsafe extern "C" {
10874 #[doc = "Set view_port width.\n\n Will be used to limit canvas drawing area and autolayout feature.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `width` - wanted width, 0 - auto."]
10875 pub fn view_port_set_width(view_port: *mut ViewPort, width: u8);
10876}
10877unsafe extern "C" {
10878 pub fn view_port_get_width(view_port: *const ViewPort) -> u8;
10879}
10880unsafe extern "C" {
10881 #[doc = "Set view_port height.\n\n Will be used to limit canvas drawing area and autolayout feature.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `height` - wanted height, 0 - auto."]
10882 pub fn view_port_set_height(view_port: *mut ViewPort, height: u8);
10883}
10884unsafe extern "C" {
10885 pub fn view_port_get_height(view_port: *const ViewPort) -> u8;
10886}
10887unsafe extern "C" {
10888 #[doc = "Enable or disable view_port rendering.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `enabled` - Indicates if enabled\n automatically dispatches update event"]
10889 pub fn view_port_enabled_set(view_port: *mut ViewPort, enabled: bool);
10890}
10891unsafe extern "C" {
10892 pub fn view_port_is_enabled(view_port: *const ViewPort) -> bool;
10893}
10894unsafe extern "C" {
10895 #[doc = "ViewPort event callbacks\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `callback` - appropriate callback function\n * `context` - context to pass to callback"]
10896 pub fn view_port_draw_callback_set(
10897 view_port: *mut ViewPort,
10898 callback: ViewPortDrawCallback,
10899 context: *mut core::ffi::c_void,
10900 );
10901}
10902unsafe extern "C" {
10903 pub fn view_port_input_callback_set(
10904 view_port: *mut ViewPort,
10905 callback: ViewPortInputCallback,
10906 context: *mut core::ffi::c_void,
10907 );
10908}
10909unsafe extern "C" {
10910 #[doc = "Emit update signal to GUI system.\n\n Rendering will happen later after GUI system process signal.\n\n # Arguments\n\n* `view_port` - ViewPort instance"]
10911 pub fn view_port_update(view_port: *mut ViewPort);
10912}
10913unsafe extern "C" {
10914 #[doc = "Set ViewPort orientation.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `orientation` - display orientation, horizontal or vertical."]
10915 pub fn view_port_set_orientation(view_port: *mut ViewPort, orientation: ViewPortOrientation);
10916}
10917unsafe extern "C" {
10918 pub fn view_port_get_orientation(view_port: *const ViewPort) -> ViewPortOrientation;
10919}
10920#[doc = "< Desktop layer for internal use. Like fullscreen but with status bar"]
10921pub const GuiLayerDesktop: GuiLayer = GuiLayer(0);
10922#[doc = "< Window layer, status bar is shown"]
10923pub const GuiLayerWindow: GuiLayer = GuiLayer(1);
10924#[doc = "< Status bar left-side layer, auto-layout"]
10925pub const GuiLayerStatusBarLeft: GuiLayer = GuiLayer(2);
10926#[doc = "< Status bar right-side layer, auto-layout"]
10927pub const GuiLayerStatusBarRight: GuiLayer = GuiLayer(3);
10928#[doc = "< Fullscreen layer, no status bar"]
10929pub const GuiLayerFullscreen: GuiLayer = GuiLayer(4);
10930#[doc = "< Don't use or move, special value"]
10931pub const GuiLayerMAX: GuiLayer = GuiLayer(5);
10932#[repr(transparent)]
10933#[doc = "Gui layers"]
10934#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10935pub struct GuiLayer(pub core::ffi::c_uchar);
10936#[doc = "Gui Canvas Commit Callback"]
10937pub type GuiCanvasCommitCallback = ::core::option::Option<
10938 unsafe extern "C" fn(
10939 data: *mut u8,
10940 size: usize,
10941 orientation: CanvasOrientation,
10942 context: *mut core::ffi::c_void,
10943 ),
10944>;
10945#[repr(C)]
10946#[derive(Debug, Copy, Clone)]
10947pub struct Gui {
10948 _unused: [u8; 0],
10949}
10950unsafe extern "C" {
10951 #[doc = "Add view_port to view_port tree\n\n > thread safe\n\n # Arguments\n\n* `gui` - Gui instance\n * `view_port` - ViewPort instance\n * `layer` (direction in) - GuiLayer where to place view_port"]
10952 pub fn gui_add_view_port(gui: *mut Gui, view_port: *mut ViewPort, layer: GuiLayer);
10953}
10954unsafe extern "C" {
10955 #[doc = "Remove view_port from rendering tree\n\n > thread safe\n\n # Arguments\n\n* `gui` - Gui instance\n * `view_port` - ViewPort instance"]
10956 pub fn gui_remove_view_port(gui: *mut Gui, view_port: *mut ViewPort);
10957}
10958unsafe extern "C" {
10959 #[doc = "Send ViewPort to the front\n\n Places selected ViewPort to the top of the drawing stack\n\n # Arguments\n\n* `gui` - Gui instance\n * `view_port` - ViewPort instance"]
10960 pub fn gui_view_port_send_to_front(gui: *mut Gui, view_port: *mut ViewPort);
10961}
10962unsafe extern "C" {
10963 #[doc = "Add gui canvas commit callback\n\n This callback will be called upon Canvas commit Callback dispatched from GUI\n thread and is time critical\n\n # Arguments\n\n* `gui` - Gui instance\n * `callback` - GuiCanvasCommitCallback\n * `context` - GuiCanvasCommitCallback context"]
10964 pub fn gui_add_framebuffer_callback(
10965 gui: *mut Gui,
10966 callback: GuiCanvasCommitCallback,
10967 context: *mut core::ffi::c_void,
10968 );
10969}
10970unsafe extern "C" {
10971 #[doc = "Remove gui canvas commit callback\n\n # Arguments\n\n* `gui` - Gui instance\n * `callback` - GuiCanvasCommitCallback\n * `context` - GuiCanvasCommitCallback context"]
10972 pub fn gui_remove_framebuffer_callback(
10973 gui: *mut Gui,
10974 callback: GuiCanvasCommitCallback,
10975 context: *mut core::ffi::c_void,
10976 );
10977}
10978unsafe extern "C" {
10979 #[doc = "Get gui canvas frame buffer size\n *\n # Arguments\n\n* `gui` - Gui instance\n # Returns\n\nsize_t size of frame buffer in bytes"]
10980 pub fn gui_get_framebuffer_size(gui: *const Gui) -> usize;
10981}
10982unsafe extern "C" {
10983 #[doc = "Set lockdown mode\n\n When lockdown mode is enabled, only GuiLayerDesktop is shown.\n This feature prevents services from showing sensitive information when flipper is locked.\n\n # Arguments\n\n* `gui` - Gui instance\n * `lockdown` - bool, true if enabled"]
10984 pub fn gui_set_lockdown(gui: *mut Gui, lockdown: bool);
10985}
10986unsafe extern "C" {
10987 #[doc = "Acquire Direct Draw lock and get Canvas instance\n\n This method return Canvas instance for use in monopoly mode. Direct draw lock\n disables input and draw call dispatch functions in GUI service. No other\n applications or services will be able to draw until gui_direct_draw_release\n call.\n\n # Arguments\n\n* `gui` - The graphical user interface\n\n # Returns\n\nCanvas instance"]
10988 pub fn gui_direct_draw_acquire(gui: *mut Gui) -> *mut Canvas;
10989}
10990unsafe extern "C" {
10991 #[doc = "Release Direct Draw Lock\n\n Release Direct Draw Lock, enables Input and Draw call processing. Canvas\n acquired in gui_direct_draw_acquire will become invalid after this call.\n\n # Arguments\n\n* `gui` - Gui instance"]
10992 pub fn gui_direct_draw_release(gui: *mut Gui);
10993}
10994#[repr(C)]
10995#[derive(Debug, Copy, Clone)]
10996pub struct Icon {
10997 pub width: u16,
10998 pub height: u16,
10999 pub frame_count: u8,
11000 pub frame_rate: u8,
11001 pub frames: *const *const u8,
11002}
11003#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11004const _: () = {
11005 ["Size of Icon"][::core::mem::size_of::<Icon>() - 12usize];
11006 ["Alignment of Icon"][::core::mem::align_of::<Icon>() - 4usize];
11007 ["Offset of field: Icon::width"][::core::mem::offset_of!(Icon, width) - 0usize];
11008 ["Offset of field: Icon::height"][::core::mem::offset_of!(Icon, height) - 2usize];
11009 ["Offset of field: Icon::frame_count"][::core::mem::offset_of!(Icon, frame_count) - 4usize];
11010 ["Offset of field: Icon::frame_rate"][::core::mem::offset_of!(Icon, frame_rate) - 5usize];
11011 ["Offset of field: Icon::frames"][::core::mem::offset_of!(Icon, frames) - 8usize];
11012};
11013#[repr(C)]
11014#[derive(Debug, Copy, Clone)]
11015pub struct ButtonMenu {
11016 _unused: [u8; 0],
11017}
11018#[repr(C)]
11019#[derive(Debug, Copy, Clone)]
11020pub struct ButtonMenuItem {
11021 _unused: [u8; 0],
11022}
11023#[doc = "Callback for any button menu actions"]
11024pub type ButtonMenuItemCallback = ::core::option::Option<
11025 unsafe extern "C" fn(context: *mut core::ffi::c_void, index: i32, type_: InputType),
11026>;
11027pub const ButtonMenuItemTypeCommon: ButtonMenuItemType = ButtonMenuItemType(0);
11028pub const ButtonMenuItemTypeControl: ButtonMenuItemType = ButtonMenuItemType(1);
11029#[repr(transparent)]
11030#[doc = "Type of button. Difference in drawing buttons."]
11031#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11032pub struct ButtonMenuItemType(pub core::ffi::c_uchar);
11033unsafe extern "C" {
11034 #[doc = "Get button menu view\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance\n\n # Returns\n\nView instance that can be used for embedding"]
11035 pub fn button_menu_get_view(button_menu: *mut ButtonMenu) -> *mut View;
11036}
11037unsafe extern "C" {
11038 #[doc = "Clean button menu\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance"]
11039 pub fn button_menu_reset(button_menu: *mut ButtonMenu);
11040}
11041unsafe extern "C" {
11042 #[doc = "Add item to button menu instance\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance\n * `label` - text inside new button\n * `index` - value to distinct between buttons inside\n ButtonMenuItemCallback\n * `callback` - The callback\n * `type` - type of button to create. Differ by button\n drawing. Control buttons have no frames, and\n have more squared borders.\n * `callback_context` - The callback context\n\n # Returns\n\npointer to just-created item"]
11043 pub fn button_menu_add_item(
11044 button_menu: *mut ButtonMenu,
11045 label: *const core::ffi::c_char,
11046 index: i32,
11047 callback: ButtonMenuItemCallback,
11048 type_: ButtonMenuItemType,
11049 callback_context: *mut core::ffi::c_void,
11050 ) -> *mut ButtonMenuItem;
11051}
11052unsafe extern "C" {
11053 #[doc = "Allocate and initialize new instance of ButtonMenu model\n\n # Returns\n\njust-created ButtonMenu model"]
11054 pub fn button_menu_alloc() -> *mut ButtonMenu;
11055}
11056unsafe extern "C" {
11057 #[doc = "Free ButtonMenu element\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance"]
11058 pub fn button_menu_free(button_menu: *mut ButtonMenu);
11059}
11060unsafe extern "C" {
11061 #[doc = "Set ButtonMenu header on top of canvas\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance\n * `header` - header on the top of button menu"]
11062 pub fn button_menu_set_header(button_menu: *mut ButtonMenu, header: *const core::ffi::c_char);
11063}
11064unsafe extern "C" {
11065 #[doc = "Set selected item\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance\n * `index` - index of ButtonMenu to be selected"]
11066 pub fn button_menu_set_selected_item(button_menu: *mut ButtonMenu, index: u32);
11067}
11068#[repr(C)]
11069#[derive(Debug, Copy, Clone)]
11070pub struct ButtonPanel {
11071 _unused: [u8; 0],
11072}
11073#[doc = "Callback type to call for handling selecting button_panel items"]
11074pub type ButtonItemCallback = ::core::option::Option<
11075 unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32, type_: InputType),
11076>;
11077unsafe extern "C" {
11078 #[doc = "Allocate new button_panel module.\n\n # Returns\n\nButtonPanel instance"]
11079 pub fn button_panel_alloc() -> *mut ButtonPanel;
11080}
11081unsafe extern "C" {
11082 #[doc = "Free button_panel module.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance"]
11083 pub fn button_panel_free(button_panel: *mut ButtonPanel);
11084}
11085unsafe extern "C" {
11086 #[doc = "Free items from button_panel module. Preallocated matrix stays unchanged.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance"]
11087 pub fn button_panel_reset(button_panel: *mut ButtonPanel);
11088}
11089unsafe extern "C" {
11090 #[doc = "Reserve space for adding items.\n\n One does not simply use button_panel_add_item() without this function. It\n should be allocated space for it first.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance\n * `reserve_x` - number of columns in button_panel\n * `reserve_y` - number of rows in button_panel"]
11091 pub fn button_panel_reserve(button_panel: *mut ButtonPanel, reserve_x: usize, reserve_y: usize);
11092}
11093unsafe extern "C" {
11094 #[doc = "Add item to button_panel module.\n\n Have to set element in bounds of allocated size by X and by Y.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance\n * `index` - value to pass to callback\n * `matrix_place_x` - coordinates by x-axis on virtual grid, it\n is only used for navigation\n * `matrix_place_y` - coordinates by y-axis on virtual grid, it\n is only used for naviagation\n * `x` - x-coordinate to draw icon on\n * `y` - y-coordinate to draw icon on\n * `icon_name` - name of the icon to draw\n * `icon_name_selected` - name of the icon to draw when current\n element is selected\n * `callback` - function to call when specific element is\n selected (pressed Ok on selected item)\n * `callback_context` - context to pass to callback"]
11095 pub fn button_panel_add_item(
11096 button_panel: *mut ButtonPanel,
11097 index: u32,
11098 matrix_place_x: u16,
11099 matrix_place_y: u16,
11100 x: u16,
11101 y: u16,
11102 icon_name: *const Icon,
11103 icon_name_selected: *const Icon,
11104 callback: ButtonItemCallback,
11105 callback_context: *mut core::ffi::c_void,
11106 );
11107}
11108unsafe extern "C" {
11109 #[doc = "Get button_panel view.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance\n\n # Returns\n\nacquired view"]
11110 pub fn button_panel_get_view(button_panel: *mut ButtonPanel) -> *mut View;
11111}
11112unsafe extern "C" {
11113 #[doc = "Add label to button_panel module.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance\n * `x` - x-coordinate to place label\n * `y` - y-coordinate to place label\n * `font` - font to write label with\n * `label_str` - string label to write"]
11114 pub fn button_panel_add_label(
11115 button_panel: *mut ButtonPanel,
11116 x: u16,
11117 y: u16,
11118 font: Font,
11119 label_str: *const core::ffi::c_char,
11120 );
11121}
11122unsafe extern "C" {
11123 #[doc = "Add a non-button icon to button_panel module.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance\n * `x` - x-coordinate to place icon\n * `y` - y-coordinate to place icon\n * `icon_name` - name of the icon to draw"]
11124 pub fn button_panel_add_icon(
11125 button_panel: *mut ButtonPanel,
11126 x: u16,
11127 y: u16,
11128 icon_name: *const Icon,
11129 );
11130}
11131#[repr(C)]
11132#[derive(Debug, Copy, Clone)]
11133pub struct ByteInput {
11134 _unused: [u8; 0],
11135}
11136#[doc = "callback that is executed on save button press"]
11137pub type ByteInputCallback =
11138 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11139#[doc = "callback that is executed when byte buffer is changed"]
11140pub type ByteChangedCallback =
11141 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11142unsafe extern "C" {
11143 #[doc = "Allocate and initialize byte input. This byte input is used to enter bytes.\n\n # Returns\n\nByteInput instance pointer"]
11144 pub fn byte_input_alloc() -> *mut ByteInput;
11145}
11146unsafe extern "C" {
11147 #[doc = "Deinitialize and free byte input\n\n # Arguments\n\n* `byte_input` - Byte input instance"]
11148 pub fn byte_input_free(byte_input: *mut ByteInput);
11149}
11150unsafe extern "C" {
11151 #[doc = "Get byte input view\n\n # Arguments\n\n* `byte_input` - byte input instance\n\n # Returns\n\nView instance that can be used for embedding"]
11152 pub fn byte_input_get_view(byte_input: *mut ByteInput) -> *mut View;
11153}
11154unsafe extern "C" {
11155 #[doc = "Set byte input result callback\n\n # Arguments\n\n* `byte_input` - byte input instance\n * `input_callback` - input callback fn\n * `changed_callback` - changed callback fn\n * `callback_context` - callback context\n * `bytes` - buffer to use\n * `bytes_count` - buffer length"]
11156 pub fn byte_input_set_result_callback(
11157 byte_input: *mut ByteInput,
11158 input_callback: ByteInputCallback,
11159 changed_callback: ByteChangedCallback,
11160 callback_context: *mut core::ffi::c_void,
11161 bytes: *mut u8,
11162 bytes_count: u8,
11163 );
11164}
11165unsafe extern "C" {
11166 #[doc = "Set byte input header text\n\n # Arguments\n\n* `byte_input` - byte input instance\n * `text` - text to be shown"]
11167 pub fn byte_input_set_header_text(byte_input: *mut ByteInput, text: *const core::ffi::c_char);
11168}
11169#[repr(C)]
11170#[derive(Debug, Copy, Clone)]
11171pub struct DialogEx {
11172 _unused: [u8; 0],
11173}
11174pub const DialogExResultLeft: DialogExResult = DialogExResult(0);
11175pub const DialogExResultCenter: DialogExResult = DialogExResult(1);
11176pub const DialogExResultRight: DialogExResult = DialogExResult(2);
11177pub const DialogExPressLeft: DialogExResult = DialogExResult(3);
11178pub const DialogExPressCenter: DialogExResult = DialogExResult(4);
11179pub const DialogExPressRight: DialogExResult = DialogExResult(5);
11180pub const DialogExReleaseLeft: DialogExResult = DialogExResult(6);
11181pub const DialogExReleaseCenter: DialogExResult = DialogExResult(7);
11182pub const DialogExReleaseRight: DialogExResult = DialogExResult(8);
11183#[repr(transparent)]
11184#[doc = "DialogEx result"]
11185#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11186pub struct DialogExResult(pub core::ffi::c_uchar);
11187#[doc = "DialogEx result callback type\n comes from GUI thread"]
11188pub type DialogExResultCallback = ::core::option::Option<
11189 unsafe extern "C" fn(result: DialogExResult, context: *mut core::ffi::c_void),
11190>;
11191unsafe extern "C" {
11192 #[doc = "Allocate and initialize dialog\n\n This dialog used to ask simple questions\n\n # Returns\n\nDialogEx instance"]
11193 pub fn dialog_ex_alloc() -> *mut DialogEx;
11194}
11195unsafe extern "C" {
11196 #[doc = "Deinitialize and free dialog\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11197 pub fn dialog_ex_free(dialog_ex: *mut DialogEx);
11198}
11199unsafe extern "C" {
11200 #[doc = "Get dialog view\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n\n # Returns\n\nView instance that can be used for embedding"]
11201 pub fn dialog_ex_get_view(dialog_ex: *mut DialogEx) -> *mut View;
11202}
11203unsafe extern "C" {
11204 #[doc = "Set dialog result callback\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `callback` - result callback function"]
11205 pub fn dialog_ex_set_result_callback(
11206 dialog_ex: *mut DialogEx,
11207 callback: DialogExResultCallback,
11208 );
11209}
11210unsafe extern "C" {
11211 #[doc = "Set dialog context\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `context` - context pointer, will be passed to result callback"]
11212 pub fn dialog_ex_set_context(dialog_ex: *mut DialogEx, context: *mut core::ffi::c_void);
11213}
11214unsafe extern "C" {
11215 #[doc = "Set dialog header text\n\n If text is null, dialog header will not be rendered\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `text` - text to be shown, can be multiline\n * `x` - x position\n * `y` - y position\n * `horizontal` - horizontal text alignment\n * `vertical` - vertical text alignment"]
11216 pub fn dialog_ex_set_header(
11217 dialog_ex: *mut DialogEx,
11218 text: *const core::ffi::c_char,
11219 x: u8,
11220 y: u8,
11221 horizontal: Align,
11222 vertical: Align,
11223 );
11224}
11225unsafe extern "C" {
11226 #[doc = "Set dialog text\n\n If text is null, dialog text will not be rendered\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `text` - text to be shown, can be multiline\n * `x` - x position\n * `y` - y position\n * `horizontal` - horizontal text alignment\n * `vertical` - vertical text alignment"]
11227 pub fn dialog_ex_set_text(
11228 dialog_ex: *mut DialogEx,
11229 text: *const core::ffi::c_char,
11230 x: u8,
11231 y: u8,
11232 horizontal: Align,
11233 vertical: Align,
11234 );
11235}
11236unsafe extern "C" {
11237 #[doc = "Set dialog icon\n\n If x or y is negative, dialog icon will not be rendered\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `x` - x position\n * `y` - y position\n * `icon` - The icon"]
11238 pub fn dialog_ex_set_icon(dialog_ex: *mut DialogEx, x: u8, y: u8, icon: *const Icon);
11239}
11240unsafe extern "C" {
11241 #[doc = "Set left button text\n\n If text is null, left button will not be rendered and processed\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `text` - text to be shown"]
11242 pub fn dialog_ex_set_left_button_text(dialog_ex: *mut DialogEx, text: *const core::ffi::c_char);
11243}
11244unsafe extern "C" {
11245 #[doc = "Set center button text\n\n If text is null, center button will not be rendered and processed\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `text` - text to be shown"]
11246 pub fn dialog_ex_set_center_button_text(
11247 dialog_ex: *mut DialogEx,
11248 text: *const core::ffi::c_char,
11249 );
11250}
11251unsafe extern "C" {
11252 #[doc = "Set right button text\n\n If text is null, right button will not be rendered and processed\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `text` - text to be shown"]
11253 pub fn dialog_ex_set_right_button_text(
11254 dialog_ex: *mut DialogEx,
11255 text: *const core::ffi::c_char,
11256 );
11257}
11258unsafe extern "C" {
11259 #[doc = "Clean dialog\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11260 pub fn dialog_ex_reset(dialog_ex: *mut DialogEx);
11261}
11262unsafe extern "C" {
11263 #[doc = "Enable press/release events\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11264 pub fn dialog_ex_enable_extended_events(dialog_ex: *mut DialogEx);
11265}
11266unsafe extern "C" {
11267 #[doc = "Disable press/release events\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11268 pub fn dialog_ex_disable_extended_events(dialog_ex: *mut DialogEx);
11269}
11270#[repr(C)]
11271#[derive(Debug, Copy, Clone)]
11272pub struct EmptyScreen {
11273 _unused: [u8; 0],
11274}
11275unsafe extern "C" {
11276 #[doc = "Allocate and initialize empty screen\n\n This empty screen used to ask simple questions like Yes/\n\n # Returns\n\nEmptyScreen instance"]
11277 pub fn empty_screen_alloc() -> *mut EmptyScreen;
11278}
11279unsafe extern "C" {
11280 #[doc = "Deinitialize and free empty screen\n\n # Arguments\n\n* `empty_screen` - Empty screen instance"]
11281 pub fn empty_screen_free(empty_screen: *mut EmptyScreen);
11282}
11283unsafe extern "C" {
11284 #[doc = "Get empty screen view\n\n # Arguments\n\n* `empty_screen` - Empty screen instance\n\n # Returns\n\nView instance that can be used for embedding"]
11285 pub fn empty_screen_get_view(empty_screen: *mut EmptyScreen) -> *mut View;
11286}
11287#[repr(C)]
11288#[derive(Debug, Copy, Clone)]
11289pub struct BrowserWorker {
11290 _unused: [u8; 0],
11291}
11292pub type BrowserWorkerFolderOpenCallback = ::core::option::Option<
11293 unsafe extern "C" fn(
11294 context: *mut core::ffi::c_void,
11295 item_cnt: u32,
11296 file_idx: i32,
11297 is_root: bool,
11298 ),
11299>;
11300pub type BrowserWorkerListLoadCallback = ::core::option::Option<
11301 unsafe extern "C" fn(context: *mut core::ffi::c_void, list_load_offset: u32),
11302>;
11303pub type BrowserWorkerListItemCallback = ::core::option::Option<
11304 unsafe extern "C" fn(
11305 context: *mut core::ffi::c_void,
11306 item_path: *mut FuriString,
11307 is_folder: bool,
11308 is_last: bool,
11309 ),
11310>;
11311pub type BrowserWorkerLongLoadCallback =
11312 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11313unsafe extern "C" {
11314 pub fn file_browser_worker_alloc(
11315 path: *mut FuriString,
11316 base_path: *const core::ffi::c_char,
11317 ext_filter: *const core::ffi::c_char,
11318 skip_assets: bool,
11319 hide_dot_files: bool,
11320 ) -> *mut BrowserWorker;
11321}
11322unsafe extern "C" {
11323 pub fn file_browser_worker_free(browser: *mut BrowserWorker);
11324}
11325unsafe extern "C" {
11326 pub fn file_browser_worker_set_callback_context(
11327 browser: *mut BrowserWorker,
11328 context: *mut core::ffi::c_void,
11329 );
11330}
11331unsafe extern "C" {
11332 pub fn file_browser_worker_set_folder_callback(
11333 browser: *mut BrowserWorker,
11334 cb: BrowserWorkerFolderOpenCallback,
11335 );
11336}
11337unsafe extern "C" {
11338 pub fn file_browser_worker_set_list_callback(
11339 browser: *mut BrowserWorker,
11340 cb: BrowserWorkerListLoadCallback,
11341 );
11342}
11343unsafe extern "C" {
11344 pub fn file_browser_worker_set_item_callback(
11345 browser: *mut BrowserWorker,
11346 cb: BrowserWorkerListItemCallback,
11347 );
11348}
11349unsafe extern "C" {
11350 pub fn file_browser_worker_set_long_load_callback(
11351 browser: *mut BrowserWorker,
11352 cb: BrowserWorkerLongLoadCallback,
11353 );
11354}
11355unsafe extern "C" {
11356 pub fn file_browser_worker_set_config(
11357 browser: *mut BrowserWorker,
11358 path: *mut FuriString,
11359 ext_filter: *const core::ffi::c_char,
11360 skip_assets: bool,
11361 hide_dot_files: bool,
11362 );
11363}
11364unsafe extern "C" {
11365 pub fn file_browser_worker_folder_enter(
11366 browser: *mut BrowserWorker,
11367 path: *mut FuriString,
11368 item_idx: i32,
11369 );
11370}
11371unsafe extern "C" {
11372 pub fn file_browser_worker_is_in_start_folder(browser: *mut BrowserWorker) -> bool;
11373}
11374unsafe extern "C" {
11375 pub fn file_browser_worker_folder_exit(browser: *mut BrowserWorker);
11376}
11377unsafe extern "C" {
11378 pub fn file_browser_worker_folder_refresh(browser: *mut BrowserWorker, item_idx: i32);
11379}
11380unsafe extern "C" {
11381 pub fn file_browser_worker_load(browser: *mut BrowserWorker, offset: u32, count: u32);
11382}
11383#[repr(C)]
11384#[derive(Debug, Copy, Clone)]
11385pub struct Loading {
11386 _unused: [u8; 0],
11387}
11388unsafe extern "C" {
11389 #[doc = "Allocate and initialize\n\n This View used to show system is doing some processing\n\n # Returns\n\nLoading View instance"]
11390 pub fn loading_alloc() -> *mut Loading;
11391}
11392unsafe extern "C" {
11393 #[doc = "Deinitialize and free Loading View\n\n # Arguments\n\n* `instance` - Loading instance"]
11394 pub fn loading_free(instance: *mut Loading);
11395}
11396unsafe extern "C" {
11397 #[doc = "Get Loading view\n\n # Arguments\n\n* `instance` - Loading instance\n\n # Returns\n\nView instance that can be used for embedding"]
11398 pub fn loading_get_view(instance: *mut Loading) -> *mut View;
11399}
11400#[repr(C)]
11401#[derive(Debug, Copy, Clone)]
11402pub struct Menu {
11403 _unused: [u8; 0],
11404}
11405#[doc = "Menu Item Callback"]
11406pub type MenuItemCallback =
11407 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32)>;
11408unsafe extern "C" {
11409 #[doc = "Menu allocation and initialization\n\n # Returns\n\nMenu instance"]
11410 pub fn menu_alloc() -> *mut Menu;
11411}
11412unsafe extern "C" {
11413 #[doc = "Free menu\n\n # Arguments\n\n* `menu` - Menu instance"]
11414 pub fn menu_free(menu: *mut Menu);
11415}
11416unsafe extern "C" {
11417 #[doc = "Get Menu view\n\n # Arguments\n\n* `menu` - Menu instance\n\n # Returns\n\nView instance"]
11418 pub fn menu_get_view(menu: *mut Menu) -> *mut View;
11419}
11420unsafe extern "C" {
11421 #[doc = "Add item to menu\n\n # Arguments\n\n* `menu` - Menu instance\n * `label` - menu item string label\n * `icon` - IconAnimation instance\n * `index` - menu item index\n * `callback` - MenuItemCallback instance\n * `context` - pointer to context"]
11422 pub fn menu_add_item(
11423 menu: *mut Menu,
11424 label: *const core::ffi::c_char,
11425 icon: *const Icon,
11426 index: u32,
11427 callback: MenuItemCallback,
11428 context: *mut core::ffi::c_void,
11429 );
11430}
11431unsafe extern "C" {
11432 #[doc = "Clean menu\n > **Note:** this function does not free menu instance\n\n # Arguments\n\n* `menu` - Menu instance"]
11433 pub fn menu_reset(menu: *mut Menu);
11434}
11435unsafe extern "C" {
11436 #[doc = "Set current menu item\n\n # Arguments\n\n* `menu` - Menu instance\n * `index` - The index"]
11437 pub fn menu_set_selected_item(menu: *mut Menu, index: u32);
11438}
11439#[repr(C)]
11440#[derive(Debug, Copy, Clone)]
11441pub struct NumberInput {
11442 _unused: [u8; 0],
11443}
11444#[doc = "Callback to be called on save button press"]
11445pub type NumberInputCallback =
11446 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, number: i32)>;
11447unsafe extern "C" {
11448 #[doc = "Allocate and initialize Number input.\n\n This Number input is used to enter Numbers (Integers).\n\n # Returns\n\nNumberInput instance pointer"]
11449 pub fn number_input_alloc() -> *mut NumberInput;
11450}
11451unsafe extern "C" {
11452 #[doc = "Deinitialize and free byte input\n\n # Arguments\n\n* `number_input` - Number input instance"]
11453 pub fn number_input_free(number_input: *mut NumberInput);
11454}
11455unsafe extern "C" {
11456 #[doc = "Get byte input view\n\n # Arguments\n\n* `number_input` - byte input instance\n\n # Returns\n\nView instance that can be used for embedding"]
11457 pub fn number_input_get_view(number_input: *mut NumberInput) -> *mut View;
11458}
11459unsafe extern "C" {
11460 #[doc = "Set byte input result callback\n\n # Arguments\n\n* `number_input` - byte input instance\n * `input_callback` - input callback fn\n * `callback_context` - callback context\n * `current_number` (direction in) - The current number\n * `min_value` - Min number value\n * `max_value` - Max number value"]
11461 pub fn number_input_set_result_callback(
11462 number_input: *mut NumberInput,
11463 input_callback: NumberInputCallback,
11464 callback_context: *mut core::ffi::c_void,
11465 current_number: i32,
11466 min_value: i32,
11467 max_value: i32,
11468 );
11469}
11470unsafe extern "C" {
11471 #[doc = "Set byte input header text\n\n # Arguments\n\n* `number_input` - byte input instance\n * `text` - text to be shown"]
11472 pub fn number_input_set_header_text(
11473 number_input: *mut NumberInput,
11474 text: *const core::ffi::c_char,
11475 );
11476}
11477#[repr(C)]
11478#[derive(Debug, Copy, Clone)]
11479pub struct Popup {
11480 _unused: [u8; 0],
11481}
11482#[doc = "Popup result callback type\n comes from GUI thread"]
11483pub type PopupCallback =
11484 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11485unsafe extern "C" {
11486 #[doc = "Allocate and initialize popup\n\n This popup used to ask simple questions like Yes/\n\n # Returns\n\nPopup instance"]
11487 pub fn popup_alloc() -> *mut Popup;
11488}
11489unsafe extern "C" {
11490 #[doc = "Deinitialize and free popup\n\n # Arguments\n\n* `popup` - Popup instance"]
11491 pub fn popup_free(popup: *mut Popup);
11492}
11493unsafe extern "C" {
11494 #[doc = "Get popup view\n\n # Arguments\n\n* `popup` - Popup instance\n\n # Returns\n\nView instance that can be used for embedding"]
11495 pub fn popup_get_view(popup: *mut Popup) -> *mut View;
11496}
11497unsafe extern "C" {
11498 #[doc = "Set popup timeout callback\n\n # Arguments\n\n* `popup` - Popup instance\n * `callback` - PopupCallback"]
11499 pub fn popup_set_callback(popup: *mut Popup, callback: PopupCallback);
11500}
11501unsafe extern "C" {
11502 #[doc = "Set popup context\n\n # Arguments\n\n* `popup` - Popup instance\n * `context` - context pointer, will be passed to result callback"]
11503 pub fn popup_set_context(popup: *mut Popup, context: *mut core::ffi::c_void);
11504}
11505unsafe extern "C" {
11506 #[doc = "Set popup header text\n\n If text is null, popup header will not be rendered\n\n # Arguments\n\n* `popup` - Popup instance\n * `text` - text to be shown, can be multiline\n * `x` - x position\n * `y` - y position\n * `horizontal` - horizontal alignment\n * `vertical` - vertical alignment"]
11507 pub fn popup_set_header(
11508 popup: *mut Popup,
11509 text: *const core::ffi::c_char,
11510 x: u8,
11511 y: u8,
11512 horizontal: Align,
11513 vertical: Align,
11514 );
11515}
11516unsafe extern "C" {
11517 #[doc = "Set popup text\n\n If text is null, popup text will not be rendered\n\n # Arguments\n\n* `popup` - Popup instance\n * `text` - text to be shown, can be multiline\n * `x` - x position\n * `y` - y position\n * `horizontal` - horizontal alignment\n * `vertical` - vertical alignment"]
11518 pub fn popup_set_text(
11519 popup: *mut Popup,
11520 text: *const core::ffi::c_char,
11521 x: u8,
11522 y: u8,
11523 horizontal: Align,
11524 vertical: Align,
11525 );
11526}
11527unsafe extern "C" {
11528 #[doc = "Set popup icon\n\n If icon position is negative, popup icon will not be rendered\n\n # Arguments\n\n* `popup` - Popup instance\n * `x` - x position\n * `y` - y position\n * `icon` - pointer to Icon data"]
11529 pub fn popup_set_icon(popup: *mut Popup, x: u8, y: u8, icon: *const Icon);
11530}
11531unsafe extern "C" {
11532 #[doc = "Set popup timeout\n\n # Arguments\n\n* `popup` - Popup instance\n * `timeout_in_ms` - popup timeout value in milliseconds"]
11533 pub fn popup_set_timeout(popup: *mut Popup, timeout_in_ms: u32);
11534}
11535unsafe extern "C" {
11536 #[doc = "Enable popup timeout\n\n # Arguments\n\n* `popup` - Popup instance"]
11537 pub fn popup_enable_timeout(popup: *mut Popup);
11538}
11539unsafe extern "C" {
11540 #[doc = "Disable popup timeout\n\n # Arguments\n\n* `popup` - Popup instance"]
11541 pub fn popup_disable_timeout(popup: *mut Popup);
11542}
11543unsafe extern "C" {
11544 #[doc = "Reset popup instance state\n\n # Arguments\n\n* `popup` - Popup instance"]
11545 pub fn popup_reset(popup: *mut Popup);
11546}
11547#[repr(C)]
11548#[derive(Debug, Copy, Clone)]
11549pub struct Submenu {
11550 _unused: [u8; 0],
11551}
11552pub type SubmenuItemCallback =
11553 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32)>;
11554pub type SubmenuItemCallbackEx = ::core::option::Option<
11555 unsafe extern "C" fn(context: *mut core::ffi::c_void, input_type: InputType, index: u32),
11556>;
11557unsafe extern "C" {
11558 #[doc = "Allocate and initialize submenu\n\n This submenu is used to select one option\n\n # Returns\n\nSubmenu instance"]
11559 pub fn submenu_alloc() -> *mut Submenu;
11560}
11561unsafe extern "C" {
11562 #[doc = "Deinitialize and free submenu\n\n # Arguments\n\n* `submenu` - Submenu instance"]
11563 pub fn submenu_free(submenu: *mut Submenu);
11564}
11565unsafe extern "C" {
11566 #[doc = "Get submenu view\n\n # Arguments\n\n* `submenu` - Submenu instance\n\n # Returns\n\nView instance that can be used for embedding"]
11567 pub fn submenu_get_view(submenu: *mut Submenu) -> *mut View;
11568}
11569unsafe extern "C" {
11570 #[doc = "Add item to submenu\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `label` - menu item label\n * `index` - menu item index, used for callback, may be\n the same with other items\n * `callback` - menu item callback\n * `callback_context` - menu item callback context"]
11571 pub fn submenu_add_item(
11572 submenu: *mut Submenu,
11573 label: *const core::ffi::c_char,
11574 index: u32,
11575 callback: SubmenuItemCallback,
11576 callback_context: *mut core::ffi::c_void,
11577 );
11578}
11579unsafe extern "C" {
11580 #[doc = "Add item to submenu with extended press events\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `label` - menu item label\n * `index` - menu item index, used for callback, may be\n the same with other items\n * `callback` - menu item extended callback\n * `callback_context` - menu item callback context"]
11581 pub fn submenu_add_item_ex(
11582 submenu: *mut Submenu,
11583 label: *const core::ffi::c_char,
11584 index: u32,
11585 callback: SubmenuItemCallbackEx,
11586 callback_context: *mut core::ffi::c_void,
11587 );
11588}
11589unsafe extern "C" {
11590 #[doc = "Change label of an existing item\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `index` - The index of the item\n * `label` - The new label"]
11591 pub fn submenu_change_item_label(
11592 submenu: *mut Submenu,
11593 index: u32,
11594 label: *const core::ffi::c_char,
11595 );
11596}
11597unsafe extern "C" {
11598 #[doc = "Remove all items from submenu\n\n # Arguments\n\n* `submenu` - Submenu instance"]
11599 pub fn submenu_reset(submenu: *mut Submenu);
11600}
11601unsafe extern "C" {
11602 #[doc = "Get submenu selected item index\n\n # Arguments\n\n* `submenu` - Submenu instance\n\n # Returns\n\nIndex of the selected item"]
11603 pub fn submenu_get_selected_item(submenu: *mut Submenu) -> u32;
11604}
11605unsafe extern "C" {
11606 #[doc = "Set submenu selected item by index\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `index` - The index of the selected item"]
11607 pub fn submenu_set_selected_item(submenu: *mut Submenu, index: u32);
11608}
11609unsafe extern "C" {
11610 #[doc = "Set optional header for submenu\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `header` - header to set"]
11611 pub fn submenu_set_header(submenu: *mut Submenu, header: *const core::ffi::c_char);
11612}
11613#[repr(C)]
11614#[derive(Debug, Copy, Clone)]
11615pub struct TextBox {
11616 _unused: [u8; 0],
11617}
11618pub const TextBoxFontText: TextBoxFont = TextBoxFont(0);
11619pub const TextBoxFontHex: TextBoxFont = TextBoxFont(1);
11620#[repr(transparent)]
11621#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11622pub struct TextBoxFont(pub core::ffi::c_uchar);
11623pub const TextBoxFocusStart: TextBoxFocus = TextBoxFocus(0);
11624pub const TextBoxFocusEnd: TextBoxFocus = TextBoxFocus(1);
11625#[repr(transparent)]
11626#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11627pub struct TextBoxFocus(pub core::ffi::c_uchar);
11628unsafe extern "C" {
11629 #[doc = "Allocate and initialize text_box\n\n # Returns\n\nTextBox instance"]
11630 pub fn text_box_alloc() -> *mut TextBox;
11631}
11632unsafe extern "C" {
11633 #[doc = "Deinitialize and free text_box\n\n # Arguments\n\n* `text_box` - text_box instance"]
11634 pub fn text_box_free(text_box: *mut TextBox);
11635}
11636unsafe extern "C" {
11637 #[doc = "Get text_box view\n\n # Arguments\n\n* `text_box` - TextBox instance\n\n # Returns\n\nView instance that can be used for embedding"]
11638 pub fn text_box_get_view(text_box: *mut TextBox) -> *mut View;
11639}
11640unsafe extern "C" {
11641 #[doc = "Clean text_box\n\n # Arguments\n\n* `text_box` - TextBox instance"]
11642 pub fn text_box_reset(text_box: *mut TextBox);
11643}
11644unsafe extern "C" {
11645 #[doc = "Set text for text_box\n\n # Arguments\n\n* `text_box` - TextBox instance\n * `text` - text to set"]
11646 pub fn text_box_set_text(text_box: *mut TextBox, text: *const core::ffi::c_char);
11647}
11648unsafe extern "C" {
11649 #[doc = "Set TextBox font\n\n # Arguments\n\n* `text_box` - TextBox instance\n * `font` - TextBoxFont instance"]
11650 pub fn text_box_set_font(text_box: *mut TextBox, font: TextBoxFont);
11651}
11652unsafe extern "C" {
11653 #[doc = "Set TextBox focus\n > **Note:** Use to display from start or from end\n\n # Arguments\n\n* `text_box` - TextBox instance\n * `focus` - TextBoxFocus instance"]
11654 pub fn text_box_set_focus(text_box: *mut TextBox, focus: TextBoxFocus);
11655}
11656#[repr(C)]
11657#[derive(Debug, Copy, Clone)]
11658pub struct ValidatorIsFile {
11659 _unused: [u8; 0],
11660}
11661unsafe extern "C" {
11662 pub fn validator_is_file_alloc_init(
11663 app_path_folder: *const core::ffi::c_char,
11664 app_extension: *const core::ffi::c_char,
11665 current_name: *const core::ffi::c_char,
11666 ) -> *mut ValidatorIsFile;
11667}
11668unsafe extern "C" {
11669 pub fn validator_is_file_free(instance: *mut ValidatorIsFile);
11670}
11671unsafe extern "C" {
11672 pub fn validator_is_file_callback(
11673 text: *const core::ffi::c_char,
11674 error: *mut FuriString,
11675 context: *mut core::ffi::c_void,
11676 ) -> bool;
11677}
11678#[repr(C)]
11679#[derive(Debug, Copy, Clone)]
11680pub struct TextInput {
11681 _unused: [u8; 0],
11682}
11683pub type TextInputCallback =
11684 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11685pub type TextInputValidatorCallback = ::core::option::Option<
11686 unsafe extern "C" fn(
11687 text: *const core::ffi::c_char,
11688 error: *mut FuriString,
11689 context: *mut core::ffi::c_void,
11690 ) -> bool,
11691>;
11692unsafe extern "C" {
11693 #[doc = "Allocate and initialize text input\n\n This text input is used to enter string\n\n # Returns\n\nTextInput instance"]
11694 pub fn text_input_alloc() -> *mut TextInput;
11695}
11696unsafe extern "C" {
11697 #[doc = "Deinitialize and free text input\n\n # Arguments\n\n* `text_input` - TextInput instance"]
11698 pub fn text_input_free(text_input: *mut TextInput);
11699}
11700unsafe extern "C" {
11701 #[doc = "Clean text input view Note: this function does not free memory\n\n # Arguments\n\n* `text_input` - Text input instance"]
11702 pub fn text_input_reset(text_input: *mut TextInput);
11703}
11704unsafe extern "C" {
11705 #[doc = "Get text input view\n\n # Arguments\n\n* `text_input` - TextInput instance\n\n # Returns\n\nView instance that can be used for embedding"]
11706 pub fn text_input_get_view(text_input: *mut TextInput) -> *mut View;
11707}
11708unsafe extern "C" {
11709 #[doc = "Set text input result callback\n\n # Arguments\n\n* `text_input` - TextInput instance\n * `callback` - callback fn\n * `callback_context` - callback context\n * `text_buffer` - pointer to YOUR text buffer, that we going\n to modify\n * `text_buffer_size` - YOUR text buffer size in bytes. Max string\n length will be text_buffer_size-1.\n * `clear_default_text` - clear text from text_buffer on first OK\n event"]
11710 pub fn text_input_set_result_callback(
11711 text_input: *mut TextInput,
11712 callback: TextInputCallback,
11713 callback_context: *mut core::ffi::c_void,
11714 text_buffer: *mut core::ffi::c_char,
11715 text_buffer_size: usize,
11716 clear_default_text: bool,
11717 );
11718}
11719unsafe extern "C" {
11720 #[doc = "Sets the minimum length of a TextInput\n # Arguments\n\n* `[in]` - text_input TextInput\n * `[in]` - minimum_length Minimum input length"]
11721 pub fn text_input_set_minimum_length(text_input: *mut TextInput, minimum_length: usize);
11722}
11723unsafe extern "C" {
11724 pub fn text_input_set_validator(
11725 text_input: *mut TextInput,
11726 callback: TextInputValidatorCallback,
11727 callback_context: *mut core::ffi::c_void,
11728 );
11729}
11730unsafe extern "C" {
11731 pub fn text_input_get_validator_callback(
11732 text_input: *mut TextInput,
11733 ) -> TextInputValidatorCallback;
11734}
11735unsafe extern "C" {
11736 pub fn text_input_get_validator_callback_context(
11737 text_input: *mut TextInput,
11738 ) -> *mut core::ffi::c_void;
11739}
11740unsafe extern "C" {
11741 #[doc = "Set text input header text\n\n # Arguments\n\n* `text_input` - TextInput instance\n * `text` - text to be shown"]
11742 pub fn text_input_set_header_text(text_input: *mut TextInput, text: *const core::ffi::c_char);
11743}
11744#[repr(C)]
11745#[derive(Debug, Copy, Clone)]
11746pub struct VariableItemList {
11747 _unused: [u8; 0],
11748}
11749#[repr(C)]
11750#[derive(Debug, Copy, Clone)]
11751pub struct VariableItem {
11752 _unused: [u8; 0],
11753}
11754pub type VariableItemChangeCallback =
11755 ::core::option::Option<unsafe extern "C" fn(item: *mut VariableItem)>;
11756pub type VariableItemListEnterCallback =
11757 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32)>;
11758unsafe extern "C" {
11759 #[doc = "Allocate and initialize VariableItemList\n\n # Returns\n\nVariableItemList*"]
11760 pub fn variable_item_list_alloc() -> *mut VariableItemList;
11761}
11762unsafe extern "C" {
11763 #[doc = "Deinitialize and free VariableItemList\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance"]
11764 pub fn variable_item_list_free(variable_item_list: *mut VariableItemList);
11765}
11766unsafe extern "C" {
11767 #[doc = "Clear all elements from list\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance"]
11768 pub fn variable_item_list_reset(variable_item_list: *mut VariableItemList);
11769}
11770unsafe extern "C" {
11771 #[doc = "Get VariableItemList View instance\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance\n\n # Returns\n\nView instance"]
11772 pub fn variable_item_list_get_view(variable_item_list: *mut VariableItemList) -> *mut View;
11773}
11774unsafe extern "C" {
11775 #[doc = "Add item to VariableItemList\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance\n * `label` - item name\n * `values_count` - item values count\n * `change_callback` - called on value change in gui\n * `context` - item context\n\n # Returns\n\nVariableItem* item instance"]
11776 pub fn variable_item_list_add(
11777 variable_item_list: *mut VariableItemList,
11778 label: *const core::ffi::c_char,
11779 values_count: u8,
11780 change_callback: VariableItemChangeCallback,
11781 context: *mut core::ffi::c_void,
11782 ) -> *mut VariableItem;
11783}
11784unsafe extern "C" {
11785 #[doc = "Set enter callback\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance\n * `callback` - VariableItemListEnterCallback instance\n * `context` - pointer to context"]
11786 pub fn variable_item_list_set_enter_callback(
11787 variable_item_list: *mut VariableItemList,
11788 callback: VariableItemListEnterCallback,
11789 context: *mut core::ffi::c_void,
11790 );
11791}
11792unsafe extern "C" {
11793 pub fn variable_item_list_set_selected_item(
11794 variable_item_list: *mut VariableItemList,
11795 index: u8,
11796 );
11797}
11798unsafe extern "C" {
11799 pub fn variable_item_list_get_selected_item_index(
11800 variable_item_list: *mut VariableItemList,
11801 ) -> u8;
11802}
11803unsafe extern "C" {
11804 #[doc = "Set item current selected index\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `current_value_index` - The current value index"]
11805 pub fn variable_item_set_current_value_index(item: *mut VariableItem, current_value_index: u8);
11806}
11807unsafe extern "C" {
11808 #[doc = "Set number of values for item\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `values_count` - The new values count"]
11809 pub fn variable_item_set_values_count(item: *mut VariableItem, values_count: u8);
11810}
11811unsafe extern "C" {
11812 #[doc = "Set item current selected text\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `current_value_text` - The current value text"]
11813 pub fn variable_item_set_current_value_text(
11814 item: *mut VariableItem,
11815 current_value_text: *const core::ffi::c_char,
11816 );
11817}
11818unsafe extern "C" {
11819 #[doc = "Get item current selected index\n\n # Arguments\n\n* `item` - VariableItem* instance\n\n # Returns\n\nuint8_t current selected index"]
11820 pub fn variable_item_get_current_value_index(item: *mut VariableItem) -> u8;
11821}
11822unsafe extern "C" {
11823 #[doc = "Get item context\n\n # Arguments\n\n* `item` - VariableItem* instance\n\n # Returns\n\nvoid* item context"]
11824 pub fn variable_item_get_context(item: *mut VariableItem) -> *mut core::ffi::c_void;
11825}
11826pub const GuiButtonTypeLeft: GuiButtonType = GuiButtonType(0);
11827pub const GuiButtonTypeCenter: GuiButtonType = GuiButtonType(1);
11828pub const GuiButtonTypeRight: GuiButtonType = GuiButtonType(2);
11829#[repr(transparent)]
11830#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11831pub struct GuiButtonType(pub core::ffi::c_uchar);
11832pub type ButtonCallback = ::core::option::Option<
11833 unsafe extern "C" fn(result: GuiButtonType, type_: InputType, context: *mut core::ffi::c_void),
11834>;
11835#[repr(C)]
11836#[derive(Debug, Copy, Clone)]
11837pub struct Widget {
11838 _unused: [u8; 0],
11839}
11840#[repr(C)]
11841#[derive(Debug, Copy, Clone)]
11842pub struct WidgetElement {
11843 _unused: [u8; 0],
11844}
11845unsafe extern "C" {
11846 #[doc = "Allocate Widget that holds Widget Elements\n\n # Returns\n\nWidget instance"]
11847 pub fn widget_alloc() -> *mut Widget;
11848}
11849unsafe extern "C" {
11850 #[doc = "Free Widget\n > **Note:** this function free allocated Widget Elements\n\n # Arguments\n\n* `widget` - Widget instance"]
11851 pub fn widget_free(widget: *mut Widget);
11852}
11853unsafe extern "C" {
11854 #[doc = "Reset Widget\n\n # Arguments\n\n* `widget` - Widget instance"]
11855 pub fn widget_reset(widget: *mut Widget);
11856}
11857unsafe extern "C" {
11858 #[doc = "Get Widget view\n\n # Arguments\n\n* `widget` - Widget instance\n\n # Returns\n\nView instance"]
11859 pub fn widget_get_view(widget: *mut Widget) -> *mut View;
11860}
11861unsafe extern "C" {
11862 #[doc = "Add Multi String Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `horizontal` - Align instance\n * `vertical` - Align instance\n * `font` - Font instance\n * `text` (direction in) - The text"]
11863 pub fn widget_add_string_multiline_element(
11864 widget: *mut Widget,
11865 x: u8,
11866 y: u8,
11867 horizontal: Align,
11868 vertical: Align,
11869 font: Font,
11870 text: *const core::ffi::c_char,
11871 );
11872}
11873unsafe extern "C" {
11874 #[doc = "Add String Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `horizontal` - Align instance\n * `vertical` - Align instance\n * `font` - Font instance\n * `text` (direction in) - The text"]
11875 pub fn widget_add_string_element(
11876 widget: *mut Widget,
11877 x: u8,
11878 y: u8,
11879 horizontal: Align,
11880 vertical: Align,
11881 font: Font,
11882 text: *const core::ffi::c_char,
11883 );
11884}
11885unsafe extern "C" {
11886 #[doc = "Add Text Box Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - width to fit text\n * `height` - height to fit text\n * `horizontal` - Align instance\n * `vertical` - Align instance\n * `text` (direction in) - Formatted text. The following formats are available:\n \"text- bold font is used\n \"text- monospaced font is used\n \"text- white text on black background\n * `strip_to_dots` - Strip text to ... if does not fit to width"]
11887 pub fn widget_add_text_box_element(
11888 widget: *mut Widget,
11889 x: u8,
11890 y: u8,
11891 width: u8,
11892 height: u8,
11893 horizontal: Align,
11894 vertical: Align,
11895 text: *const core::ffi::c_char,
11896 strip_to_dots: bool,
11897 );
11898}
11899unsafe extern "C" {
11900 #[doc = "Add Text Scroll Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `width` - width to fit text\n * `height` - height to fit text\n * `text` (direction in) - Formatted text. Default format: align left, Secondary font.\n The following formats are available:\n \"text\" - sets bold font before until next 'symbol\n \"text- sets monospaced font before until next 'symbol\n \"text\" - sets center horizontal align until the next 'symbol\n \"text\" - sets right horizontal align until the next 'symbol"]
11901 pub fn widget_add_text_scroll_element(
11902 widget: *mut Widget,
11903 x: u8,
11904 y: u8,
11905 width: u8,
11906 height: u8,
11907 text: *const core::ffi::c_char,
11908 );
11909}
11910unsafe extern "C" {
11911 #[doc = "Add Button Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `button_type` - GuiButtonType instance\n * `text` - text on allocated button\n * `callback` - ButtonCallback instance\n * `context` - pointer to context"]
11912 pub fn widget_add_button_element(
11913 widget: *mut Widget,
11914 button_type: GuiButtonType,
11915 text: *const core::ffi::c_char,
11916 callback: ButtonCallback,
11917 context: *mut core::ffi::c_void,
11918 );
11919}
11920unsafe extern "C" {
11921 #[doc = "Add Icon Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - top left x coordinate\n * `y` - top left y coordinate\n * `icon` - Icon instance"]
11922 pub fn widget_add_icon_element(widget: *mut Widget, x: u8, y: u8, icon: *const Icon);
11923}
11924unsafe extern "C" {
11925 #[doc = "Add Rect Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - top left x coordinate\n * `y` - top left y coordinate\n * `width` - rect width\n * `height` - rect height\n * `radius` - corner radius\n * `fill` - whether to fill the box or not"]
11926 pub fn widget_add_rect_element(
11927 widget: *mut Widget,
11928 x: u8,
11929 y: u8,
11930 width: u8,
11931 height: u8,
11932 radius: u8,
11933 fill: bool,
11934 );
11935}
11936unsafe extern "C" {
11937 #[doc = "Add Circle Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x` - center x coordinate\n * `y` - center y coordinate\n * `radius` - circle radius\n * `fill` - whether to fill the circle or not"]
11938 pub fn widget_add_circle_element(widget: *mut Widget, x: u8, y: u8, radius: u8, fill: bool);
11939}
11940unsafe extern "C" {
11941 #[doc = "Add Line Element\n\n # Arguments\n\n* `widget` - Widget instance\n * `x1` - first x coordinate\n * `y1` - first y coordinate\n * `x2` - second x coordinate\n * `y2` - second y coordinate"]
11942 pub fn widget_add_line_element(widget: *mut Widget, x1: u8, y1: u8, x2: u8, y2: u8);
11943}
11944pub const SceneManagerEventTypeCustom: SceneManagerEventType = SceneManagerEventType(0);
11945pub const SceneManagerEventTypeBack: SceneManagerEventType = SceneManagerEventType(1);
11946pub const SceneManagerEventTypeTick: SceneManagerEventType = SceneManagerEventType(2);
11947#[repr(transparent)]
11948#[doc = "Scene Manager events type"]
11949#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11950pub struct SceneManagerEventType(pub core::ffi::c_uchar);
11951#[doc = "Scene Manager event"]
11952#[repr(C)]
11953#[derive(Debug, Copy, Clone)]
11954pub struct SceneManagerEvent {
11955 pub type_: SceneManagerEventType,
11956 pub event: u32,
11957}
11958#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11959const _: () = {
11960 ["Size of SceneManagerEvent"][::core::mem::size_of::<SceneManagerEvent>() - 8usize];
11961 ["Alignment of SceneManagerEvent"][::core::mem::align_of::<SceneManagerEvent>() - 4usize];
11962 ["Offset of field: SceneManagerEvent::type_"]
11963 [::core::mem::offset_of!(SceneManagerEvent, type_) - 0usize];
11964 ["Offset of field: SceneManagerEvent::event"]
11965 [::core::mem::offset_of!(SceneManagerEvent, event) - 4usize];
11966};
11967#[doc = "Prototype for Scene on_enter handler"]
11968pub type AppSceneOnEnterCallback =
11969 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11970#[doc = "Prototype for Scene on_event handler"]
11971pub type AppSceneOnEventCallback = ::core::option::Option<
11972 unsafe extern "C" fn(context: *mut core::ffi::c_void, event: SceneManagerEvent) -> bool,
11973>;
11974#[doc = "Prototype for Scene on_exit handler"]
11975pub type AppSceneOnExitCallback =
11976 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11977#[doc = "Scene Manager configuration structure\n Contains array of Scene handlers"]
11978#[repr(C)]
11979#[derive(Debug, Copy, Clone)]
11980pub struct SceneManagerHandlers {
11981 pub on_enter_handlers: *const AppSceneOnEnterCallback,
11982 pub on_event_handlers: *const AppSceneOnEventCallback,
11983 pub on_exit_handlers: *const AppSceneOnExitCallback,
11984 pub scene_num: u32,
11985}
11986#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11987const _: () = {
11988 ["Size of SceneManagerHandlers"][::core::mem::size_of::<SceneManagerHandlers>() - 16usize];
11989 ["Alignment of SceneManagerHandlers"][::core::mem::align_of::<SceneManagerHandlers>() - 4usize];
11990 ["Offset of field: SceneManagerHandlers::on_enter_handlers"]
11991 [::core::mem::offset_of!(SceneManagerHandlers, on_enter_handlers) - 0usize];
11992 ["Offset of field: SceneManagerHandlers::on_event_handlers"]
11993 [::core::mem::offset_of!(SceneManagerHandlers, on_event_handlers) - 4usize];
11994 ["Offset of field: SceneManagerHandlers::on_exit_handlers"]
11995 [::core::mem::offset_of!(SceneManagerHandlers, on_exit_handlers) - 8usize];
11996 ["Offset of field: SceneManagerHandlers::scene_num"]
11997 [::core::mem::offset_of!(SceneManagerHandlers, scene_num) - 12usize];
11998};
11999#[repr(C)]
12000#[derive(Debug, Copy, Clone)]
12001pub struct SceneManager {
12002 _unused: [u8; 0],
12003}
12004unsafe extern "C" {
12005 #[doc = "Set Scene state\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n * `state` - Scene new state"]
12006 pub fn scene_manager_set_scene_state(
12007 scene_manager: *mut SceneManager,
12008 scene_id: u32,
12009 state: u32,
12010 );
12011}
12012unsafe extern "C" {
12013 #[doc = "Get Scene state\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n\n # Returns\n\nScene state"]
12014 pub fn scene_manager_get_scene_state(scene_manager: *const SceneManager, scene_id: u32) -> u32;
12015}
12016unsafe extern "C" {
12017 #[doc = "Scene Manager allocation and configuration\n\n Scene Manager allocates all scenes internally\n\n # Arguments\n\n* `app_scene_handlers` - SceneManagerHandlers instance\n * `context` - context to be set on Scene handlers calls\n\n # Returns\n\nSceneManager instance"]
12018 pub fn scene_manager_alloc(
12019 app_scene_handlers: *const SceneManagerHandlers,
12020 context: *mut core::ffi::c_void,
12021 ) -> *mut SceneManager;
12022}
12023unsafe extern "C" {
12024 #[doc = "Free Scene Manager with allocated Scenes\n\n # Arguments\n\n* `scene_manager` - SceneManager instance"]
12025 pub fn scene_manager_free(scene_manager: *mut SceneManager);
12026}
12027unsafe extern "C" {
12028 #[doc = "Custom event handler\n\n Calls Scene event handler with Custom event parameter\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `custom_event` - Custom event code\n\n # Returns\n\ntrue if event was consumed, false otherwise"]
12029 pub fn scene_manager_handle_custom_event(
12030 scene_manager: *mut SceneManager,
12031 custom_event: u32,
12032 ) -> bool;
12033}
12034unsafe extern "C" {
12035 #[doc = "Back event handler\n\n Calls Scene event handler with Back event parameter\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n\n # Returns\n\ntrue if event was consumed, false otherwise"]
12036 pub fn scene_manager_handle_back_event(scene_manager: *mut SceneManager) -> bool;
12037}
12038unsafe extern "C" {
12039 #[doc = "Tick event handler\n\n Calls Scene event handler with Tick event parameter\n\n # Arguments\n\n* `scene_manager` - SceneManager instance"]
12040 pub fn scene_manager_handle_tick_event(scene_manager: *mut SceneManager);
12041}
12042unsafe extern "C" {
12043 #[doc = "Add and run next Scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `next_scene_id` - next Scene ID"]
12044 pub fn scene_manager_next_scene(scene_manager: *mut SceneManager, next_scene_id: u32);
12045}
12046unsafe extern "C" {
12047 #[doc = "Run previous Scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n\n # Returns\n\ntrue if previous scene was found, false otherwise"]
12048 pub fn scene_manager_previous_scene(scene_manager: *mut SceneManager) -> bool;
12049}
12050unsafe extern "C" {
12051 #[doc = "Search previous Scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n\n # Returns\n\ntrue if previous scene was found, false otherwise"]
12052 pub fn scene_manager_has_previous_scene(
12053 scene_manager: *const SceneManager,
12054 scene_id: u32,
12055 ) -> bool;
12056}
12057unsafe extern "C" {
12058 #[doc = "Search and switch to previous Scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n\n # Returns\n\ntrue if previous scene was found, false otherwise"]
12059 pub fn scene_manager_search_and_switch_to_previous_scene(
12060 scene_manager: *mut SceneManager,
12061 scene_id: u32,
12062 ) -> bool;
12063}
12064unsafe extern "C" {
12065 #[doc = "Search and switch to previous Scene, multiple choice\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_ids` - Array of scene IDs\n * `scene_ids_size` - Array of scene IDs size\n\n # Returns\n\ntrue if one of previous scenes was found, false otherwise"]
12066 pub fn scene_manager_search_and_switch_to_previous_scene_one_of(
12067 scene_manager: *mut SceneManager,
12068 scene_ids: *const u32,
12069 scene_ids_size: usize,
12070 ) -> bool;
12071}
12072unsafe extern "C" {
12073 #[doc = "Clear Scene stack and switch to another Scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n\n # Returns\n\ntrue if previous scene was found, false otherwise"]
12074 pub fn scene_manager_search_and_switch_to_another_scene(
12075 scene_manager: *mut SceneManager,
12076 scene_id: u32,
12077 ) -> bool;
12078}
12079unsafe extern "C" {
12080 #[doc = "Get id of current scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n\n # Returns\n\nScene ID"]
12081 pub fn scene_manager_get_current_scene(scene_manager: *mut SceneManager) -> u32;
12082}
12083unsafe extern "C" {
12084 #[doc = "Exit from current scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance"]
12085 pub fn scene_manager_stop(scene_manager: *mut SceneManager);
12086}
12087#[doc = "< Desktop layer: fullscreen with status bar on top of it. For internal usage."]
12088pub const ViewDispatcherTypeDesktop: ViewDispatcherType = ViewDispatcherType(0);
12089#[doc = "< Window layer: with status bar"]
12090pub const ViewDispatcherTypeWindow: ViewDispatcherType = ViewDispatcherType(1);
12091#[doc = "< Fullscreen layer: without status bar"]
12092pub const ViewDispatcherTypeFullscreen: ViewDispatcherType = ViewDispatcherType(2);
12093#[repr(transparent)]
12094#[doc = "ViewDispatcher view_port placement"]
12095#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12096pub struct ViewDispatcherType(pub core::ffi::c_uchar);
12097#[repr(C)]
12098#[derive(Debug, Copy, Clone)]
12099pub struct ViewDispatcher {
12100 _unused: [u8; 0],
12101}
12102#[doc = "Prototype for custom event callback"]
12103pub type ViewDispatcherCustomEventCallback = ::core::option::Option<
12104 unsafe extern "C" fn(context: *mut core::ffi::c_void, event: u32) -> bool,
12105>;
12106#[doc = "Prototype for navigation event callback"]
12107pub type ViewDispatcherNavigationEventCallback =
12108 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> bool>;
12109#[doc = "Prototype for tick event callback"]
12110pub type ViewDispatcherTickEventCallback =
12111 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
12112unsafe extern "C" {
12113 #[doc = "Allocate ViewDispatcher instance\n\n # Returns\n\npointer to ViewDispatcher instance"]
12114 pub fn view_dispatcher_alloc() -> *mut ViewDispatcher;
12115}
12116unsafe extern "C" {
12117 #[doc = "Allocate ViewDispatcher instance with an externally owned event loop. If\n this constructor is used instead of `view_dispatcher_alloc`, the burden of\n freeing the event loop is placed on the caller.\n\n # Arguments\n\n* `loop` - pointer to FuriEventLoop instance\n # Returns\n\npointer to ViewDispatcher instance"]
12118 pub fn view_dispatcher_alloc_ex(loop_: *mut FuriEventLoop) -> *mut ViewDispatcher;
12119}
12120unsafe extern "C" {
12121 #[doc = "Free ViewDispatcher instance\n\n All added views MUST be removed using view_dispatcher_remove_view()\n before calling this function.\n\n # Arguments\n\n* `view_dispatcher` - pointer to ViewDispatcher"]
12122 pub fn view_dispatcher_free(view_dispatcher: *mut ViewDispatcher);
12123}
12124unsafe extern "C" {
12125 #[doc = "Enable queue support\n\n > **Deprecated** Do NOT use in new code and remove all calls to it from existing code.\n The queue support is now always enabled during construction. If no queue support\n is required, consider using ViewHolder instead.\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12126 pub fn view_dispatcher_enable_queue(view_dispatcher: *mut ViewDispatcher);
12127}
12128unsafe extern "C" {
12129 #[doc = "Send custom event\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `event` (direction in) - The event"]
12130 pub fn view_dispatcher_send_custom_event(view_dispatcher: *mut ViewDispatcher, event: u32);
12131}
12132unsafe extern "C" {
12133 #[doc = "Set custom event handler\n\n Called on Custom Event, if it is not consumed by view\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `callback` - ViewDispatcherCustomEventCallback instance"]
12134 pub fn view_dispatcher_set_custom_event_callback(
12135 view_dispatcher: *mut ViewDispatcher,
12136 callback: ViewDispatcherCustomEventCallback,
12137 );
12138}
12139unsafe extern "C" {
12140 #[doc = "Set navigation event handler\n\n Called on Input Short Back Event, if it is not consumed by view\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `callback` - ViewDispatcherNavigationEventCallback instance"]
12141 pub fn view_dispatcher_set_navigation_event_callback(
12142 view_dispatcher: *mut ViewDispatcher,
12143 callback: ViewDispatcherNavigationEventCallback,
12144 );
12145}
12146unsafe extern "C" {
12147 #[doc = "Set tick event handler\n\n Requires the event loop to be owned by the view dispatcher, i.e.\n it should have been instantiated with `view_dispatcher_alloc`, not\n `view_dispatcher_alloc_ex`.\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `callback` - ViewDispatcherTickEventCallback\n * `tick_period` - callback call period"]
12148 pub fn view_dispatcher_set_tick_event_callback(
12149 view_dispatcher: *mut ViewDispatcher,
12150 callback: ViewDispatcherTickEventCallback,
12151 tick_period: u32,
12152 );
12153}
12154unsafe extern "C" {
12155 #[doc = "Set event callback context\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `context` - pointer to context"]
12156 pub fn view_dispatcher_set_event_callback_context(
12157 view_dispatcher: *mut ViewDispatcher,
12158 context: *mut core::ffi::c_void,
12159 );
12160}
12161unsafe extern "C" {
12162 #[doc = "Get event_loop instance\n\n Use the return value to connect additional supported primitives (message queues, timers, etc)\n to this ViewDispatcher instance's event loop.\n\n Do NOT call furi_event_loop_run() on the returned instance, it is done internally\n in the view_dispatcher_run() call.\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n\n # Returns\n\nThe event_loop instance."]
12163 pub fn view_dispatcher_get_event_loop(
12164 view_dispatcher: *mut ViewDispatcher,
12165 ) -> *mut FuriEventLoop;
12166}
12167unsafe extern "C" {
12168 #[doc = "Run ViewDispatcher\n\n This function will start the event loop and block until view_dispatcher_stop() is called\n or the current thread receives a FuriSignalExit signal.\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12169 pub fn view_dispatcher_run(view_dispatcher: *mut ViewDispatcher);
12170}
12171unsafe extern "C" {
12172 #[doc = "Stop ViewDispatcher\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12173 pub fn view_dispatcher_stop(view_dispatcher: *mut ViewDispatcher);
12174}
12175unsafe extern "C" {
12176 #[doc = "Add view to ViewDispatcher\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `view_id` - View id to register\n * `view` - View instance"]
12177 pub fn view_dispatcher_add_view(
12178 view_dispatcher: *mut ViewDispatcher,
12179 view_id: u32,
12180 view: *mut View,
12181 );
12182}
12183unsafe extern "C" {
12184 #[doc = "Remove view from ViewDispatcher\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `view_id` - View id to remove"]
12185 pub fn view_dispatcher_remove_view(view_dispatcher: *mut ViewDispatcher, view_id: u32);
12186}
12187unsafe extern "C" {
12188 #[doc = "Switch to View\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `view_id` - View id to register\n switching may be delayed till input events complementarity\n reached"]
12189 pub fn view_dispatcher_switch_to_view(view_dispatcher: *mut ViewDispatcher, view_id: u32);
12190}
12191unsafe extern "C" {
12192 #[doc = "Send ViewPort of this ViewDispatcher instance to front\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12193 pub fn view_dispatcher_send_to_front(view_dispatcher: *mut ViewDispatcher);
12194}
12195unsafe extern "C" {
12196 #[doc = "Send ViewPort of this ViewDispatcher instance to back\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12197 pub fn view_dispatcher_send_to_back(view_dispatcher: *mut ViewDispatcher);
12198}
12199unsafe extern "C" {
12200 #[doc = "Attach ViewDispatcher to GUI\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `gui` - GUI instance to attach to\n * `type` (direction in) - The type"]
12201 pub fn view_dispatcher_attach_to_gui(
12202 view_dispatcher: *mut ViewDispatcher,
12203 gui: *mut Gui,
12204 type_: ViewDispatcherType,
12205 );
12206}
12207#[repr(C)]
12208#[derive(Debug, Copy, Clone)]
12209pub struct ViewHolder {
12210 _unused: [u8; 0],
12211}
12212#[doc = "Free callback type"]
12213pub type FreeCallback =
12214 ::core::option::Option<unsafe extern "C" fn(free_context: *mut core::ffi::c_void)>;
12215#[doc = "Back callback type\n\n Will be called from the GUI thread"]
12216pub type BackCallback =
12217 ::core::option::Option<unsafe extern "C" fn(back_context: *mut core::ffi::c_void)>;
12218unsafe extern "C" {
12219 #[doc = "Allocate ViewHolder\n # Returns\n\npointer to ViewHolder instance"]
12220 pub fn view_holder_alloc() -> *mut ViewHolder;
12221}
12222unsafe extern "C" {
12223 #[doc = "Free ViewHolder and call Free callback\n\n The current view must be unset prior to freeing a ViewHolder instance.\n\n # Arguments\n\n* `view_holder` - pointer to ViewHolder"]
12224 pub fn view_holder_free(view_holder: *mut ViewHolder);
12225}
12226unsafe extern "C" {
12227 #[doc = "Set view for ViewHolder\n\n Pass NULL as the view parameter to unset the current view.\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n * `view` - View instance"]
12228 pub fn view_holder_set_view(view_holder: *mut ViewHolder, view: *mut View);
12229}
12230unsafe extern "C" {
12231 #[doc = "Set Free callback\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n * `free_callback` - callback pointer\n * `free_context` - callback context"]
12232 pub fn view_holder_set_free_callback(
12233 view_holder: *mut ViewHolder,
12234 free_callback: FreeCallback,
12235 free_context: *mut core::ffi::c_void,
12236 );
12237}
12238unsafe extern "C" {
12239 #[doc = "Free callback context getter.\n\n Useful if your Free callback is a module destructor, so you can get an instance of the module using this method.\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n # Returns\n\nvoid* free callback context"]
12240 pub fn view_holder_get_free_context(view_holder: *mut ViewHolder) -> *mut core::ffi::c_void;
12241}
12242unsafe extern "C" {
12243 #[doc = "Set the back key callback.\n\n The callback function will be called if the user has pressed the Back key\n and the current view did not handle this event.\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n * `back_callback` - pointer to the callback function\n * `back_context` - pointer to a user-specific object, can be NULL"]
12244 pub fn view_holder_set_back_callback(
12245 view_holder: *mut ViewHolder,
12246 back_callback: BackCallback,
12247 back_context: *mut core::ffi::c_void,
12248 );
12249}
12250unsafe extern "C" {
12251 #[doc = "Attach ViewHolder to GUI\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n * `gui` - GUI instance to attach to"]
12252 pub fn view_holder_attach_to_gui(view_holder: *mut ViewHolder, gui: *mut Gui);
12253}
12254unsafe extern "C" {
12255 #[doc = "View Update Handler\n\n # Arguments\n\n* `view` - View Instance\n * `context` - ViewHolder instance"]
12256 pub fn view_holder_update(view: *mut View, context: *mut core::ffi::c_void);
12257}
12258unsafe extern "C" {
12259 #[doc = "Send ViewPort of this ViewHolder instance to front\n\n # Arguments\n\n* `view_holder` - ViewHolder instance"]
12260 pub fn view_holder_send_to_front(view_holder: *mut ViewHolder);
12261}
12262unsafe extern "C" {
12263 #[doc = "Send ViewPort of this ViewHolder instance to back\n\n # Arguments\n\n* `view_holder` - ViewHolder instance"]
12264 pub fn view_holder_send_to_back(view_holder: *mut ViewHolder);
12265}
12266#[repr(C)]
12267#[derive(Debug, Copy, Clone)]
12268pub struct ViewStack {
12269 _unused: [u8; 0],
12270}
12271unsafe extern "C" {
12272 #[doc = "Allocate and init ViewStack\n\n # Returns\n\nViewStack instance"]
12273 pub fn view_stack_alloc() -> *mut ViewStack;
12274}
12275unsafe extern "C" {
12276 #[doc = "Free ViewStack instance\n\n # Arguments\n\n* `view_stack` - instance"]
12277 pub fn view_stack_free(view_stack: *mut ViewStack);
12278}
12279unsafe extern "C" {
12280 #[doc = "Get View of ViewStack.\n Should this View to any view manager such as\n ViewDispatcher or ViewHolder.\n\n # Arguments\n\n* `view_stack` - instance"]
12281 pub fn view_stack_get_view(view_stack: *mut ViewStack) -> *mut View;
12282}
12283unsafe extern "C" {
12284 #[doc = "Add View to ViewStack.\n Adds View on top of ViewStack.\n\n # Arguments\n\n* `view_stack` - instance\n * `view` - view to add"]
12285 pub fn view_stack_add_view(view_stack: *mut ViewStack, view: *mut View);
12286}
12287unsafe extern "C" {
12288 #[doc = "Remove any View in ViewStack.\n If no View to remove found - ignore.\n\n # Arguments\n\n* `view_stack` - instance\n * `view` - view to remove"]
12289 pub fn view_stack_remove_view(view_stack: *mut ViewStack, view: *mut View);
12290}
12291unsafe extern "C" {
12292 pub static firmware_api_interface: *const ElfApiInterface;
12293}
12294#[repr(C)]
12295#[derive(Debug, Copy, Clone)]
12296pub struct Loader {
12297 _unused: [u8; 0],
12298}
12299pub const LoaderStatusOk: LoaderStatus = LoaderStatus(0);
12300pub const LoaderStatusErrorAppStarted: LoaderStatus = LoaderStatus(1);
12301pub const LoaderStatusErrorUnknownApp: LoaderStatus = LoaderStatus(2);
12302pub const LoaderStatusErrorInternal: LoaderStatus = LoaderStatus(3);
12303#[repr(transparent)]
12304#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12305pub struct LoaderStatus(pub core::ffi::c_uchar);
12306pub const LoaderEventTypeApplicationBeforeLoad: LoaderEventType = LoaderEventType(0);
12307pub const LoaderEventTypeApplicationLoadFailed: LoaderEventType = LoaderEventType(1);
12308pub const LoaderEventTypeApplicationStopped: LoaderEventType = LoaderEventType(2);
12309pub const LoaderEventTypeNoMoreAppsInQueue: LoaderEventType = LoaderEventType(3);
12310#[repr(transparent)]
12311#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12312pub struct LoaderEventType(pub core::ffi::c_uchar);
12313#[repr(C)]
12314#[derive(Debug, Copy, Clone)]
12315pub struct LoaderEvent {
12316 pub type_: LoaderEventType,
12317}
12318#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12319const _: () = {
12320 ["Size of LoaderEvent"][::core::mem::size_of::<LoaderEvent>() - 1usize];
12321 ["Alignment of LoaderEvent"][::core::mem::align_of::<LoaderEvent>() - 1usize];
12322 ["Offset of field: LoaderEvent::type_"][::core::mem::offset_of!(LoaderEvent, type_) - 0usize];
12323};
12324pub const LoaderDeferredLaunchFlagNone: LoaderDeferredLaunchFlag = LoaderDeferredLaunchFlag(0);
12325pub const LoaderDeferredLaunchFlagGui: LoaderDeferredLaunchFlag = LoaderDeferredLaunchFlag(2);
12326#[repr(transparent)]
12327#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12328pub struct LoaderDeferredLaunchFlag(pub core::ffi::c_uchar);
12329unsafe extern "C" {
12330 #[doc = "Start application\n # Arguments\n\n* `instance` (direction in) - loader instance\n * `name` (direction in) - application name or id\n * `args` (direction in) - application arguments\n * `error_message` (direction out) - detailed error message, can be NULL\n # Returns\n\nLoaderStatus"]
12331 pub fn loader_start(
12332 instance: *mut Loader,
12333 name: *const core::ffi::c_char,
12334 args: *const core::ffi::c_char,
12335 error_message: *mut FuriString,
12336 ) -> LoaderStatus;
12337}
12338unsafe extern "C" {
12339 #[doc = "Start application with GUI error message\n # Arguments\n\n* `instance` (direction in) - loader instance\n * `name` (direction in) - application name or id\n * `args` (direction in) - application arguments\n # Returns\n\nLoaderStatus"]
12340 pub fn loader_start_with_gui_error(
12341 loader: *mut Loader,
12342 name: *const core::ffi::c_char,
12343 args: *const core::ffi::c_char,
12344 ) -> LoaderStatus;
12345}
12346unsafe extern "C" {
12347 #[doc = "Start application detached with GUI error message\n # Arguments\n\n* `instance` (direction in) - loader instance\n * `name` (direction in) - application name or id\n * `args` (direction in) - application arguments"]
12348 pub fn loader_start_detached_with_gui_error(
12349 loader: *mut Loader,
12350 name: *const core::ffi::c_char,
12351 args: *const core::ffi::c_char,
12352 );
12353}
12354unsafe extern "C" {
12355 #[doc = "Lock application start\n # Arguments\n\n* `instance` (direction in) - loader instance\n # Returns\n\ntrue on success"]
12356 pub fn loader_lock(instance: *mut Loader) -> bool;
12357}
12358unsafe extern "C" {
12359 #[doc = "Unlock application start\n # Arguments\n\n* `instance` (direction in) - loader instance"]
12360 pub fn loader_unlock(instance: *mut Loader);
12361}
12362unsafe extern "C" {
12363 #[doc = "Check if loader is locked\n # Arguments\n\n* `instance` (direction in) - loader instance\n # Returns\n\ntrue if locked"]
12364 pub fn loader_is_locked(instance: *mut Loader) -> bool;
12365}
12366unsafe extern "C" {
12367 #[doc = "Show loader menu\n # Arguments\n\n* `instance` (direction in) - loader instance"]
12368 pub fn loader_show_menu(instance: *mut Loader);
12369}
12370unsafe extern "C" {
12371 #[doc = "Get loader pubsub\n # Arguments\n\n* `instance` (direction in) - loader instance\n # Returns\n\nFuriPubSub*"]
12372 pub fn loader_get_pubsub(instance: *mut Loader) -> *mut FuriPubSub;
12373}
12374unsafe extern "C" {
12375 #[doc = "Send a signal to the currently running application\n\n # Arguments\n\n* `instance` (direction in) - pointer to the loader instance\n * `signal` (direction in) - signal value to be sent\n * `arg` (direction in, out) - optional argument (can be of any value, including NULL)\n\n # Returns\n\ntrue if the signal was handled by the application, false otherwise"]
12376 pub fn loader_signal(instance: *mut Loader, signal: u32, arg: *mut core::ffi::c_void) -> bool;
12377}
12378unsafe extern "C" {
12379 #[doc = "Get the name of the currently running application\n\n # Arguments\n\n* `instance` (direction in) - pointer to the loader instance\n * `name` (direction in, out) - pointer to the string to contain the name (must be allocated)\n # Returns\n\ntrue if it was possible to get an application name, false otherwise"]
12380 pub fn loader_get_application_name(instance: *mut Loader, name: *mut FuriString) -> bool;
12381}
12382unsafe extern "C" {
12383 #[doc = "Get the launch path or name of the currently running application\n\n This is the string that was supplied to `loader_start` such that the current\n app is running now. It might be a name (in the case of internal apps) or a\n path (in the case of external apps). This value can be used to launch the\n same app again.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the loader instance\n * `name` (direction in, out) - pointer to the string to contain the path or name\n (must be allocated)\n # Returns\n\ntrue if it was possible to get an application path, false otherwise"]
12384 pub fn loader_get_application_launch_path(instance: *mut Loader, name: *mut FuriString)
12385 -> bool;
12386}
12387unsafe extern "C" {
12388 #[doc = "Enqueues a request to launch an application after the current one\n\n # Arguments\n\n* `instance` (direction in) - pointer to the loader instance\n * `name` (direction in) - pointer to the name or path of the application, or NULL to\n cancel a previous request\n * `args` (direction in) - pointer to argument to provide to the next app\n * `flags` (direction in) - additional flags. see enum documentation for more info"]
12389 pub fn loader_enqueue_launch(
12390 instance: *mut Loader,
12391 name: *const core::ffi::c_char,
12392 args: *const core::ffi::c_char,
12393 flags: LoaderDeferredLaunchFlag,
12394 );
12395}
12396unsafe extern "C" {
12397 #[doc = "Removes all requests to launch applications after the current one\n exits\n\n # Arguments\n\n* `instance` (direction in) - pointer to the loader instance"]
12398 pub fn loader_clear_launch_queue(instance: *mut Loader);
12399}
12400#[doc = "< Metric measurement units"]
12401pub const LocaleMeasurementUnitsMetric: LocaleMeasurementUnits = LocaleMeasurementUnits(0);
12402#[doc = "< Imperial measurement units"]
12403pub const LocaleMeasurementUnitsImperial: LocaleMeasurementUnits = LocaleMeasurementUnits(1);
12404#[repr(transparent)]
12405#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12406pub struct LocaleMeasurementUnits(pub core::ffi::c_uchar);
12407#[doc = "< 24-hour format"]
12408pub const LocaleTimeFormat24h: LocaleTimeFormat = LocaleTimeFormat(0);
12409#[doc = "< 12-hour format"]
12410pub const LocaleTimeFormat12h: LocaleTimeFormat = LocaleTimeFormat(1);
12411#[repr(transparent)]
12412#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12413pub struct LocaleTimeFormat(pub core::ffi::c_uchar);
12414#[doc = "< Day/Month/Year"]
12415pub const LocaleDateFormatDMY: LocaleDateFormat = LocaleDateFormat(0);
12416#[doc = "< Month/Day/Year"]
12417pub const LocaleDateFormatMDY: LocaleDateFormat = LocaleDateFormat(1);
12418#[doc = "< Year/Month/Day"]
12419pub const LocaleDateFormatYMD: LocaleDateFormat = LocaleDateFormat(2);
12420#[repr(transparent)]
12421#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12422pub struct LocaleDateFormat(pub core::ffi::c_uchar);
12423unsafe extern "C" {
12424 #[doc = "Get Locale measurement units\n\n # Returns\n\nThe locale measurement units."]
12425 pub fn locale_get_measurement_unit() -> LocaleMeasurementUnits;
12426}
12427unsafe extern "C" {
12428 #[doc = "Set locale measurement units\n\n # Arguments\n\n* `format` (direction in) - The locale measurements units"]
12429 pub fn locale_set_measurement_unit(format: LocaleMeasurementUnits);
12430}
12431unsafe extern "C" {
12432 #[doc = "Convert Fahrenheit to Celsius\n\n # Arguments\n\n* `temp_f` (direction in) - The Temperature in Fahrenheit\n\n # Returns\n\nThe Temperature in Celsius"]
12433 pub fn locale_fahrenheit_to_celsius(temp_f: f32) -> f32;
12434}
12435unsafe extern "C" {
12436 #[doc = "Convert Celsius to Fahrenheit\n\n # Arguments\n\n* `temp_c` (direction in) - The Temperature in Celsius\n\n # Returns\n\nThe Temperature in Fahrenheit"]
12437 pub fn locale_celsius_to_fahrenheit(temp_c: f32) -> f32;
12438}
12439unsafe extern "C" {
12440 #[doc = "Get Locale time format\n\n # Returns\n\nThe locale time format."]
12441 pub fn locale_get_time_format() -> LocaleTimeFormat;
12442}
12443unsafe extern "C" {
12444 #[doc = "Set Locale Time Format\n\n # Arguments\n\n* `format` (direction in) - The Locale Time Format"]
12445 pub fn locale_set_time_format(format: LocaleTimeFormat);
12446}
12447unsafe extern "C" {
12448 #[doc = "Format time to furi string\n\n # Arguments\n\n* `out_str` (direction out) - The FuriString to store formatted time\n * `datetime` (direction in) - Pointer to the datetime\n * `format` (direction in) - The Locale Time Format\n * `show_seconds` (direction in) - The show seconds flag"]
12449 pub fn locale_format_time(
12450 out_str: *mut FuriString,
12451 datetime: *const DateTime,
12452 format: LocaleTimeFormat,
12453 show_seconds: bool,
12454 );
12455}
12456unsafe extern "C" {
12457 #[doc = "Get Locale DateFormat\n\n # Returns\n\nThe Locale DateFormat."]
12458 pub fn locale_get_date_format() -> LocaleDateFormat;
12459}
12460unsafe extern "C" {
12461 #[doc = "Set Locale DateFormat\n\n # Arguments\n\n* `format` (direction in) - The Locale DateFormat"]
12462 pub fn locale_set_date_format(format: LocaleDateFormat);
12463}
12464unsafe extern "C" {
12465 #[doc = "Format date to furi string\n\n # Arguments\n\n* `out_str` (direction out) - The FuriString to store formatted date\n * `datetime` (direction in) - Pointer to the datetime\n * `format` (direction in) - The format\n * `separator` (direction in) - The separator"]
12466 pub fn locale_format_date(
12467 out_str: *mut FuriString,
12468 datetime: *const DateTime,
12469 format: LocaleDateFormat,
12470 separator: *const core::ffi::c_char,
12471 );
12472}
12473#[repr(C)]
12474#[derive(Debug, Copy, Clone)]
12475pub struct NotificationApp {
12476 _unused: [u8; 0],
12477}
12478#[repr(C)]
12479#[derive(Debug, Copy, Clone)]
12480pub struct NotificationMessageDataSound {
12481 pub frequency: f32,
12482 pub volume: f32,
12483}
12484#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12485const _: () = {
12486 ["Size of NotificationMessageDataSound"]
12487 [::core::mem::size_of::<NotificationMessageDataSound>() - 8usize];
12488 ["Alignment of NotificationMessageDataSound"]
12489 [::core::mem::align_of::<NotificationMessageDataSound>() - 4usize];
12490 ["Offset of field: NotificationMessageDataSound::frequency"]
12491 [::core::mem::offset_of!(NotificationMessageDataSound, frequency) - 0usize];
12492 ["Offset of field: NotificationMessageDataSound::volume"]
12493 [::core::mem::offset_of!(NotificationMessageDataSound, volume) - 4usize];
12494};
12495#[repr(C)]
12496#[derive(Debug, Copy, Clone)]
12497pub struct NotificationMessageDataLed {
12498 pub value: u8,
12499}
12500#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12501const _: () = {
12502 ["Size of NotificationMessageDataLed"]
12503 [::core::mem::size_of::<NotificationMessageDataLed>() - 1usize];
12504 ["Alignment of NotificationMessageDataLed"]
12505 [::core::mem::align_of::<NotificationMessageDataLed>() - 1usize];
12506 ["Offset of field: NotificationMessageDataLed::value"]
12507 [::core::mem::offset_of!(NotificationMessageDataLed, value) - 0usize];
12508};
12509#[repr(C)]
12510#[derive(Debug, Copy, Clone)]
12511pub struct NotificationMessageDataVibro {
12512 pub on: bool,
12513}
12514#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12515const _: () = {
12516 ["Size of NotificationMessageDataVibro"]
12517 [::core::mem::size_of::<NotificationMessageDataVibro>() - 1usize];
12518 ["Alignment of NotificationMessageDataVibro"]
12519 [::core::mem::align_of::<NotificationMessageDataVibro>() - 1usize];
12520 ["Offset of field: NotificationMessageDataVibro::on"]
12521 [::core::mem::offset_of!(NotificationMessageDataVibro, on) - 0usize];
12522};
12523#[repr(C)]
12524#[derive(Debug, Copy, Clone)]
12525pub struct NotificationMessageDataDelay {
12526 pub length: u32,
12527}
12528#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12529const _: () = {
12530 ["Size of NotificationMessageDataDelay"]
12531 [::core::mem::size_of::<NotificationMessageDataDelay>() - 4usize];
12532 ["Alignment of NotificationMessageDataDelay"]
12533 [::core::mem::align_of::<NotificationMessageDataDelay>() - 4usize];
12534 ["Offset of field: NotificationMessageDataDelay::length"]
12535 [::core::mem::offset_of!(NotificationMessageDataDelay, length) - 0usize];
12536};
12537#[repr(C)]
12538#[derive(Debug, Copy, Clone)]
12539pub struct NotificationMessageDataForcedSettings {
12540 pub speaker_volume: f32,
12541 pub vibro: bool,
12542 pub display_brightness: f32,
12543}
12544#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12545const _: () = {
12546 ["Size of NotificationMessageDataForcedSettings"]
12547 [::core::mem::size_of::<NotificationMessageDataForcedSettings>() - 12usize];
12548 ["Alignment of NotificationMessageDataForcedSettings"]
12549 [::core::mem::align_of::<NotificationMessageDataForcedSettings>() - 4usize];
12550 ["Offset of field: NotificationMessageDataForcedSettings::speaker_volume"]
12551 [::core::mem::offset_of!(NotificationMessageDataForcedSettings, speaker_volume) - 0usize];
12552 ["Offset of field: NotificationMessageDataForcedSettings::vibro"]
12553 [::core::mem::offset_of!(NotificationMessageDataForcedSettings, vibro) - 4usize];
12554 ["Offset of field: NotificationMessageDataForcedSettings::display_brightness"][::core::mem::offset_of!(
12555 NotificationMessageDataForcedSettings,
12556 display_brightness
12557 ) - 8usize];
12558};
12559#[repr(C)]
12560#[derive(Debug, Copy, Clone)]
12561pub struct NotificationMessageDataLedBlink {
12562 pub on_time: u16,
12563 pub period: u16,
12564 pub color: Light,
12565}
12566#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12567const _: () = {
12568 ["Size of NotificationMessageDataLedBlink"]
12569 [::core::mem::size_of::<NotificationMessageDataLedBlink>() - 6usize];
12570 ["Alignment of NotificationMessageDataLedBlink"]
12571 [::core::mem::align_of::<NotificationMessageDataLedBlink>() - 2usize];
12572 ["Offset of field: NotificationMessageDataLedBlink::on_time"]
12573 [::core::mem::offset_of!(NotificationMessageDataLedBlink, on_time) - 0usize];
12574 ["Offset of field: NotificationMessageDataLedBlink::period"]
12575 [::core::mem::offset_of!(NotificationMessageDataLedBlink, period) - 2usize];
12576 ["Offset of field: NotificationMessageDataLedBlink::color"]
12577 [::core::mem::offset_of!(NotificationMessageDataLedBlink, color) - 4usize];
12578};
12579#[repr(C)]
12580#[derive(Copy, Clone)]
12581pub union NotificationMessageData {
12582 pub sound: NotificationMessageDataSound,
12583 pub led: NotificationMessageDataLed,
12584 pub led_blink: NotificationMessageDataLedBlink,
12585 pub vibro: NotificationMessageDataVibro,
12586 pub delay: NotificationMessageDataDelay,
12587 pub forced_settings: NotificationMessageDataForcedSettings,
12588}
12589#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12590const _: () = {
12591 ["Size of NotificationMessageData"]
12592 [::core::mem::size_of::<NotificationMessageData>() - 12usize];
12593 ["Alignment of NotificationMessageData"]
12594 [::core::mem::align_of::<NotificationMessageData>() - 4usize];
12595 ["Offset of field: NotificationMessageData::sound"]
12596 [::core::mem::offset_of!(NotificationMessageData, sound) - 0usize];
12597 ["Offset of field: NotificationMessageData::led"]
12598 [::core::mem::offset_of!(NotificationMessageData, led) - 0usize];
12599 ["Offset of field: NotificationMessageData::led_blink"]
12600 [::core::mem::offset_of!(NotificationMessageData, led_blink) - 0usize];
12601 ["Offset of field: NotificationMessageData::vibro"]
12602 [::core::mem::offset_of!(NotificationMessageData, vibro) - 0usize];
12603 ["Offset of field: NotificationMessageData::delay"]
12604 [::core::mem::offset_of!(NotificationMessageData, delay) - 0usize];
12605 ["Offset of field: NotificationMessageData::forced_settings"]
12606 [::core::mem::offset_of!(NotificationMessageData, forced_settings) - 0usize];
12607};
12608pub const NotificationMessageTypeVibro: NotificationMessageType = NotificationMessageType(0);
12609pub const NotificationMessageTypeSoundOn: NotificationMessageType = NotificationMessageType(1);
12610pub const NotificationMessageTypeSoundOff: NotificationMessageType = NotificationMessageType(2);
12611pub const NotificationMessageTypeLedRed: NotificationMessageType = NotificationMessageType(3);
12612pub const NotificationMessageTypeLedGreen: NotificationMessageType = NotificationMessageType(4);
12613pub const NotificationMessageTypeLedBlue: NotificationMessageType = NotificationMessageType(5);
12614pub const NotificationMessageTypeLedBlinkStart: NotificationMessageType =
12615 NotificationMessageType(6);
12616pub const NotificationMessageTypeLedBlinkStop: NotificationMessageType = NotificationMessageType(7);
12617pub const NotificationMessageTypeLedBlinkColor: NotificationMessageType =
12618 NotificationMessageType(8);
12619pub const NotificationMessageTypeDelay: NotificationMessageType = NotificationMessageType(9);
12620pub const NotificationMessageTypeLedDisplayBacklight: NotificationMessageType =
12621 NotificationMessageType(10);
12622pub const NotificationMessageTypeLedDisplayBacklightEnforceOn: NotificationMessageType =
12623 NotificationMessageType(11);
12624pub const NotificationMessageTypeLedDisplayBacklightEnforceAuto: NotificationMessageType =
12625 NotificationMessageType(12);
12626pub const NotificationMessageTypeDoNotReset: NotificationMessageType = NotificationMessageType(13);
12627pub const NotificationMessageTypeForceSpeakerVolumeSetting: NotificationMessageType =
12628 NotificationMessageType(14);
12629pub const NotificationMessageTypeForceVibroSetting: NotificationMessageType =
12630 NotificationMessageType(15);
12631pub const NotificationMessageTypeForceDisplayBrightnessSetting: NotificationMessageType =
12632 NotificationMessageType(16);
12633pub const NotificationMessageTypeLedBrightnessSettingApply: NotificationMessageType =
12634 NotificationMessageType(17);
12635pub const NotificationMessageTypeLcdContrastUpdate: NotificationMessageType =
12636 NotificationMessageType(18);
12637#[repr(transparent)]
12638#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12639pub struct NotificationMessageType(pub core::ffi::c_uchar);
12640#[repr(C)]
12641#[derive(Copy, Clone)]
12642pub struct NotificationMessage {
12643 pub type_: NotificationMessageType,
12644 pub data: NotificationMessageData,
12645}
12646#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12647const _: () = {
12648 ["Size of NotificationMessage"][::core::mem::size_of::<NotificationMessage>() - 16usize];
12649 ["Alignment of NotificationMessage"][::core::mem::align_of::<NotificationMessage>() - 4usize];
12650 ["Offset of field: NotificationMessage::type_"]
12651 [::core::mem::offset_of!(NotificationMessage, type_) - 0usize];
12652 ["Offset of field: NotificationMessage::data"]
12653 [::core::mem::offset_of!(NotificationMessage, data) - 4usize];
12654};
12655pub type NotificationSequence = [*const NotificationMessage; 0usize];
12656unsafe extern "C" {
12657 pub fn notification_message(app: *mut NotificationApp, sequence: *const NotificationSequence);
12658}
12659unsafe extern "C" {
12660 pub fn notification_message_block(
12661 app: *mut NotificationApp,
12662 sequence: *const NotificationSequence,
12663 );
12664}
12665unsafe extern "C" {
12666 #[doc = "Send internal (apply to permanent layer) notification message. Think twice before use.\n\n # Arguments\n\n* `app` - notification record content\n * `sequence` - notification sequence"]
12667 pub fn notification_internal_message(
12668 app: *mut NotificationApp,
12669 sequence: *const NotificationSequence,
12670 );
12671}
12672unsafe extern "C" {
12673 #[doc = "Send internal (apply to permanent layer) notification message and wait for notification end. Think twice before use.\n\n # Arguments\n\n* `app` - notification record content\n * `sequence` - notification sequence"]
12674 pub fn notification_internal_message_block(
12675 app: *mut NotificationApp,
12676 sequence: *const NotificationSequence,
12677 );
12678}
12679unsafe extern "C" {
12680 pub static message_click: NotificationMessage;
12681}
12682unsafe extern "C" {
12683 pub static message_note_c0: NotificationMessage;
12684}
12685unsafe extern "C" {
12686 pub static message_note_cs0: NotificationMessage;
12687}
12688unsafe extern "C" {
12689 pub static message_note_d0: NotificationMessage;
12690}
12691unsafe extern "C" {
12692 pub static message_note_ds0: NotificationMessage;
12693}
12694unsafe extern "C" {
12695 pub static message_note_e0: NotificationMessage;
12696}
12697unsafe extern "C" {
12698 pub static message_note_f0: NotificationMessage;
12699}
12700unsafe extern "C" {
12701 pub static message_note_fs0: NotificationMessage;
12702}
12703unsafe extern "C" {
12704 pub static message_note_g0: NotificationMessage;
12705}
12706unsafe extern "C" {
12707 pub static message_note_gs0: NotificationMessage;
12708}
12709unsafe extern "C" {
12710 pub static message_note_a0: NotificationMessage;
12711}
12712unsafe extern "C" {
12713 pub static message_note_as0: NotificationMessage;
12714}
12715unsafe extern "C" {
12716 pub static message_note_b0: NotificationMessage;
12717}
12718unsafe extern "C" {
12719 pub static message_note_c1: NotificationMessage;
12720}
12721unsafe extern "C" {
12722 pub static message_note_cs1: NotificationMessage;
12723}
12724unsafe extern "C" {
12725 pub static message_note_d1: NotificationMessage;
12726}
12727unsafe extern "C" {
12728 pub static message_note_ds1: NotificationMessage;
12729}
12730unsafe extern "C" {
12731 pub static message_note_e1: NotificationMessage;
12732}
12733unsafe extern "C" {
12734 pub static message_note_f1: NotificationMessage;
12735}
12736unsafe extern "C" {
12737 pub static message_note_fs1: NotificationMessage;
12738}
12739unsafe extern "C" {
12740 pub static message_note_g1: NotificationMessage;
12741}
12742unsafe extern "C" {
12743 pub static message_note_gs1: NotificationMessage;
12744}
12745unsafe extern "C" {
12746 pub static message_note_a1: NotificationMessage;
12747}
12748unsafe extern "C" {
12749 pub static message_note_as1: NotificationMessage;
12750}
12751unsafe extern "C" {
12752 pub static message_note_b1: NotificationMessage;
12753}
12754unsafe extern "C" {
12755 pub static message_note_c2: NotificationMessage;
12756}
12757unsafe extern "C" {
12758 pub static message_note_cs2: NotificationMessage;
12759}
12760unsafe extern "C" {
12761 pub static message_note_d2: NotificationMessage;
12762}
12763unsafe extern "C" {
12764 pub static message_note_ds2: NotificationMessage;
12765}
12766unsafe extern "C" {
12767 pub static message_note_e2: NotificationMessage;
12768}
12769unsafe extern "C" {
12770 pub static message_note_f2: NotificationMessage;
12771}
12772unsafe extern "C" {
12773 pub static message_note_fs2: NotificationMessage;
12774}
12775unsafe extern "C" {
12776 pub static message_note_g2: NotificationMessage;
12777}
12778unsafe extern "C" {
12779 pub static message_note_gs2: NotificationMessage;
12780}
12781unsafe extern "C" {
12782 pub static message_note_a2: NotificationMessage;
12783}
12784unsafe extern "C" {
12785 pub static message_note_as2: NotificationMessage;
12786}
12787unsafe extern "C" {
12788 pub static message_note_b2: NotificationMessage;
12789}
12790unsafe extern "C" {
12791 pub static message_note_c3: NotificationMessage;
12792}
12793unsafe extern "C" {
12794 pub static message_note_cs3: NotificationMessage;
12795}
12796unsafe extern "C" {
12797 pub static message_note_d3: NotificationMessage;
12798}
12799unsafe extern "C" {
12800 pub static message_note_ds3: NotificationMessage;
12801}
12802unsafe extern "C" {
12803 pub static message_note_e3: NotificationMessage;
12804}
12805unsafe extern "C" {
12806 pub static message_note_f3: NotificationMessage;
12807}
12808unsafe extern "C" {
12809 pub static message_note_fs3: NotificationMessage;
12810}
12811unsafe extern "C" {
12812 pub static message_note_g3: NotificationMessage;
12813}
12814unsafe extern "C" {
12815 pub static message_note_gs3: NotificationMessage;
12816}
12817unsafe extern "C" {
12818 pub static message_note_a3: NotificationMessage;
12819}
12820unsafe extern "C" {
12821 pub static message_note_as3: NotificationMessage;
12822}
12823unsafe extern "C" {
12824 pub static message_note_b3: NotificationMessage;
12825}
12826unsafe extern "C" {
12827 pub static message_note_c4: NotificationMessage;
12828}
12829unsafe extern "C" {
12830 pub static message_note_cs4: NotificationMessage;
12831}
12832unsafe extern "C" {
12833 pub static message_note_d4: NotificationMessage;
12834}
12835unsafe extern "C" {
12836 pub static message_note_ds4: NotificationMessage;
12837}
12838unsafe extern "C" {
12839 pub static message_note_e4: NotificationMessage;
12840}
12841unsafe extern "C" {
12842 pub static message_note_f4: NotificationMessage;
12843}
12844unsafe extern "C" {
12845 pub static message_note_fs4: NotificationMessage;
12846}
12847unsafe extern "C" {
12848 pub static message_note_g4: NotificationMessage;
12849}
12850unsafe extern "C" {
12851 pub static message_note_gs4: NotificationMessage;
12852}
12853unsafe extern "C" {
12854 pub static message_note_a4: NotificationMessage;
12855}
12856unsafe extern "C" {
12857 pub static message_note_as4: NotificationMessage;
12858}
12859unsafe extern "C" {
12860 pub static message_note_b4: NotificationMessage;
12861}
12862unsafe extern "C" {
12863 pub static message_note_c5: NotificationMessage;
12864}
12865unsafe extern "C" {
12866 pub static message_note_cs5: NotificationMessage;
12867}
12868unsafe extern "C" {
12869 pub static message_note_d5: NotificationMessage;
12870}
12871unsafe extern "C" {
12872 pub static message_note_ds5: NotificationMessage;
12873}
12874unsafe extern "C" {
12875 pub static message_note_e5: NotificationMessage;
12876}
12877unsafe extern "C" {
12878 pub static message_note_f5: NotificationMessage;
12879}
12880unsafe extern "C" {
12881 pub static message_note_fs5: NotificationMessage;
12882}
12883unsafe extern "C" {
12884 pub static message_note_g5: NotificationMessage;
12885}
12886unsafe extern "C" {
12887 pub static message_note_gs5: NotificationMessage;
12888}
12889unsafe extern "C" {
12890 pub static message_note_a5: NotificationMessage;
12891}
12892unsafe extern "C" {
12893 pub static message_note_as5: NotificationMessage;
12894}
12895unsafe extern "C" {
12896 pub static message_note_b5: NotificationMessage;
12897}
12898unsafe extern "C" {
12899 pub static message_note_c6: NotificationMessage;
12900}
12901unsafe extern "C" {
12902 pub static message_note_cs6: NotificationMessage;
12903}
12904unsafe extern "C" {
12905 pub static message_note_d6: NotificationMessage;
12906}
12907unsafe extern "C" {
12908 pub static message_note_ds6: NotificationMessage;
12909}
12910unsafe extern "C" {
12911 pub static message_note_e6: NotificationMessage;
12912}
12913unsafe extern "C" {
12914 pub static message_note_f6: NotificationMessage;
12915}
12916unsafe extern "C" {
12917 pub static message_note_fs6: NotificationMessage;
12918}
12919unsafe extern "C" {
12920 pub static message_note_g6: NotificationMessage;
12921}
12922unsafe extern "C" {
12923 pub static message_note_gs6: NotificationMessage;
12924}
12925unsafe extern "C" {
12926 pub static message_note_a6: NotificationMessage;
12927}
12928unsafe extern "C" {
12929 pub static message_note_as6: NotificationMessage;
12930}
12931unsafe extern "C" {
12932 pub static message_note_b6: NotificationMessage;
12933}
12934unsafe extern "C" {
12935 pub static message_note_c7: NotificationMessage;
12936}
12937unsafe extern "C" {
12938 pub static message_note_cs7: NotificationMessage;
12939}
12940unsafe extern "C" {
12941 pub static message_note_d7: NotificationMessage;
12942}
12943unsafe extern "C" {
12944 pub static message_note_ds7: NotificationMessage;
12945}
12946unsafe extern "C" {
12947 pub static message_note_e7: NotificationMessage;
12948}
12949unsafe extern "C" {
12950 pub static message_note_f7: NotificationMessage;
12951}
12952unsafe extern "C" {
12953 pub static message_note_fs7: NotificationMessage;
12954}
12955unsafe extern "C" {
12956 pub static message_note_g7: NotificationMessage;
12957}
12958unsafe extern "C" {
12959 pub static message_note_gs7: NotificationMessage;
12960}
12961unsafe extern "C" {
12962 pub static message_note_a7: NotificationMessage;
12963}
12964unsafe extern "C" {
12965 pub static message_note_as7: NotificationMessage;
12966}
12967unsafe extern "C" {
12968 pub static message_note_b7: NotificationMessage;
12969}
12970unsafe extern "C" {
12971 pub static message_note_c8: NotificationMessage;
12972}
12973unsafe extern "C" {
12974 pub static message_note_cs8: NotificationMessage;
12975}
12976unsafe extern "C" {
12977 pub static message_note_d8: NotificationMessage;
12978}
12979unsafe extern "C" {
12980 pub static message_note_ds8: NotificationMessage;
12981}
12982unsafe extern "C" {
12983 pub static message_note_e8: NotificationMessage;
12984}
12985unsafe extern "C" {
12986 pub static message_note_f8: NotificationMessage;
12987}
12988unsafe extern "C" {
12989 pub static message_note_fs8: NotificationMessage;
12990}
12991unsafe extern "C" {
12992 pub static message_note_g8: NotificationMessage;
12993}
12994unsafe extern "C" {
12995 pub static message_note_gs8: NotificationMessage;
12996}
12997unsafe extern "C" {
12998 pub static message_note_a8: NotificationMessage;
12999}
13000unsafe extern "C" {
13001 pub static message_note_as8: NotificationMessage;
13002}
13003unsafe extern "C" {
13004 pub static message_note_b8: NotificationMessage;
13005}
13006unsafe extern "C" {
13007 #[doc = "Returns the frequency of the given note\n\n This function calculates and returns the frequency (in Hz) of the specified note.\n If the input note name is invalid, the function returns 0.0.\n\n # Arguments\n\n* `[in]` - note_name The name of the note (e.g., \"A4\", cs5\")\n # Returns\n\nThe frequency of the note in Hz, or 0.0 if the note name is invalid"]
13008 pub fn notification_messages_notes_frequency_from_name(
13009 note_name: *const core::ffi::c_char,
13010 ) -> f32;
13011}
13012unsafe extern "C" {
13013 #[doc = "Messages"]
13014 pub static message_display_backlight_on: NotificationMessage;
13015}
13016unsafe extern "C" {
13017 pub static message_display_backlight_off: NotificationMessage;
13018}
13019unsafe extern "C" {
13020 pub static message_display_backlight_enforce_on: NotificationMessage;
13021}
13022unsafe extern "C" {
13023 pub static message_display_backlight_enforce_auto: NotificationMessage;
13024}
13025unsafe extern "C" {
13026 pub static message_red_255: NotificationMessage;
13027}
13028unsafe extern "C" {
13029 pub static message_green_255: NotificationMessage;
13030}
13031unsafe extern "C" {
13032 pub static message_blue_255: NotificationMessage;
13033}
13034unsafe extern "C" {
13035 pub static message_red_0: NotificationMessage;
13036}
13037unsafe extern "C" {
13038 pub static message_green_0: NotificationMessage;
13039}
13040unsafe extern "C" {
13041 pub static message_blue_0: NotificationMessage;
13042}
13043unsafe extern "C" {
13044 pub static message_blink_start_10: NotificationMessage;
13045}
13046unsafe extern "C" {
13047 pub static message_blink_start_100: NotificationMessage;
13048}
13049unsafe extern "C" {
13050 pub static message_blink_stop: NotificationMessage;
13051}
13052unsafe extern "C" {
13053 pub static message_blink_set_color_red: NotificationMessage;
13054}
13055unsafe extern "C" {
13056 pub static message_blink_set_color_green: NotificationMessage;
13057}
13058unsafe extern "C" {
13059 pub static message_blink_set_color_blue: NotificationMessage;
13060}
13061unsafe extern "C" {
13062 pub static message_blink_set_color_cyan: NotificationMessage;
13063}
13064unsafe extern "C" {
13065 pub static message_blink_set_color_magenta: NotificationMessage;
13066}
13067unsafe extern "C" {
13068 pub static message_blink_set_color_yellow: NotificationMessage;
13069}
13070unsafe extern "C" {
13071 pub static message_blink_set_color_white: NotificationMessage;
13072}
13073unsafe extern "C" {
13074 pub static message_delay_1: NotificationMessage;
13075}
13076unsafe extern "C" {
13077 pub static message_delay_10: NotificationMessage;
13078}
13079unsafe extern "C" {
13080 pub static message_delay_25: NotificationMessage;
13081}
13082unsafe extern "C" {
13083 pub static message_delay_50: NotificationMessage;
13084}
13085unsafe extern "C" {
13086 pub static message_delay_100: NotificationMessage;
13087}
13088unsafe extern "C" {
13089 pub static message_delay_250: NotificationMessage;
13090}
13091unsafe extern "C" {
13092 pub static message_delay_500: NotificationMessage;
13093}
13094unsafe extern "C" {
13095 pub static message_delay_1000: NotificationMessage;
13096}
13097unsafe extern "C" {
13098 pub static message_sound_off: NotificationMessage;
13099}
13100unsafe extern "C" {
13101 pub static message_vibro_on: NotificationMessage;
13102}
13103unsafe extern "C" {
13104 pub static message_vibro_off: NotificationMessage;
13105}
13106unsafe extern "C" {
13107 pub static message_do_not_reset: NotificationMessage;
13108}
13109unsafe extern "C" {
13110 pub static message_force_speaker_volume_setting_1f: NotificationMessage;
13111}
13112unsafe extern "C" {
13113 pub static message_force_vibro_setting_on: NotificationMessage;
13114}
13115unsafe extern "C" {
13116 pub static message_force_vibro_setting_off: NotificationMessage;
13117}
13118unsafe extern "C" {
13119 pub static message_force_display_brightness_setting_1f: NotificationMessage;
13120}
13121unsafe extern "C" {
13122 pub static message_lcd_contrast_update: NotificationMessage;
13123}
13124unsafe extern "C" {
13125 #[doc = "Message sequences"]
13126 pub static sequence_reset_red: NotificationSequence;
13127}
13128unsafe extern "C" {
13129 pub static sequence_reset_green: NotificationSequence;
13130}
13131unsafe extern "C" {
13132 pub static sequence_reset_blue: NotificationSequence;
13133}
13134unsafe extern "C" {
13135 pub static sequence_reset_rgb: NotificationSequence;
13136}
13137unsafe extern "C" {
13138 pub static sequence_reset_display: NotificationSequence;
13139}
13140unsafe extern "C" {
13141 pub static sequence_reset_sound: NotificationSequence;
13142}
13143unsafe extern "C" {
13144 pub static sequence_reset_vibro: NotificationSequence;
13145}
13146unsafe extern "C" {
13147 pub static sequence_set_vibro_on: NotificationSequence;
13148}
13149unsafe extern "C" {
13150 #[doc = "Display: backlight wakeup"]
13151 pub static sequence_display_backlight_on: NotificationSequence;
13152}
13153unsafe extern "C" {
13154 #[doc = "Display: backlight force off"]
13155 pub static sequence_display_backlight_off: NotificationSequence;
13156}
13157unsafe extern "C" {
13158 #[doc = "Display: backlight force off after a delay of 1000ms"]
13159 pub static sequence_display_backlight_off_delay_1000: NotificationSequence;
13160}
13161unsafe extern "C" {
13162 #[doc = "Display: backlight always on lock"]
13163 pub static sequence_display_backlight_enforce_on: NotificationSequence;
13164}
13165unsafe extern "C" {
13166 #[doc = "Display: backlight always on unlock"]
13167 pub static sequence_display_backlight_enforce_auto: NotificationSequence;
13168}
13169unsafe extern "C" {
13170 pub static sequence_charging: NotificationSequence;
13171}
13172unsafe extern "C" {
13173 pub static sequence_charged: NotificationSequence;
13174}
13175unsafe extern "C" {
13176 pub static sequence_not_charging: NotificationSequence;
13177}
13178unsafe extern "C" {
13179 pub static sequence_set_only_red_255: NotificationSequence;
13180}
13181unsafe extern "C" {
13182 pub static sequence_set_only_green_255: NotificationSequence;
13183}
13184unsafe extern "C" {
13185 pub static sequence_set_only_blue_255: NotificationSequence;
13186}
13187unsafe extern "C" {
13188 pub static sequence_set_red_255: NotificationSequence;
13189}
13190unsafe extern "C" {
13191 pub static sequence_set_green_255: NotificationSequence;
13192}
13193unsafe extern "C" {
13194 pub static sequence_set_blue_255: NotificationSequence;
13195}
13196unsafe extern "C" {
13197 pub static sequence_solid_yellow: NotificationSequence;
13198}
13199unsafe extern "C" {
13200 pub static sequence_blink_blue_10: NotificationSequence;
13201}
13202unsafe extern "C" {
13203 pub static sequence_blink_red_10: NotificationSequence;
13204}
13205unsafe extern "C" {
13206 pub static sequence_blink_green_10: NotificationSequence;
13207}
13208unsafe extern "C" {
13209 pub static sequence_blink_yellow_10: NotificationSequence;
13210}
13211unsafe extern "C" {
13212 pub static sequence_blink_cyan_10: NotificationSequence;
13213}
13214unsafe extern "C" {
13215 pub static sequence_blink_magenta_10: NotificationSequence;
13216}
13217unsafe extern "C" {
13218 pub static sequence_blink_red_100: NotificationSequence;
13219}
13220unsafe extern "C" {
13221 pub static sequence_blink_green_100: NotificationSequence;
13222}
13223unsafe extern "C" {
13224 pub static sequence_blink_blue_100: NotificationSequence;
13225}
13226unsafe extern "C" {
13227 pub static sequence_blink_yellow_100: NotificationSequence;
13228}
13229unsafe extern "C" {
13230 pub static sequence_blink_cyan_100: NotificationSequence;
13231}
13232unsafe extern "C" {
13233 pub static sequence_blink_magenta_100: NotificationSequence;
13234}
13235unsafe extern "C" {
13236 pub static sequence_blink_white_100: NotificationSequence;
13237}
13238unsafe extern "C" {
13239 pub static sequence_blink_start_blue: NotificationSequence;
13240}
13241unsafe extern "C" {
13242 pub static sequence_blink_start_red: NotificationSequence;
13243}
13244unsafe extern "C" {
13245 pub static sequence_blink_start_green: NotificationSequence;
13246}
13247unsafe extern "C" {
13248 pub static sequence_blink_start_yellow: NotificationSequence;
13249}
13250unsafe extern "C" {
13251 pub static sequence_blink_start_cyan: NotificationSequence;
13252}
13253unsafe extern "C" {
13254 pub static sequence_blink_start_magenta: NotificationSequence;
13255}
13256unsafe extern "C" {
13257 pub static sequence_blink_stop: NotificationSequence;
13258}
13259unsafe extern "C" {
13260 pub static sequence_single_vibro: NotificationSequence;
13261}
13262unsafe extern "C" {
13263 pub static sequence_double_vibro: NotificationSequence;
13264}
13265unsafe extern "C" {
13266 pub static sequence_success: NotificationSequence;
13267}
13268unsafe extern "C" {
13269 pub static sequence_semi_success: NotificationSequence;
13270}
13271unsafe extern "C" {
13272 pub static sequence_error: NotificationSequence;
13273}
13274unsafe extern "C" {
13275 pub static sequence_audiovisual_alert: NotificationSequence;
13276}
13277unsafe extern "C" {
13278 pub static sequence_lcd_contrast_update: NotificationSequence;
13279}
13280unsafe extern "C" {
13281 pub static sequence_empty: NotificationSequence;
13282}
13283#[repr(C)]
13284#[derive(Debug, Copy, Clone)]
13285pub struct Power {
13286 _unused: [u8; 0],
13287}
13288pub const PowerBootModeNormal: PowerBootMode = PowerBootMode(0);
13289pub const PowerBootModeDfu: PowerBootMode = PowerBootMode(1);
13290pub const PowerBootModeUpdateStart: PowerBootMode = PowerBootMode(2);
13291#[repr(transparent)]
13292#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13293pub struct PowerBootMode(pub core::ffi::c_uchar);
13294pub const PowerEventTypeStopCharging: PowerEventType = PowerEventType(0);
13295pub const PowerEventTypeStartCharging: PowerEventType = PowerEventType(1);
13296pub const PowerEventTypeFullyCharged: PowerEventType = PowerEventType(2);
13297pub const PowerEventTypeBatteryLevelChanged: PowerEventType = PowerEventType(3);
13298#[repr(transparent)]
13299#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13300pub struct PowerEventType(pub core::ffi::c_uchar);
13301#[repr(C)]
13302#[derive(Copy, Clone)]
13303pub union PowerEventData {
13304 pub battery_level: u8,
13305}
13306#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13307const _: () = {
13308 ["Size of PowerEventData"][::core::mem::size_of::<PowerEventData>() - 1usize];
13309 ["Alignment of PowerEventData"][::core::mem::align_of::<PowerEventData>() - 1usize];
13310 ["Offset of field: PowerEventData::battery_level"]
13311 [::core::mem::offset_of!(PowerEventData, battery_level) - 0usize];
13312};
13313#[repr(C)]
13314#[derive(Copy, Clone)]
13315pub struct PowerEvent {
13316 pub type_: PowerEventType,
13317 pub data: PowerEventData,
13318}
13319#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13320const _: () = {
13321 ["Size of PowerEvent"][::core::mem::size_of::<PowerEvent>() - 2usize];
13322 ["Alignment of PowerEvent"][::core::mem::align_of::<PowerEvent>() - 1usize];
13323 ["Offset of field: PowerEvent::type_"][::core::mem::offset_of!(PowerEvent, type_) - 0usize];
13324 ["Offset of field: PowerEvent::data"][::core::mem::offset_of!(PowerEvent, data) - 1usize];
13325};
13326#[repr(C)]
13327#[derive(Debug, Copy, Clone)]
13328pub struct PowerInfo {
13329 pub gauge_is_ok: bool,
13330 pub is_charging: bool,
13331 pub is_shutdown_requested: bool,
13332 pub is_otg_enabled: bool,
13333 pub current_charger: f32,
13334 pub current_gauge: f32,
13335 pub voltage_battery_charge_limit: f32,
13336 pub voltage_charger: f32,
13337 pub voltage_gauge: f32,
13338 pub voltage_vbus: f32,
13339 pub capacity_remaining: u32,
13340 pub capacity_full: u32,
13341 pub temperature_charger: f32,
13342 pub temperature_gauge: f32,
13343 pub charge: u8,
13344 pub health: u8,
13345}
13346#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13347const _: () = {
13348 ["Size of PowerInfo"][::core::mem::size_of::<PowerInfo>() - 48usize];
13349 ["Alignment of PowerInfo"][::core::mem::align_of::<PowerInfo>() - 4usize];
13350 ["Offset of field: PowerInfo::gauge_is_ok"]
13351 [::core::mem::offset_of!(PowerInfo, gauge_is_ok) - 0usize];
13352 ["Offset of field: PowerInfo::is_charging"]
13353 [::core::mem::offset_of!(PowerInfo, is_charging) - 1usize];
13354 ["Offset of field: PowerInfo::is_shutdown_requested"]
13355 [::core::mem::offset_of!(PowerInfo, is_shutdown_requested) - 2usize];
13356 ["Offset of field: PowerInfo::is_otg_enabled"]
13357 [::core::mem::offset_of!(PowerInfo, is_otg_enabled) - 3usize];
13358 ["Offset of field: PowerInfo::current_charger"]
13359 [::core::mem::offset_of!(PowerInfo, current_charger) - 4usize];
13360 ["Offset of field: PowerInfo::current_gauge"]
13361 [::core::mem::offset_of!(PowerInfo, current_gauge) - 8usize];
13362 ["Offset of field: PowerInfo::voltage_battery_charge_limit"]
13363 [::core::mem::offset_of!(PowerInfo, voltage_battery_charge_limit) - 12usize];
13364 ["Offset of field: PowerInfo::voltage_charger"]
13365 [::core::mem::offset_of!(PowerInfo, voltage_charger) - 16usize];
13366 ["Offset of field: PowerInfo::voltage_gauge"]
13367 [::core::mem::offset_of!(PowerInfo, voltage_gauge) - 20usize];
13368 ["Offset of field: PowerInfo::voltage_vbus"]
13369 [::core::mem::offset_of!(PowerInfo, voltage_vbus) - 24usize];
13370 ["Offset of field: PowerInfo::capacity_remaining"]
13371 [::core::mem::offset_of!(PowerInfo, capacity_remaining) - 28usize];
13372 ["Offset of field: PowerInfo::capacity_full"]
13373 [::core::mem::offset_of!(PowerInfo, capacity_full) - 32usize];
13374 ["Offset of field: PowerInfo::temperature_charger"]
13375 [::core::mem::offset_of!(PowerInfo, temperature_charger) - 36usize];
13376 ["Offset of field: PowerInfo::temperature_gauge"]
13377 [::core::mem::offset_of!(PowerInfo, temperature_gauge) - 40usize];
13378 ["Offset of field: PowerInfo::charge"][::core::mem::offset_of!(PowerInfo, charge) - 44usize];
13379 ["Offset of field: PowerInfo::health"][::core::mem::offset_of!(PowerInfo, health) - 45usize];
13380};
13381unsafe extern "C" {
13382 #[doc = "Power off device"]
13383 pub fn power_off(power: *mut Power);
13384}
13385unsafe extern "C" {
13386 #[doc = "Reboot device\n\n # Arguments\n\n* `mode` - PowerBootMode"]
13387 pub fn power_reboot(power: *mut Power, mode: PowerBootMode);
13388}
13389unsafe extern "C" {
13390 #[doc = "Get power info\n\n # Arguments\n\n* `power` - Power instance\n * `info` - PowerInfo instance"]
13391 pub fn power_get_info(power: *mut Power, info: *mut PowerInfo);
13392}
13393unsafe extern "C" {
13394 #[doc = "Get power event pubsub handler\n\n # Arguments\n\n* `power` - Power instance\n\n # Returns\n\nFuriPubSub instance"]
13395 pub fn power_get_pubsub(power: *mut Power) -> *mut FuriPubSub;
13396}
13397unsafe extern "C" {
13398 #[doc = "Check battery health\n\n # Returns\n\ntrue if battery is healthy"]
13399 pub fn power_is_battery_healthy(power: *mut Power) -> bool;
13400}
13401unsafe extern "C" {
13402 #[doc = "Enable or disable battery low level notification message\n\n # Arguments\n\n* `power` - Power instance\n * `enable` - true - enable, false - disable"]
13403 pub fn power_enable_low_battery_level_notification(power: *mut Power, enable: bool);
13404}
13405unsafe extern "C" {
13406 #[doc = "Enable or disable OTG\n\n # Arguments\n\n* `power` - Power instance\n * `enable` - true - enable, false - disable"]
13407 pub fn power_enable_otg(power: *mut Power, enable: bool);
13408}
13409unsafe extern "C" {
13410 #[doc = "Check OTG status\n\n # Returns\n\ntrue if OTG is requested"]
13411 pub fn power_is_otg_enabled(power: *mut Power) -> bool;
13412}
13413#[repr(C)]
13414#[derive(Debug, Copy, Clone)]
13415pub struct Rpc {
13416 _unused: [u8; 0],
13417}
13418#[repr(C)]
13419#[derive(Debug, Copy, Clone)]
13420pub struct RpcSession {
13421 _unused: [u8; 0],
13422}
13423#[doc = "Callback to send to client any data (e.g. response to command)"]
13424pub type RpcSendBytesCallback = ::core::option::Option<
13425 unsafe extern "C" fn(context: *mut core::ffi::c_void, bytes: *mut u8, bytes_len: usize),
13426>;
13427#[doc = "Callback to notify client that buffer is empty"]
13428pub type RpcBufferIsEmptyCallback =
13429 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
13430#[doc = "Callback to notify transport layer that close_session command\n is received. Any other actions lays on transport layer.\n No destruction or session close performed."]
13431pub type RpcSessionClosedCallback =
13432 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
13433#[doc = "Callback to notify transport layer that session was closed\n and all operations were finished"]
13434pub type RpcSessionTerminatedCallback =
13435 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
13436pub const RpcOwnerUnknown: RpcOwner = RpcOwner(0);
13437pub const RpcOwnerBle: RpcOwner = RpcOwner(1);
13438pub const RpcOwnerUsb: RpcOwner = RpcOwner(2);
13439pub const RpcOwnerUart: RpcOwner = RpcOwner(3);
13440pub const RpcOwnerCount: RpcOwner = RpcOwner(4);
13441#[repr(transparent)]
13442#[doc = "RPC owner"]
13443#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13444pub struct RpcOwner(pub core::ffi::c_uchar);
13445unsafe extern "C" {
13446 #[doc = "Get RPC session owner\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n # Returns\n\nsession owner"]
13447 pub fn rpc_session_get_owner(session: *mut RpcSession) -> RpcOwner;
13448}
13449unsafe extern "C" {
13450 #[doc = "Open RPC session\n\n USAGE:\n 1) rpc_session_open();\n 2) rpc_session_set_context();\n 3) rpc_session_set_send_bytes_callback();\n 4) rpc_session_set_close_callback();\n 5) while(1) {\n rpc_session_feed();\n }\n 6) rpc_session_close();\n\n\n # Arguments\n\n* `rpc` - instance\n * `owner` - owner of session\n # Returns\n\npointer to RpcSession descriptor, or\n NULL if RPC is busy and can't open session now"]
13451 pub fn rpc_session_open(rpc: *mut Rpc, owner: RpcOwner) -> *mut RpcSession;
13452}
13453unsafe extern "C" {
13454 #[doc = "Close RPC session\n It is guaranteed that no callbacks will be called\n as soon as session is closed. So no need in setting\n callbacks to NULL after session close.\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor"]
13455 pub fn rpc_session_close(session: *mut RpcSession);
13456}
13457unsafe extern "C" {
13458 #[doc = "Set session context for callbacks to pass\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n * `context` - context to pass to callbacks"]
13459 pub fn rpc_session_set_context(session: *mut RpcSession, context: *mut core::ffi::c_void);
13460}
13461unsafe extern "C" {
13462 #[doc = "Set callback to send bytes to client\n WARN: It's forbidden to call RPC API within RpcSendBytesCallback\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n * `callback` - callback to send bytes to client (can be NULL)"]
13463 pub fn rpc_session_set_send_bytes_callback(
13464 session: *mut RpcSession,
13465 callback: RpcSendBytesCallback,
13466 );
13467}
13468unsafe extern "C" {
13469 #[doc = "Set callback to notify that buffer is empty\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n * `callback` - callback to notify client that buffer is empty (can be NULL)\n * `context` - context to pass to callback"]
13470 pub fn rpc_session_set_buffer_is_empty_callback(
13471 session: *mut RpcSession,
13472 callback: RpcBufferIsEmptyCallback,
13473 );
13474}
13475unsafe extern "C" {
13476 #[doc = "Set callback to be called when RPC command to close session is received\n WARN: It's forbidden to call RPC API within RpcSessionClosedCallback\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n * `callback` - callback to inform about RPC close session command (can be NULL)"]
13477 pub fn rpc_session_set_close_callback(
13478 session: *mut RpcSession,
13479 callback: RpcSessionClosedCallback,
13480 );
13481}
13482unsafe extern "C" {
13483 #[doc = "Set callback to be called when RPC session is closed\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n * `callback` - callback to inform about RPC session state"]
13484 pub fn rpc_session_set_terminated_callback(
13485 session: *mut RpcSession,
13486 callback: RpcSessionTerminatedCallback,
13487 );
13488}
13489unsafe extern "C" {
13490 #[doc = "Give bytes to RPC service to decode them and perform command\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n * `buffer` - buffer to provide to RPC service\n * `size` - size of buffer\n * `timeout` - max timeout to wait till all buffer will be consumed\n\n # Returns\n\nactually consumed bytes"]
13491 pub fn rpc_session_feed(
13492 session: *mut RpcSession,
13493 buffer: *const u8,
13494 size: usize,
13495 timeout: u32,
13496 ) -> usize;
13497}
13498unsafe extern "C" {
13499 #[doc = "Get available size of RPC buffer\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n\n # Returns\n\nbytes available in buffer"]
13500 pub fn rpc_session_get_available_size(session: *mut RpcSession) -> usize;
13501}
13502pub const RpcAppSystemErrorCodeNone: RpcAppSystemErrorCode = RpcAppSystemErrorCode(0);
13503#[doc = "There are no errors"]
13504pub const RpcAppSystemErrorCodeParseFile: RpcAppSystemErrorCode = RpcAppSystemErrorCode(1);
13505#[doc = "File parsing error, or wrong file structure, or missing required parameters. more accurate data can be obtained through the debug port"]
13506pub const RpcAppSystemErrorCodeRegionLock: RpcAppSystemErrorCode = RpcAppSystemErrorCode(2);
13507#[doc = "Requested function is blocked by regional settings"]
13508pub const RpcAppSystemErrorCodeInternalParse: RpcAppSystemErrorCode = RpcAppSystemErrorCode(3);
13509#[repr(transparent)]
13510#[doc = "Enumeration of possible error codes for application which can be started through rpc"]
13511#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13512pub struct RpcAppSystemErrorCode(pub core::ffi::c_uchar);
13513#[doc = "< No data is provided by the event."]
13514pub const RpcAppSystemEventDataTypeNone: RpcAppSystemEventDataType = RpcAppSystemEventDataType(0);
13515#[doc = "< Event data contains a zero-terminated string."]
13516pub const RpcAppSystemEventDataTypeString: RpcAppSystemEventDataType = RpcAppSystemEventDataType(1);
13517#[doc = "< Event data contains a signed 32-bit integer."]
13518pub const RpcAppSystemEventDataTypeInt32: RpcAppSystemEventDataType = RpcAppSystemEventDataType(2);
13519#[doc = "< Event data contains zero or more bytes."]
13520pub const RpcAppSystemEventDataTypeBytes: RpcAppSystemEventDataType = RpcAppSystemEventDataType(3);
13521#[repr(transparent)]
13522#[doc = "Enumeration of possible event data types."]
13523#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13524pub struct RpcAppSystemEventDataType(pub core::ffi::c_uchar);
13525#[doc = "Event data structure, containing the type and associated data.\n\n All below fields except for type are valid only if the respective type is set."]
13526#[repr(C)]
13527#[derive(Copy, Clone)]
13528pub struct RpcAppSystemEventData {
13529 #[doc = "< Type of the data. The meaning of other fields depends on this one."]
13530 pub type_: RpcAppSystemEventDataType,
13531 pub __bindgen_anon_1: RpcAppSystemEventData__bindgen_ty_1,
13532}
13533#[repr(C)]
13534#[derive(Copy, Clone)]
13535pub union RpcAppSystemEventData__bindgen_ty_1 {
13536 #[doc = "< Pointer to a zero-terminated character string."]
13537 pub string: *const core::ffi::c_char,
13538 #[doc = "< Signed 32-bit integer value."]
13539 pub i32_: i32,
13540 #[doc = "< Byte array of arbitrary length."]
13541 pub bytes: RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1,
13542}
13543#[repr(C)]
13544#[derive(Debug, Copy, Clone)]
13545pub struct RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1 {
13546 #[doc = "< Pointer to the byte array data."]
13547 pub ptr: *const u8,
13548 #[doc = "< Size of the byte array, in bytes."]
13549 pub size: usize,
13550}
13551#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13552const _: () = {
13553 ["Size of RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1"]
13554 [::core::mem::size_of::<RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1>() - 8usize];
13555 ["Alignment of RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1"]
13556 [::core::mem::align_of::<RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1>() - 4usize];
13557 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1::ptr"]
13558 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1, ptr) - 0usize];
13559 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1::size"]
13560 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1, size) - 4usize];
13561};
13562#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13563const _: () = {
13564 ["Size of RpcAppSystemEventData__bindgen_ty_1"]
13565 [::core::mem::size_of::<RpcAppSystemEventData__bindgen_ty_1>() - 8usize];
13566 ["Alignment of RpcAppSystemEventData__bindgen_ty_1"]
13567 [::core::mem::align_of::<RpcAppSystemEventData__bindgen_ty_1>() - 4usize];
13568 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1::string"]
13569 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1, string) - 0usize];
13570 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1::i32_"]
13571 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1, i32_) - 0usize];
13572 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1::bytes"]
13573 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1, bytes) - 0usize];
13574};
13575#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13576const _: () = {
13577 ["Size of RpcAppSystemEventData"][::core::mem::size_of::<RpcAppSystemEventData>() - 12usize];
13578 ["Alignment of RpcAppSystemEventData"]
13579 [::core::mem::align_of::<RpcAppSystemEventData>() - 4usize];
13580 ["Offset of field: RpcAppSystemEventData::type_"]
13581 [::core::mem::offset_of!(RpcAppSystemEventData, type_) - 0usize];
13582};
13583#[doc = "Denotes an invalid state.\n\n An event of this type shall never be passed into the callback."]
13584pub const RpcAppEventTypeInvalid: RpcAppSystemEventType = RpcAppSystemEventType(0);
13585#[doc = "The client side has closed the session.\n\n After receiving this event, the RPC context is no more valid."]
13586pub const RpcAppEventTypeSessionClose: RpcAppSystemEventType = RpcAppSystemEventType(1);
13587#[doc = "The client has requested the application to exit.\n\n The application must exit after receiving this command."]
13588pub const RpcAppEventTypeAppExit: RpcAppSystemEventType = RpcAppSystemEventType(2);
13589#[doc = "The client has requested the application to load a file.\n\n This command's meaning is application-specific, i.e. the application might or\n might not require additional commands after loading a file to do anything useful."]
13590pub const RpcAppEventTypeLoadFile: RpcAppSystemEventType = RpcAppSystemEventType(3);
13591#[doc = "The client has informed the application that a button has been pressed.\n\n This command's meaning is application-specific, e.g. to select a part of the\n previously loaded file or to invoke a particular function within the application."]
13592pub const RpcAppEventTypeButtonPress: RpcAppSystemEventType = RpcAppSystemEventType(4);
13593#[doc = "The client has informed the application that a button has been released.\n\n This command's meaning is application-specific, e.g. to cease\n all activities to be conducted while a button is being pressed."]
13594pub const RpcAppEventTypeButtonRelease: RpcAppSystemEventType = RpcAppSystemEventType(5);
13595#[doc = "The client has informed the application that a button has been pressed and released.\n\n This command's meaning is application-specific, e.g. to perform an action\n once without repeating it."]
13596pub const RpcAppEventTypeButtonPressRelease: RpcAppSystemEventType = RpcAppSystemEventType(6);
13597#[doc = "The client has sent a byte array of arbitrary size.\n\n This command's purpose is bi-directional exchange of arbitrary raw data.\n Useful for implementing higher-level protocols while using the RPC as a transport layer."]
13598pub const RpcAppEventTypeDataExchange: RpcAppSystemEventType = RpcAppSystemEventType(7);
13599#[repr(transparent)]
13600#[doc = "Enumeration of possible event types."]
13601#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13602pub struct RpcAppSystemEventType(pub core::ffi::c_uchar);
13603#[doc = "RPC application subsystem event structure."]
13604#[repr(C)]
13605#[derive(Copy, Clone)]
13606pub struct RpcAppSystemEvent {
13607 #[doc = "< Type of the event."]
13608 pub type_: RpcAppSystemEventType,
13609 #[doc = "< Data associated with the event."]
13610 pub data: RpcAppSystemEventData,
13611}
13612#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13613const _: () = {
13614 ["Size of RpcAppSystemEvent"][::core::mem::size_of::<RpcAppSystemEvent>() - 16usize];
13615 ["Alignment of RpcAppSystemEvent"][::core::mem::align_of::<RpcAppSystemEvent>() - 4usize];
13616 ["Offset of field: RpcAppSystemEvent::type_"]
13617 [::core::mem::offset_of!(RpcAppSystemEvent, type_) - 0usize];
13618 ["Offset of field: RpcAppSystemEvent::data"]
13619 [::core::mem::offset_of!(RpcAppSystemEvent, data) - 4usize];
13620};
13621#[doc = "Callback function type.\n\n A function of this type must be passed to rpc_system_app_set_callback() by the user code.\n\n The event pointer is valid ONLY inside the callback function.\n\n # Arguments\n\n* `event` (direction in) - pointer to the event object. Valid only inside the callback function.\n * `context` (direction in, out) - pointer to the user-defined context object."]
13622pub type RpcAppSystemCallback = ::core::option::Option<
13623 unsafe extern "C" fn(event: *const RpcAppSystemEvent, context: *mut core::ffi::c_void),
13624>;
13625#[repr(C)]
13626#[derive(Debug, Copy, Clone)]
13627pub struct RpcAppSystem {
13628 _unused: [u8; 0],
13629}
13630unsafe extern "C" {
13631 #[doc = "Set the callback function for use by an RpcAppSystem instance.\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be configured.\n * `callback` (direction in) - pointer to the function to be called upon message reception.\n * `context` (direction in, out) - pointer to the user-defined context object. Will be passed to the callback."]
13632 pub fn rpc_system_app_set_callback(
13633 rpc_app: *mut RpcAppSystem,
13634 callback: RpcAppSystemCallback,
13635 context: *mut core::ffi::c_void,
13636 );
13637}
13638unsafe extern "C" {
13639 #[doc = "Send a notification that an RpcAppSystem instance has been started and is ready.\n\n Call this function once right after acquiring an RPC context and setting the callback.\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be used."]
13640 pub fn rpc_system_app_send_started(rpc_app: *mut RpcAppSystem);
13641}
13642unsafe extern "C" {
13643 #[doc = "Send a notification that the application using an RpcAppSystem instance is about to exit.\n\n Call this function when the application is about to exit (usually in the *_free() function).\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be used."]
13644 pub fn rpc_system_app_send_exited(rpc_app: *mut RpcAppSystem);
13645}
13646unsafe extern "C" {
13647 #[doc = "Send a confirmation that the application using an RpcAppSystem instance has handled the event.\n\n An explicit confirmation is required for the following event types:\n - RpcAppEventTypeAppExit\n - RpcAppEventTypeLoadFile\n - RpcAppEventTypeButtonPress\n - RpcAppEventTypeButtonRelease\n - RpcAppEventTypeButtonPressRelease\n - RpcAppEventTypeDataExchange\n\n Not confirming these events will result in a client-side timeout.\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be used.\n * `result` (direction in) - whether the command was successfully handled or not (true for success)."]
13648 pub fn rpc_system_app_confirm(rpc_app: *mut RpcAppSystem, result: bool);
13649}
13650unsafe extern "C" {
13651 #[doc = "Set the error code stored in an RpcAppSystem instance.\n\n The error code can be retrieved by the client at any time by using the GetError request.\n The error code value has no meaning within the subsystem, i.e. it is only passed through to the client.\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be modified.\n * `error_code` (direction in) - arbitrary error code to be set."]
13652 pub fn rpc_system_app_set_error_code(rpc_app: *mut RpcAppSystem, error_code: u32);
13653}
13654unsafe extern "C" {
13655 #[doc = "Set the error text stored in an RpcAppSystem instance.\n\n The error text can be retrieved by the client at any time by using the GetError request.\n The text has no meaning within the subsystem, i.e. it is only passed through to the client.\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be modified.\n * `error_text` (direction in) - Pointer to a zero-terminated string containing the error text."]
13656 pub fn rpc_system_app_set_error_text(
13657 rpc_app: *mut RpcAppSystem,
13658 error_text: *const core::ffi::c_char,
13659 );
13660}
13661unsafe extern "C" {
13662 #[doc = "Reset the error code and text stored in an RpcAppSystem instance.\n\n Resets the error code to 0 and error text to \"\" (empty string).\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be reset."]
13663 pub fn rpc_system_app_error_reset(rpc_app: *mut RpcAppSystem);
13664}
13665unsafe extern "C" {
13666 #[doc = "Send a byte array of arbitrary data to the client using an RpcAppSystem instance.\n\n # Arguments\n\n* `rpc_app` (direction in, out) - pointer to the instance to be used.\n * `data` (direction in) - pointer to the data buffer to be sent.\n * `data_size` (direction in) - size of the data buffer, in bytes."]
13667 pub fn rpc_system_app_exchange_data(
13668 rpc_app: *mut RpcAppSystem,
13669 data: *const u8,
13670 data_size: usize,
13671 );
13672}
13673pub const BitLibParityEven: BitLibParity = BitLibParity(0);
13674pub const BitLibParityOdd: BitLibParity = BitLibParity(1);
13675pub const BitLibParityAlways0: BitLibParity = BitLibParity(2);
13676pub const BitLibParityAlways1: BitLibParity = BitLibParity(3);
13677#[repr(transparent)]
13678#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13679pub struct BitLibParity(pub core::ffi::c_uchar);
13680unsafe extern "C" {
13681 #[doc = "Push a bit into a byte array.\n # Arguments\n\n* `data` - array to push bit into\n * `data_size` - array size\n * `bit` - bit to push"]
13682 pub fn bit_lib_push_bit(data: *mut u8, data_size: usize, bit: bool);
13683}
13684unsafe extern "C" {
13685 #[doc = "Set a bit in a byte array.\n # Arguments\n\n* `data` - array to set bit in\n * `position` - The position of the bit to set.\n * `bit` - bit value to set"]
13686 pub fn bit_lib_set_bit(data: *mut u8, position: usize, bit: bool);
13687}
13688unsafe extern "C" {
13689 #[doc = "Set the bit at the given position to the given value.\n # Arguments\n\n* `data` - The data to set the bit in.\n * `position` - The position of the bit to set.\n * `byte` - The data to set the bit to.\n * `length` - The length of the data."]
13690 pub fn bit_lib_set_bits(data: *mut u8, position: usize, byte: u8, length: u8);
13691}
13692unsafe extern "C" {
13693 #[doc = "Get the bit of a byte.\n # Arguments\n\n* `data` - The byte to get the bits from.\n * `position` - The position of the bit.\n # Returns\n\nThe bit."]
13694 pub fn bit_lib_get_bit(data: *const u8, position: usize) -> bool;
13695}
13696unsafe extern "C" {
13697 #[doc = "Get the bits of a data, as uint8_t.\n # Arguments\n\n* `data` - The data to get the bits from.\n * `position` - The position of the first bit.\n * `length` - The length of the bits.\n # Returns\n\nThe bits."]
13698 pub fn bit_lib_get_bits(data: *const u8, position: usize, length: u8) -> u8;
13699}
13700unsafe extern "C" {
13701 #[doc = "Get the bits of a data, as uint16_t.\n # Arguments\n\n* `data` - The data to get the bits from.\n * `position` - The position of the first bit.\n * `length` - The length of the bits.\n # Returns\n\nThe bits."]
13702 pub fn bit_lib_get_bits_16(data: *const u8, position: usize, length: u8) -> u16;
13703}
13704unsafe extern "C" {
13705 #[doc = "Get the bits of a data, as uint32_t.\n # Arguments\n\n* `data` - The data to get the bits from.\n * `position` - The position of the first bit.\n * `length` - The length of the bits.\n # Returns\n\nThe bits."]
13706 pub fn bit_lib_get_bits_32(data: *const u8, position: usize, length: u8) -> u32;
13707}
13708unsafe extern "C" {
13709 #[doc = "Get the bits of a data, as uint64_t.\n # Arguments\n\n* `data` - The data to get the bits from.\n * `position` - The position of the first bit.\n * `length` - The length of the bits.\n # Returns\n\nThe bits."]
13710 pub fn bit_lib_get_bits_64(data: *const u8, position: usize, length: u8) -> u64;
13711}
13712unsafe extern "C" {
13713 #[doc = "Test parity of given bits\n # Arguments\n\n* `bits` - Bits to test parity of\n * `parity` - Parity to test against\n # Returns\n\ntrue if parity is correct, false otherwise"]
13714 pub fn bit_lib_test_parity_32(bits: u32, parity: BitLibParity) -> bool;
13715}
13716unsafe extern "C" {
13717 #[doc = "Test parity of bit array, check parity for every parity_length block from start\n\n # Arguments\n\n* `data` - Bit array\n * `position` - Start position\n * `length` - Bit count\n * `parity` - Parity to test against\n * `parity_length` - Parity block length\n # Returns\n\ntrue\n false"]
13718 pub fn bit_lib_test_parity(
13719 data: *const u8,
13720 position: usize,
13721 length: u8,
13722 parity: BitLibParity,
13723 parity_length: u8,
13724 ) -> bool;
13725}
13726unsafe extern "C" {
13727 #[doc = "Add parity to bit array\n\n # Arguments\n\n* `data` - Source bit array\n * `position` - Start position\n * `dest` - Destination bit array\n * `dest_position` - Destination position\n * `source_length` - Source bit count\n * `parity_length` - Parity block length\n * `parity` - Parity to test against\n # Returns\n\nsize_t"]
13728 pub fn bit_lib_add_parity(
13729 data: *const u8,
13730 position: usize,
13731 dest: *mut u8,
13732 dest_position: usize,
13733 source_length: u8,
13734 parity_length: u8,
13735 parity: BitLibParity,
13736 ) -> usize;
13737}
13738unsafe extern "C" {
13739 #[doc = "Remove bit every n in array and shift array left. Useful to remove parity.\n\n # Arguments\n\n* `data` - Bit array\n * `position` - Start position\n * `length` - Bit count\n * `n` - every n bit will be removed\n # Returns\n\nsize_t"]
13740 pub fn bit_lib_remove_bit_every_nth(data: *mut u8, position: usize, length: u8, n: u8)
13741 -> usize;
13742}
13743unsafe extern "C" {
13744 #[doc = "Copy bits from source to destination.\n\n # Arguments\n\n* `data` - destination array\n * `position` - position in destination array\n * `length` - length of bits to copy\n * `source` - source array\n * `source_position` - position in source array"]
13745 pub fn bit_lib_copy_bits(
13746 data: *mut u8,
13747 position: usize,
13748 length: usize,
13749 source: *const u8,
13750 source_position: usize,
13751 );
13752}
13753unsafe extern "C" {
13754 #[doc = "Reverse bits in bit array\n\n # Arguments\n\n* `data` - Bit array\n * `position` - start position\n * `length` - length of bits to reverse"]
13755 pub fn bit_lib_reverse_bits(data: *mut u8, position: usize, length: u8);
13756}
13757unsafe extern "C" {
13758 #[doc = "Count 1 bits in data\n\n # Arguments\n\n* `data` -\n # Returns\n\nuint8_t set bit count"]
13759 pub fn bit_lib_get_bit_count(data: u32) -> u8;
13760}
13761unsafe extern "C" {
13762 #[doc = "Print data as bit array\n\n # Arguments\n\n* `data` -\n * `length` -"]
13763 pub fn bit_lib_print_bits(data: *const u8, length: usize);
13764}
13765#[repr(C)]
13766#[derive(Debug, Copy, Clone)]
13767pub struct BitLibRegion {
13768 pub mark: core::ffi::c_char,
13769 pub start: usize,
13770 pub length: usize,
13771}
13772#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13773const _: () = {
13774 ["Size of BitLibRegion"][::core::mem::size_of::<BitLibRegion>() - 12usize];
13775 ["Alignment of BitLibRegion"][::core::mem::align_of::<BitLibRegion>() - 4usize];
13776 ["Offset of field: BitLibRegion::mark"][::core::mem::offset_of!(BitLibRegion, mark) - 0usize];
13777 ["Offset of field: BitLibRegion::start"][::core::mem::offset_of!(BitLibRegion, start) - 4usize];
13778 ["Offset of field: BitLibRegion::length"]
13779 [::core::mem::offset_of!(BitLibRegion, length) - 8usize];
13780};
13781unsafe extern "C" {
13782 #[doc = "Print data as bit array and mark regions. Regions needs to be sorted by start position.\n\n # Arguments\n\n* `regions` -\n * `region_count` -\n * `data` -\n * `length` -"]
13783 pub fn bit_lib_print_regions(
13784 regions: *const BitLibRegion,
13785 region_count: usize,
13786 data: *const u8,
13787 length: usize,
13788 );
13789}
13790unsafe extern "C" {
13791 #[doc = "Reverse bits in uint16_t, faster than generic bit_lib_reverse_bits.\n\n # Arguments\n\n* `data` -\n # Returns\n\nuint16_t"]
13792 pub fn bit_lib_reverse_16_fast(data: u16) -> u16;
13793}
13794unsafe extern "C" {
13795 #[doc = "Reverse bits in uint8_t, faster than generic bit_lib_reverse_bits.\n\n # Arguments\n\n* `byte` - Byte\n # Returns\n\nuint8_t the reversed byte"]
13796 pub fn bit_lib_reverse_8_fast(byte: u8) -> u8;
13797}
13798unsafe extern "C" {
13799 #[doc = "Slow, but generic CRC8 implementation\n\n # Arguments\n\n* `data` -\n * `data_size` -\n * `polynom` - CRC polynom\n * `init` - init value\n * `ref_in` - true if the right bit is older\n * `ref_out` - true to reverse output\n * `xor_out` - xor output with this value\n # Returns\n\nuint8_t"]
13800 pub fn bit_lib_crc8(
13801 data: *const u8,
13802 data_size: usize,
13803 polynom: u8,
13804 init: u8,
13805 ref_in: bool,
13806 ref_out: bool,
13807 xor_out: u8,
13808 ) -> u16;
13809}
13810unsafe extern "C" {
13811 #[doc = "Slow, but generic CRC16 implementation\n\n # Arguments\n\n* `data` -\n * `data_size` -\n * `polynom` - CRC polynom\n * `init` - init value\n * `ref_in` - true if the right bit is older\n * `ref_out` - true to reverse output\n * `xor_out` - xor output with this value\n # Returns\n\nuint16_t"]
13812 pub fn bit_lib_crc16(
13813 data: *const u8,
13814 data_size: usize,
13815 polynom: u16,
13816 init: u16,
13817 ref_in: bool,
13818 ref_out: bool,
13819 xor_out: u16,
13820 ) -> u16;
13821}
13822unsafe extern "C" {
13823 #[doc = "Convert number to bytes in big endian order\n\n # Arguments\n\n* `src` - number to convert\n * `len` - max used bytes count\n * `dest` - destination\n # Returns\n\nvoid"]
13824 pub fn bit_lib_num_to_bytes_be(src: u64, len: u8, dest: *mut u8);
13825}
13826unsafe extern "C" {
13827 #[doc = "Convert number to bytes in little endian order\n\n # Arguments\n\n* `src` - number to convert\n * `len` - max used bytes count\n * `dest` - destination\n # Returns\n\nvoid"]
13828 pub fn bit_lib_num_to_bytes_le(src: u64, len: u8, dest: *mut u8);
13829}
13830unsafe extern "C" {
13831 #[doc = "Convert bytes to number in big endian order\n\n # Arguments\n\n* `src` - byte array\n * `len` - max used bytes count\n # Returns\n\nuint64_t"]
13832 pub fn bit_lib_bytes_to_num_be(src: *const u8, len: u8) -> u64;
13833}
13834unsafe extern "C" {
13835 #[doc = "Convert bytes to number in little endian order\n\n # Arguments\n\n* `src` - byte array\n * `len` - max used bytes count\n # Returns\n\nuint64_t"]
13836 pub fn bit_lib_bytes_to_num_le(src: *const u8, len: u8) -> u64;
13837}
13838unsafe extern "C" {
13839 #[doc = "Convert bytes in binary-coded decimal encoding to number\n\n # Arguments\n\n* `src` - byte array\n * `len` - max used bytes count\n * `is_bcd` - will be true if all processed bytes is BCD encoded (no A-F nibbles)\n # Returns\n\nuint64_t"]
13840 pub fn bit_lib_bytes_to_num_bcd(src: *const u8, len: u8, is_bcd: *mut bool) -> u64;
13841}
13842#[doc = "Optional arguments to pass along with profile template as\n FuriHalBleProfileParams for tuning profile behavior"]
13843#[repr(C)]
13844#[derive(Debug, Copy, Clone)]
13845pub struct BleProfileHidParams {
13846 #[doc = "< Prefix for device name. Length must be less than 8"]
13847 pub device_name_prefix: *const core::ffi::c_char,
13848 #[doc = "< XOR mask for device address, for uniqueness"]
13849 pub mac_xor: u16,
13850}
13851#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13852const _: () = {
13853 ["Size of BleProfileHidParams"][::core::mem::size_of::<BleProfileHidParams>() - 8usize];
13854 ["Alignment of BleProfileHidParams"][::core::mem::align_of::<BleProfileHidParams>() - 4usize];
13855 ["Offset of field: BleProfileHidParams::device_name_prefix"]
13856 [::core::mem::offset_of!(BleProfileHidParams, device_name_prefix) - 0usize];
13857 ["Offset of field: BleProfileHidParams::mac_xor"]
13858 [::core::mem::offset_of!(BleProfileHidParams, mac_xor) - 4usize];
13859};
13860#[repr(C)]
13861#[derive(Debug, Copy, Clone)]
13862pub struct BleServiceHid {
13863 _unused: [u8; 0],
13864}
13865#[repr(C)]
13866#[derive(Debug, Copy, Clone)]
13867pub struct DigitalSignal {
13868 _unused: [u8; 0],
13869}
13870unsafe extern "C" {
13871 #[doc = "Append one period to the end of the DigitalSignal instance.\n\n # Arguments\n\n* `signal` (direction in, out) - pointer to a the instance to append to.\n * `ticks` (direction in) - the period length, in 10 picosecond units."]
13872 pub fn digital_signal_add_period(signal: *mut DigitalSignal, ticks: u32);
13873}
13874unsafe extern "C" {
13875 #[doc = "Append one period to the end of the DigitalSignal instance, with the level specified.\n\n If the level is the same as the last level contained in the instance, then it is extened\n by the given ticks value. Otherwise, the behaviour is identical to digital_signal_add_period().\n\n Example 1: add tc with HIGH level\n ```\n before:\n ... ------+\n ta | tb\n +-------\n after:\n ... ------+ +-------\n ta | tb | tc\n +------+\n ```\n Example 2: add tc with LOW level\n ```\n before:\n ... ------+\n ta | tb\n +-------\n after:\n ... ------+\n ta | tb + tc\n +--------------\n ```\n\n # Arguments\n\n* `signal` (direction in, out) - pointer to the instance to append to.\n * `ticks` (direction in) - the period length, in 10 picosecond units.\n * `level` (direction in) - the level to be set during the period."]
13876 pub fn digital_signal_add_period_with_level(
13877 signal: *mut DigitalSignal,
13878 ticks: u32,
13879 level: bool,
13880 );
13881}
13882unsafe extern "C" {
13883 #[doc = "Get the current start level contained in the DigitalSignal instance.\n\n If not explicitly set with digital_signal_set_start_level(), it defaults to false.\n\n # Arguments\n\n* `signal` (direction in) - pointer to the instance to be queried.\n # Returns\n\nthe start level value."]
13884 pub fn digital_signal_get_start_level(signal: *const DigitalSignal) -> bool;
13885}
13886unsafe extern "C" {
13887 #[doc = "Set the start level contained in the DigitalSignal instance.\n\n # Arguments\n\n* `signal` (direction in, out) - pointer to the instance to be modified.\n * `level` (direction in) - signal level to be set as the start level."]
13888 pub fn digital_signal_set_start_level(signal: *mut DigitalSignal, level: bool);
13889}
13890unsafe extern "C" {
13891 #[doc = "Get the number of periods currently stored in a DigitalSignal instance.\n\n # Arguments\n\n* `signal` (direction in) - pointer to the instance to be queried.\n # Returns\n\nthe number of periods stored in the instance."]
13892 pub fn digital_signal_get_size(signal: *const DigitalSignal) -> u32;
13893}
13894#[repr(C)]
13895#[derive(Debug, Copy, Clone)]
13896pub struct DigitalSequence {
13897 _unused: [u8; 0],
13898}
13899unsafe extern "C" {
13900 #[doc = "Register a signal within a DigitalSequence instance by its index.\n\n This function must be called for each signal to be used in the sequence. The DigitalSequence\n instance does not own the signals, therefore, their lifetime must be no less than the instance's.\n\n The user is responsible for creation and deletion of DigitalSignal instances and\n also for keeping track of their respective indices.\n\n # Arguments\n\n* `sequence` (direction in, out) - pointer to the instance to be modified.\n * `signal_index` (direction in) - index to register the signal under (must be less than 32).\n * `signal` (direction in) - pointer to the DigitalSignal instance to be registered."]
13901 pub fn digital_sequence_register_signal(
13902 sequence: *mut DigitalSequence,
13903 signal_index: u8,
13904 signal: *const DigitalSignal,
13905 );
13906}
13907unsafe extern "C" {
13908 #[doc = "Append a signal index to a DigitalSequence instance.\n\n The signal under the index must be registered beforehand by calling digital_sequence_set_signal().\n\n # Arguments\n\n* `sequence` (direction in, out) - pointer to the instance to be modified.\n * `signal_index` (direction in) - signal index to be appended to the sequence (must be less than 32)."]
13909 pub fn digital_sequence_add_signal(sequence: *mut DigitalSequence, signal_index: u8);
13910}
13911unsafe extern "C" {
13912 #[doc = "Transmit the sequence contained in the DigitalSequence instance.\n\n Must contain at least one registered signal and one signal index.\n\n NOTE: The current implementation will properly initialise the GPIO provided during construction,\n but it is the caller's responsibility to reconfigure it back before reusing for other purposes.\n This is due to performance reasons.\n\n # Arguments\n\n* `sequence` (direction in) - pointer to the sequence to be transmitted."]
13913 pub fn digital_sequence_transmit(sequence: *mut DigitalSequence);
13914}
13915unsafe extern "C" {
13916 #[doc = "Read register\n\n # Arguments\n\n* `handle` - - pointer t FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `val` - - pointer to the variable to store the read value"]
13917 pub fn st25r3916_read_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: *mut u8);
13918}
13919unsafe extern "C" {
13920 #[doc = "Read multiple registers\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg_start` - - start register address\n * `values` - - pointer to the buffer to store the read values\n * `length` - - number of registers to read"]
13921 pub fn st25r3916_read_burst_regs(
13922 handle: *const FuriHalSpiBusHandle,
13923 reg_start: u8,
13924 values: *mut u8,
13925 length: u8,
13926 );
13927}
13928unsafe extern "C" {
13929 #[doc = "Write register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `val` - - value to write"]
13930 pub fn st25r3916_write_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: u8);
13931}
13932unsafe extern "C" {
13933 #[doc = "Write multiple registers\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg_start` - - start register address\n * `values` - - pointer to buffer to write\n * `length` - - number of registers to write"]
13934 pub fn st25r3916_write_burst_regs(
13935 handle: *const FuriHalSpiBusHandle,
13936 reg_start: u8,
13937 values: *const u8,
13938 length: u8,
13939 );
13940}
13941unsafe extern "C" {
13942 #[doc = "Write fifo register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `buff` - - buffer to write to FIFO\n * `length` - - number of bytes to write"]
13943 pub fn st25r3916_reg_write_fifo(
13944 handle: *const FuriHalSpiBusHandle,
13945 buff: *const u8,
13946 length: usize,
13947 );
13948}
13949unsafe extern "C" {
13950 #[doc = "Read fifo register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `buff` - - buffer to store the read values\n * `length` - - number of bytes to read"]
13951 pub fn st25r3916_reg_read_fifo(
13952 handle: *const FuriHalSpiBusHandle,
13953 buff: *mut u8,
13954 length: usize,
13955 );
13956}
13957unsafe extern "C" {
13958 #[doc = "Write PTA memory register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `values` - - pointer to buffer to write\n * `length` - - number of bytes to write"]
13959 pub fn st25r3916_write_pta_mem(
13960 handle: *const FuriHalSpiBusHandle,
13961 values: *const u8,
13962 length: usize,
13963 );
13964}
13965unsafe extern "C" {
13966 #[doc = "Read PTA memory register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `values` - - buffer to store the read values\n * `length` - - number of bytes to read"]
13967 pub fn st25r3916_read_pta_mem(
13968 handle: *const FuriHalSpiBusHandle,
13969 values: *mut u8,
13970 length: usize,
13971 );
13972}
13973unsafe extern "C" {
13974 #[doc = "Write PTF memory register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `values` - - pointer to buffer to write\n * `length` - - number of bytes to write"]
13975 pub fn st25r3916_write_ptf_mem(
13976 handle: *const FuriHalSpiBusHandle,
13977 values: *const u8,
13978 length: usize,
13979 );
13980}
13981unsafe extern "C" {
13982 #[doc = "Read PTTSN memory register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `values` - - pointer to buffer to write\n * `length` - - number of bytes to write"]
13983 pub fn st25r3916_write_pttsn_mem(
13984 handle: *const FuriHalSpiBusHandle,
13985 values: *mut u8,
13986 length: usize,
13987 );
13988}
13989unsafe extern "C" {
13990 #[doc = "Send Direct command\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `cmd` - - direct command"]
13991 pub fn st25r3916_direct_cmd(handle: *const FuriHalSpiBusHandle, cmd: u8);
13992}
13993unsafe extern "C" {
13994 #[doc = "Read test register\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `val` - - pointer to the variable to store the read value"]
13995 pub fn st25r3916_read_test_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: *mut u8);
13996}
13997unsafe extern "C" {
13998 #[doc = "Write test register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `val` - - value to write"]
13999 pub fn st25r3916_write_test_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: u8);
14000}
14001unsafe extern "C" {
14002 #[doc = "Clear register bits\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `clr_mask` - - bit mask to clear"]
14003 pub fn st25r3916_clear_reg_bits(handle: *const FuriHalSpiBusHandle, reg: u8, clr_mask: u8);
14004}
14005unsafe extern "C" {
14006 #[doc = "Set register bits\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `set_mask` - - bit mask to set"]
14007 pub fn st25r3916_set_reg_bits(handle: *const FuriHalSpiBusHandle, reg: u8, set_mask: u8);
14008}
14009unsafe extern "C" {
14010 #[doc = "Change register bits\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `mask` - - bit mask to change\n * `value` - - new register value to write"]
14011 pub fn st25r3916_change_reg_bits(
14012 handle: *const FuriHalSpiBusHandle,
14013 reg: u8,
14014 mask: u8,
14015 value: u8,
14016 );
14017}
14018unsafe extern "C" {
14019 #[doc = "Modify register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `clr_mask` - - bit mask to clear\n * `set_mask` - - bit mask to set"]
14020 pub fn st25r3916_modify_reg(
14021 handle: *const FuriHalSpiBusHandle,
14022 reg: u8,
14023 clr_mask: u8,
14024 set_mask: u8,
14025 );
14026}
14027unsafe extern "C" {
14028 #[doc = "Change test register bits\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `mask` - - bit mask to change\n * `value` - - new register value to write"]
14029 pub fn st25r3916_change_test_reg_bits(
14030 handle: *const FuriHalSpiBusHandle,
14031 reg: u8,
14032 mask: u8,
14033 value: u8,
14034 );
14035}
14036unsafe extern "C" {
14037 #[doc = "Check register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `mask` - - bit mask to check\n * `val` - - expected register value\n\n # Returns\n\ntrue if register value matches the expected value, false otherwise"]
14038 pub fn st25r3916_check_reg(
14039 handle: *const FuriHalSpiBusHandle,
14040 reg: u8,
14041 mask: u8,
14042 val: u8,
14043 ) -> bool;
14044}
14045unsafe extern "C" {
14046 #[doc = "Mask st25r3916 interrupts\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `mask` - - mask of interrupts to be disabled"]
14047 pub fn st25r3916_mask_irq(handle: *const FuriHalSpiBusHandle, mask: u32);
14048}
14049unsafe extern "C" {
14050 #[doc = "Get st25r3916 interrupts\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n\n # Returns\n\nreceived interrupts"]
14051 pub fn st25r3916_get_irq(handle: *const FuriHalSpiBusHandle) -> u32;
14052}
14053unsafe extern "C" {
14054 #[doc = "Write FIFO\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `buff` - - buffer to write to FIFO\n * `bits` - - number of bits to write"]
14055 pub fn st25r3916_write_fifo(handle: *const FuriHalSpiBusHandle, buff: *const u8, bits: usize);
14056}
14057unsafe extern "C" {
14058 #[doc = "Read FIFO\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `buff` - - buffer to read from FIFO\n * `buff_size` - - buffer size n bytes\n * `buff_bits` - - pointer to number of bits read\n\n # Returns\n\ntrue if read success, false otherwise"]
14059 pub fn st25r3916_read_fifo(
14060 handle: *const FuriHalSpiBusHandle,
14061 buff: *mut u8,
14062 buff_size: usize,
14063 buff_bits: *mut usize,
14064 ) -> bool;
14065}
14066unsafe extern "C" {
14067 #[doc = "Resolver for API entries using a pre-sorted table with hashes\n # Arguments\n\n* `interface` - pointer to HashtableApiInterface\n * `hash` - gnu hash of function name\n * `address` - output for function address\n # Returns\n\ntrue if the table contains a function"]
14068 pub fn elf_resolve_from_hashtable(
14069 interface: *const ElfApiInterface,
14070 hash: u32,
14071 address: *mut Elf32_Addr,
14072 ) -> bool;
14073}
14074unsafe extern "C" {
14075 pub fn elf_symbolname_hash(s: *const core::ffi::c_char) -> u32;
14076}
14077#[repr(C)]
14078#[derive(Debug, Copy, Clone)]
14079pub struct CompositeApiResolver {
14080 _unused: [u8; 0],
14081}
14082unsafe extern "C" {
14083 #[doc = "Allocate composite API resolver\n # Returns\n\nCompositeApiResolver* instance"]
14084 pub fn composite_api_resolver_alloc() -> *mut CompositeApiResolver;
14085}
14086unsafe extern "C" {
14087 #[doc = "Free composite API resolver\n # Arguments\n\n* `resolver` - Instance"]
14088 pub fn composite_api_resolver_free(resolver: *mut CompositeApiResolver);
14089}
14090unsafe extern "C" {
14091 #[doc = "Add API resolver to composite resolver\n # Arguments\n\n* `resolver` - Instance\n * `interface` - API resolver"]
14092 pub fn composite_api_resolver_add(
14093 resolver: *mut CompositeApiResolver,
14094 interface: *const ElfApiInterface,
14095 );
14096}
14097unsafe extern "C" {
14098 #[doc = "Get API interface from composite resolver\n # Arguments\n\n* `resolver` - Instance\n # Returns\n\nAPI interface"]
14099 pub fn composite_api_resolver_get(
14100 resolver: *mut CompositeApiResolver,
14101 ) -> *const ElfApiInterface;
14102}
14103#[repr(C)]
14104#[derive(Debug, Copy, Clone)]
14105pub struct PluginManager {
14106 _unused: [u8; 0],
14107}
14108pub const PluginManagerErrorNone: PluginManagerError = PluginManagerError(0);
14109pub const PluginManagerErrorLoaderError: PluginManagerError = PluginManagerError(1);
14110pub const PluginManagerErrorApplicationIdMismatch: PluginManagerError = PluginManagerError(2);
14111pub const PluginManagerErrorAPIVersionMismatch: PluginManagerError = PluginManagerError(3);
14112#[repr(transparent)]
14113#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14114pub struct PluginManagerError(pub core::ffi::c_uchar);
14115unsafe extern "C" {
14116 #[doc = "Allocates new PluginManager\n # Arguments\n\n* `application_id` - Application ID filter - only plugins with matching ID will be loaded\n * `api_version` - Application API version filter - only plugins with matching API version\n * `api_interface` - Application API interface - used to resolve plugins' API imports\n If plugin uses private application's API, use CompoundApiInterface\n # Returns\n\nnew PluginManager instance"]
14117 pub fn plugin_manager_alloc(
14118 application_id: *const core::ffi::c_char,
14119 api_version: u32,
14120 api_interface: *const ElfApiInterface,
14121 ) -> *mut PluginManager;
14122}
14123unsafe extern "C" {
14124 #[doc = "Frees PluginManager\n # Arguments\n\n* `manager` - PluginManager instance"]
14125 pub fn plugin_manager_free(manager: *mut PluginManager);
14126}
14127unsafe extern "C" {
14128 #[doc = "Loads single plugin by full path\n # Arguments\n\n* `manager` - PluginManager instance\n * `path` - Path to plugin\n # Returns\n\nError code"]
14129 pub fn plugin_manager_load_single(
14130 manager: *mut PluginManager,
14131 path: *const core::ffi::c_char,
14132 ) -> PluginManagerError;
14133}
14134unsafe extern "C" {
14135 #[doc = "Loads all plugins from specified directory\n # Arguments\n\n* `manager` - PluginManager instance\n * `path` - Path to directory\n # Returns\n\nError code"]
14136 pub fn plugin_manager_load_all(
14137 manager: *mut PluginManager,
14138 path: *const core::ffi::c_char,
14139 ) -> PluginManagerError;
14140}
14141unsafe extern "C" {
14142 #[doc = "Returns number of loaded plugins\n # Arguments\n\n* `manager` - PluginManager instance\n # Returns\n\nNumber of loaded plugins"]
14143 pub fn plugin_manager_get_count(manager: *mut PluginManager) -> u32;
14144}
14145unsafe extern "C" {
14146 #[doc = "Returns plugin descriptor by index\n # Arguments\n\n* `manager` - PluginManager instance\n * `index` - Plugin index\n # Returns\n\nPlugin descriptor"]
14147 pub fn plugin_manager_get(
14148 manager: *mut PluginManager,
14149 index: u32,
14150 ) -> *const FlipperAppPluginDescriptor;
14151}
14152unsafe extern "C" {
14153 #[doc = "Returns plugin entry point by index\n # Arguments\n\n* `manager` - PluginManager instance\n * `index` - Plugin index\n # Returns\n\nPlugin entry point"]
14154 pub fn plugin_manager_get_ep(
14155 manager: *mut PluginManager,
14156 index: u32,
14157 ) -> *const core::ffi::c_void;
14158}
14159#[repr(C)]
14160#[derive(Debug, Copy, Clone)]
14161pub struct FlipperFormat {
14162 _unused: [u8; 0],
14163}
14164pub const FlipperFormatOffsetFromCurrent: FlipperFormatOffset = FlipperFormatOffset(0);
14165pub const FlipperFormatOffsetFromStart: FlipperFormatOffset = FlipperFormatOffset(1);
14166pub const FlipperFormatOffsetFromEnd: FlipperFormatOffset = FlipperFormatOffset(2);
14167#[repr(transparent)]
14168#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14169pub struct FlipperFormatOffset(pub core::ffi::c_uchar);
14170unsafe extern "C" {
14171 #[doc = "Allocate FlipperFormat as string.\n\n # Returns\n\nFlipperFormat* pointer to a FlipperFormat instance"]
14172 pub fn flipper_format_string_alloc() -> *mut FlipperFormat;
14173}
14174unsafe extern "C" {
14175 #[doc = "Allocate FlipperFormat as file.\n\n # Arguments\n\n* `storage` - The storage\n\n # Returns\n\nFlipperFormat* pointer to a FlipperFormat instance"]
14176 pub fn flipper_format_file_alloc(storage: *mut Storage) -> *mut FlipperFormat;
14177}
14178unsafe extern "C" {
14179 #[doc = "Allocate FlipperFormat as file, buffered mode.\n\n # Arguments\n\n* `storage` - The storage\n\n # Returns\n\nFlipperFormat* pointer to a FlipperFormat instance"]
14180 pub fn flipper_format_buffered_file_alloc(storage: *mut Storage) -> *mut FlipperFormat;
14181}
14182unsafe extern "C" {
14183 #[doc = "Open existing file. Use only if FlipperFormat allocated as a file.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `path` - File path\n\n # Returns\n\nTrue on success"]
14184 pub fn flipper_format_file_open_existing(
14185 flipper_format: *mut FlipperFormat,
14186 path: *const core::ffi::c_char,
14187 ) -> bool;
14188}
14189unsafe extern "C" {
14190 #[doc = "Open existing file, buffered mode. Use only if FlipperFormat allocated as a\n buffered file.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `path` - File path\n\n # Returns\n\nTrue on success"]
14191 pub fn flipper_format_buffered_file_open_existing(
14192 flipper_format: *mut FlipperFormat,
14193 path: *const core::ffi::c_char,
14194 ) -> bool;
14195}
14196unsafe extern "C" {
14197 #[doc = "Open existing file for writing and add values to the end of file. Use only if\n FlipperFormat allocated as a file.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `path` - File path\n\n # Returns\n\nTrue on success"]
14198 pub fn flipper_format_file_open_append(
14199 flipper_format: *mut FlipperFormat,
14200 path: *const core::ffi::c_char,
14201 ) -> bool;
14202}
14203unsafe extern "C" {
14204 #[doc = "Open file. Creates a new file, or deletes the contents of the file if it\n already exists. Use only if FlipperFormat allocated as a file.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `path` - File path\n\n # Returns\n\nTrue on success"]
14205 pub fn flipper_format_file_open_always(
14206 flipper_format: *mut FlipperFormat,
14207 path: *const core::ffi::c_char,
14208 ) -> bool;
14209}
14210unsafe extern "C" {
14211 #[doc = "Open file. Creates a new file, or deletes the contents of the file if it\n already exists, buffered mode. Use only if FlipperFormat allocated as a\n buffered file.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `path` - File path\n\n # Returns\n\nTrue on success"]
14212 pub fn flipper_format_buffered_file_open_always(
14213 flipper_format: *mut FlipperFormat,
14214 path: *const core::ffi::c_char,
14215 ) -> bool;
14216}
14217unsafe extern "C" {
14218 #[doc = "Open file. Creates a new file, fails if file already exists. Use only if\n FlipperFormat allocated as a file.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `path` - File path\n\n # Returns\n\nTrue on success"]
14219 pub fn flipper_format_file_open_new(
14220 flipper_format: *mut FlipperFormat,
14221 path: *const core::ffi::c_char,
14222 ) -> bool;
14223}
14224unsafe extern "C" {
14225 #[doc = "Closes the file, use only if FlipperFormat allocated as a file.\n\n # Arguments\n\n* `flipper_format` - The flipper format\n\n # Returns\n\ntrue\n false"]
14226 pub fn flipper_format_file_close(flipper_format: *mut FlipperFormat) -> bool;
14227}
14228unsafe extern "C" {
14229 #[doc = "Closes the file, use only if FlipperFormat allocated as a buffered file.\n\n # Arguments\n\n* `flipper_format` - The flipper format\n\n # Returns\n\ntrue\n false"]
14230 pub fn flipper_format_buffered_file_close(flipper_format: *mut FlipperFormat) -> bool;
14231}
14232unsafe extern "C" {
14233 #[doc = "Free FlipperFormat.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance"]
14234 pub fn flipper_format_free(flipper_format: *mut FlipperFormat);
14235}
14236unsafe extern "C" {
14237 #[doc = "Set FlipperFormat mode.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `strict_mode` - True obligates not to skip valid fields. False by\n default."]
14238 pub fn flipper_format_set_strict_mode(flipper_format: *mut FlipperFormat, strict_mode: bool);
14239}
14240unsafe extern "C" {
14241 #[doc = "Rewind the RW pointer.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n\n # Returns\n\nTrue on success"]
14242 pub fn flipper_format_rewind(flipper_format: *mut FlipperFormat) -> bool;
14243}
14244unsafe extern "C" {
14245 #[doc = "Get the RW pointer position\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n\n # Returns\n\nRW pointer position"]
14246 pub fn flipper_format_tell(flipper_format: *mut FlipperFormat) -> usize;
14247}
14248unsafe extern "C" {
14249 #[doc = "Set the RW pointer position to an arbitrary value\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `offset` - Offset relative to the anchor point\n * `anchor` - Anchor point (e.g. start of file)\n\n # Returns\n\nTrue on success"]
14250 pub fn flipper_format_seek(
14251 flipper_format: *mut FlipperFormat,
14252 offset: i32,
14253 anchor: FlipperFormatOffset,
14254 ) -> bool;
14255}
14256unsafe extern "C" {
14257 #[doc = "Move the RW pointer at the end. Can be useful if you want to add some data\n after reading.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n\n # Returns\n\nTrue on success"]
14258 pub fn flipper_format_seek_to_end(flipper_format: *mut FlipperFormat) -> bool;
14259}
14260unsafe extern "C" {
14261 #[doc = "Check if the key exists.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n\n # Returns\n\ntrue key exists\n false key is not exists"]
14262 pub fn flipper_format_key_exist(
14263 flipper_format: *mut FlipperFormat,
14264 key: *const core::ffi::c_char,
14265 ) -> bool;
14266}
14267unsafe extern "C" {
14268 #[doc = "Read the header (file type and version).\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `filetype` - File type string\n * `version` - Version Value\n\n # Returns\n\nTrue on success"]
14269 pub fn flipper_format_read_header(
14270 flipper_format: *mut FlipperFormat,
14271 filetype: *mut FuriString,
14272 version: *mut u32,
14273 ) -> bool;
14274}
14275unsafe extern "C" {
14276 #[doc = "Write the header (file type and version).\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `filetype` - File type string\n * `version` - Version Value\n\n # Returns\n\nTrue on success"]
14277 pub fn flipper_format_write_header(
14278 flipper_format: *mut FlipperFormat,
14279 filetype: *mut FuriString,
14280 version: u32,
14281 ) -> bool;
14282}
14283unsafe extern "C" {
14284 #[doc = "Write the header (file type and version). Plain C string version.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `filetype` - File type string\n * `version` - Version Value\n\n # Returns\n\nTrue on success"]
14285 pub fn flipper_format_write_header_cstr(
14286 flipper_format: *mut FlipperFormat,
14287 filetype: *const core::ffi::c_char,
14288 version: u32,
14289 ) -> bool;
14290}
14291unsafe extern "C" {
14292 #[doc = "Get the count of values by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - The key\n * `count` - The count\n\n # Returns\n\nbool"]
14293 pub fn flipper_format_get_value_count(
14294 flipper_format: *mut FlipperFormat,
14295 key: *const core::ffi::c_char,
14296 count: *mut u32,
14297 ) -> bool;
14298}
14299unsafe extern "C" {
14300 #[doc = "Read a string by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14301 pub fn flipper_format_read_string(
14302 flipper_format: *mut FlipperFormat,
14303 key: *const core::ffi::c_char,
14304 data: *mut FuriString,
14305 ) -> bool;
14306}
14307unsafe extern "C" {
14308 #[doc = "Write key and string\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14309 pub fn flipper_format_write_string(
14310 flipper_format: *mut FlipperFormat,
14311 key: *const core::ffi::c_char,
14312 data: *mut FuriString,
14313 ) -> bool;
14314}
14315unsafe extern "C" {
14316 #[doc = "Write key and string. Plain C string version.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14317 pub fn flipper_format_write_string_cstr(
14318 flipper_format: *mut FlipperFormat,
14319 key: *const core::ffi::c_char,
14320 data: *const core::ffi::c_char,
14321 ) -> bool;
14322}
14323unsafe extern "C" {
14324 #[doc = "Read array of uint64 in hex format by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14325 pub fn flipper_format_read_hex_uint64(
14326 flipper_format: *mut FlipperFormat,
14327 key: *const core::ffi::c_char,
14328 data: *mut u64,
14329 data_size: u16,
14330 ) -> bool;
14331}
14332unsafe extern "C" {
14333 #[doc = "Write key and array of uint64 in hex format\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14334 pub fn flipper_format_write_hex_uint64(
14335 flipper_format: *mut FlipperFormat,
14336 key: *const core::ffi::c_char,
14337 data: *const u64,
14338 data_size: u16,
14339 ) -> bool;
14340}
14341unsafe extern "C" {
14342 #[doc = "Read array of uint32 by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14343 pub fn flipper_format_read_uint32(
14344 flipper_format: *mut FlipperFormat,
14345 key: *const core::ffi::c_char,
14346 data: *mut u32,
14347 data_size: u16,
14348 ) -> bool;
14349}
14350unsafe extern "C" {
14351 #[doc = "Write key and array of uint32\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14352 pub fn flipper_format_write_uint32(
14353 flipper_format: *mut FlipperFormat,
14354 key: *const core::ffi::c_char,
14355 data: *const u32,
14356 data_size: u16,
14357 ) -> bool;
14358}
14359unsafe extern "C" {
14360 #[doc = "Read array of int32 by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14361 pub fn flipper_format_read_int32(
14362 flipper_format: *mut FlipperFormat,
14363 key: *const core::ffi::c_char,
14364 data: *mut i32,
14365 data_size: u16,
14366 ) -> bool;
14367}
14368unsafe extern "C" {
14369 #[doc = "Write key and array of int32\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14370 pub fn flipper_format_write_int32(
14371 flipper_format: *mut FlipperFormat,
14372 key: *const core::ffi::c_char,
14373 data: *const i32,
14374 data_size: u16,
14375 ) -> bool;
14376}
14377unsafe extern "C" {
14378 #[doc = "Read array of bool by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14379 pub fn flipper_format_read_bool(
14380 flipper_format: *mut FlipperFormat,
14381 key: *const core::ffi::c_char,
14382 data: *mut bool,
14383 data_size: u16,
14384 ) -> bool;
14385}
14386unsafe extern "C" {
14387 #[doc = "Write key and array of bool\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14388 pub fn flipper_format_write_bool(
14389 flipper_format: *mut FlipperFormat,
14390 key: *const core::ffi::c_char,
14391 data: *const bool,
14392 data_size: u16,
14393 ) -> bool;
14394}
14395unsafe extern "C" {
14396 #[doc = "Read array of float by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14397 pub fn flipper_format_read_float(
14398 flipper_format: *mut FlipperFormat,
14399 key: *const core::ffi::c_char,
14400 data: *mut f32,
14401 data_size: u16,
14402 ) -> bool;
14403}
14404unsafe extern "C" {
14405 #[doc = "Write key and array of float\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14406 pub fn flipper_format_write_float(
14407 flipper_format: *mut FlipperFormat,
14408 key: *const core::ffi::c_char,
14409 data: *const f32,
14410 data_size: u16,
14411 ) -> bool;
14412}
14413unsafe extern "C" {
14414 #[doc = "Read array of hex-formatted bytes by key\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14415 pub fn flipper_format_read_hex(
14416 flipper_format: *mut FlipperFormat,
14417 key: *const core::ffi::c_char,
14418 data: *mut u8,
14419 data_size: u16,
14420 ) -> bool;
14421}
14422unsafe extern "C" {
14423 #[doc = "Write key and array of hex-formatted bytes\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` - Values count\n\n # Returns\n\nTrue on success"]
14424 pub fn flipper_format_write_hex(
14425 flipper_format: *mut FlipperFormat,
14426 key: *const core::ffi::c_char,
14427 data: *const u8,
14428 data_size: u16,
14429 ) -> bool;
14430}
14431unsafe extern "C" {
14432 #[doc = "Write comment\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `data` - Comment text\n\n # Returns\n\nTrue on success"]
14433 pub fn flipper_format_write_comment(
14434 flipper_format: *mut FlipperFormat,
14435 data: *mut FuriString,
14436 ) -> bool;
14437}
14438unsafe extern "C" {
14439 #[doc = "Write comment. Plain C string version.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `data` - Comment text\n\n # Returns\n\nTrue on success"]
14440 pub fn flipper_format_write_comment_cstr(
14441 flipper_format: *mut FlipperFormat,
14442 data: *const core::ffi::c_char,
14443 ) -> bool;
14444}
14445unsafe extern "C" {
14446 #[doc = "Write empty line (Improves readability for human based parsing)\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n\n # Returns\n\nTrue on success"]
14447 pub fn flipper_format_write_empty_line(flipper_format: *mut FlipperFormat) -> bool;
14448}
14449unsafe extern "C" {
14450 #[doc = "Removes the first matching key and its value. Sets the RW pointer to a\n position of deleted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n\n # Returns\n\nTrue on success"]
14451 pub fn flipper_format_delete_key(
14452 flipper_format: *mut FlipperFormat,
14453 key: *const core::ffi::c_char,
14454 ) -> bool;
14455}
14456unsafe extern "C" {
14457 #[doc = "Updates the value of the first matching key to a string value. Sets the RW\n pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14458 pub fn flipper_format_update_string(
14459 flipper_format: *mut FlipperFormat,
14460 key: *const core::ffi::c_char,
14461 data: *mut FuriString,
14462 ) -> bool;
14463}
14464unsafe extern "C" {
14465 #[doc = "Updates the value of the first matching key to a string value. Plain C\n version. Sets the RW pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14466 pub fn flipper_format_update_string_cstr(
14467 flipper_format: *mut FlipperFormat,
14468 key: *const core::ffi::c_char,
14469 data: *const core::ffi::c_char,
14470 ) -> bool;
14471}
14472unsafe extern "C" {
14473 #[doc = "Updates the value of the first matching key to a uint32 array value. Sets the\n RW pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14474 pub fn flipper_format_update_uint32(
14475 flipper_format: *mut FlipperFormat,
14476 key: *const core::ffi::c_char,
14477 data: *const u32,
14478 data_size: u16,
14479 ) -> bool;
14480}
14481unsafe extern "C" {
14482 #[doc = "Updates the value of the first matching key to a int32 array value. Sets the\n RW pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14483 pub fn flipper_format_update_int32(
14484 flipper_format: *mut FlipperFormat,
14485 key: *const core::ffi::c_char,
14486 data: *const i32,
14487 data_size: u16,
14488 ) -> bool;
14489}
14490unsafe extern "C" {
14491 #[doc = "Updates the value of the first matching key to a bool array value. Sets the\n RW pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14492 pub fn flipper_format_update_bool(
14493 flipper_format: *mut FlipperFormat,
14494 key: *const core::ffi::c_char,
14495 data: *const bool,
14496 data_size: u16,
14497 ) -> bool;
14498}
14499unsafe extern "C" {
14500 #[doc = "Updates the value of the first matching key to a float array value. Sets the\n RW pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14501 pub fn flipper_format_update_float(
14502 flipper_format: *mut FlipperFormat,
14503 key: *const core::ffi::c_char,
14504 data: *const f32,
14505 data_size: u16,
14506 ) -> bool;
14507}
14508unsafe extern "C" {
14509 #[doc = "Updates the value of the first matching key to an array of hex-formatted\n bytes. Sets the RW pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14510 pub fn flipper_format_update_hex(
14511 flipper_format: *mut FlipperFormat,
14512 key: *const core::ffi::c_char,
14513 data: *const u8,
14514 data_size: u16,
14515 ) -> bool;
14516}
14517unsafe extern "C" {
14518 #[doc = "Updates the value of the first matching key to a string value, or adds the\n key and value if the key did not exist. Sets the RW pointer to a position at\n the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14519 pub fn flipper_format_insert_or_update_string(
14520 flipper_format: *mut FlipperFormat,
14521 key: *const core::ffi::c_char,
14522 data: *mut FuriString,
14523 ) -> bool;
14524}
14525unsafe extern "C" {
14526 #[doc = "Updates the value of the first matching key to a string value, or adds the\n key and value if the key did not exist. Plain C version. Sets the RW pointer\n to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n\n # Returns\n\nTrue on success"]
14527 pub fn flipper_format_insert_or_update_string_cstr(
14528 flipper_format: *mut FlipperFormat,
14529 key: *const core::ffi::c_char,
14530 data: *const core::ffi::c_char,
14531 ) -> bool;
14532}
14533unsafe extern "C" {
14534 #[doc = "Updates the value of the first matching key to a uint32 array value, or adds\n the key and value if the key did not exist. Sets the RW pointer to a position\n at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14535 pub fn flipper_format_insert_or_update_uint32(
14536 flipper_format: *mut FlipperFormat,
14537 key: *const core::ffi::c_char,
14538 data: *const u32,
14539 data_size: u16,
14540 ) -> bool;
14541}
14542unsafe extern "C" {
14543 #[doc = "Updates the value of the first matching key to a int32 array value, or adds\n the key and value if the key did not exist. Sets the RW pointer to a position\n at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14544 pub fn flipper_format_insert_or_update_int32(
14545 flipper_format: *mut FlipperFormat,
14546 key: *const core::ffi::c_char,
14547 data: *const i32,
14548 data_size: u16,
14549 ) -> bool;
14550}
14551unsafe extern "C" {
14552 #[doc = "Updates the value of the first matching key to a bool array value, or adds\n the key and value if the key did not exist. Sets the RW pointer to a position\n at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14553 pub fn flipper_format_insert_or_update_bool(
14554 flipper_format: *mut FlipperFormat,
14555 key: *const core::ffi::c_char,
14556 data: *const bool,
14557 data_size: u16,
14558 ) -> bool;
14559}
14560unsafe extern "C" {
14561 #[doc = "Updates the value of the first matching key to a float array value, or adds\n the key and value if the key did not exist. Sets the RW pointer to a position\n at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14562 pub fn flipper_format_insert_or_update_float(
14563 flipper_format: *mut FlipperFormat,
14564 key: *const core::ffi::c_char,
14565 data: *const f32,
14566 data_size: u16,
14567 ) -> bool;
14568}
14569unsafe extern "C" {
14570 #[doc = "Updates the value of the first matching key to an array of hex-formatted\n bytes, or adds the key and value if the key did not exist. Sets the RW\n pointer to a position at the end of inserted data.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `key` - Key\n * `data` - Value\n * `data_size` (direction in) - The data size\n\n # Returns\n\nTrue on success"]
14571 pub fn flipper_format_insert_or_update_hex(
14572 flipper_format: *mut FlipperFormat,
14573 key: *const core::ffi::c_char,
14574 data: *const u8,
14575 data_size: u16,
14576 ) -> bool;
14577}
14578#[repr(C)]
14579#[derive(Debug, Copy, Clone)]
14580pub struct Stream {
14581 _unused: [u8; 0],
14582}
14583pub const StreamOffsetFromCurrent: StreamOffset = StreamOffset(0);
14584pub const StreamOffsetFromStart: StreamOffset = StreamOffset(1);
14585pub const StreamOffsetFromEnd: StreamOffset = StreamOffset(2);
14586#[repr(transparent)]
14587#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14588pub struct StreamOffset(pub core::ffi::c_uchar);
14589pub const StreamDirectionForward: StreamDirection = StreamDirection(0);
14590pub const StreamDirectionBackward: StreamDirection = StreamDirection(1);
14591#[repr(transparent)]
14592#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14593pub struct StreamDirection(pub core::ffi::c_uchar);
14594pub type StreamWriteCB = ::core::option::Option<
14595 unsafe extern "C" fn(stream: *mut Stream, context: *const core::ffi::c_void) -> bool,
14596>;
14597unsafe extern "C" {
14598 #[doc = "Free Stream\n # Arguments\n\n* `stream` - Stream instance"]
14599 pub fn stream_free(stream: *mut Stream);
14600}
14601unsafe extern "C" {
14602 #[doc = "Clean (empty) Stream\n # Arguments\n\n* `stream` - Stream instance"]
14603 pub fn stream_clean(stream: *mut Stream);
14604}
14605unsafe extern "C" {
14606 #[doc = "Indicates that the RW pointer is at the end of the stream\n # Arguments\n\n* `stream` - Stream instance\n # Returns\n\ntrue if RW pointer is at the end of the stream\n false if RW pointer is not at the end of the stream"]
14607 pub fn stream_eof(stream: *mut Stream) -> bool;
14608}
14609unsafe extern "C" {
14610 #[doc = "Moves the RW pointer.\n # Arguments\n\n* `stream` - Stream instance\n * `offset` - how much to move the pointer\n * `offset_type` - starting from what\n # Returns\n\ntrue\n false"]
14611 pub fn stream_seek(stream: *mut Stream, offset: i32, offset_type: StreamOffset) -> bool;
14612}
14613unsafe extern "C" {
14614 #[doc = "Seek to next occurrence of the character\n\n # Arguments\n\n* `stream` - Pointer to the stream instance\n * `c` (direction in) - The Character\n * `direction` (direction in) - The Direction\n\n # Returns\n\ntrue on success"]
14615 pub fn stream_seek_to_char(
14616 stream: *mut Stream,
14617 c: core::ffi::c_char,
14618 direction: StreamDirection,
14619 ) -> bool;
14620}
14621unsafe extern "C" {
14622 #[doc = "Gets the value of the RW pointer\n # Arguments\n\n* `stream` - Stream instance\n # Returns\n\nsize_t value of the RW pointer"]
14623 pub fn stream_tell(stream: *mut Stream) -> usize;
14624}
14625unsafe extern "C" {
14626 #[doc = "Gets the size of the stream\n # Arguments\n\n* `stream` - Stream instance\n # Returns\n\nsize_t size of the stream"]
14627 pub fn stream_size(stream: *mut Stream) -> usize;
14628}
14629unsafe extern "C" {
14630 #[doc = "Write N bytes to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `data` - data to write\n * `size` - size of data to be written\n # Returns\n\nsize_t how many bytes was written"]
14631 pub fn stream_write(stream: *mut Stream, data: *const u8, size: usize) -> usize;
14632}
14633unsafe extern "C" {
14634 #[doc = "Read N bytes from stream\n # Arguments\n\n* `stream` - Stream instance\n * `data` - data to be read\n * `count` - size of data to be read\n # Returns\n\nsize_t how many bytes was read"]
14635 pub fn stream_read(stream: *mut Stream, data: *mut u8, count: usize) -> usize;
14636}
14637unsafe extern "C" {
14638 #[doc = "Delete N chars from the stream and write data by calling write_callback(context)\n # Arguments\n\n* `stream` - Stream instance\n * `delete_size` - size of data to be deleted\n * `write_callback` - write callback\n * `context` - write callback context\n # Returns\n\ntrue if the operation was successful\n false on error"]
14639 pub fn stream_delete_and_insert(
14640 stream: *mut Stream,
14641 delete_size: usize,
14642 write_callback: StreamWriteCB,
14643 context: *const core::ffi::c_void,
14644 ) -> bool;
14645}
14646unsafe extern "C" {
14647 #[doc = "Read line from a stream (supports LF and CRLF line endings)\n # Arguments\n\n* `stream` -\n * `str_result` -\n # Returns\n\ntrue if line length is not zero\n false otherwise"]
14648 pub fn stream_read_line(stream: *mut Stream, str_result: *mut FuriString) -> bool;
14649}
14650unsafe extern "C" {
14651 #[doc = "Moves the RW pointer to the start\n # Arguments\n\n* `stream` - Stream instance"]
14652 pub fn stream_rewind(stream: *mut Stream) -> bool;
14653}
14654unsafe extern "C" {
14655 #[doc = "Write char to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `c` - char value\n # Returns\n\nsize_t how many bytes was written"]
14656 pub fn stream_write_char(stream: *mut Stream, c: core::ffi::c_char) -> usize;
14657}
14658unsafe extern "C" {
14659 #[doc = "Write string to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `string` - string value\n # Returns\n\nsize_t how many bytes was written"]
14660 pub fn stream_write_string(stream: *mut Stream, string: *mut FuriString) -> usize;
14661}
14662unsafe extern "C" {
14663 #[doc = "Write const char* to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `string` - c-string value\n # Returns\n\nsize_t how many bytes was written"]
14664 pub fn stream_write_cstring(stream: *mut Stream, string: *const core::ffi::c_char) -> usize;
14665}
14666unsafe extern "C" {
14667 #[doc = "Write formatted string to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `format` -\n * `...` -\n # Returns\n\nsize_t how many bytes was written"]
14668 pub fn stream_write_format(stream: *mut Stream, format: *const core::ffi::c_char, ...)
14669 -> usize;
14670}
14671unsafe extern "C" {
14672 #[doc = "Write formatted string to the stream, va_list version\n # Arguments\n\n* `stream` - Stream instance\n * `format` -\n * `args` -\n # Returns\n\nsize_t how many bytes was written"]
14673 pub fn stream_write_vaformat(
14674 stream: *mut Stream,
14675 format: *const core::ffi::c_char,
14676 args: va_list,
14677 ) -> usize;
14678}
14679unsafe extern "C" {
14680 #[doc = "Insert N chars to the stream, starting at the current pointer.\n Data will be inserted, not overwritten, so the stream will be increased in size.\n # Arguments\n\n* `stream` - Stream instance\n * `data` - data to be inserted\n * `size` - size of data to be inserted\n # Returns\n\ntrue if the operation was successful\n false on error"]
14681 pub fn stream_insert(stream: *mut Stream, data: *const u8, size: usize) -> bool;
14682}
14683unsafe extern "C" {
14684 #[doc = "Insert char to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `c` - char value\n # Returns\n\ntrue if the operation was successful\n false on error"]
14685 pub fn stream_insert_char(stream: *mut Stream, c: core::ffi::c_char) -> bool;
14686}
14687unsafe extern "C" {
14688 #[doc = "Insert string to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `string` - string value\n # Returns\n\ntrue if the operation was successful\n false on error"]
14689 pub fn stream_insert_string(stream: *mut Stream, string: *mut FuriString) -> bool;
14690}
14691unsafe extern "C" {
14692 #[doc = "Insert const char* to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `string` - c-string value\n # Returns\n\ntrue if the operation was successful\n false on error"]
14693 pub fn stream_insert_cstring(stream: *mut Stream, string: *const core::ffi::c_char) -> bool;
14694}
14695unsafe extern "C" {
14696 #[doc = "Insert formatted string to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `format` -\n * `...` -\n # Returns\n\ntrue if the operation was successful\n false on error"]
14697 pub fn stream_insert_format(stream: *mut Stream, format: *const core::ffi::c_char, ...)
14698 -> bool;
14699}
14700unsafe extern "C" {
14701 #[doc = "Insert formatted string to the stream, va_list version\n # Arguments\n\n* `stream` - Stream instance\n * `format` -\n * `args` -\n # Returns\n\ntrue if the operation was successful\n false on error"]
14702 pub fn stream_insert_vaformat(
14703 stream: *mut Stream,
14704 format: *const core::ffi::c_char,
14705 args: va_list,
14706 ) -> bool;
14707}
14708unsafe extern "C" {
14709 #[doc = "Delete N chars from the stream and insert char to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `delete_size` - size of data to be deleted\n * `c` - char value\n # Returns\n\ntrue if the operation was successful\n false on error"]
14710 pub fn stream_delete_and_insert_char(
14711 stream: *mut Stream,
14712 delete_size: usize,
14713 c: core::ffi::c_char,
14714 ) -> bool;
14715}
14716unsafe extern "C" {
14717 #[doc = "Delete N chars from the stream and insert string to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `delete_size` - size of data to be deleted\n * `string` - string value\n # Returns\n\ntrue if the operation was successful\n false on error"]
14718 pub fn stream_delete_and_insert_string(
14719 stream: *mut Stream,
14720 delete_size: usize,
14721 string: *mut FuriString,
14722 ) -> bool;
14723}
14724unsafe extern "C" {
14725 #[doc = "Delete N chars from the stream and insert const char* to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `delete_size` - size of data to be deleted\n * `string` - c-string value\n # Returns\n\ntrue if the operation was successful\n false on error"]
14726 pub fn stream_delete_and_insert_cstring(
14727 stream: *mut Stream,
14728 delete_size: usize,
14729 string: *const core::ffi::c_char,
14730 ) -> bool;
14731}
14732unsafe extern "C" {
14733 #[doc = "Delete N chars from the stream and insert formatted string to the stream\n # Arguments\n\n* `stream` - Stream instance\n * `delete_size` - size of data to be deleted\n * `format` -\n * `...` -\n # Returns\n\ntrue if the operation was successful\n false on error"]
14734 pub fn stream_delete_and_insert_format(
14735 stream: *mut Stream,
14736 delete_size: usize,
14737 format: *const core::ffi::c_char,
14738 ...
14739 ) -> bool;
14740}
14741unsafe extern "C" {
14742 #[doc = "Delete N chars from the stream and insert formatted string to the stream, va_list version\n # Arguments\n\n* `stream` - Stream instance\n * `delete_size` - size of data to be deleted\n * `format` -\n * `args` -\n # Returns\n\ntrue if the operation was successful\n false on error"]
14743 pub fn stream_delete_and_insert_vaformat(
14744 stream: *mut Stream,
14745 delete_size: usize,
14746 format: *const core::ffi::c_char,
14747 args: va_list,
14748 ) -> bool;
14749}
14750unsafe extern "C" {
14751 #[doc = "Remove N chars from the stream, starting at the current pointer.\n The size may be larger than stream size, the stream will be cleared from current RW pointer to the end.\n # Arguments\n\n* `stream` - Stream instance\n * `size` - how many chars need to be deleted\n # Returns\n\ntrue if the operation was successful\n false on error"]
14752 pub fn stream_delete(stream: *mut Stream, size: usize) -> bool;
14753}
14754unsafe extern "C" {
14755 #[doc = "Copy data from one stream to another. Data will be copied from current RW pointer and to current RW pointer.\n # Arguments\n\n* `stream_from` -\n * `stream_to` -\n * `size` -\n # Returns\n\nsize_t"]
14756 pub fn stream_copy(stream_from: *mut Stream, stream_to: *mut Stream, size: usize) -> usize;
14757}
14758unsafe extern "C" {
14759 #[doc = "Copy data from one stream to another. Data will be copied from start of one stream and to start of other stream.\n # Arguments\n\n* `stream_from` -\n * `stream_to` -\n # Returns\n\nsize_t"]
14760 pub fn stream_copy_full(stream_from: *mut Stream, stream_to: *mut Stream) -> usize;
14761}
14762unsafe extern "C" {
14763 #[doc = "Splits one stream into two others. The original stream will remain untouched.\n # Arguments\n\n* `stream` -\n * `stream_left` -\n * `stream_right` -\n # Returns\n\ntrue\n false"]
14764 pub fn stream_split(
14765 stream: *mut Stream,
14766 stream_left: *mut Stream,
14767 stream_right: *mut Stream,
14768 ) -> bool;
14769}
14770unsafe extern "C" {
14771 #[doc = "Loads data to the stream from a file. Data will be loaded to the current RW pointer. RW pointer will be moved to the end of the stream.\n # Arguments\n\n* `stream` - Stream instance\n * `storage` -\n * `path` -\n # Returns\n\nsize_t"]
14772 pub fn stream_load_from_file(
14773 stream: *mut Stream,
14774 storage: *mut Storage,
14775 path: *const core::ffi::c_char,
14776 ) -> usize;
14777}
14778unsafe extern "C" {
14779 #[doc = "Writes data from a stream to a file. Data will be saved starting from the current RW pointer. RW pointer will be moved to the end of the stream.\n # Arguments\n\n* `stream` - Stream instance\n * `storage` -\n * `path` -\n * `mode` -\n # Returns\n\nsize_t"]
14780 pub fn stream_save_to_file(
14781 stream: *mut Stream,
14782 storage: *mut Storage,
14783 path: *const core::ffi::c_char,
14784 mode: FS_OpenMode,
14785 ) -> usize;
14786}
14787unsafe extern "C" {
14788 #[doc = "Dump stream inner data (size, RW position, content)\n # Arguments\n\n* `stream` - Stream instance"]
14789 pub fn stream_dump_data(stream: *mut Stream);
14790}
14791unsafe extern "C" {
14792 #[doc = "Returns the underlying stream instance.\n Use only if you know what you are doing.\n # Arguments\n\n* `flipper_format` -\n # Returns\n\nStream*"]
14793 pub fn flipper_format_get_raw_stream(flipper_format: *mut FlipperFormat) -> *mut Stream;
14794}
14795pub const FlipperStreamValueIgnore: FlipperStreamValue = FlipperStreamValue(0);
14796pub const FlipperStreamValueStr: FlipperStreamValue = FlipperStreamValue(1);
14797pub const FlipperStreamValueHex: FlipperStreamValue = FlipperStreamValue(2);
14798pub const FlipperStreamValueFloat: FlipperStreamValue = FlipperStreamValue(3);
14799pub const FlipperStreamValueInt32: FlipperStreamValue = FlipperStreamValue(4);
14800pub const FlipperStreamValueUint32: FlipperStreamValue = FlipperStreamValue(5);
14801pub const FlipperStreamValueHexUint64: FlipperStreamValue = FlipperStreamValue(6);
14802pub const FlipperStreamValueBool: FlipperStreamValue = FlipperStreamValue(7);
14803#[repr(transparent)]
14804#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14805pub struct FlipperStreamValue(pub core::ffi::c_uchar);
14806#[repr(C)]
14807#[derive(Debug, Copy, Clone)]
14808pub struct FlipperStreamWriteData {
14809 pub key: *const core::ffi::c_char,
14810 pub type_: FlipperStreamValue,
14811 pub data: *const core::ffi::c_void,
14812 pub data_size: usize,
14813}
14814#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14815const _: () = {
14816 ["Size of FlipperStreamWriteData"][::core::mem::size_of::<FlipperStreamWriteData>() - 16usize];
14817 ["Alignment of FlipperStreamWriteData"]
14818 [::core::mem::align_of::<FlipperStreamWriteData>() - 4usize];
14819 ["Offset of field: FlipperStreamWriteData::key"]
14820 [::core::mem::offset_of!(FlipperStreamWriteData, key) - 0usize];
14821 ["Offset of field: FlipperStreamWriteData::type_"]
14822 [::core::mem::offset_of!(FlipperStreamWriteData, type_) - 4usize];
14823 ["Offset of field: FlipperStreamWriteData::data"]
14824 [::core::mem::offset_of!(FlipperStreamWriteData, data) - 8usize];
14825 ["Offset of field: FlipperStreamWriteData::data_size"]
14826 [::core::mem::offset_of!(FlipperStreamWriteData, data_size) - 12usize];
14827};
14828unsafe extern "C" {
14829 #[doc = "Writes a key/value pair to the stream.\n # Arguments\n\n* `stream` -\n * `write_data` -\n # Returns\n\ntrue\n false"]
14830 pub fn flipper_format_stream_write_value_line(
14831 stream: *mut Stream,
14832 write_data: *mut FlipperStreamWriteData,
14833 ) -> bool;
14834}
14835unsafe extern "C" {
14836 #[doc = "Reads a value by key from a stream.\n # Arguments\n\n* `stream` -\n * `key` -\n * `type` -\n * `_data` -\n * `data_size` -\n * `strict_mode` -\n # Returns\n\ntrue\n false"]
14837 pub fn flipper_format_stream_read_value_line(
14838 stream: *mut Stream,
14839 key: *const core::ffi::c_char,
14840 type_: FlipperStreamValue,
14841 _data: *mut core::ffi::c_void,
14842 data_size: usize,
14843 strict_mode: bool,
14844 ) -> bool;
14845}
14846unsafe extern "C" {
14847 #[doc = "Get the count of values by key from a stream.\n # Arguments\n\n* `stream` -\n * `key` -\n * `count` -\n * `strict_mode` -\n # Returns\n\ntrue\n false"]
14848 pub fn flipper_format_stream_get_value_count(
14849 stream: *mut Stream,
14850 key: *const core::ffi::c_char,
14851 count: *mut u32,
14852 strict_mode: bool,
14853 ) -> bool;
14854}
14855unsafe extern "C" {
14856 #[doc = "Removes a key and the corresponding value string from the stream and inserts a new key/value pair.\n # Arguments\n\n* `stream` -\n * `write_data` -\n * `strict_mode` -\n # Returns\n\ntrue\n false"]
14857 pub fn flipper_format_stream_delete_key_and_write(
14858 stream: *mut Stream,
14859 write_data: *mut FlipperStreamWriteData,
14860 strict_mode: bool,
14861 ) -> bool;
14862}
14863unsafe extern "C" {
14864 #[doc = "Writes a comment string to the stream.\n # Arguments\n\n* `stream` -\n * `data` -\n # Returns\n\ntrue\n false"]
14865 pub fn flipper_format_stream_write_comment_cstr(
14866 stream: *mut Stream,
14867 data: *const core::ffi::c_char,
14868 ) -> bool;
14869}
14870pub type iButtonProtocolId = i32;
14871pub const iButtonProtocolIdInvalid: _bindgen_ty_2 = _bindgen_ty_2(-1);
14872#[repr(transparent)]
14873#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14874pub struct _bindgen_ty_2(pub core::ffi::c_schar);
14875pub const iButtonProtocolFeatureExtData: iButtonProtocolFeature = iButtonProtocolFeature(1);
14876pub const iButtonProtocolFeatureWriteId: iButtonProtocolFeature = iButtonProtocolFeature(2);
14877pub const iButtonProtocolFeatureWriteCopy: iButtonProtocolFeature = iButtonProtocolFeature(4);
14878#[repr(transparent)]
14879#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14880pub struct iButtonProtocolFeature(pub core::ffi::c_uchar);
14881#[repr(C)]
14882#[derive(Debug, Copy, Clone)]
14883pub struct iButtonEditableData {
14884 pub ptr: *mut u8,
14885 pub size: usize,
14886}
14887#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14888const _: () = {
14889 ["Size of iButtonEditableData"][::core::mem::size_of::<iButtonEditableData>() - 8usize];
14890 ["Alignment of iButtonEditableData"][::core::mem::align_of::<iButtonEditableData>() - 4usize];
14891 ["Offset of field: iButtonEditableData::ptr"]
14892 [::core::mem::offset_of!(iButtonEditableData, ptr) - 0usize];
14893 ["Offset of field: iButtonEditableData::size"]
14894 [::core::mem::offset_of!(iButtonEditableData, size) - 4usize];
14895};
14896#[repr(C)]
14897#[derive(Debug, Copy, Clone)]
14898pub struct iButtonKey {
14899 _unused: [u8; 0],
14900}
14901unsafe extern "C" {
14902 #[doc = "Allocate a key object\n # Arguments\n\n* `[in]` - data_size maximum data size held by the key\n # Returns\n\npointer to the key object"]
14903 pub fn ibutton_key_alloc(data_size: usize) -> *mut iButtonKey;
14904}
14905unsafe extern "C" {
14906 #[doc = "Destroy the key object, free resources\n # Arguments\n\n* `[in]` - key pointer to the key object"]
14907 pub fn ibutton_key_free(key: *mut iButtonKey);
14908}
14909unsafe extern "C" {
14910 #[doc = "Get the protocol id held by the key\n # Arguments\n\n* `[in]` - key pointer to the key object\n # Returns\n\nprotocol id held by the key"]
14911 pub fn ibutton_key_get_protocol_id(key: *const iButtonKey) -> iButtonProtocolId;
14912}
14913unsafe extern "C" {
14914 #[doc = "Set the protocol id held by the key\n # Arguments\n\n* `[in]` - key pointer to the key object\n * `[in]` - protocol_id new protocol id"]
14915 pub fn ibutton_key_set_protocol_id(key: *mut iButtonKey, protocol_id: iButtonProtocolId);
14916}
14917unsafe extern "C" {
14918 #[doc = "Reset the protocol id and data held by the key\n # Arguments\n\n* `[in]` - key pointer to the key object"]
14919 pub fn ibutton_key_reset(key: *mut iButtonKey);
14920}
14921#[repr(C)]
14922#[derive(Debug, Copy, Clone)]
14923pub struct iButtonProtocols {
14924 _unused: [u8; 0],
14925}
14926unsafe extern "C" {
14927 #[doc = "Allocate an iButtonProtocols object\n # Returns\n\npointer to an iButtonProtocols object"]
14928 pub fn ibutton_protocols_alloc() -> *mut iButtonProtocols;
14929}
14930unsafe extern "C" {
14931 #[doc = "Destroy an iButtonProtocols object, free resources\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object"]
14932 pub fn ibutton_protocols_free(protocols: *mut iButtonProtocols);
14933}
14934unsafe extern "C" {
14935 #[doc = "Get the total number of available protocols"]
14936 pub fn ibutton_protocols_get_protocol_count() -> u32;
14937}
14938unsafe extern "C" {
14939 #[doc = "Get maximum data size out of all protocols available\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n # Returns\n\nmaximum data size in bytes"]
14940 pub fn ibutton_protocols_get_max_data_size(protocols: *mut iButtonProtocols) -> usize;
14941}
14942unsafe extern "C" {
14943 #[doc = "Get the protocol id based on its name\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - name pointer to a string containing the name\n # Returns\n\nprotocol id on success on iButtonProtocolIdInvalid on failure"]
14944 pub fn ibutton_protocols_get_id_by_name(
14945 protocols: *mut iButtonProtocols,
14946 name: *const core::ffi::c_char,
14947 ) -> iButtonProtocolId;
14948}
14949unsafe extern "C" {
14950 #[doc = "Get the manufacturer name based on the protocol id\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - id id of the protocol in question\n # Returns\n\npointer to a statically allocated string with manufacturer name"]
14951 pub fn ibutton_protocols_get_manufacturer(
14952 protocols: *mut iButtonProtocols,
14953 id: iButtonProtocolId,
14954 ) -> *const core::ffi::c_char;
14955}
14956unsafe extern "C" {
14957 #[doc = "Get the protocol name based on the protocol id\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - id id of the protocol in question\n # Returns\n\npointer to a statically allocated string with protocol name"]
14958 pub fn ibutton_protocols_get_name(
14959 protocols: *mut iButtonProtocols,
14960 id: iButtonProtocolId,
14961 ) -> *const core::ffi::c_char;
14962}
14963unsafe extern "C" {
14964 #[doc = "Get protocol features bitmask by protocol id\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - id id of the protocol in question"]
14965 pub fn ibutton_protocols_get_features(
14966 protocols: *mut iButtonProtocols,
14967 id: iButtonProtocolId,
14968 ) -> u32;
14969}
14970unsafe extern "C" {
14971 #[doc = "Read a physical device (a key or an emulator)\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[out]` - key pointer to the key to read into (must be allocated before)\n # Returns\n\ntrue on success, false on failure"]
14972 pub fn ibutton_protocols_read(protocols: *mut iButtonProtocols, key: *mut iButtonKey) -> bool;
14973}
14974unsafe extern "C" {
14975 #[doc = "Write the key to a blank\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be written\n # Returns\n\ntrue on success, false on failure"]
14976 pub fn ibutton_protocols_write_id(
14977 protocols: *mut iButtonProtocols,
14978 key: *mut iButtonKey,
14979 ) -> bool;
14980}
14981unsafe extern "C" {
14982 #[doc = "Write the key to another one of the same type\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be written\n # Returns\n\ntrue on success, false on failure"]
14983 pub fn ibutton_protocols_write_copy(
14984 protocols: *mut iButtonProtocols,
14985 key: *mut iButtonKey,
14986 ) -> bool;
14987}
14988unsafe extern "C" {
14989 #[doc = "Start emulating the key\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be emulated"]
14990 pub fn ibutton_protocols_emulate_start(protocols: *mut iButtonProtocols, key: *mut iButtonKey);
14991}
14992unsafe extern "C" {
14993 #[doc = "Stop emulating the key\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be emulated"]
14994 pub fn ibutton_protocols_emulate_stop(protocols: *mut iButtonProtocols, key: *mut iButtonKey);
14995}
14996unsafe extern "C" {
14997 #[doc = "Save the key data to a file.\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be saved\n * `[in]` - file_name full absolute path to the file name\n # Returns\n\ntrue on success, false on failure"]
14998 pub fn ibutton_protocols_save(
14999 protocols: *mut iButtonProtocols,
15000 key: *const iButtonKey,
15001 file_name: *const core::ffi::c_char,
15002 ) -> bool;
15003}
15004unsafe extern "C" {
15005 #[doc = "Load the key from a file.\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[out]` - key pointer to the key to load into (must be allocated before)\n * `[in]` - file_name full absolute path to the file name\n # Returns\n\ntrue on success, false on failure"]
15006 pub fn ibutton_protocols_load(
15007 protocols: *mut iButtonProtocols,
15008 key: *mut iButtonKey,
15009 file_name: *const core::ffi::c_char,
15010 ) -> bool;
15011}
15012unsafe extern "C" {
15013 #[doc = "Format a string containing defice UID\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be rendered\n * `[out]` - result pointer to the FuriString instance (must be initialized)"]
15014 pub fn ibutton_protocols_render_uid(
15015 protocols: *mut iButtonProtocols,
15016 key: *const iButtonKey,
15017 result: *mut FuriString,
15018 );
15019}
15020unsafe extern "C" {
15021 #[doc = "Format a string containing device full data\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be rendered\n * `[out]` - result pointer to the FuriString instance (must be initialized)"]
15022 pub fn ibutton_protocols_render_data(
15023 protocols: *mut iButtonProtocols,
15024 key: *const iButtonKey,
15025 result: *mut FuriString,
15026 );
15027}
15028unsafe extern "C" {
15029 #[doc = "Format a string containing device brief data\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be rendered\n * `[out]` - result pointer to the FuriString instance (must be initialized)"]
15030 pub fn ibutton_protocols_render_brief_data(
15031 protocols: *mut iButtonProtocols,
15032 key: *const iButtonKey,
15033 result: *mut FuriString,
15034 );
15035}
15036unsafe extern "C" {
15037 #[doc = "Format a string containing error message (for invalid keys)\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be rendered\n * `[out]` - result pointer to the FuriString instance (must be initialized)"]
15038 pub fn ibutton_protocols_render_error(
15039 protocols: *mut iButtonProtocols,
15040 key: *const iButtonKey,
15041 result: *mut FuriString,
15042 );
15043}
15044unsafe extern "C" {
15045 #[doc = "Check whether the key data is valid\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be checked\n # Returns\n\ntrue if data is valid, false otherwise"]
15046 pub fn ibutton_protocols_is_valid(
15047 protocols: *mut iButtonProtocols,
15048 key: *const iButtonKey,
15049 ) -> bool;
15050}
15051unsafe extern "C" {
15052 #[doc = "Get a pointer to the key's editable data (for in-place editing)\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in]` - key pointer to the key to be checked\n * `[out]` - editable pointer to a structure to contain the editable data"]
15053 pub fn ibutton_protocols_get_editable_data(
15054 protocols: *mut iButtonProtocols,
15055 key: *const iButtonKey,
15056 editable: *mut iButtonEditableData,
15057 );
15058}
15059unsafe extern "C" {
15060 #[doc = "Make all necessary internal adjustments after editing the key\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object\n * `[in,out]` - key pointer to the key to be adjusted"]
15061 pub fn ibutton_protocols_apply_edits(protocols: *mut iButtonProtocols, key: *const iButtonKey);
15062}
15063pub const iButtonWorkerWriteOK: iButtonWorkerWriteResult = iButtonWorkerWriteResult(0);
15064pub const iButtonWorkerWriteSameKey: iButtonWorkerWriteResult = iButtonWorkerWriteResult(1);
15065pub const iButtonWorkerWriteNoDetect: iButtonWorkerWriteResult = iButtonWorkerWriteResult(2);
15066pub const iButtonWorkerWriteCannotWrite: iButtonWorkerWriteResult = iButtonWorkerWriteResult(3);
15067#[repr(transparent)]
15068#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15069pub struct iButtonWorkerWriteResult(pub core::ffi::c_uchar);
15070pub type iButtonWorkerReadCallback =
15071 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
15072pub type iButtonWorkerWriteCallback = ::core::option::Option<
15073 unsafe extern "C" fn(context: *mut core::ffi::c_void, result: iButtonWorkerWriteResult),
15074>;
15075pub type iButtonWorkerEmulateCallback =
15076 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, emulated: bool)>;
15077#[repr(C)]
15078#[derive(Debug, Copy, Clone)]
15079pub struct iButtonWorker {
15080 _unused: [u8; 0],
15081}
15082unsafe extern "C" {
15083 #[doc = "Allocate ibutton worker\n # Returns\n\niButtonWorker*"]
15084 pub fn ibutton_worker_alloc(protocols: *mut iButtonProtocols) -> *mut iButtonWorker;
15085}
15086unsafe extern "C" {
15087 #[doc = "Free ibutton worker\n # Arguments\n\n* `worker` -"]
15088 pub fn ibutton_worker_free(worker: *mut iButtonWorker);
15089}
15090unsafe extern "C" {
15091 #[doc = "Start ibutton worker thread\n # Arguments\n\n* `worker` -"]
15092 pub fn ibutton_worker_start_thread(worker: *mut iButtonWorker);
15093}
15094unsafe extern "C" {
15095 #[doc = "Stop ibutton worker thread\n # Arguments\n\n* `worker` -"]
15096 pub fn ibutton_worker_stop_thread(worker: *mut iButtonWorker);
15097}
15098unsafe extern "C" {
15099 #[doc = "Set \"read success\" callback\n # Arguments\n\n* `worker` -\n * `callback` -\n * `context` -"]
15100 pub fn ibutton_worker_read_set_callback(
15101 worker: *mut iButtonWorker,
15102 callback: iButtonWorkerReadCallback,
15103 context: *mut core::ffi::c_void,
15104 );
15105}
15106unsafe extern "C" {
15107 #[doc = "Start read mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15108 pub fn ibutton_worker_read_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15109}
15110unsafe extern "C" {
15111 #[doc = "Set \"write event\" callback\n # Arguments\n\n* `worker` -\n * `callback` -\n * `context` -"]
15112 pub fn ibutton_worker_write_set_callback(
15113 worker: *mut iButtonWorker,
15114 callback: iButtonWorkerWriteCallback,
15115 context: *mut core::ffi::c_void,
15116 );
15117}
15118unsafe extern "C" {
15119 #[doc = "Start write blank mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15120 pub fn ibutton_worker_write_id_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15121}
15122unsafe extern "C" {
15123 #[doc = "Start write copy mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15124 pub fn ibutton_worker_write_copy_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15125}
15126unsafe extern "C" {
15127 #[doc = "Set \"emulate success\" callback\n # Arguments\n\n* `worker` -\n * `callback` -\n * `context` -"]
15128 pub fn ibutton_worker_emulate_set_callback(
15129 worker: *mut iButtonWorker,
15130 callback: iButtonWorkerEmulateCallback,
15131 context: *mut core::ffi::c_void,
15132 );
15133}
15134unsafe extern "C" {
15135 #[doc = "Start emulate mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15136 pub fn ibutton_worker_emulate_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15137}
15138unsafe extern "C" {
15139 #[doc = "Stop all modes\n # Arguments\n\n* `worker` -"]
15140 pub fn ibutton_worker_stop(worker: *mut iButtonWorker);
15141}
15142unsafe extern "C" {
15143 pub fn __wrap_strtof(in_: *const core::ffi::c_char, tail: *mut *mut core::ffi::c_char) -> f32;
15144}
15145unsafe extern "C" {
15146 pub fn __wrap_strtod(in_: *const core::ffi::c_char, tail: *mut *mut core::ffi::c_char) -> f64;
15147}
15148#[repr(C)]
15149#[derive(Debug, Copy, Clone)]
15150pub struct InfraredDecoderHandler {
15151 _unused: [u8; 0],
15152}
15153#[repr(C)]
15154#[derive(Debug, Copy, Clone)]
15155pub struct InfraredEncoderHandler {
15156 _unused: [u8; 0],
15157}
15158pub const InfraredProtocolUnknown: InfraredProtocol = InfraredProtocol(-1);
15159pub const InfraredProtocolNEC: InfraredProtocol = InfraredProtocol(0);
15160pub const InfraredProtocolNECext: InfraredProtocol = InfraredProtocol(1);
15161pub const InfraredProtocolNEC42: InfraredProtocol = InfraredProtocol(2);
15162pub const InfraredProtocolNEC42ext: InfraredProtocol = InfraredProtocol(3);
15163pub const InfraredProtocolSamsung32: InfraredProtocol = InfraredProtocol(4);
15164pub const InfraredProtocolRC6: InfraredProtocol = InfraredProtocol(5);
15165pub const InfraredProtocolRC5: InfraredProtocol = InfraredProtocol(6);
15166pub const InfraredProtocolRC5X: InfraredProtocol = InfraredProtocol(7);
15167pub const InfraredProtocolSIRC: InfraredProtocol = InfraredProtocol(8);
15168pub const InfraredProtocolSIRC15: InfraredProtocol = InfraredProtocol(9);
15169pub const InfraredProtocolSIRC20: InfraredProtocol = InfraredProtocol(10);
15170pub const InfraredProtocolKaseikyo: InfraredProtocol = InfraredProtocol(11);
15171pub const InfraredProtocolRCA: InfraredProtocol = InfraredProtocol(12);
15172pub const InfraredProtocolPioneer: InfraredProtocol = InfraredProtocol(13);
15173pub const InfraredProtocolMAX: InfraredProtocol = InfraredProtocol(14);
15174#[repr(transparent)]
15175#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15176pub struct InfraredProtocol(pub core::ffi::c_schar);
15177#[repr(C)]
15178#[derive(Debug, Copy, Clone)]
15179pub struct InfraredMessage {
15180 pub protocol: InfraredProtocol,
15181 pub address: u32,
15182 pub command: u32,
15183 pub repeat: bool,
15184}
15185#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15186const _: () = {
15187 ["Size of InfraredMessage"][::core::mem::size_of::<InfraredMessage>() - 16usize];
15188 ["Alignment of InfraredMessage"][::core::mem::align_of::<InfraredMessage>() - 4usize];
15189 ["Offset of field: InfraredMessage::protocol"]
15190 [::core::mem::offset_of!(InfraredMessage, protocol) - 0usize];
15191 ["Offset of field: InfraredMessage::address"]
15192 [::core::mem::offset_of!(InfraredMessage, address) - 4usize];
15193 ["Offset of field: InfraredMessage::command"]
15194 [::core::mem::offset_of!(InfraredMessage, command) - 8usize];
15195 ["Offset of field: InfraredMessage::repeat"]
15196 [::core::mem::offset_of!(InfraredMessage, repeat) - 12usize];
15197};
15198pub const InfraredStatusError: InfraredStatus = InfraredStatus(0);
15199pub const InfraredStatusOk: InfraredStatus = InfraredStatus(1);
15200pub const InfraredStatusDone: InfraredStatus = InfraredStatus(2);
15201pub const InfraredStatusReady: InfraredStatus = InfraredStatus(3);
15202#[repr(transparent)]
15203#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15204pub struct InfraredStatus(pub core::ffi::c_uchar);
15205unsafe extern "C" {
15206 #[doc = "Initialize decoder.\n\n # Returns\n\nreturns pointer to INFRARED decoder handler if success, otherwise - error."]
15207 pub fn infrared_alloc_decoder() -> *mut InfraredDecoderHandler;
15208}
15209unsafe extern "C" {
15210 #[doc = "Provide to decoder next timing.\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED decoders. Should be acquired with `infrared_alloc_decoder().`\n * `level` (direction in) - - high(true) or low(false) level of input signal to analyze.\n it should alternate every call, otherwise it is an error case,\n and decoder resets its state and start decoding from the start.\n * `duration` (direction in) - - duration of steady high/low input signal.\n # Returns\n\nif message is ready, returns pointer to decoded message, returns NULL.\n Note: ownership of returned ptr belongs to handler. So pointer is valid\n up to next infrared_free_decoder(), infrared_reset_decoder(),\n infrared_decode(), infrared_check_decoder_ready() calls."]
15211 pub fn infrared_decode(
15212 handler: *mut InfraredDecoderHandler,
15213 level: bool,
15214 duration: u32,
15215 ) -> *const InfraredMessage;
15216}
15217unsafe extern "C" {
15218 #[doc = "Check whether decoder is ready.\n Functionality is quite similar to infrared_decode(), but with no timing providing.\n Some protocols (e.g. Sony SIRC) has variable payload length, which means we\n can't recognize end of message right after receiving last bit. That's why\n application should call to infrared_check_decoder_ready() after some timeout to\n retrieve decoded message, if so.\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED decoders. Should be acquired with `infrared_alloc_decoder().`\n # Returns\n\nif message is ready, returns pointer to decoded message, returns NULL.\n Note: ownership of returned ptr belongs to handler. So pointer is valid\n up to next infrared_free_decoder(), infrared_reset_decoder(),\n infrared_decode(), infrared_check_decoder_ready() calls."]
15219 pub fn infrared_check_decoder_ready(
15220 handler: *mut InfraredDecoderHandler,
15221 ) -> *const InfraredMessage;
15222}
15223unsafe extern "C" {
15224 #[doc = "Deinitialize decoder and free allocated memory.\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED decoders. Should be acquired with `infrared_alloc_decoder().`"]
15225 pub fn infrared_free_decoder(handler: *mut InfraredDecoderHandler);
15226}
15227unsafe extern "C" {
15228 #[doc = "Reset INFRARED decoder.\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED decoders. Should be acquired with `infrared_alloc_decoder().`"]
15229 pub fn infrared_reset_decoder(handler: *mut InfraredDecoderHandler);
15230}
15231unsafe extern "C" {
15232 #[doc = "Get protocol name by protocol enum.\n\n # Arguments\n\n* `protocol` (direction in) - - protocol identifier.\n # Returns\n\nstring to protocol name."]
15233 pub fn infrared_get_protocol_name(protocol: InfraredProtocol) -> *const core::ffi::c_char;
15234}
15235unsafe extern "C" {
15236 #[doc = "Get protocol enum by protocol name.\n\n # Arguments\n\n* `protocol_name` (direction in) - - string to protocol name.\n # Returns\n\nprotocol identifier."]
15237 pub fn infrared_get_protocol_by_name(
15238 protocol_name: *const core::ffi::c_char,
15239 ) -> InfraredProtocol;
15240}
15241unsafe extern "C" {
15242 #[doc = "Get address length by protocol enum.\n\n # Arguments\n\n* `protocol` (direction in) - - protocol identifier.\n # Returns\n\nlength of address in bits."]
15243 pub fn infrared_get_protocol_address_length(protocol: InfraredProtocol) -> u8;
15244}
15245unsafe extern "C" {
15246 #[doc = "Get command length by protocol enum.\n\n # Arguments\n\n* `protocol` (direction in) - - protocol identifier.\n # Returns\n\nlength of command in bits."]
15247 pub fn infrared_get_protocol_command_length(protocol: InfraredProtocol) -> u8;
15248}
15249unsafe extern "C" {
15250 #[doc = "Checks whether protocol valid.\n\n # Arguments\n\n* `protocol` (direction in) - - protocol identifier.\n # Returns\n\ntrue if protocol is valid, false otherwise."]
15251 pub fn infrared_is_protocol_valid(protocol: InfraredProtocol) -> bool;
15252}
15253unsafe extern "C" {
15254 #[doc = "Allocate INFRARED encoder.\n\n # Returns\n\nencoder handler."]
15255 pub fn infrared_alloc_encoder() -> *mut InfraredEncoderHandler;
15256}
15257unsafe extern "C" {
15258 #[doc = "Free encoder handler previously allocated with `infrared_alloc_encoder().`\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED encoder. Should be acquired with `infrared_alloc_encoder().`"]
15259 pub fn infrared_free_encoder(handler: *mut InfraredEncoderHandler);
15260}
15261unsafe extern "C" {
15262 #[doc = "Encode previously set INFRARED message.\n Usage:\n 1) alloc with `infrared_alloc_encoder()`\n 2) set message to encode with `infrared_reset_encoder()`\n 3) call for `infrared_encode()` to continuously get one at a time timings.\n 4) when `infrared_encode()` returns InfraredStatusDone, it means new message is fully encoded.\n 5) to encode additional timings, just continue calling `infrared_encode().`\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED encoder. Should be acquired with `infrared_alloc_encoder().`\n * `duration` (direction out) - - encoded timing.\n * `level` (direction out) - - encoded level.\n\n # Returns\n\nstatus of encode operation."]
15263 pub fn infrared_encode(
15264 handler: *mut InfraredEncoderHandler,
15265 duration: *mut u32,
15266 level: *mut bool,
15267 ) -> InfraredStatus;
15268}
15269unsafe extern "C" {
15270 #[doc = "Reset INFRARED encoder and set new message to encode. If it's not called after receiveing\n InfraredStatusDone in `infrared_encode(),` encoder will encode repeat messages\n till the end of time.\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED encoder. Should be acquired with `infrared_alloc_encoder().`\n * `message` (direction in) - - message to encode."]
15271 pub fn infrared_reset_encoder(
15272 handler: *mut InfraredEncoderHandler,
15273 message: *const InfraredMessage,
15274 );
15275}
15276unsafe extern "C" {
15277 #[doc = "Get PWM frequency value for selected protocol\n\n # Arguments\n\n* `protocol` (direction in) - - protocol to get from PWM frequency\n\n # Returns\n\nfrequency"]
15278 pub fn infrared_get_protocol_frequency(protocol: InfraredProtocol) -> u32;
15279}
15280unsafe extern "C" {
15281 #[doc = "Get PWM duty cycle value for selected protocol\n\n # Arguments\n\n* `protocol` (direction in) - - protocol to get from PWM duty cycle\n\n # Returns\n\nduty cycle"]
15282 pub fn infrared_get_protocol_duty_cycle(protocol: InfraredProtocol) -> f32;
15283}
15284unsafe extern "C" {
15285 #[doc = "Get the minimum count of signal repeats for the selected protocol\n\n # Arguments\n\n* `protocol` (direction in) - - protocol to get the repeat count from\n\n # Returns\n\nrepeat count"]
15286 pub fn infrared_get_protocol_min_repeat_count(protocol: InfraredProtocol) -> usize;
15287}
15288pub const InfraredErrorCodeNone: InfraredErrorCode = InfraredErrorCode(0);
15289pub const InfraredErrorCodeFileOperationFailed: InfraredErrorCode = InfraredErrorCode(8388608);
15290pub const InfraredErrorCodeWrongFileType: InfraredErrorCode = InfraredErrorCode(2147483904);
15291pub const InfraredErrorCodeWrongFileVersion: InfraredErrorCode = InfraredErrorCode(2147484160);
15292pub const InfraredErrorCodeSignalTypeUnknown: InfraredErrorCode = InfraredErrorCode(2147484416);
15293pub const InfraredErrorCodeSignalNameNotFound: InfraredErrorCode = InfraredErrorCode(2147484672);
15294pub const InfraredErrorCodeSignalUnableToReadType: InfraredErrorCode =
15295 InfraredErrorCode(2147484928);
15296pub const InfraredErrorCodeSignalUnableToWriteType: InfraredErrorCode =
15297 InfraredErrorCode(2147485184);
15298pub const InfraredErrorCodeSignalRawUnableToReadFrequency: InfraredErrorCode =
15299 InfraredErrorCode(2147485440);
15300pub const InfraredErrorCodeSignalRawUnableToReadDutyCycle: InfraredErrorCode =
15301 InfraredErrorCode(2147485696);
15302pub const InfraredErrorCodeSignalRawUnableToReadTimingsSize: InfraredErrorCode =
15303 InfraredErrorCode(2147485952);
15304pub const InfraredErrorCodeSignalRawUnableToReadTooLongData: InfraredErrorCode =
15305 InfraredErrorCode(2147486208);
15306pub const InfraredErrorCodeSignalRawUnableToReadData: InfraredErrorCode =
15307 InfraredErrorCode(2147486464);
15308pub const InfraredErrorCodeSignalRawUnableToWriteFrequency: InfraredErrorCode =
15309 InfraredErrorCode(2147486720);
15310pub const InfraredErrorCodeSignalRawUnableToWriteDutyCycle: InfraredErrorCode =
15311 InfraredErrorCode(2147486976);
15312pub const InfraredErrorCodeSignalRawUnableToWriteData: InfraredErrorCode =
15313 InfraredErrorCode(2147487232);
15314pub const InfraredErrorCodeSignalMessageUnableToReadProtocol: InfraredErrorCode =
15315 InfraredErrorCode(2147487488);
15316pub const InfraredErrorCodeSignalMessageUnableToReadAddress: InfraredErrorCode =
15317 InfraredErrorCode(2147487744);
15318pub const InfraredErrorCodeSignalMessageUnableToReadCommand: InfraredErrorCode =
15319 InfraredErrorCode(2147488000);
15320pub const InfraredErrorCodeSignalMessageIsInvalid: InfraredErrorCode =
15321 InfraredErrorCode(2147488256);
15322pub const InfraredErrorCodeSignalMessageUnableToWriteProtocol: InfraredErrorCode =
15323 InfraredErrorCode(2147488512);
15324pub const InfraredErrorCodeSignalMessageUnableToWriteAddress: InfraredErrorCode =
15325 InfraredErrorCode(2147488768);
15326pub const InfraredErrorCodeSignalMessageUnableToWriteCommand: InfraredErrorCode =
15327 InfraredErrorCode(2147489024);
15328#[repr(transparent)]
15329#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15330pub struct InfraredErrorCode(pub core::ffi::c_uint);
15331#[repr(C)]
15332#[derive(Debug, Copy, Clone)]
15333pub struct InfraredBruteForce {
15334 _unused: [u8; 0],
15335}
15336#[repr(C)]
15337#[derive(Debug, Copy, Clone)]
15338pub struct InfraredSignal {
15339 _unused: [u8; 0],
15340}
15341#[doc = "Raw signal type definition.\n\n Measurement units used:\n - time: microseconds (uS)\n - frequency: Hertz (Hz)\n - duty_cycle: no units, fraction between 0 and 1."]
15342#[repr(C)]
15343#[derive(Debug, Copy, Clone)]
15344pub struct InfraredRawSignal {
15345 #[doc = "< Number of elements in the timings array."]
15346 pub timings_size: usize,
15347 #[doc = "< Pointer to an array of timings describing the signal."]
15348 pub timings: *mut u32,
15349 #[doc = "< Carrier frequency of the signal."]
15350 pub frequency: u32,
15351 #[doc = "< Duty cycle of the signal."]
15352 pub duty_cycle: f32,
15353}
15354#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15355const _: () = {
15356 ["Size of InfraredRawSignal"][::core::mem::size_of::<InfraredRawSignal>() - 16usize];
15357 ["Alignment of InfraredRawSignal"][::core::mem::align_of::<InfraredRawSignal>() - 4usize];
15358 ["Offset of field: InfraredRawSignal::timings_size"]
15359 [::core::mem::offset_of!(InfraredRawSignal, timings_size) - 0usize];
15360 ["Offset of field: InfraredRawSignal::timings"]
15361 [::core::mem::offset_of!(InfraredRawSignal, timings) - 4usize];
15362 ["Offset of field: InfraredRawSignal::frequency"]
15363 [::core::mem::offset_of!(InfraredRawSignal, frequency) - 8usize];
15364 ["Offset of field: InfraredRawSignal::duty_cycle"]
15365 [::core::mem::offset_of!(InfraredRawSignal, duty_cycle) - 12usize];
15366};
15367pub const FuriHalInfraredTxPinInternal: FuriHalInfraredTxPin = FuriHalInfraredTxPin(0);
15368pub const FuriHalInfraredTxPinExtPA7: FuriHalInfraredTxPin = FuriHalInfraredTxPin(1);
15369pub const FuriHalInfraredTxPinMax: FuriHalInfraredTxPin = FuriHalInfraredTxPin(2);
15370#[repr(transparent)]
15371#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15372pub struct FuriHalInfraredTxPin(pub core::ffi::c_uchar);
15373#[doc = "< New data obtained"]
15374pub const FuriHalInfraredTxGetDataStateOk: FuriHalInfraredTxGetDataState =
15375 FuriHalInfraredTxGetDataState(0);
15376#[doc = "< New data obtained, and this is end of package"]
15377pub const FuriHalInfraredTxGetDataStateDone: FuriHalInfraredTxGetDataState =
15378 FuriHalInfraredTxGetDataState(1);
15379#[doc = "< New data obtained, and this is end of package and no more data available"]
15380pub const FuriHalInfraredTxGetDataStateLastDone: FuriHalInfraredTxGetDataState =
15381 FuriHalInfraredTxGetDataState(2);
15382#[repr(transparent)]
15383#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15384pub struct FuriHalInfraredTxGetDataState(pub core::ffi::c_uchar);
15385#[doc = "Callback type for providing data to INFRARED DMA TX system. It is called every tim"]
15386pub type FuriHalInfraredTxGetDataISRCallback = ::core::option::Option<
15387 unsafe extern "C" fn(
15388 context: *mut core::ffi::c_void,
15389 duration: *mut u32,
15390 level: *mut bool,
15391 ) -> FuriHalInfraredTxGetDataState,
15392>;
15393#[doc = "Callback type called every time signal is sent by DMA to Timer.\n\n Actually, it means there are 2 timings left to send for this signal, which is\n almost end. Don't use this callback to stop transmission, as far as there are\n next signal is charged for transmission by DMA."]
15394pub type FuriHalInfraredTxSignalSentISRCallback =
15395 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
15396#[doc = "Signature of callback function for receiving continuous INFRARED rx signal.\n\n # Arguments\n\n* `ctx` (direction in) - context to pass to callback\n * `level` (direction in) - level of input INFRARED rx signal\n * `duration` (direction in) - duration of continuous rx signal level in us"]
15397pub type FuriHalInfraredRxCaptureCallback = ::core::option::Option<
15398 unsafe extern "C" fn(ctx: *mut core::ffi::c_void, level: bool, duration: u32),
15399>;
15400#[doc = "Signature of callback function for reaching silence timeout on INFRARED port.\n\n # Arguments\n\n* `ctx` (direction in) - context to pass to callback"]
15401pub type FuriHalInfraredRxTimeoutCallback =
15402 ::core::option::Option<unsafe extern "C" fn(ctx: *mut core::ffi::c_void)>;
15403unsafe extern "C" {
15404 #[doc = "Initialize INFRARED RX timer to receive interrupts.\n\n It provides interrupts for every RX-signal edge changing with its duration."]
15405 pub fn furi_hal_infrared_async_rx_start();
15406}
15407unsafe extern "C" {
15408 #[doc = "Deinitialize INFRARED RX interrupt."]
15409 pub fn furi_hal_infrared_async_rx_stop();
15410}
15411unsafe extern "C" {
15412 #[doc = "Setup hal for receiving silence timeout.\n\n Should be used with 'furi_hal_infrared_timeout_irq_set_callback()'.\n\n # Arguments\n\n* `timeout_us` (direction in) - time to wait for silence on INFRARED port before\n generating IRQ."]
15413 pub fn furi_hal_infrared_async_rx_set_timeout(timeout_us: u32);
15414}
15415unsafe extern "C" {
15416 #[doc = "Setup callback for previously initialized INFRARED RX interrupt.\n\n # Arguments\n\n* `callback` (direction in) - callback to call when RX signal edge changing occurs\n * `ctx` (direction in) - context for callback"]
15417 pub fn furi_hal_infrared_async_rx_set_capture_isr_callback(
15418 callback: FuriHalInfraredRxCaptureCallback,
15419 ctx: *mut core::ffi::c_void,
15420 );
15421}
15422unsafe extern "C" {
15423 #[doc = "Setup callback for reaching silence timeout on INFRARED port.\n\n Should setup hal with 'furi_hal_infrared_setup_rx_timeout_irq()' first.\n\n # Arguments\n\n* `callback` (direction in) - callback for silence timeout\n * `ctx` (direction in) - context to pass to callback"]
15424 pub fn furi_hal_infrared_async_rx_set_timeout_isr_callback(
15425 callback: FuriHalInfraredRxTimeoutCallback,
15426 ctx: *mut core::ffi::c_void,
15427 );
15428}
15429unsafe extern "C" {
15430 #[doc = "Check if INFRARED is in use now.\n\n # Returns\n\ntrue if INFRARED is busy, false otherwise."]
15431 pub fn furi_hal_infrared_is_busy() -> bool;
15432}
15433unsafe extern "C" {
15434 #[doc = "Set callback providing new data.\n\n This function has to be called before furi_hal_infrared_async_tx_start().\n\n # Arguments\n\n* `callback` (direction in) - function to provide new data\n * `context` (direction in) - context for callback"]
15435 pub fn furi_hal_infrared_async_tx_set_data_isr_callback(
15436 callback: FuriHalInfraredTxGetDataISRCallback,
15437 context: *mut core::ffi::c_void,
15438 );
15439}
15440unsafe extern "C" {
15441 #[doc = "Start IR asynchronous transmission.\n\n It can be stopped by 2 reasons:\n 1. implicit call for furi_hal_infrared_async_tx_stop()\n 2. callback can provide FuriHalInfraredTxGetDataStateLastDone response which\n means no more data available for transmission.\n\n Any func (furi_hal_infrared_async_tx_stop() or\n furi_hal_infrared_async_tx_wait_termination()) has to be called to wait end of\n transmission and free resources.\n\n # Arguments\n\n* `freq` (direction in) - frequency for PWM\n * `duty_cycle` (direction in) - duty cycle for PWM"]
15442 pub fn furi_hal_infrared_async_tx_start(freq: u32, duty_cycle: f32);
15443}
15444unsafe extern "C" {
15445 #[doc = "Stop IR asynchronous transmission and free resources.\n\n Transmission will stop as soon as transmission reaches end of package\n (FuriHalInfraredTxGetDataStateDone or FuriHalInfraredTxGetDataStateLastDone)."]
15446 pub fn furi_hal_infrared_async_tx_stop();
15447}
15448unsafe extern "C" {
15449 #[doc = "Wait for end of IR asynchronous transmission and free resources.\n\n Transmission will stop as soon as transmission reaches end of transmission\n (FuriHalInfraredTxGetDataStateLastDone)."]
15450 pub fn furi_hal_infrared_async_tx_wait_termination();
15451}
15452unsafe extern "C" {
15453 #[doc = "Set callback for end of signal transmission\n\n # Arguments\n\n* `callback` (direction in) - function to call when signal is sent\n * `context` (direction in) - context for callback"]
15454 pub fn furi_hal_infrared_async_tx_set_signal_sent_isr_callback(
15455 callback: FuriHalInfraredTxSignalSentISRCallback,
15456 context: *mut core::ffi::c_void,
15457 );
15458}
15459unsafe extern "C" {
15460 #[doc = "Detect which pin has an external IR module connected.\n\n External IR modules are detected by enabling a weak pull-up\n on supported pins and testing whether the input is still low.\n\n This method works best on modules that employ a FET with a\n strong pull-down or a BJT for driving IR LEDs.\n\n The module MUST pull the input voltage down to at least 0.9V\n or lower in order for it to be detected.\n\n If no module has been detected, FuriHalInfraredTxPinInternal is returned.\n\n # Returns\n\nnumeric identifier of the first pin with a module detected."]
15461 pub fn furi_hal_infrared_detect_tx_output() -> FuriHalInfraredTxPin;
15462}
15463unsafe extern "C" {
15464 #[doc = "Set which pin will be used to transmit infrared signals.\n\n # Arguments\n\n* `tx_pin` (direction in) - pin to be used for signal transmission."]
15465 pub fn furi_hal_infrared_set_tx_output(tx_pin: FuriHalInfraredTxPin);
15466}
15467unsafe extern "C" {
15468 #[doc = "Send message over INFRARED.\n\n # Arguments\n\n* `message` (direction in) - - message to send.\n * `times` (direction in) - - number of times message should be sent."]
15469 pub fn infrared_send(message: *const InfraredMessage, times: core::ffi::c_int);
15470}
15471unsafe extern "C" {
15472 #[doc = "Send raw data through infrared port.\n\n # Arguments\n\n* `timings` (direction in) - - array of timings to send.\n * `timings_cnt` (direction in) - - timings array size.\n * `start_from_mark` (direction in) - - true if timings starts from mark,\n otherwise from space"]
15473 pub fn infrared_send_raw(timings: *const u32, timings_cnt: u32, start_from_mark: bool);
15474}
15475unsafe extern "C" {
15476 #[doc = "Send raw data through infrared port, with additional settings.\n\n # Arguments\n\n* `timings` (direction in) - - array of timings to send.\n * `timings_cnt` (direction in) - - timings array size.\n * `start_from_mark` (direction in) - - true if timings starts from mark,\n otherwise from space\n * `duty_cycle` (direction in) - - duty cycle to generate on PWM\n * `frequency` (direction in) - - frequency to generate on PWM"]
15477 pub fn infrared_send_raw_ext(
15478 timings: *const u32,
15479 timings_cnt: u32,
15480 start_from_mark: bool,
15481 frequency: u32,
15482 duty_cycle: f32,
15483 );
15484}
15485#[repr(C)]
15486#[derive(Debug, Copy, Clone)]
15487pub struct InfraredWorker {
15488 _unused: [u8; 0],
15489}
15490#[repr(C)]
15491#[derive(Debug, Copy, Clone)]
15492pub struct InfraredWorkerSignal {
15493 _unused: [u8; 0],
15494}
15495pub const InfraredWorkerGetSignalResponseNew: InfraredWorkerGetSignalResponse =
15496 InfraredWorkerGetSignalResponse(0);
15497#[doc = "Signal, provided by callback is new and encoder should be reseted"]
15498pub const InfraredWorkerGetSignalResponseSame: InfraredWorkerGetSignalResponse =
15499 InfraredWorkerGetSignalResponse(1);
15500#[doc = "Signal, provided by callback is same. No encoder resetting."]
15501pub const InfraredWorkerGetSignalResponseStop: InfraredWorkerGetSignalResponse =
15502 InfraredWorkerGetSignalResponse(2);
15503#[repr(transparent)]
15504#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15505pub struct InfraredWorkerGetSignalResponse(pub core::ffi::c_uchar);
15506#[doc = "Callback type for providing next signal to send. Should be used with\n infrared_worker_make_decoded_signal() or infrared_worker_make_raw_signal()"]
15507pub type InfraredWorkerGetSignalCallback = ::core::option::Option<
15508 unsafe extern "C" fn(
15509 context: *mut core::ffi::c_void,
15510 instance: *mut InfraredWorker,
15511 ) -> InfraredWorkerGetSignalResponse,
15512>;
15513#[doc = "Callback type for 'message is sent' event"]
15514pub type InfraredWorkerMessageSentCallback =
15515 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
15516#[doc = "Callback type to call by InfraredWorker thread when new signal is received"]
15517pub type InfraredWorkerReceivedSignalCallback = ::core::option::Option<
15518 unsafe extern "C" fn(
15519 context: *mut core::ffi::c_void,
15520 received_signal: *mut InfraredWorkerSignal,
15521 ),
15522>;
15523unsafe extern "C" {
15524 #[doc = "Allocate InfraredWorker\n\n # Returns\n\njust created instance of InfraredWorker"]
15525 pub fn infrared_worker_alloc() -> *mut InfraredWorker;
15526}
15527unsafe extern "C" {
15528 #[doc = "Free InfraredWorker\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15529 pub fn infrared_worker_free(instance: *mut InfraredWorker);
15530}
15531unsafe extern "C" {
15532 #[doc = "Start InfraredWorker thread, initialise furi_hal, prepare all work.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15533 pub fn infrared_worker_rx_start(instance: *mut InfraredWorker);
15534}
15535unsafe extern "C" {
15536 #[doc = "Stop InfraredWorker thread, deinitialize furi_hal.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15537 pub fn infrared_worker_rx_stop(instance: *mut InfraredWorker);
15538}
15539unsafe extern "C" {
15540 #[doc = "Set received data callback InfraredWorker\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance\n * `context` (direction in) - - context to pass to callbacks\n * `callback` (direction in) - - InfraredWorkerReceivedSignalCallback callback"]
15541 pub fn infrared_worker_rx_set_received_signal_callback(
15542 instance: *mut InfraredWorker,
15543 callback: InfraredWorkerReceivedSignalCallback,
15544 context: *mut core::ffi::c_void,
15545 );
15546}
15547unsafe extern "C" {
15548 #[doc = "Enable blinking on receiving any signal on IR port.\n\n # Arguments\n\n* `instance` (direction in) - - instance of InfraredWorker\n * `enable` (direction in) - - true if you want to enable blinking\n false otherwise"]
15549 pub fn infrared_worker_rx_enable_blink_on_receiving(
15550 instance: *mut InfraredWorker,
15551 enable: bool,
15552 );
15553}
15554unsafe extern "C" {
15555 #[doc = "Enable decoding of received infrared signals.\n\n # Arguments\n\n* `instance` (direction in) - - instance of InfraredWorker\n * `enable` (direction in) - - true if you want to enable decoding\n false otherwise"]
15556 pub fn infrared_worker_rx_enable_signal_decoding(instance: *mut InfraredWorker, enable: bool);
15557}
15558unsafe extern "C" {
15559 #[doc = "Clarify is received signal either decoded or raw\n\n # Arguments\n\n* `signal` (direction in) - - received signal\n # Returns\n\ntrue if signal is decoded, false if signal is raw"]
15560 pub fn infrared_worker_signal_is_decoded(signal: *const InfraredWorkerSignal) -> bool;
15561}
15562unsafe extern "C" {
15563 #[doc = "Start transmitting signal. Callback InfraredWorkerGetSignalCallback should be\n set before this function is called, as it calls for it to fill buffer before\n starting transmission.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15564 pub fn infrared_worker_tx_start(instance: *mut InfraredWorker);
15565}
15566unsafe extern "C" {
15567 #[doc = "Stop transmitting signal. Waits for end of current signal and stops transmission.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15568 pub fn infrared_worker_tx_stop(instance: *mut InfraredWorker);
15569}
15570unsafe extern "C" {
15571 #[doc = "Set callback for providing next signal to send\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance\n * `context` (direction in) - - context to pass to callbacks\n * `callback` (direction in) - - InfraredWorkerGetSignalCallback callback"]
15572 pub fn infrared_worker_tx_set_get_signal_callback(
15573 instance: *mut InfraredWorker,
15574 callback: InfraredWorkerGetSignalCallback,
15575 context: *mut core::ffi::c_void,
15576 );
15577}
15578unsafe extern "C" {
15579 #[doc = "Set callback for end of signal transmitting\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance\n * `context` (direction in) - - context to pass to callbacks\n * `callback` (direction in) - - InfraredWorkerMessageSentCallback callback"]
15580 pub fn infrared_worker_tx_set_signal_sent_callback(
15581 instance: *mut InfraredWorker,
15582 callback: InfraredWorkerMessageSentCallback,
15583 context: *mut core::ffi::c_void,
15584 );
15585}
15586unsafe extern "C" {
15587 #[doc = "Callback to pass to infrared_worker_tx_set_get_signal_callback() if signal\n is steady and will not be changed between infrared_worker start and stop.\n Before starting transmission, desired steady signal must be set with\n infrared_worker_set_decoded_signal() or infrared_worker_set_raw_signal().\n\n This function should not be called directly.\n\n # Arguments\n\n* `context` (direction in) - - context\n * `instance` (direction out) - - InfraredWorker instance"]
15588 pub fn infrared_worker_tx_get_signal_steady_callback(
15589 context: *mut core::ffi::c_void,
15590 instance: *mut InfraredWorker,
15591 ) -> InfraredWorkerGetSignalResponse;
15592}
15593unsafe extern "C" {
15594 #[doc = "Acquire raw signal from interface struct 'InfraredWorkerSignal'.\n First, you have to ensure that signal is raw.\n\n # Arguments\n\n* `signal` (direction in) - - received signal\n * `timings` (direction out) - - pointer to array of timings\n * `timings_cnt` (direction out) - - pointer to amount of timings"]
15595 pub fn infrared_worker_get_raw_signal(
15596 signal: *const InfraredWorkerSignal,
15597 timings: *mut *const u32,
15598 timings_cnt: *mut usize,
15599 );
15600}
15601unsafe extern "C" {
15602 #[doc = "Acquire decoded message from interface struct 'InfraredWorkerSignal'.\n First, you have to ensure that signal is decoded.\n\n # Arguments\n\n* `signal` (direction in) - - received signal\n # Returns\n\ndecoded INFRARED message"]
15603 pub fn infrared_worker_get_decoded_signal(
15604 signal: *const InfraredWorkerSignal,
15605 ) -> *const InfraredMessage;
15606}
15607unsafe extern "C" {
15608 #[doc = "Set current decoded signal for InfraredWorker instance\n\n # Arguments\n\n* `instance` (direction out) - - InfraredWorker instance\n * `message` (direction in) - - decoded signal"]
15609 pub fn infrared_worker_set_decoded_signal(
15610 instance: *mut InfraredWorker,
15611 message: *const InfraredMessage,
15612 );
15613}
15614unsafe extern "C" {
15615 #[doc = "Set current raw signal for InfraredWorker instance\n\n # Arguments\n\n* `instance` (direction out) - - InfraredWorker instance\n * `timings` (direction in) - - array of raw timings\n * `timings_cnt` (direction in) - - size of array of raw timings\n * `frequency` (direction in) - - carrier frequency in Hertz\n * `duty_cycle` (direction in) - - carrier duty cycle (0.0 - 1.0)"]
15616 pub fn infrared_worker_set_raw_signal(
15617 instance: *mut InfraredWorker,
15618 timings: *const u32,
15619 timings_cnt: usize,
15620 frequency: u32,
15621 duty_cycle: f32,
15622 );
15623}
15624pub type ProtocolAlloc = ::core::option::Option<unsafe extern "C" fn() -> *mut core::ffi::c_void>;
15625pub type ProtocolFree =
15626 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void)>;
15627pub type ProtocolGetData =
15628 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void) -> *mut u8>;
15629pub type ProtocolDecoderStart =
15630 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void)>;
15631pub type ProtocolDecoderFeed = ::core::option::Option<
15632 unsafe extern "C" fn(protocol: *mut core::ffi::c_void, level: bool, duration: u32) -> bool,
15633>;
15634pub type ProtocolEncoderStart =
15635 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void) -> bool>;
15636pub type ProtocolEncoderYield =
15637 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void) -> LevelDuration>;
15638pub type ProtocolRenderData = ::core::option::Option<
15639 unsafe extern "C" fn(protocol: *mut core::ffi::c_void, result: *mut FuriString),
15640>;
15641pub type ProtocolWriteData = ::core::option::Option<
15642 unsafe extern "C" fn(protocol: *mut core::ffi::c_void, data: *mut core::ffi::c_void) -> bool,
15643>;
15644#[repr(C)]
15645#[derive(Debug, Copy, Clone)]
15646pub struct ProtocolDecoder {
15647 pub start: ProtocolDecoderStart,
15648 pub feed: ProtocolDecoderFeed,
15649}
15650#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15651const _: () = {
15652 ["Size of ProtocolDecoder"][::core::mem::size_of::<ProtocolDecoder>() - 8usize];
15653 ["Alignment of ProtocolDecoder"][::core::mem::align_of::<ProtocolDecoder>() - 4usize];
15654 ["Offset of field: ProtocolDecoder::start"]
15655 [::core::mem::offset_of!(ProtocolDecoder, start) - 0usize];
15656 ["Offset of field: ProtocolDecoder::feed"]
15657 [::core::mem::offset_of!(ProtocolDecoder, feed) - 4usize];
15658};
15659#[repr(C)]
15660#[derive(Debug, Copy, Clone)]
15661pub struct ProtocolEncoder {
15662 pub start: ProtocolEncoderStart,
15663 pub yield_: ProtocolEncoderYield,
15664}
15665#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15666const _: () = {
15667 ["Size of ProtocolEncoder"][::core::mem::size_of::<ProtocolEncoder>() - 8usize];
15668 ["Alignment of ProtocolEncoder"][::core::mem::align_of::<ProtocolEncoder>() - 4usize];
15669 ["Offset of field: ProtocolEncoder::start"]
15670 [::core::mem::offset_of!(ProtocolEncoder, start) - 0usize];
15671 ["Offset of field: ProtocolEncoder::yield_"]
15672 [::core::mem::offset_of!(ProtocolEncoder, yield_) - 4usize];
15673};
15674#[repr(C)]
15675#[derive(Debug, Copy, Clone)]
15676pub struct ProtocolBase {
15677 pub data_size: usize,
15678 pub name: *const core::ffi::c_char,
15679 pub manufacturer: *const core::ffi::c_char,
15680 pub features: u32,
15681 pub validate_count: u8,
15682 pub alloc: ProtocolAlloc,
15683 pub free: ProtocolFree,
15684 pub get_data: ProtocolGetData,
15685 pub decoder: ProtocolDecoder,
15686 pub encoder: ProtocolEncoder,
15687 pub render_uid: ProtocolRenderData,
15688 pub render_data: ProtocolRenderData,
15689 pub render_brief_data: ProtocolRenderData,
15690 pub write_data: ProtocolWriteData,
15691}
15692#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15693const _: () = {
15694 ["Size of ProtocolBase"][::core::mem::size_of::<ProtocolBase>() - 64usize];
15695 ["Alignment of ProtocolBase"][::core::mem::align_of::<ProtocolBase>() - 4usize];
15696 ["Offset of field: ProtocolBase::data_size"]
15697 [::core::mem::offset_of!(ProtocolBase, data_size) - 0usize];
15698 ["Offset of field: ProtocolBase::name"][::core::mem::offset_of!(ProtocolBase, name) - 4usize];
15699 ["Offset of field: ProtocolBase::manufacturer"]
15700 [::core::mem::offset_of!(ProtocolBase, manufacturer) - 8usize];
15701 ["Offset of field: ProtocolBase::features"]
15702 [::core::mem::offset_of!(ProtocolBase, features) - 12usize];
15703 ["Offset of field: ProtocolBase::validate_count"]
15704 [::core::mem::offset_of!(ProtocolBase, validate_count) - 16usize];
15705 ["Offset of field: ProtocolBase::alloc"]
15706 [::core::mem::offset_of!(ProtocolBase, alloc) - 20usize];
15707 ["Offset of field: ProtocolBase::free"][::core::mem::offset_of!(ProtocolBase, free) - 24usize];
15708 ["Offset of field: ProtocolBase::get_data"]
15709 [::core::mem::offset_of!(ProtocolBase, get_data) - 28usize];
15710 ["Offset of field: ProtocolBase::decoder"]
15711 [::core::mem::offset_of!(ProtocolBase, decoder) - 32usize];
15712 ["Offset of field: ProtocolBase::encoder"]
15713 [::core::mem::offset_of!(ProtocolBase, encoder) - 40usize];
15714 ["Offset of field: ProtocolBase::render_uid"]
15715 [::core::mem::offset_of!(ProtocolBase, render_uid) - 48usize];
15716 ["Offset of field: ProtocolBase::render_data"]
15717 [::core::mem::offset_of!(ProtocolBase, render_data) - 52usize];
15718 ["Offset of field: ProtocolBase::render_brief_data"]
15719 [::core::mem::offset_of!(ProtocolBase, render_brief_data) - 56usize];
15720 ["Offset of field: ProtocolBase::write_data"]
15721 [::core::mem::offset_of!(ProtocolBase, write_data) - 60usize];
15722};
15723#[repr(C)]
15724#[derive(Debug, Copy, Clone)]
15725pub struct ProtocolDict {
15726 _unused: [u8; 0],
15727}
15728pub type ProtocolId = i32;
15729unsafe extern "C" {
15730 pub fn protocol_dict_alloc(
15731 protocols: *const *const ProtocolBase,
15732 protocol_count: usize,
15733 ) -> *mut ProtocolDict;
15734}
15735unsafe extern "C" {
15736 pub fn protocol_dict_free(dict: *mut ProtocolDict);
15737}
15738unsafe extern "C" {
15739 pub fn protocol_dict_set_data(
15740 dict: *mut ProtocolDict,
15741 protocol_index: usize,
15742 data: *const u8,
15743 data_size: usize,
15744 );
15745}
15746unsafe extern "C" {
15747 pub fn protocol_dict_get_data(
15748 dict: *mut ProtocolDict,
15749 protocol_index: usize,
15750 data: *mut u8,
15751 data_size: usize,
15752 );
15753}
15754unsafe extern "C" {
15755 pub fn protocol_dict_get_data_size(dict: *mut ProtocolDict, protocol_index: usize) -> usize;
15756}
15757unsafe extern "C" {
15758 pub fn protocol_dict_get_max_data_size(dict: *mut ProtocolDict) -> usize;
15759}
15760unsafe extern "C" {
15761 pub fn protocol_dict_get_name(
15762 dict: *mut ProtocolDict,
15763 protocol_index: usize,
15764 ) -> *const core::ffi::c_char;
15765}
15766unsafe extern "C" {
15767 pub fn protocol_dict_get_manufacturer(
15768 dict: *mut ProtocolDict,
15769 protocol_index: usize,
15770 ) -> *const core::ffi::c_char;
15771}
15772unsafe extern "C" {
15773 pub fn protocol_dict_decoders_start(dict: *mut ProtocolDict);
15774}
15775unsafe extern "C" {
15776 pub fn protocol_dict_get_features(dict: *mut ProtocolDict, protocol_index: usize) -> u32;
15777}
15778unsafe extern "C" {
15779 pub fn protocol_dict_decoders_feed(
15780 dict: *mut ProtocolDict,
15781 level: bool,
15782 duration: u32,
15783 ) -> ProtocolId;
15784}
15785unsafe extern "C" {
15786 pub fn protocol_dict_decoders_feed_by_feature(
15787 dict: *mut ProtocolDict,
15788 feature: u32,
15789 level: bool,
15790 duration: u32,
15791 ) -> ProtocolId;
15792}
15793unsafe extern "C" {
15794 pub fn protocol_dict_decoders_feed_by_id(
15795 dict: *mut ProtocolDict,
15796 protocol_index: usize,
15797 level: bool,
15798 duration: u32,
15799 ) -> ProtocolId;
15800}
15801unsafe extern "C" {
15802 pub fn protocol_dict_encoder_start(dict: *mut ProtocolDict, protocol_index: usize) -> bool;
15803}
15804unsafe extern "C" {
15805 pub fn protocol_dict_encoder_yield(
15806 dict: *mut ProtocolDict,
15807 protocol_index: usize,
15808 ) -> LevelDuration;
15809}
15810unsafe extern "C" {
15811 pub fn protocol_dict_render_uid(
15812 dict: *mut ProtocolDict,
15813 result: *mut FuriString,
15814 protocol_index: usize,
15815 );
15816}
15817unsafe extern "C" {
15818 pub fn protocol_dict_render_data(
15819 dict: *mut ProtocolDict,
15820 result: *mut FuriString,
15821 protocol_index: usize,
15822 );
15823}
15824unsafe extern "C" {
15825 pub fn protocol_dict_render_brief_data(
15826 dict: *mut ProtocolDict,
15827 result: *mut FuriString,
15828 protocol_index: usize,
15829 );
15830}
15831unsafe extern "C" {
15832 pub fn protocol_dict_get_validate_count(dict: *mut ProtocolDict, protocol_index: usize) -> u32;
15833}
15834unsafe extern "C" {
15835 pub fn protocol_dict_get_protocol_by_name(
15836 dict: *mut ProtocolDict,
15837 name: *const core::ffi::c_char,
15838 ) -> ProtocolId;
15839}
15840unsafe extern "C" {
15841 pub fn protocol_dict_get_write_data(
15842 dict: *mut ProtocolDict,
15843 protocol_index: usize,
15844 data: *mut core::ffi::c_void,
15845 ) -> bool;
15846}
15847#[repr(C)]
15848#[derive(Debug, Copy, Clone)]
15849pub struct LFRFIDT5577 {
15850 pub block: [u32; 8usize],
15851 pub blocks_to_write: u32,
15852 pub mask: u8,
15853}
15854#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15855const _: () = {
15856 ["Size of LFRFIDT5577"][::core::mem::size_of::<LFRFIDT5577>() - 40usize];
15857 ["Alignment of LFRFIDT5577"][::core::mem::align_of::<LFRFIDT5577>() - 4usize];
15858 ["Offset of field: LFRFIDT5577::block"][::core::mem::offset_of!(LFRFIDT5577, block) - 0usize];
15859 ["Offset of field: LFRFIDT5577::blocks_to_write"]
15860 [::core::mem::offset_of!(LFRFIDT5577, blocks_to_write) - 32usize];
15861 ["Offset of field: LFRFIDT5577::mask"][::core::mem::offset_of!(LFRFIDT5577, mask) - 36usize];
15862};
15863unsafe extern "C" {
15864 #[doc = "Write T5577 tag data to tag\n\n # Arguments\n\n* `data` -"]
15865 pub fn t5577_write(data: *mut LFRFIDT5577);
15866}
15867unsafe extern "C" {
15868 pub fn t5577_write_with_pass(data: *mut LFRFIDT5577, password: u32);
15869}
15870unsafe extern "C" {
15871 pub fn t5577_write_with_mask(data: *mut LFRFIDT5577, page: u8, with_pass: bool, password: u32);
15872}
15873#[repr(C)]
15874#[derive(Debug, Copy, Clone)]
15875pub struct LFRFIDEM4305 {
15876 #[doc = "< Word data to write"]
15877 pub word: [u32; 16usize],
15878 #[doc = "< Word mask"]
15879 pub mask: u16,
15880}
15881#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15882const _: () = {
15883 ["Size of LFRFIDEM4305"][::core::mem::size_of::<LFRFIDEM4305>() - 68usize];
15884 ["Alignment of LFRFIDEM4305"][::core::mem::align_of::<LFRFIDEM4305>() - 4usize];
15885 ["Offset of field: LFRFIDEM4305::word"][::core::mem::offset_of!(LFRFIDEM4305, word) - 0usize];
15886 ["Offset of field: LFRFIDEM4305::mask"][::core::mem::offset_of!(LFRFIDEM4305, mask) - 64usize];
15887};
15888unsafe extern "C" {
15889 #[doc = "Write EM4305 tag data to tag\n\n # Arguments\n\n* `data` - The data to write (mask is taken from that data)"]
15890 pub fn em4305_write(data: *mut LFRFIDEM4305);
15891}
15892pub const LFRFIDFeatureASK: LFRFIDFeature = LFRFIDFeature(1);
15893#[doc = "ASK Demodulation"]
15894pub const LFRFIDFeaturePSK: LFRFIDFeature = LFRFIDFeature(2);
15895#[repr(transparent)]
15896#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15897pub struct LFRFIDFeature(pub core::ffi::c_uchar);
15898pub const LFRFIDProtocolEM4100: LFRFIDProtocol = LFRFIDProtocol(0);
15899pub const LFRFIDProtocolEM410032: LFRFIDProtocol = LFRFIDProtocol(1);
15900pub const LFRFIDProtocolEM410016: LFRFIDProtocol = LFRFIDProtocol(2);
15901pub const LFRFIDProtocolElectra: LFRFIDProtocol = LFRFIDProtocol(3);
15902pub const LFRFIDProtocolH10301: LFRFIDProtocol = LFRFIDProtocol(4);
15903pub const LFRFIDProtocolIdteck: LFRFIDProtocol = LFRFIDProtocol(5);
15904pub const LFRFIDProtocolIndala26: LFRFIDProtocol = LFRFIDProtocol(6);
15905pub const LFRFIDProtocolIOProxXSF: LFRFIDProtocol = LFRFIDProtocol(7);
15906pub const LFRFIDProtocolAwid: LFRFIDProtocol = LFRFIDProtocol(8);
15907pub const LFRFIDProtocolFDXA: LFRFIDProtocol = LFRFIDProtocol(9);
15908pub const LFRFIDProtocolFDXB: LFRFIDProtocol = LFRFIDProtocol(10);
15909pub const LFRFIDProtocolHidGeneric: LFRFIDProtocol = LFRFIDProtocol(11);
15910pub const LFRFIDProtocolHidExGeneric: LFRFIDProtocol = LFRFIDProtocol(12);
15911pub const LFRFIDProtocolPyramid: LFRFIDProtocol = LFRFIDProtocol(13);
15912pub const LFRFIDProtocolViking: LFRFIDProtocol = LFRFIDProtocol(14);
15913pub const LFRFIDProtocolJablotron: LFRFIDProtocol = LFRFIDProtocol(15);
15914pub const LFRFIDProtocolParadox: LFRFIDProtocol = LFRFIDProtocol(16);
15915pub const LFRFIDProtocolPACStanley: LFRFIDProtocol = LFRFIDProtocol(17);
15916pub const LFRFIDProtocolKeri: LFRFIDProtocol = LFRFIDProtocol(18);
15917pub const LFRFIDProtocolGallagher: LFRFIDProtocol = LFRFIDProtocol(19);
15918pub const LFRFIDProtocolNexwatch: LFRFIDProtocol = LFRFIDProtocol(20);
15919pub const LFRFIDProtocolSecurakey: LFRFIDProtocol = LFRFIDProtocol(21);
15920pub const LFRFIDProtocolGProxII: LFRFIDProtocol = LFRFIDProtocol(22);
15921pub const LFRFIDProtocolNoralsy: LFRFIDProtocol = LFRFIDProtocol(23);
15922pub const LFRFIDProtocolMax: LFRFIDProtocol = LFRFIDProtocol(24);
15923#[repr(transparent)]
15924#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15925pub struct LFRFIDProtocol(pub core::ffi::c_uchar);
15926unsafe extern "C" {
15927 pub static lfrfid_protocols: [*const ProtocolBase; 0usize];
15928}
15929pub const LFRFIDWriteTypeT5577: LFRFIDWriteType = LFRFIDWriteType(0);
15930pub const LFRFIDWriteTypeEM4305: LFRFIDWriteType = LFRFIDWriteType(1);
15931pub const LFRFIDWriteTypeMax: LFRFIDWriteType = LFRFIDWriteType(2);
15932#[repr(transparent)]
15933#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15934pub struct LFRFIDWriteType(pub core::ffi::c_uchar);
15935#[repr(C)]
15936#[derive(Copy, Clone)]
15937pub struct LFRFIDWriteRequest {
15938 pub write_type: LFRFIDWriteType,
15939 pub __bindgen_anon_1: LFRFIDWriteRequest__bindgen_ty_1,
15940}
15941#[repr(C)]
15942#[derive(Copy, Clone)]
15943pub union LFRFIDWriteRequest__bindgen_ty_1 {
15944 pub t5577: LFRFIDT5577,
15945 pub em4305: LFRFIDEM4305,
15946}
15947#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15948const _: () = {
15949 ["Size of LFRFIDWriteRequest__bindgen_ty_1"]
15950 [::core::mem::size_of::<LFRFIDWriteRequest__bindgen_ty_1>() - 68usize];
15951 ["Alignment of LFRFIDWriteRequest__bindgen_ty_1"]
15952 [::core::mem::align_of::<LFRFIDWriteRequest__bindgen_ty_1>() - 4usize];
15953 ["Offset of field: LFRFIDWriteRequest__bindgen_ty_1::t5577"]
15954 [::core::mem::offset_of!(LFRFIDWriteRequest__bindgen_ty_1, t5577) - 0usize];
15955 ["Offset of field: LFRFIDWriteRequest__bindgen_ty_1::em4305"]
15956 [::core::mem::offset_of!(LFRFIDWriteRequest__bindgen_ty_1, em4305) - 0usize];
15957};
15958#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15959const _: () = {
15960 ["Size of LFRFIDWriteRequest"][::core::mem::size_of::<LFRFIDWriteRequest>() - 72usize];
15961 ["Alignment of LFRFIDWriteRequest"][::core::mem::align_of::<LFRFIDWriteRequest>() - 4usize];
15962 ["Offset of field: LFRFIDWriteRequest::write_type"]
15963 [::core::mem::offset_of!(LFRFIDWriteRequest, write_type) - 0usize];
15964};
15965unsafe extern "C" {
15966 #[doc = "Save protocol from dictionary to file\n\n # Arguments\n\n* `dict` -\n * `protocol` -\n * `filename` -\n # Returns\n\ntrue\n false"]
15967 pub fn lfrfid_dict_file_save(
15968 dict: *mut ProtocolDict,
15969 protocol: ProtocolId,
15970 filename: *const core::ffi::c_char,
15971 ) -> bool;
15972}
15973unsafe extern "C" {
15974 #[doc = "Load protocol from file to dictionary\n\n # Arguments\n\n* `dict` -\n * `filename` -\n # Returns\n\nProtocolId"]
15975 pub fn lfrfid_dict_file_load(
15976 dict: *mut ProtocolDict,
15977 filename: *const core::ffi::c_char,
15978 ) -> ProtocolId;
15979}
15980#[repr(C)]
15981#[derive(Debug, Copy, Clone)]
15982pub struct LFRFIDRawFile {
15983 _unused: [u8; 0],
15984}
15985unsafe extern "C" {
15986 #[doc = "Allocate a new LFRFIDRawFile instance\n\n # Arguments\n\n* `storage` -\n # Returns\n\nLFRFIDRawFile*"]
15987 pub fn lfrfid_raw_file_alloc(storage: *mut Storage) -> *mut LFRFIDRawFile;
15988}
15989unsafe extern "C" {
15990 #[doc = "Free a LFRFIDRawFile instance\n\n # Arguments\n\n* `file` -"]
15991 pub fn lfrfid_raw_file_free(file: *mut LFRFIDRawFile);
15992}
15993unsafe extern "C" {
15994 #[doc = "Open RAW file for writing\n\n # Arguments\n\n* `file` -\n * `file_path` -\n # Returns\n\nbool"]
15995 pub fn lfrfid_raw_file_open_write(
15996 file: *mut LFRFIDRawFile,
15997 file_path: *const core::ffi::c_char,
15998 ) -> bool;
15999}
16000unsafe extern "C" {
16001 #[doc = "Open RAW file for reading\n # Arguments\n\n* `file` -\n * `file_path` -\n # Returns\n\nbool"]
16002 pub fn lfrfid_raw_file_open_read(
16003 file: *mut LFRFIDRawFile,
16004 file_path: *const core::ffi::c_char,
16005 ) -> bool;
16006}
16007unsafe extern "C" {
16008 #[doc = "Write RAW file header\n\n # Arguments\n\n* `file` -\n * `frequency` -\n * `duty_cycle` -\n * `max_buffer_size` -\n # Returns\n\nbool"]
16009 pub fn lfrfid_raw_file_write_header(
16010 file: *mut LFRFIDRawFile,
16011 frequency: f32,
16012 duty_cycle: f32,
16013 max_buffer_size: u32,
16014 ) -> bool;
16015}
16016unsafe extern "C" {
16017 #[doc = "Write data to RAW file\n\n # Arguments\n\n* `file` -\n * `buffer_data` -\n * `buffer_size` -\n # Returns\n\nbool"]
16018 pub fn lfrfid_raw_file_write_buffer(
16019 file: *mut LFRFIDRawFile,
16020 buffer_data: *mut u8,
16021 buffer_size: usize,
16022 ) -> bool;
16023}
16024unsafe extern "C" {
16025 #[doc = "Read RAW file header\n\n # Arguments\n\n* `file` -\n * `frequency` -\n * `duty_cycle` -\n # Returns\n\nbool"]
16026 pub fn lfrfid_raw_file_read_header(
16027 file: *mut LFRFIDRawFile,
16028 frequency: *mut f32,
16029 duty_cycle: *mut f32,
16030 ) -> bool;
16031}
16032unsafe extern "C" {
16033 #[doc = "Read varint-encoded pair from RAW file\n\n # Arguments\n\n* `file` -\n * `duration` -\n * `pulse` -\n * `pass_end` - file was wrapped around, can be NULL\n # Returns\n\nbool"]
16034 pub fn lfrfid_raw_file_read_pair(
16035 file: *mut LFRFIDRawFile,
16036 duration: *mut u32,
16037 pulse: *mut u32,
16038 pass_end: *mut bool,
16039 ) -> bool;
16040}
16041pub const LFRFIDWorkerWriteOK: LFRFIDWorkerWriteResult = LFRFIDWorkerWriteResult(0);
16042pub const LFRFIDWorkerWriteProtocolCannotBeWritten: LFRFIDWorkerWriteResult =
16043 LFRFIDWorkerWriteResult(1);
16044pub const LFRFIDWorkerWriteFobCannotBeWritten: LFRFIDWorkerWriteResult = LFRFIDWorkerWriteResult(2);
16045pub const LFRFIDWorkerWriteTooLongToWrite: LFRFIDWorkerWriteResult = LFRFIDWorkerWriteResult(3);
16046#[repr(transparent)]
16047#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16048pub struct LFRFIDWorkerWriteResult(pub core::ffi::c_uchar);
16049pub const LFRFIDWorkerReadTypeAuto: LFRFIDWorkerReadType = LFRFIDWorkerReadType(0);
16050pub const LFRFIDWorkerReadTypeASKOnly: LFRFIDWorkerReadType = LFRFIDWorkerReadType(1);
16051pub const LFRFIDWorkerReadTypePSKOnly: LFRFIDWorkerReadType = LFRFIDWorkerReadType(2);
16052#[repr(transparent)]
16053#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16054pub struct LFRFIDWorkerReadType(pub core::ffi::c_uchar);
16055pub const LFRFIDWorkerReadSenseStart: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(0);
16056pub const LFRFIDWorkerReadSenseEnd: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(1);
16057pub const LFRFIDWorkerReadSenseCardStart: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(2);
16058pub const LFRFIDWorkerReadSenseCardEnd: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(3);
16059pub const LFRFIDWorkerReadStartASK: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(4);
16060pub const LFRFIDWorkerReadStartPSK: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(5);
16061pub const LFRFIDWorkerReadDone: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(6);
16062#[repr(transparent)]
16063#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16064pub struct LFRFIDWorkerReadResult(pub core::ffi::c_uchar);
16065pub const LFRFIDWorkerReadRawFileError: LFRFIDWorkerReadRawResult = LFRFIDWorkerReadRawResult(0);
16066pub const LFRFIDWorkerReadRawOverrun: LFRFIDWorkerReadRawResult = LFRFIDWorkerReadRawResult(1);
16067#[repr(transparent)]
16068#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16069pub struct LFRFIDWorkerReadRawResult(pub core::ffi::c_uchar);
16070pub const LFRFIDWorkerEmulateRawFileError: LFRFIDWorkerEmulateRawResult =
16071 LFRFIDWorkerEmulateRawResult(0);
16072pub const LFRFIDWorkerEmulateRawOverrun: LFRFIDWorkerEmulateRawResult =
16073 LFRFIDWorkerEmulateRawResult(1);
16074#[repr(transparent)]
16075#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16076pub struct LFRFIDWorkerEmulateRawResult(pub core::ffi::c_uchar);
16077pub type LFRFIDWorkerReadCallback = ::core::option::Option<
16078 unsafe extern "C" fn(
16079 result: LFRFIDWorkerReadResult,
16080 protocol: ProtocolId,
16081 context: *mut core::ffi::c_void,
16082 ),
16083>;
16084pub type LFRFIDWorkerWriteCallback = ::core::option::Option<
16085 unsafe extern "C" fn(result: LFRFIDWorkerWriteResult, context: *mut core::ffi::c_void),
16086>;
16087pub type LFRFIDWorkerReadRawCallback = ::core::option::Option<
16088 unsafe extern "C" fn(result: LFRFIDWorkerReadRawResult, context: *mut core::ffi::c_void),
16089>;
16090pub type LFRFIDWorkerEmulateRawCallback = ::core::option::Option<
16091 unsafe extern "C" fn(result: LFRFIDWorkerEmulateRawResult, context: *mut core::ffi::c_void),
16092>;
16093#[repr(C)]
16094#[derive(Debug, Copy, Clone)]
16095pub struct LFRFIDWorker {
16096 _unused: [u8; 0],
16097}
16098unsafe extern "C" {
16099 #[doc = "Allocate LF-RFID worker\n # Returns\n\nLFRFIDWorker*"]
16100 pub fn lfrfid_worker_alloc(dict: *mut ProtocolDict) -> *mut LFRFIDWorker;
16101}
16102unsafe extern "C" {
16103 #[doc = "Free LF-RFID worker\n\n # Arguments\n\n* `worker` - The worker"]
16104 pub fn lfrfid_worker_free(worker: *mut LFRFIDWorker);
16105}
16106unsafe extern "C" {
16107 #[doc = "Start LF-RFID worker thread\n\n # Arguments\n\n* `worker` - The worker"]
16108 pub fn lfrfid_worker_start_thread(worker: *mut LFRFIDWorker);
16109}
16110unsafe extern "C" {
16111 #[doc = "Stop LF-RFID worker thread\n\n # Arguments\n\n* `worker` - The worker"]
16112 pub fn lfrfid_worker_stop_thread(worker: *mut LFRFIDWorker);
16113}
16114unsafe extern "C" {
16115 #[doc = "Start read mode\n\n # Arguments\n\n* `worker` - The worker\n * `type` - The type\n * `callback` - The callback\n * `context` - The context"]
16116 pub fn lfrfid_worker_read_start(
16117 worker: *mut LFRFIDWorker,
16118 type_: LFRFIDWorkerReadType,
16119 callback: LFRFIDWorkerReadCallback,
16120 context: *mut core::ffi::c_void,
16121 );
16122}
16123unsafe extern "C" {
16124 #[doc = "Start write mode\n\n # Arguments\n\n* `worker` - The worker\n * `protocol` - The protocol\n * `callback` - The callback\n * `context` - The context"]
16125 pub fn lfrfid_worker_write_start(
16126 worker: *mut LFRFIDWorker,
16127 protocol: LFRFIDProtocol,
16128 callback: LFRFIDWorkerWriteCallback,
16129 context: *mut core::ffi::c_void,
16130 );
16131}
16132unsafe extern "C" {
16133 #[doc = "Start emulate mode\n\n # Arguments\n\n* `worker` - The worker\n * `protocol` (direction in) - The protocol"]
16134 pub fn lfrfid_worker_emulate_start(worker: *mut LFRFIDWorker, protocol: LFRFIDProtocol);
16135}
16136unsafe extern "C" {
16137 #[doc = "Start raw read mode\n\n # Arguments\n\n* `worker` - The worker\n * `filename` - The filename\n * `type` - The type\n * `callback` - The callback\n * `context` - The context"]
16138 pub fn lfrfid_worker_read_raw_start(
16139 worker: *mut LFRFIDWorker,
16140 filename: *const core::ffi::c_char,
16141 type_: LFRFIDWorkerReadType,
16142 callback: LFRFIDWorkerReadRawCallback,
16143 context: *mut core::ffi::c_void,
16144 );
16145}
16146unsafe extern "C" {
16147 #[doc = "Emulate raw read mode\n\n # Arguments\n\n* `worker` - The worker\n * `filename` - The filename\n * `callback` - The callback\n * `context` - The context"]
16148 pub fn lfrfid_worker_emulate_raw_start(
16149 worker: *mut LFRFIDWorker,
16150 filename: *const core::ffi::c_char,
16151 callback: LFRFIDWorkerEmulateRawCallback,
16152 context: *mut core::ffi::c_void,
16153 );
16154}
16155unsafe extern "C" {
16156 #[doc = "Stop all modes\n\n # Arguments\n\n* `worker` - The worker"]
16157 pub fn lfrfid_worker_stop(worker: *mut LFRFIDWorker);
16158}
16159#[repr(C)]
16160#[derive(Debug, Copy, Clone)]
16161pub struct LFRFIDRawWorker {
16162 _unused: [u8; 0],
16163}
16164unsafe extern "C" {
16165 #[doc = "Allocate a new LFRFIDRawWorker instance\n\n # Returns\n\nLFRFIDRawWorker*"]
16166 pub fn lfrfid_raw_worker_alloc() -> *mut LFRFIDRawWorker;
16167}
16168unsafe extern "C" {
16169 #[doc = "Free a LFRFIDRawWorker instance\n\n # Arguments\n\n* `worker` - LFRFIDRawWorker instance"]
16170 pub fn lfrfid_raw_worker_free(worker: *mut LFRFIDRawWorker);
16171}
16172unsafe extern "C" {
16173 #[doc = "Start reading\n\n # Arguments\n\n* `worker` - LFRFIDRawWorker instance\n * `file_path` - path where file will be saved\n * `frequency` - HW frequency\n * `duty_cycle` - HW duty cycle\n * `callback` - callback for read event\n * `context` - context for callback"]
16174 pub fn lfrfid_raw_worker_start_read(
16175 worker: *mut LFRFIDRawWorker,
16176 file_path: *const core::ffi::c_char,
16177 frequency: f32,
16178 duty_cycle: f32,
16179 callback: LFRFIDWorkerReadRawCallback,
16180 context: *mut core::ffi::c_void,
16181 );
16182}
16183unsafe extern "C" {
16184 #[doc = "Start emulate\n\n # Arguments\n\n* `worker` - LFRFIDRawWorker instance\n * `file_path` - path to file that will be emulated\n * `callback` - callback for emulate event\n * `context` - context for callback"]
16185 pub fn lfrfid_raw_worker_start_emulate(
16186 worker: *mut LFRFIDRawWorker,
16187 file_path: *const core::ffi::c_char,
16188 callback: LFRFIDWorkerEmulateRawCallback,
16189 context: *mut core::ffi::c_void,
16190 );
16191}
16192unsafe extern "C" {
16193 #[doc = "Stop worker\n\n # Arguments\n\n* `worker` -"]
16194 pub fn lfrfid_raw_worker_stop(worker: *mut LFRFIDRawWorker);
16195}
16196#[doc = "Line Coding Structure"]
16197#[repr(C, packed)]
16198#[derive(Debug, Copy, Clone)]
16199pub struct usb_cdc_line_coding {
16200 #[doc = "<Data terminal rate, in bits per second."]
16201 pub dwDTERate: u32,
16202 #[doc = "<Stop bits."]
16203 pub bCharFormat: u8,
16204 #[doc = "<Parity."]
16205 pub bParityType: u8,
16206 #[doc = "<Data bits (5,6,7,8 or 16)."]
16207 pub bDataBits: u8,
16208}
16209#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16210const _: () = {
16211 ["Size of usb_cdc_line_coding"][::core::mem::size_of::<usb_cdc_line_coding>() - 7usize];
16212 ["Alignment of usb_cdc_line_coding"][::core::mem::align_of::<usb_cdc_line_coding>() - 1usize];
16213 ["Offset of field: usb_cdc_line_coding::dwDTERate"]
16214 [::core::mem::offset_of!(usb_cdc_line_coding, dwDTERate) - 0usize];
16215 ["Offset of field: usb_cdc_line_coding::bCharFormat"]
16216 [::core::mem::offset_of!(usb_cdc_line_coding, bCharFormat) - 4usize];
16217 ["Offset of field: usb_cdc_line_coding::bParityType"]
16218 [::core::mem::offset_of!(usb_cdc_line_coding, bParityType) - 5usize];
16219 ["Offset of field: usb_cdc_line_coding::bDataBits"]
16220 [::core::mem::offset_of!(usb_cdc_line_coding, bDataBits) - 6usize];
16221};
16222#[doc = "Triple-DES context structure\n\n DES/3DES are considered weak ciphers and their use constitutes a\n security risk. We recommend considering stronger ciphers\n instead."]
16223#[repr(C)]
16224#[derive(Debug, Copy, Clone)]
16225pub struct mbedtls_des3_context {
16226 #[doc = "< 3DES subkeys"]
16227 pub private_sk: [u32; 96usize],
16228}
16229#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16230const _: () = {
16231 ["Size of mbedtls_des3_context"][::core::mem::size_of::<mbedtls_des3_context>() - 384usize];
16232 ["Alignment of mbedtls_des3_context"][::core::mem::align_of::<mbedtls_des3_context>() - 4usize];
16233 ["Offset of field: mbedtls_des3_context::private_sk"]
16234 [::core::mem::offset_of!(mbedtls_des3_context, private_sk) - 0usize];
16235};
16236pub type mjs_val_t = u64;
16237#[repr(C)]
16238#[derive(Debug, Copy, Clone)]
16239pub struct mjs {
16240 _unused: [u8; 0],
16241}
16242pub const MJS_TYPE_UNDEFINED: mjs_type = mjs_type(0);
16243pub const MJS_TYPE_NULL: mjs_type = mjs_type(1);
16244pub const MJS_TYPE_BOOLEAN: mjs_type = mjs_type(2);
16245pub const MJS_TYPE_NUMBER: mjs_type = mjs_type(3);
16246pub const MJS_TYPE_STRING: mjs_type = mjs_type(4);
16247pub const MJS_TYPE_FOREIGN: mjs_type = mjs_type(5);
16248pub const MJS_TYPE_ARRAY_BUF: mjs_type = mjs_type(6);
16249pub const MJS_TYPE_ARRAY_BUF_VIEW: mjs_type = mjs_type(7);
16250pub const MJS_TYPE_OBJECT_GENERIC: mjs_type = mjs_type(8);
16251pub const MJS_TYPE_OBJECT_ARRAY: mjs_type = mjs_type(9);
16252pub const MJS_TYPE_OBJECT_FUNCTION: mjs_type = mjs_type(10);
16253pub const MJS_TYPES_CNT: mjs_type = mjs_type(11);
16254#[repr(transparent)]
16255#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16256pub struct mjs_type(pub core::ffi::c_uchar);
16257pub const MJS_OK: mjs_err = mjs_err(0);
16258pub const MJS_SYNTAX_ERROR: mjs_err = mjs_err(1);
16259pub const MJS_REFERENCE_ERROR: mjs_err = mjs_err(2);
16260pub const MJS_TYPE_ERROR: mjs_err = mjs_err(3);
16261pub const MJS_OUT_OF_MEMORY: mjs_err = mjs_err(4);
16262pub const MJS_INTERNAL_ERROR: mjs_err = mjs_err(5);
16263pub const MJS_NOT_IMPLEMENTED_ERROR: mjs_err = mjs_err(6);
16264pub const MJS_FILE_READ_ERROR: mjs_err = mjs_err(7);
16265pub const MJS_BAD_ARGS_ERROR: mjs_err = mjs_err(8);
16266pub const MJS_NEED_EXIT: mjs_err = mjs_err(9);
16267pub const MJS_ERRS_CNT: mjs_err = mjs_err(10);
16268#[repr(transparent)]
16269#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16270pub struct mjs_err(pub core::ffi::c_uchar);
16271pub use self::mjs_err as mjs_err_t;
16272pub type mjs_flags_poller_t = ::core::option::Option<unsafe extern "C" fn(mjs: *mut mjs)>;
16273unsafe extern "C" {
16274 pub fn mjs_create(context: *mut core::ffi::c_void) -> *mut mjs;
16275}
16276unsafe extern "C" {
16277 pub fn mjs_destroy(mjs: *mut mjs);
16278}
16279unsafe extern "C" {
16280 pub fn mjs_get_global(mjs: *mut mjs) -> mjs_val_t;
16281}
16282unsafe extern "C" {
16283 pub fn mjs_own(mjs: *mut mjs, v: *mut mjs_val_t);
16284}
16285unsafe extern "C" {
16286 pub fn mjs_disown(mjs: *mut mjs, v: *mut mjs_val_t) -> core::ffi::c_int;
16287}
16288unsafe extern "C" {
16289 pub fn mjs_set_errorf(
16290 mjs: *mut mjs,
16291 err: mjs_err_t,
16292 fmt: *const core::ffi::c_char,
16293 ...
16294 ) -> mjs_err_t;
16295}
16296unsafe extern "C" {
16297 pub fn mjs_exit(mjs: *mut mjs);
16298}
16299unsafe extern "C" {
16300 pub fn mjs_set_exec_flags_poller(mjs: *mut mjs, poller: mjs_flags_poller_t);
16301}
16302unsafe extern "C" {
16303 pub fn mjs_get_context(mjs: *mut mjs) -> *mut core::ffi::c_void;
16304}
16305unsafe extern "C" {
16306 pub fn mjs_prepend_errorf(
16307 mjs: *mut mjs,
16308 err: mjs_err_t,
16309 fmt: *const core::ffi::c_char,
16310 ...
16311 ) -> mjs_err_t;
16312}
16313unsafe extern "C" {
16314 pub fn mjs_print_error(
16315 mjs: *mut mjs,
16316 fp: *mut FILE,
16317 msg: *const core::ffi::c_char,
16318 print_stack_trace: core::ffi::c_int,
16319 );
16320}
16321unsafe extern "C" {
16322 pub fn mjs_strerror(mjs: *mut mjs, err: mjs_err) -> *const core::ffi::c_char;
16323}
16324unsafe extern "C" {
16325 pub fn mjs_get_stack_trace(mjs: *mut mjs) -> *const core::ffi::c_char;
16326}
16327unsafe extern "C" {
16328 pub fn mjs_set_generate_jsc(mjs: *mut mjs, generate_jsc: core::ffi::c_int);
16329}
16330unsafe extern "C" {
16331 pub fn mjs_nargs(mjs: *mut mjs) -> core::ffi::c_int;
16332}
16333unsafe extern "C" {
16334 pub fn mjs_arg(mjs: *mut mjs, n: core::ffi::c_int) -> mjs_val_t;
16335}
16336unsafe extern "C" {
16337 pub fn mjs_return(mjs: *mut mjs, v: mjs_val_t);
16338}
16339pub const MJS_DATAVIEW_U8: mjs_dataview_type_t = mjs_dataview_type_t(0);
16340pub const MJS_DATAVIEW_I8: mjs_dataview_type_t = mjs_dataview_type_t(1);
16341pub const MJS_DATAVIEW_U16: mjs_dataview_type_t = mjs_dataview_type_t(2);
16342pub const MJS_DATAVIEW_I16: mjs_dataview_type_t = mjs_dataview_type_t(3);
16343pub const MJS_DATAVIEW_U32: mjs_dataview_type_t = mjs_dataview_type_t(4);
16344pub const MJS_DATAVIEW_I32: mjs_dataview_type_t = mjs_dataview_type_t(5);
16345#[repr(transparent)]
16346#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16347pub struct mjs_dataview_type_t(pub core::ffi::c_uchar);
16348unsafe extern "C" {
16349 pub fn mjs_is_array_buf(v: mjs_val_t) -> core::ffi::c_int;
16350}
16351unsafe extern "C" {
16352 pub fn mjs_is_data_view(v: mjs_val_t) -> core::ffi::c_int;
16353}
16354unsafe extern "C" {
16355 pub fn mjs_is_typed_array(v: mjs_val_t) -> core::ffi::c_int;
16356}
16357unsafe extern "C" {
16358 pub fn mjs_mk_array_buf(
16359 mjs: *mut mjs,
16360 data: *mut core::ffi::c_char,
16361 buf_len: usize,
16362 ) -> mjs_val_t;
16363}
16364unsafe extern "C" {
16365 pub fn mjs_array_buf_get_ptr(
16366 mjs: *mut mjs,
16367 buf: mjs_val_t,
16368 bytelen: *mut usize,
16369 ) -> *mut core::ffi::c_char;
16370}
16371unsafe extern "C" {
16372 pub fn mjs_dataview_get_buf(mjs: *mut mjs, obj: mjs_val_t) -> mjs_val_t;
16373}
16374unsafe extern "C" {
16375 pub fn mjs_mk_array(mjs: *mut mjs) -> mjs_val_t;
16376}
16377unsafe extern "C" {
16378 pub fn mjs_array_length(mjs: *mut mjs, arr: mjs_val_t) -> core::ffi::c_ulong;
16379}
16380unsafe extern "C" {
16381 pub fn mjs_array_push(mjs: *mut mjs, arr: mjs_val_t, v: mjs_val_t) -> mjs_err_t;
16382}
16383unsafe extern "C" {
16384 pub fn mjs_array_get(arg1: *mut mjs, arr: mjs_val_t, index: core::ffi::c_ulong) -> mjs_val_t;
16385}
16386unsafe extern "C" {
16387 pub fn mjs_array_set(
16388 mjs: *mut mjs,
16389 arr: mjs_val_t,
16390 index: core::ffi::c_ulong,
16391 v: mjs_val_t,
16392 ) -> mjs_err_t;
16393}
16394unsafe extern "C" {
16395 pub fn mjs_is_array(v: mjs_val_t) -> core::ffi::c_int;
16396}
16397unsafe extern "C" {
16398 pub fn mjs_array_del(mjs: *mut mjs, arr: mjs_val_t, index: core::ffi::c_ulong);
16399}
16400unsafe extern "C" {
16401 pub fn mjs_exec(
16402 arg1: *mut mjs,
16403 src: *const core::ffi::c_char,
16404 res: *mut mjs_val_t,
16405 ) -> mjs_err_t;
16406}
16407unsafe extern "C" {
16408 pub fn mjs_exec_file(
16409 mjs: *mut mjs,
16410 path: *const core::ffi::c_char,
16411 res: *mut mjs_val_t,
16412 ) -> mjs_err_t;
16413}
16414unsafe extern "C" {
16415 pub fn mjs_apply(
16416 mjs: *mut mjs,
16417 res: *mut mjs_val_t,
16418 func: mjs_val_t,
16419 this_val: mjs_val_t,
16420 nargs: core::ffi::c_int,
16421 args: *mut mjs_val_t,
16422 ) -> mjs_err_t;
16423}
16424unsafe extern "C" {
16425 pub fn mjs_call(
16426 mjs: *mut mjs,
16427 res: *mut mjs_val_t,
16428 func: mjs_val_t,
16429 this_val: mjs_val_t,
16430 nargs: core::ffi::c_int,
16431 ...
16432 ) -> mjs_err_t;
16433}
16434unsafe extern "C" {
16435 pub fn mjs_get_this(mjs: *mut mjs) -> mjs_val_t;
16436}
16437pub const MJS_FFI_CTYPE_NONE: mjs_ffi_ctype = mjs_ffi_ctype(0);
16438pub const MJS_FFI_CTYPE_USERDATA: mjs_ffi_ctype = mjs_ffi_ctype(1);
16439pub const MJS_FFI_CTYPE_CALLBACK: mjs_ffi_ctype = mjs_ffi_ctype(2);
16440pub const MJS_FFI_CTYPE_INT: mjs_ffi_ctype = mjs_ffi_ctype(3);
16441pub const MJS_FFI_CTYPE_BOOL: mjs_ffi_ctype = mjs_ffi_ctype(4);
16442pub const MJS_FFI_CTYPE_DOUBLE: mjs_ffi_ctype = mjs_ffi_ctype(5);
16443pub const MJS_FFI_CTYPE_FLOAT: mjs_ffi_ctype = mjs_ffi_ctype(6);
16444pub const MJS_FFI_CTYPE_CHAR_PTR: mjs_ffi_ctype = mjs_ffi_ctype(7);
16445pub const MJS_FFI_CTYPE_VOID_PTR: mjs_ffi_ctype = mjs_ffi_ctype(8);
16446pub const MJS_FFI_CTYPE_STRUCT_MG_STR_PTR: mjs_ffi_ctype = mjs_ffi_ctype(9);
16447pub const MJS_FFI_CTYPE_STRUCT_MG_STR: mjs_ffi_ctype = mjs_ffi_ctype(10);
16448pub const MJS_FFI_CTYPE_INVALID: mjs_ffi_ctype = mjs_ffi_ctype(11);
16449#[repr(transparent)]
16450#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16451pub struct mjs_ffi_ctype(pub core::ffi::c_uchar);
16452pub type mjs_ffi_resolver_t = ::core::option::Option<
16453 unsafe extern "C" fn(
16454 handle: *mut core::ffi::c_void,
16455 symbol: *const core::ffi::c_char,
16456 ) -> *mut core::ffi::c_void,
16457>;
16458unsafe extern "C" {
16459 pub fn mjs_set_ffi_resolver(
16460 mjs: *mut mjs,
16461 dlsym: mjs_ffi_resolver_t,
16462 handle: *mut core::ffi::c_void,
16463 );
16464}
16465unsafe extern "C" {
16466 pub fn mjs_ffi_resolve(
16467 mjs: *mut mjs,
16468 symbol: *const core::ffi::c_char,
16469 ) -> *mut core::ffi::c_void;
16470}
16471unsafe extern "C" {
16472 pub fn mjs_is_object(v: mjs_val_t) -> core::ffi::c_int;
16473}
16474unsafe extern "C" {
16475 pub fn mjs_is_object_based(v: mjs_val_t) -> core::ffi::c_int;
16476}
16477unsafe extern "C" {
16478 pub fn mjs_mk_object(mjs: *mut mjs) -> mjs_val_t;
16479}
16480pub const MJS_STRUCT_FIELD_TYPE_INVALID: mjs_struct_field_type = mjs_struct_field_type(0);
16481pub const MJS_STRUCT_FIELD_TYPE_STRUCT: mjs_struct_field_type = mjs_struct_field_type(1);
16482pub const MJS_STRUCT_FIELD_TYPE_STRUCT_PTR: mjs_struct_field_type = mjs_struct_field_type(2);
16483pub const MJS_STRUCT_FIELD_TYPE_INT: mjs_struct_field_type = mjs_struct_field_type(3);
16484pub const MJS_STRUCT_FIELD_TYPE_BOOL: mjs_struct_field_type = mjs_struct_field_type(4);
16485pub const MJS_STRUCT_FIELD_TYPE_DOUBLE: mjs_struct_field_type = mjs_struct_field_type(5);
16486pub const MJS_STRUCT_FIELD_TYPE_FLOAT: mjs_struct_field_type = mjs_struct_field_type(6);
16487pub const MJS_STRUCT_FIELD_TYPE_CHAR_PTR: mjs_struct_field_type = mjs_struct_field_type(7);
16488pub const MJS_STRUCT_FIELD_TYPE_VOID_PTR: mjs_struct_field_type = mjs_struct_field_type(8);
16489pub const MJS_STRUCT_FIELD_TYPE_MG_STR_PTR: mjs_struct_field_type = mjs_struct_field_type(9);
16490pub const MJS_STRUCT_FIELD_TYPE_MG_STR: mjs_struct_field_type = mjs_struct_field_type(10);
16491pub const MJS_STRUCT_FIELD_TYPE_DATA: mjs_struct_field_type = mjs_struct_field_type(11);
16492pub const MJS_STRUCT_FIELD_TYPE_INT8: mjs_struct_field_type = mjs_struct_field_type(12);
16493pub const MJS_STRUCT_FIELD_TYPE_INT16: mjs_struct_field_type = mjs_struct_field_type(13);
16494pub const MJS_STRUCT_FIELD_TYPE_UINT8: mjs_struct_field_type = mjs_struct_field_type(14);
16495pub const MJS_STRUCT_FIELD_TYPE_UINT16: mjs_struct_field_type = mjs_struct_field_type(15);
16496pub const MJS_STRUCT_FIELD_TYPE_CUSTOM: mjs_struct_field_type = mjs_struct_field_type(16);
16497#[repr(transparent)]
16498#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16499pub struct mjs_struct_field_type(pub core::ffi::c_uchar);
16500#[repr(C)]
16501#[derive(Debug, Copy, Clone)]
16502pub struct mjs_c_struct_member {
16503 pub name: *const core::ffi::c_char,
16504 pub offset: core::ffi::c_int,
16505 pub type_: mjs_struct_field_type,
16506 pub arg: *const core::ffi::c_void,
16507}
16508#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16509const _: () = {
16510 ["Size of mjs_c_struct_member"][::core::mem::size_of::<mjs_c_struct_member>() - 16usize];
16511 ["Alignment of mjs_c_struct_member"][::core::mem::align_of::<mjs_c_struct_member>() - 4usize];
16512 ["Offset of field: mjs_c_struct_member::name"]
16513 [::core::mem::offset_of!(mjs_c_struct_member, name) - 0usize];
16514 ["Offset of field: mjs_c_struct_member::offset"]
16515 [::core::mem::offset_of!(mjs_c_struct_member, offset) - 4usize];
16516 ["Offset of field: mjs_c_struct_member::type_"]
16517 [::core::mem::offset_of!(mjs_c_struct_member, type_) - 8usize];
16518 ["Offset of field: mjs_c_struct_member::arg"]
16519 [::core::mem::offset_of!(mjs_c_struct_member, arg) - 12usize];
16520};
16521unsafe extern "C" {
16522 pub fn mjs_struct_to_obj(
16523 mjs: *mut mjs,
16524 base: *const core::ffi::c_void,
16525 members: *const mjs_c_struct_member,
16526 ) -> mjs_val_t;
16527}
16528unsafe extern "C" {
16529 pub fn mjs_get(
16530 mjs: *mut mjs,
16531 obj: mjs_val_t,
16532 name: *const core::ffi::c_char,
16533 name_len: usize,
16534 ) -> mjs_val_t;
16535}
16536unsafe extern "C" {
16537 pub fn mjs_get_v(mjs: *mut mjs, obj: mjs_val_t, name: mjs_val_t) -> mjs_val_t;
16538}
16539unsafe extern "C" {
16540 pub fn mjs_get_v_proto(mjs: *mut mjs, obj: mjs_val_t, key: mjs_val_t) -> mjs_val_t;
16541}
16542unsafe extern "C" {
16543 pub fn mjs_set(
16544 mjs: *mut mjs,
16545 obj: mjs_val_t,
16546 name: *const core::ffi::c_char,
16547 len: usize,
16548 val: mjs_val_t,
16549 ) -> mjs_err_t;
16550}
16551unsafe extern "C" {
16552 pub fn mjs_set_v(mjs: *mut mjs, obj: mjs_val_t, name: mjs_val_t, val: mjs_val_t) -> mjs_err_t;
16553}
16554unsafe extern "C" {
16555 pub fn mjs_del(
16556 mjs: *mut mjs,
16557 obj: mjs_val_t,
16558 name: *const core::ffi::c_char,
16559 len: usize,
16560 ) -> core::ffi::c_int;
16561}
16562unsafe extern "C" {
16563 pub fn mjs_next(mjs: *mut mjs, obj: mjs_val_t, iterator: *mut mjs_val_t) -> mjs_val_t;
16564}
16565pub type mjs_custom_obj_destructor_t =
16566 ::core::option::Option<unsafe extern "C" fn(mjs: *mut mjs, object: mjs_val_t)>;
16567pub type mjs_func_ptr_t = ::core::option::Option<unsafe extern "C" fn()>;
16568unsafe extern "C" {
16569 pub fn mjs_mk_null() -> mjs_val_t;
16570}
16571unsafe extern "C" {
16572 pub fn mjs_is_null(v: mjs_val_t) -> core::ffi::c_int;
16573}
16574unsafe extern "C" {
16575 pub fn mjs_mk_undefined() -> mjs_val_t;
16576}
16577unsafe extern "C" {
16578 pub fn mjs_is_undefined(v: mjs_val_t) -> core::ffi::c_int;
16579}
16580unsafe extern "C" {
16581 pub fn mjs_mk_number(mjs: *mut mjs, num: f64) -> mjs_val_t;
16582}
16583unsafe extern "C" {
16584 pub fn mjs_get_double(mjs: *mut mjs, v: mjs_val_t) -> f64;
16585}
16586unsafe extern "C" {
16587 pub fn mjs_get_int(mjs: *mut mjs, v: mjs_val_t) -> core::ffi::c_int;
16588}
16589unsafe extern "C" {
16590 pub fn mjs_get_int32(mjs: *mut mjs, v: mjs_val_t) -> i32;
16591}
16592unsafe extern "C" {
16593 pub fn mjs_is_number(v: mjs_val_t) -> core::ffi::c_int;
16594}
16595unsafe extern "C" {
16596 pub fn mjs_mk_foreign(mjs: *mut mjs, ptr: *mut core::ffi::c_void) -> mjs_val_t;
16597}
16598unsafe extern "C" {
16599 pub fn mjs_mk_foreign_func(mjs: *mut mjs, fn_: mjs_func_ptr_t) -> mjs_val_t;
16600}
16601unsafe extern "C" {
16602 pub fn mjs_get_ptr(mjs: *mut mjs, v: mjs_val_t) -> *mut core::ffi::c_void;
16603}
16604unsafe extern "C" {
16605 pub fn mjs_is_foreign(v: mjs_val_t) -> core::ffi::c_int;
16606}
16607unsafe extern "C" {
16608 pub fn mjs_mk_boolean(mjs: *mut mjs, v: core::ffi::c_int) -> mjs_val_t;
16609}
16610unsafe extern "C" {
16611 pub fn mjs_get_bool(mjs: *mut mjs, v: mjs_val_t) -> core::ffi::c_int;
16612}
16613unsafe extern "C" {
16614 pub fn mjs_is_boolean(v: mjs_val_t) -> core::ffi::c_int;
16615}
16616unsafe extern "C" {
16617 pub fn mjs_mk_function(mjs: *mut mjs, off: usize) -> mjs_val_t;
16618}
16619unsafe extern "C" {
16620 pub fn mjs_is_function(v: mjs_val_t) -> core::ffi::c_int;
16621}
16622unsafe extern "C" {
16623 pub fn mjs_mk_string(
16624 mjs: *mut mjs,
16625 str_: *const core::ffi::c_char,
16626 len: usize,
16627 copy: core::ffi::c_int,
16628 ) -> mjs_val_t;
16629}
16630unsafe extern "C" {
16631 pub fn mjs_is_string(v: mjs_val_t) -> core::ffi::c_int;
16632}
16633unsafe extern "C" {
16634 pub fn mjs_get_string(
16635 mjs: *mut mjs,
16636 v: *mut mjs_val_t,
16637 len: *mut usize,
16638 ) -> *const core::ffi::c_char;
16639}
16640unsafe extern "C" {
16641 pub fn mjs_get_cstring(mjs: *mut mjs, v: *mut mjs_val_t) -> *const core::ffi::c_char;
16642}
16643unsafe extern "C" {
16644 pub fn mjs_strcmp(
16645 mjs: *mut mjs,
16646 a: *mut mjs_val_t,
16647 b: *const core::ffi::c_char,
16648 len: usize,
16649 ) -> core::ffi::c_int;
16650}
16651pub type MjsPrintCallback = ::core::option::Option<
16652 unsafe extern "C" fn(ctx: *mut core::ffi::c_void, format: *const core::ffi::c_char, ...),
16653>;
16654unsafe extern "C" {
16655 pub fn mjs_typeof(v: mjs_val_t) -> *const core::ffi::c_char;
16656}
16657unsafe extern "C" {
16658 pub fn mjs_fprintf(v: mjs_val_t, mjs: *mut mjs, fp: *mut FILE);
16659}
16660unsafe extern "C" {
16661 pub fn mjs_sprintf(v: mjs_val_t, mjs: *mut mjs, buf: *mut core::ffi::c_char, buflen: usize);
16662}
16663unsafe extern "C" {
16664 pub fn mjs_disasm_all(
16665 mjs: *mut mjs,
16666 print_cb: MjsPrintCallback,
16667 print_ctx: *mut core::ffi::c_void,
16668 );
16669}
16670unsafe extern "C" {
16671 pub fn mjs_dump(
16672 mjs: *mut mjs,
16673 do_disasm: core::ffi::c_int,
16674 print_cb: MjsPrintCallback,
16675 print_ctx: *mut core::ffi::c_void,
16676 );
16677}
16678unsafe extern "C" {
16679 pub fn mjs_get_bcode_filename_by_offset(
16680 mjs: *mut mjs,
16681 offset: core::ffi::c_int,
16682 ) -> *const core::ffi::c_char;
16683}
16684unsafe extern "C" {
16685 pub fn mjs_get_lineno_by_offset(mjs: *mut mjs, offset: core::ffi::c_int) -> core::ffi::c_int;
16686}
16687unsafe extern "C" {
16688 pub fn mjs_get_offset_by_call_frame_num(
16689 mjs: *mut mjs,
16690 cf_num: core::ffi::c_int,
16691 ) -> core::ffi::c_int;
16692}
16693unsafe extern "C" {
16694 pub fn mjs_to_string(
16695 mjs: *mut mjs,
16696 v: *mut mjs_val_t,
16697 p: *mut *mut core::ffi::c_char,
16698 sizep: *mut usize,
16699 need_free: *mut core::ffi::c_int,
16700 ) -> mjs_err_t;
16701}
16702unsafe extern "C" {
16703 pub fn mjs_to_boolean_v(mjs: *mut mjs, v: mjs_val_t) -> mjs_val_t;
16704}
16705unsafe extern "C" {
16706 pub fn mjs_is_truthy(mjs: *mut mjs, v: mjs_val_t) -> core::ffi::c_int;
16707}
16708pub type pb_type_t = uint_least8_t;
16709pub type pb_size_t = uint_least16_t;
16710pub type pb_ssize_t = int_least16_t;
16711pub type pb_byte_t = uint_least8_t;
16712pub type pb_istream_t = pb_istream_s;
16713pub type pb_ostream_t = pb_ostream_s;
16714pub type pb_field_iter_t = pb_field_iter_s;
16715pub type pb_msgdesc_t = pb_msgdesc_s;
16716#[repr(C)]
16717#[derive(Debug, Copy, Clone)]
16718pub struct pb_msgdesc_s {
16719 pub field_info: *const u32,
16720 pub submsg_info: *const *const pb_msgdesc_t,
16721 pub default_value: *const pb_byte_t,
16722 pub field_callback: ::core::option::Option<
16723 unsafe extern "C" fn(
16724 istream: *mut pb_istream_t,
16725 ostream: *mut pb_ostream_t,
16726 field: *const pb_field_iter_t,
16727 ) -> bool,
16728 >,
16729 pub field_count: pb_size_t,
16730 pub required_field_count: pb_size_t,
16731 pub largest_tag: pb_size_t,
16732}
16733#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16734const _: () = {
16735 ["Size of pb_msgdesc_s"][::core::mem::size_of::<pb_msgdesc_s>() - 24usize];
16736 ["Alignment of pb_msgdesc_s"][::core::mem::align_of::<pb_msgdesc_s>() - 4usize];
16737 ["Offset of field: pb_msgdesc_s::field_info"]
16738 [::core::mem::offset_of!(pb_msgdesc_s, field_info) - 0usize];
16739 ["Offset of field: pb_msgdesc_s::submsg_info"]
16740 [::core::mem::offset_of!(pb_msgdesc_s, submsg_info) - 4usize];
16741 ["Offset of field: pb_msgdesc_s::default_value"]
16742 [::core::mem::offset_of!(pb_msgdesc_s, default_value) - 8usize];
16743 ["Offset of field: pb_msgdesc_s::field_callback"]
16744 [::core::mem::offset_of!(pb_msgdesc_s, field_callback) - 12usize];
16745 ["Offset of field: pb_msgdesc_s::field_count"]
16746 [::core::mem::offset_of!(pb_msgdesc_s, field_count) - 16usize];
16747 ["Offset of field: pb_msgdesc_s::required_field_count"]
16748 [::core::mem::offset_of!(pb_msgdesc_s, required_field_count) - 18usize];
16749 ["Offset of field: pb_msgdesc_s::largest_tag"]
16750 [::core::mem::offset_of!(pb_msgdesc_s, largest_tag) - 20usize];
16751};
16752#[repr(C)]
16753#[derive(Debug, Copy, Clone)]
16754pub struct pb_field_iter_s {
16755 pub descriptor: *const pb_msgdesc_t,
16756 pub message: *mut core::ffi::c_void,
16757 pub index: pb_size_t,
16758 pub field_info_index: pb_size_t,
16759 pub required_field_index: pb_size_t,
16760 pub submessage_index: pb_size_t,
16761 pub tag: pb_size_t,
16762 pub data_size: pb_size_t,
16763 pub array_size: pb_size_t,
16764 pub type_: pb_type_t,
16765 pub pField: *mut core::ffi::c_void,
16766 pub pData: *mut core::ffi::c_void,
16767 pub pSize: *mut core::ffi::c_void,
16768 pub submsg_desc: *const pb_msgdesc_t,
16769}
16770#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16771const _: () = {
16772 ["Size of pb_field_iter_s"][::core::mem::size_of::<pb_field_iter_s>() - 40usize];
16773 ["Alignment of pb_field_iter_s"][::core::mem::align_of::<pb_field_iter_s>() - 4usize];
16774 ["Offset of field: pb_field_iter_s::descriptor"]
16775 [::core::mem::offset_of!(pb_field_iter_s, descriptor) - 0usize];
16776 ["Offset of field: pb_field_iter_s::message"]
16777 [::core::mem::offset_of!(pb_field_iter_s, message) - 4usize];
16778 ["Offset of field: pb_field_iter_s::index"]
16779 [::core::mem::offset_of!(pb_field_iter_s, index) - 8usize];
16780 ["Offset of field: pb_field_iter_s::field_info_index"]
16781 [::core::mem::offset_of!(pb_field_iter_s, field_info_index) - 10usize];
16782 ["Offset of field: pb_field_iter_s::required_field_index"]
16783 [::core::mem::offset_of!(pb_field_iter_s, required_field_index) - 12usize];
16784 ["Offset of field: pb_field_iter_s::submessage_index"]
16785 [::core::mem::offset_of!(pb_field_iter_s, submessage_index) - 14usize];
16786 ["Offset of field: pb_field_iter_s::tag"]
16787 [::core::mem::offset_of!(pb_field_iter_s, tag) - 16usize];
16788 ["Offset of field: pb_field_iter_s::data_size"]
16789 [::core::mem::offset_of!(pb_field_iter_s, data_size) - 18usize];
16790 ["Offset of field: pb_field_iter_s::array_size"]
16791 [::core::mem::offset_of!(pb_field_iter_s, array_size) - 20usize];
16792 ["Offset of field: pb_field_iter_s::type_"]
16793 [::core::mem::offset_of!(pb_field_iter_s, type_) - 22usize];
16794 ["Offset of field: pb_field_iter_s::pField"]
16795 [::core::mem::offset_of!(pb_field_iter_s, pField) - 24usize];
16796 ["Offset of field: pb_field_iter_s::pData"]
16797 [::core::mem::offset_of!(pb_field_iter_s, pData) - 28usize];
16798 ["Offset of field: pb_field_iter_s::pSize"]
16799 [::core::mem::offset_of!(pb_field_iter_s, pSize) - 32usize];
16800 ["Offset of field: pb_field_iter_s::submsg_desc"]
16801 [::core::mem::offset_of!(pb_field_iter_s, submsg_desc) - 36usize];
16802};
16803pub type pb_field_t = pb_field_iter_t;
16804#[repr(C)]
16805#[derive(Debug, Copy, Clone)]
16806pub struct pb_bytes_array_s {
16807 pub size: pb_size_t,
16808 pub bytes: [pb_byte_t; 1usize],
16809}
16810#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16811const _: () = {
16812 ["Size of pb_bytes_array_s"][::core::mem::size_of::<pb_bytes_array_s>() - 4usize];
16813 ["Alignment of pb_bytes_array_s"][::core::mem::align_of::<pb_bytes_array_s>() - 2usize];
16814 ["Offset of field: pb_bytes_array_s::size"]
16815 [::core::mem::offset_of!(pb_bytes_array_s, size) - 0usize];
16816 ["Offset of field: pb_bytes_array_s::bytes"]
16817 [::core::mem::offset_of!(pb_bytes_array_s, bytes) - 2usize];
16818};
16819pub type pb_bytes_array_t = pb_bytes_array_s;
16820pub type pb_callback_t = pb_callback_s;
16821#[repr(C)]
16822#[derive(Copy, Clone)]
16823pub struct pb_callback_s {
16824 pub funcs: pb_callback_s__bindgen_ty_1,
16825 pub arg: *mut core::ffi::c_void,
16826}
16827#[repr(C)]
16828#[derive(Copy, Clone)]
16829pub union pb_callback_s__bindgen_ty_1 {
16830 pub decode: ::core::option::Option<
16831 unsafe extern "C" fn(
16832 stream: *mut pb_istream_t,
16833 field: *const pb_field_t,
16834 arg: *mut *mut core::ffi::c_void,
16835 ) -> bool,
16836 >,
16837 pub encode: ::core::option::Option<
16838 unsafe extern "C" fn(
16839 stream: *mut pb_ostream_t,
16840 field: *const pb_field_t,
16841 arg: *const *mut core::ffi::c_void,
16842 ) -> bool,
16843 >,
16844}
16845#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16846const _: () = {
16847 ["Size of pb_callback_s__bindgen_ty_1"]
16848 [::core::mem::size_of::<pb_callback_s__bindgen_ty_1>() - 4usize];
16849 ["Alignment of pb_callback_s__bindgen_ty_1"]
16850 [::core::mem::align_of::<pb_callback_s__bindgen_ty_1>() - 4usize];
16851 ["Offset of field: pb_callback_s__bindgen_ty_1::decode"]
16852 [::core::mem::offset_of!(pb_callback_s__bindgen_ty_1, decode) - 0usize];
16853 ["Offset of field: pb_callback_s__bindgen_ty_1::encode"]
16854 [::core::mem::offset_of!(pb_callback_s__bindgen_ty_1, encode) - 0usize];
16855};
16856#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16857const _: () = {
16858 ["Size of pb_callback_s"][::core::mem::size_of::<pb_callback_s>() - 8usize];
16859 ["Alignment of pb_callback_s"][::core::mem::align_of::<pb_callback_s>() - 4usize];
16860 ["Offset of field: pb_callback_s::funcs"]
16861 [::core::mem::offset_of!(pb_callback_s, funcs) - 0usize];
16862 ["Offset of field: pb_callback_s::arg"][::core::mem::offset_of!(pb_callback_s, arg) - 4usize];
16863};
16864unsafe extern "C" {
16865 pub fn pb_default_field_callback(
16866 istream: *mut pb_istream_t,
16867 ostream: *mut pb_ostream_t,
16868 field: *const pb_field_t,
16869 ) -> bool;
16870}
16871pub const PB_WT_VARINT: pb_wire_type_t = pb_wire_type_t(0);
16872pub const PB_WT_64BIT: pb_wire_type_t = pb_wire_type_t(1);
16873pub const PB_WT_STRING: pb_wire_type_t = pb_wire_type_t(2);
16874pub const PB_WT_32BIT: pb_wire_type_t = pb_wire_type_t(5);
16875pub const PB_WT_PACKED: pb_wire_type_t = pb_wire_type_t(255);
16876#[repr(transparent)]
16877#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16878pub struct pb_wire_type_t(pub core::ffi::c_uchar);
16879pub type pb_extension_type_t = pb_extension_type_s;
16880pub type pb_extension_t = pb_extension_s;
16881#[repr(C)]
16882#[derive(Debug, Copy, Clone)]
16883pub struct pb_extension_type_s {
16884 pub decode: ::core::option::Option<
16885 unsafe extern "C" fn(
16886 stream: *mut pb_istream_t,
16887 extension: *mut pb_extension_t,
16888 tag: u32,
16889 wire_type: pb_wire_type_t,
16890 ) -> bool,
16891 >,
16892 pub encode: ::core::option::Option<
16893 unsafe extern "C" fn(stream: *mut pb_ostream_t, extension: *const pb_extension_t) -> bool,
16894 >,
16895 pub arg: *const core::ffi::c_void,
16896}
16897#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16898const _: () = {
16899 ["Size of pb_extension_type_s"][::core::mem::size_of::<pb_extension_type_s>() - 12usize];
16900 ["Alignment of pb_extension_type_s"][::core::mem::align_of::<pb_extension_type_s>() - 4usize];
16901 ["Offset of field: pb_extension_type_s::decode"]
16902 [::core::mem::offset_of!(pb_extension_type_s, decode) - 0usize];
16903 ["Offset of field: pb_extension_type_s::encode"]
16904 [::core::mem::offset_of!(pb_extension_type_s, encode) - 4usize];
16905 ["Offset of field: pb_extension_type_s::arg"]
16906 [::core::mem::offset_of!(pb_extension_type_s, arg) - 8usize];
16907};
16908#[repr(C)]
16909#[derive(Debug, Copy, Clone)]
16910pub struct pb_extension_s {
16911 pub type_: *const pb_extension_type_t,
16912 pub dest: *mut core::ffi::c_void,
16913 pub next: *mut pb_extension_t,
16914 pub found: bool,
16915}
16916#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16917const _: () = {
16918 ["Size of pb_extension_s"][::core::mem::size_of::<pb_extension_s>() - 16usize];
16919 ["Alignment of pb_extension_s"][::core::mem::align_of::<pb_extension_s>() - 4usize];
16920 ["Offset of field: pb_extension_s::type_"]
16921 [::core::mem::offset_of!(pb_extension_s, type_) - 0usize];
16922 ["Offset of field: pb_extension_s::dest"]
16923 [::core::mem::offset_of!(pb_extension_s, dest) - 4usize];
16924 ["Offset of field: pb_extension_s::next"]
16925 [::core::mem::offset_of!(pb_extension_s, next) - 8usize];
16926 ["Offset of field: pb_extension_s::found"]
16927 [::core::mem::offset_of!(pb_extension_s, found) - 12usize];
16928};
16929#[repr(C)]
16930#[derive(Debug, Copy, Clone)]
16931pub struct pb_istream_s {
16932 pub callback: ::core::option::Option<
16933 unsafe extern "C" fn(stream: *mut pb_istream_t, buf: *mut pb_byte_t, count: usize) -> bool,
16934 >,
16935 pub state: *mut core::ffi::c_void,
16936 pub bytes_left: usize,
16937 pub errmsg: *const core::ffi::c_char,
16938}
16939#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16940const _: () = {
16941 ["Size of pb_istream_s"][::core::mem::size_of::<pb_istream_s>() - 16usize];
16942 ["Alignment of pb_istream_s"][::core::mem::align_of::<pb_istream_s>() - 4usize];
16943 ["Offset of field: pb_istream_s::callback"]
16944 [::core::mem::offset_of!(pb_istream_s, callback) - 0usize];
16945 ["Offset of field: pb_istream_s::state"][::core::mem::offset_of!(pb_istream_s, state) - 4usize];
16946 ["Offset of field: pb_istream_s::bytes_left"]
16947 [::core::mem::offset_of!(pb_istream_s, bytes_left) - 8usize];
16948 ["Offset of field: pb_istream_s::errmsg"]
16949 [::core::mem::offset_of!(pb_istream_s, errmsg) - 12usize];
16950};
16951unsafe extern "C" {
16952 pub fn pb_decode(
16953 stream: *mut pb_istream_t,
16954 fields: *const pb_msgdesc_t,
16955 dest_struct: *mut core::ffi::c_void,
16956 ) -> bool;
16957}
16958unsafe extern "C" {
16959 pub fn pb_decode_ex(
16960 stream: *mut pb_istream_t,
16961 fields: *const pb_msgdesc_t,
16962 dest_struct: *mut core::ffi::c_void,
16963 flags: core::ffi::c_uint,
16964 ) -> bool;
16965}
16966unsafe extern "C" {
16967 pub fn pb_release(fields: *const pb_msgdesc_t, dest_struct: *mut core::ffi::c_void);
16968}
16969unsafe extern "C" {
16970 #[doc = "Functions for manipulating streams *"]
16971 pub fn pb_istream_from_buffer(buf: *const pb_byte_t, msglen: usize) -> pb_istream_t;
16972}
16973unsafe extern "C" {
16974 pub fn pb_read(stream: *mut pb_istream_t, buf: *mut pb_byte_t, count: usize) -> bool;
16975}
16976unsafe extern "C" {
16977 #[doc = "Helper functions for writing field callbacks *"]
16978 pub fn pb_decode_tag(
16979 stream: *mut pb_istream_t,
16980 wire_type: *mut pb_wire_type_t,
16981 tag: *mut u32,
16982 eof: *mut bool,
16983 ) -> bool;
16984}
16985unsafe extern "C" {
16986 pub fn pb_skip_field(stream: *mut pb_istream_t, wire_type: pb_wire_type_t) -> bool;
16987}
16988unsafe extern "C" {
16989 pub fn pb_decode_varint(stream: *mut pb_istream_t, dest: *mut u64) -> bool;
16990}
16991unsafe extern "C" {
16992 pub fn pb_decode_varint32(stream: *mut pb_istream_t, dest: *mut u32) -> bool;
16993}
16994unsafe extern "C" {
16995 pub fn pb_decode_bool(stream: *mut pb_istream_t, dest: *mut bool) -> bool;
16996}
16997unsafe extern "C" {
16998 pub fn pb_decode_svarint(stream: *mut pb_istream_t, dest: *mut i64) -> bool;
16999}
17000unsafe extern "C" {
17001 pub fn pb_decode_fixed32(stream: *mut pb_istream_t, dest: *mut core::ffi::c_void) -> bool;
17002}
17003unsafe extern "C" {
17004 pub fn pb_decode_fixed64(stream: *mut pb_istream_t, dest: *mut core::ffi::c_void) -> bool;
17005}
17006unsafe extern "C" {
17007 pub fn pb_make_string_substream(
17008 stream: *mut pb_istream_t,
17009 substream: *mut pb_istream_t,
17010 ) -> bool;
17011}
17012unsafe extern "C" {
17013 pub fn pb_close_string_substream(
17014 stream: *mut pb_istream_t,
17015 substream: *mut pb_istream_t,
17016 ) -> bool;
17017}
17018#[repr(C)]
17019#[derive(Debug, Copy, Clone)]
17020pub struct pb_ostream_s {
17021 pub callback: ::core::option::Option<
17022 unsafe extern "C" fn(
17023 stream: *mut pb_ostream_t,
17024 buf: *const pb_byte_t,
17025 count: usize,
17026 ) -> bool,
17027 >,
17028 pub state: *mut core::ffi::c_void,
17029 pub max_size: usize,
17030 pub bytes_written: usize,
17031 pub errmsg: *const core::ffi::c_char,
17032}
17033#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17034const _: () = {
17035 ["Size of pb_ostream_s"][::core::mem::size_of::<pb_ostream_s>() - 20usize];
17036 ["Alignment of pb_ostream_s"][::core::mem::align_of::<pb_ostream_s>() - 4usize];
17037 ["Offset of field: pb_ostream_s::callback"]
17038 [::core::mem::offset_of!(pb_ostream_s, callback) - 0usize];
17039 ["Offset of field: pb_ostream_s::state"][::core::mem::offset_of!(pb_ostream_s, state) - 4usize];
17040 ["Offset of field: pb_ostream_s::max_size"]
17041 [::core::mem::offset_of!(pb_ostream_s, max_size) - 8usize];
17042 ["Offset of field: pb_ostream_s::bytes_written"]
17043 [::core::mem::offset_of!(pb_ostream_s, bytes_written) - 12usize];
17044 ["Offset of field: pb_ostream_s::errmsg"]
17045 [::core::mem::offset_of!(pb_ostream_s, errmsg) - 16usize];
17046};
17047unsafe extern "C" {
17048 pub fn pb_encode(
17049 stream: *mut pb_ostream_t,
17050 fields: *const pb_msgdesc_t,
17051 src_struct: *const core::ffi::c_void,
17052 ) -> bool;
17053}
17054unsafe extern "C" {
17055 pub fn pb_encode_ex(
17056 stream: *mut pb_ostream_t,
17057 fields: *const pb_msgdesc_t,
17058 src_struct: *const core::ffi::c_void,
17059 flags: core::ffi::c_uint,
17060 ) -> bool;
17061}
17062unsafe extern "C" {
17063 pub fn pb_get_encoded_size(
17064 size: *mut usize,
17065 fields: *const pb_msgdesc_t,
17066 src_struct: *const core::ffi::c_void,
17067 ) -> bool;
17068}
17069unsafe extern "C" {
17070 #[doc = "Functions for manipulating streams *"]
17071 pub fn pb_ostream_from_buffer(buf: *mut pb_byte_t, bufsize: usize) -> pb_ostream_t;
17072}
17073unsafe extern "C" {
17074 pub fn pb_write(stream: *mut pb_ostream_t, buf: *const pb_byte_t, count: usize) -> bool;
17075}
17076unsafe extern "C" {
17077 #[doc = "Helper functions for writing field callbacks *"]
17078 pub fn pb_encode_tag_for_field(
17079 stream: *mut pb_ostream_t,
17080 field: *const pb_field_iter_t,
17081 ) -> bool;
17082}
17083unsafe extern "C" {
17084 pub fn pb_encode_tag(
17085 stream: *mut pb_ostream_t,
17086 wiretype: pb_wire_type_t,
17087 field_number: u32,
17088 ) -> bool;
17089}
17090unsafe extern "C" {
17091 pub fn pb_encode_varint(stream: *mut pb_ostream_t, value: u64) -> bool;
17092}
17093unsafe extern "C" {
17094 pub fn pb_encode_svarint(stream: *mut pb_ostream_t, value: i64) -> bool;
17095}
17096unsafe extern "C" {
17097 pub fn pb_encode_string(
17098 stream: *mut pb_ostream_t,
17099 buffer: *const pb_byte_t,
17100 size: usize,
17101 ) -> bool;
17102}
17103unsafe extern "C" {
17104 pub fn pb_encode_fixed32(stream: *mut pb_ostream_t, value: *const core::ffi::c_void) -> bool;
17105}
17106unsafe extern "C" {
17107 pub fn pb_encode_fixed64(stream: *mut pb_ostream_t, value: *const core::ffi::c_void) -> bool;
17108}
17109unsafe extern "C" {
17110 pub fn pb_encode_submessage(
17111 stream: *mut pb_ostream_t,
17112 fields: *const pb_msgdesc_t,
17113 src_struct: *const core::ffi::c_void,
17114 ) -> bool;
17115}
17116#[repr(C)]
17117#[derive(Debug, Copy, Clone)]
17118pub struct BitBuffer {
17119 _unused: [u8; 0],
17120}
17121unsafe extern "C" {
17122 #[doc = "Allocate a BitBuffer instance.\n\n # Arguments\n\n* `capacity_bytes` (direction in) - maximum buffer capacity, in bytes\n\n # Returns\n\npointer to the allocated BitBuffer instance"]
17123 pub fn bit_buffer_alloc(capacity_bytes: usize) -> *mut BitBuffer;
17124}
17125unsafe extern "C" {
17126 #[doc = "Delete a BitBuffer instance.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance"]
17127 pub fn bit_buffer_free(buf: *mut BitBuffer);
17128}
17129unsafe extern "C" {
17130 #[doc = "Clear all data from a BitBuffer instance.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance"]
17131 pub fn bit_buffer_reset(buf: *mut BitBuffer);
17132}
17133unsafe extern "C" {
17134 #[doc = "Copy another BitBuffer instance's contents to this one, replacing all of the\n original data.\n\n The destination capacity must be no less than the source data\n size.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to copy into\n * `other` (direction in) - pointer to a BitBuffer instance to copy from"]
17135 pub fn bit_buffer_copy(buf: *mut BitBuffer, other: *const BitBuffer);
17136}
17137unsafe extern "C" {
17138 #[doc = "Copy all BitBuffer instance's contents to this one, starting from\n start_index, replacing all of the original data.\n\n The destination capacity must be no less than the source data\n size counting from start_index.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to copy into\n * `other` (direction in) - pointer to a BitBuffer instance to copy from\n * `start_index` (direction in) - index to begin copying source data from"]
17139 pub fn bit_buffer_copy_right(buf: *mut BitBuffer, other: *const BitBuffer, start_index: usize);
17140}
17141unsafe extern "C" {
17142 #[doc = "Copy all BitBuffer instance's contents to this one, ending with end_index,\n replacing all of the original data.\n\n The destination capacity must be no less than the source data\n size counting to end_index.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to copy into\n * `other` (direction in) - pointer to a BitBuffer instance to copy from\n * `end_index` (direction in) - index to end copying source data at"]
17143 pub fn bit_buffer_copy_left(buf: *mut BitBuffer, other: *const BitBuffer, end_index: usize);
17144}
17145unsafe extern "C" {
17146 #[doc = "Copy a byte array to a BitBuffer instance, replacing all of the original\n data.\n\n The destination capacity must be no less than the source data\n size.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to copy into\n * `data` (direction in) - pointer to the byte array to be copied\n * `size_bytes` (direction in) - size of the data to be copied, in bytes"]
17147 pub fn bit_buffer_copy_bytes(buf: *mut BitBuffer, data: *const u8, size_bytes: usize);
17148}
17149unsafe extern "C" {
17150 #[doc = "Copy a byte array to a BitBuffer instance, replacing all of the original\n data.\n\n The destination capacity must be no less than the source data\n size.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to copy into\n * `data` (direction in) - pointer to the byte array to be copied\n * `size_bits` (direction in) - size of the data to be copied, in bits"]
17151 pub fn bit_buffer_copy_bits(buf: *mut BitBuffer, data: *const u8, size_bits: usize);
17152}
17153unsafe extern "C" {
17154 #[doc = "Copy a byte with parity array to a BitBuffer instance, replacing all of the\n original data.\n\n The destination capacity must be no less than the source data\n size.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to copy into\n * `data` (direction in) - pointer to the byte array to be copied\n * `size_bits` (direction in) - size of the data to be copied, in bits\n > **Note:** Parity bits are placed starting with the most significant bit\n of each byte and moving up.\n > **Note:** Example: DDDDDDDD PDDDDDDD DPDDDDDD DDP..."]
17155 pub fn bit_buffer_copy_bytes_with_parity(
17156 buf: *mut BitBuffer,
17157 data: *const u8,
17158 size_bits: usize,
17159 );
17160}
17161unsafe extern "C" {
17162 #[doc = "Write a BitBuffer instance's entire contents to an arbitrary memory location.\n\n The destination memory must be allocated. Additionally, the\n destination capacity must be no less than the source data size.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to write from\n * `dest` (direction out) - pointer to the destination memory location\n * `size_bytes` (direction in) - maximum destination data size, in bytes"]
17163 pub fn bit_buffer_write_bytes(
17164 buf: *const BitBuffer,
17165 dest: *mut core::ffi::c_void,
17166 size_bytes: usize,
17167 );
17168}
17169unsafe extern "C" {
17170 #[doc = "Write a BitBuffer instance's entire contents to an arbitrary memory location.\n\n Additionally, place a parity bit after each byte.\n\n The destination memory must be allocated. Additionally, the\n destination capacity must be no less than the source data size\n plus parity.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to write from\n * `dest` (direction out) - pointer to the destination memory location\n * `size_bytes` (direction in) - maximum destination data size, in bytes\n * `bits_written` (direction out) - actual number of bits written, in bits\n > **Note:** Parity bits are placed starting with the most significant bit of\n each byte and moving up.\n > **Note:** Example: DDDDDDDD PDDDDDDD DPDDDDDD DDP..."]
17171 pub fn bit_buffer_write_bytes_with_parity(
17172 buf: *const BitBuffer,
17173 dest: *mut core::ffi::c_void,
17174 size_bytes: usize,
17175 bits_written: *mut usize,
17176 );
17177}
17178unsafe extern "C" {
17179 #[doc = "Write a slice of BitBuffer instance's contents to an arbitrary memory\n location.\n\n The destination memory must be allocated. Additionally, the\n destination capacity must be no less than the requested slice\n size.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to write from\n * `dest` (direction out) - pointer to the destination memory location\n * `start_index` (direction in) - index to begin copying source data from\n * `size_bytes` (direction in) - data slice size, in bytes"]
17180 pub fn bit_buffer_write_bytes_mid(
17181 buf: *const BitBuffer,
17182 dest: *mut core::ffi::c_void,
17183 start_index: usize,
17184 size_bytes: usize,
17185 );
17186}
17187unsafe extern "C" {
17188 #[doc = "Check whether a BitBuffer instance contains a partial byte (i.e. the bit\n count is not divisible by 8).\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be checked\n\n # Returns\n\ntrue if the instance contains a partial byte, false otherwise"]
17189 pub fn bit_buffer_has_partial_byte(buf: *const BitBuffer) -> bool;
17190}
17191unsafe extern "C" {
17192 #[doc = "Check whether a BitBuffer instance's contents start with the designated byte.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be checked\n * `byte` (direction in) - byte value to be checked against\n\n # Returns\n\ntrue if data starts with designated byte, false otherwise"]
17193 pub fn bit_buffer_starts_with_byte(buf: *const BitBuffer, byte: u8) -> bool;
17194}
17195unsafe extern "C" {
17196 #[doc = "Get a BitBuffer instance's capacity (i.e. the maximum possible amount of\n data), in bytes.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n\n # Returns\n\ncapacity, in bytes"]
17197 pub fn bit_buffer_get_capacity_bytes(buf: *const BitBuffer) -> usize;
17198}
17199unsafe extern "C" {
17200 #[doc = "Get a BitBuffer instance's data size (i.e. the amount of stored data), in\n bits.\n\n Might be not divisible by 8 (see bit_buffer_is_partial_byte).\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n\n # Returns\n\ndata size, in bits."]
17201 pub fn bit_buffer_get_size(buf: *const BitBuffer) -> usize;
17202}
17203unsafe extern "C" {
17204 #[doc = "Get a BitBuffer instance's data size (i.e. the amount of stored data), in\n bytes.\n\n If a partial byte is present, it is also counted.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n\n # Returns\n\ndata size, in bytes."]
17205 pub fn bit_buffer_get_size_bytes(buf: *const BitBuffer) -> usize;
17206}
17207unsafe extern "C" {
17208 #[doc = "Get a byte value at a specified index in a BitBuffer instance.\n\n The index must be valid (i.e. less than the instance's data size\n in bytes).\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n * `index` (direction in) - index of the byte in question\n\n # Returns\n\nbyte value"]
17209 pub fn bit_buffer_get_byte(buf: *const BitBuffer, index: usize) -> u8;
17210}
17211unsafe extern "C" {
17212 #[doc = "Get a byte value starting from the specified bit index in a BitBuffer\n instance.\n\n The resulting byte might correspond to a single byte (if the\n index is a multiple of 8), or two overlapping bytes combined. The\n index must be valid (i.e. less than the instance's data size in\n bits).\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n * `index_bits` (direction in) - bit index of the byte in question\n\n # Returns\n\nbyte value"]
17213 pub fn bit_buffer_get_byte_from_bit(buf: *const BitBuffer, index_bits: usize) -> u8;
17214}
17215unsafe extern "C" {
17216 #[doc = "Get the pointer to a BitBuffer instance's underlying data.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n\n # Returns\n\npointer to the underlying data"]
17217 pub fn bit_buffer_get_data(buf: *const BitBuffer) -> *const u8;
17218}
17219unsafe extern "C" {
17220 #[doc = "Get the pointer to the parity data of a BitBuffer instance.\n\n # Arguments\n\n* `buf` (direction in) - pointer to a BitBuffer instance to be queried\n\n # Returns\n\npointer to the parity data"]
17221 pub fn bit_buffer_get_parity(buf: *const BitBuffer) -> *const u8;
17222}
17223unsafe extern "C" {
17224 #[doc = "Set byte value at a specified index in a BitBuffer instance.\n\n The index must be valid (i.e. less than the instance's data\n size in bytes).\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be modified\n * `index` (direction in) - index of the byte in question\n * `byte` (direction in) - byte value to be set at index"]
17225 pub fn bit_buffer_set_byte(buf: *mut BitBuffer, index: usize, byte: u8);
17226}
17227unsafe extern "C" {
17228 #[doc = "Set byte and parity bit value at a specified index in a BitBuffer instance.\n\n The index must be valid (i.e. less than the instance's data\n size in bytes).\n\n # Arguments\n\n* `buff` (direction in, out) - pointer to a BitBuffer instance to be modified\n * `index` (direction in) - index of the byte in question\n * `byte` (direction in) - byte value to be set at index\n * `parity` (direction in) - parity bit value to be set at index"]
17229 pub fn bit_buffer_set_byte_with_parity(
17230 buff: *mut BitBuffer,
17231 index: usize,
17232 byte: u8,
17233 parity: bool,
17234 );
17235}
17236unsafe extern "C" {
17237 #[doc = "Resize a BitBuffer instance to a new size, in bits.\n\n May cause bugs. Use only if absolutely necessary.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be resized\n * `new_size` (direction in) - the new size of the buffer, in bits"]
17238 pub fn bit_buffer_set_size(buf: *mut BitBuffer, new_size: usize);
17239}
17240unsafe extern "C" {
17241 #[doc = "Resize a BitBuffer instance to a new size, in bytes.\n\n May cause bugs. Use only if absolutely necessary.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be resized\n * `new_size_bytes` (direction in) - the new size of the buffer, in bytes"]
17242 pub fn bit_buffer_set_size_bytes(buf: *mut BitBuffer, new_size_bytes: usize);
17243}
17244unsafe extern "C" {
17245 #[doc = "Append all BitBuffer's instance contents to this one.\n\n The destination capacity must be no less than its original\n data size plus source data size.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be appended to\n * `other` (direction in) - pointer to a BitBuffer instance to be appended"]
17246 pub fn bit_buffer_append(buf: *mut BitBuffer, other: *const BitBuffer);
17247}
17248unsafe extern "C" {
17249 #[doc = "Append a BitBuffer's instance contents to this one, starting from\n start_index.\n\n The destination capacity must be no less than the source data\n size counting from start_index.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be appended to\n * `other` (direction in) - pointer to a BitBuffer instance to be appended\n * `start_index` (direction in) - index to begin copying source data from"]
17250 pub fn bit_buffer_append_right(
17251 buf: *mut BitBuffer,
17252 other: *const BitBuffer,
17253 start_index: usize,
17254 );
17255}
17256unsafe extern "C" {
17257 #[doc = "Append a byte to a BitBuffer instance.\n\n The destination capacity must be no less its original data\n size plus one.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be appended to\n * `byte` (direction in) - byte value to be appended"]
17258 pub fn bit_buffer_append_byte(buf: *mut BitBuffer, byte: u8);
17259}
17260unsafe extern "C" {
17261 #[doc = "Append a byte array to a BitBuffer instance.\n\n The destination capacity must be no less its original data\n size plus source data size.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be appended to\n * `data` (direction in) - pointer to the byte array to be appended\n * `size_bytes` (direction in) - size of the data to be appended, in bytes"]
17262 pub fn bit_buffer_append_bytes(buf: *mut BitBuffer, data: *const u8, size_bytes: usize);
17263}
17264unsafe extern "C" {
17265 #[doc = "Append a bit to a BitBuffer instance.\n\n The destination capacity must be sufficient to accommodate the\n additional bit.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance to be appended to\n * `bit` (direction in) - bit value to be appended"]
17266 pub fn bit_buffer_append_bit(buf: *mut BitBuffer, bit: bool);
17267}
17268#[doc = "< Display full(verbose) name."]
17269pub const NfcDeviceNameTypeFull: NfcDeviceNameType = NfcDeviceNameType(0);
17270#[doc = "< Display shortened name."]
17271pub const NfcDeviceNameTypeShort: NfcDeviceNameType = NfcDeviceNameType(1);
17272#[repr(transparent)]
17273#[doc = "Verbosity level of the displayed NFC device name."]
17274#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17275pub struct NfcDeviceNameType(pub core::ffi::c_uchar);
17276#[doc = "Generic opaque type for protocol-specific NFC device data."]
17277pub type NfcDeviceData = core::ffi::c_void;
17278#[doc = "Allocate the protocol-specific NFC device data instance.\n\n # Returns\n\npointer to the allocated instance."]
17279pub type NfcDeviceAlloc = ::core::option::Option<unsafe extern "C" fn() -> *mut NfcDeviceData>;
17280#[doc = "Delete the protocol-specific NFC device data instance.\n\n # Arguments\n\n* `data` (direction in, out) - pointer to the instance to be deleted."]
17281pub type NfcDeviceFree = ::core::option::Option<unsafe extern "C" fn(data: *mut NfcDeviceData)>;
17282#[doc = "Reset the NFC device data instance.\n\n The behaviour is protocol-specific. Usually, required fields are zeroed or\n set to their initial values.\n\n # Arguments\n\n* `data` (direction in, out) - pointer to the instance to be reset."]
17283pub type NfcDeviceReset = ::core::option::Option<unsafe extern "C" fn(data: *mut NfcDeviceData)>;
17284#[doc = "Copy source instance's data into the destination so that they become equal.\n\n # Arguments\n\n* `data` (direction in, out) - pointer to the destination instance.\n * `other` (direction in) - pointer to the source instance."]
17285pub type NfcDeviceCopy = ::core::option::Option<
17286 unsafe extern "C" fn(data: *mut NfcDeviceData, other: *const NfcDeviceData),
17287>;
17288#[doc = "Deprecated. Do not use in new protocols.\n > **Deprecated** do not use in new protocols.\n\n # Arguments\n\n* `data` (direction in, out) - pointer to the instance to be tested.\n * `device_type` (direction in) - pointer to a FuriString containing a device type identifier.\n # Returns\n\ntrue if data was verified, false otherwise."]
17289pub type NfcDeviceVerify = ::core::option::Option<
17290 unsafe extern "C" fn(data: *mut NfcDeviceData, device_type: *const FuriString) -> bool,
17291>;
17292#[doc = "Load NFC device data from a FlipperFormat file.\n\n The FlipperFormat file structure must be initialised and open by the calling code.\n\n # Arguments\n\n* `data` (direction in, out) - pointer to the instance to be loaded into.\n * `ff` (direction in) - pointer to the FlipperFormat file instance.\n * `version` (direction in) - file format version to use when loading.\n # Returns\n\ntrue if loaded successfully, false otherwise."]
17293pub type NfcDeviceLoad = ::core::option::Option<
17294 unsafe extern "C" fn(data: *mut NfcDeviceData, ff: *mut FlipperFormat, version: u32) -> bool,
17295>;
17296#[doc = "Save NFC device data to a FlipperFormat file.\n\n The FlipperFormat file structure must be initialised and open by the calling code.\n\n # Arguments\n\n* `data` (direction in) - pointer to the instance to be saved.\n * `ff` (direction in) - pointer to the FlipperFormat file instance.\n # Returns\n\ntrue if saved successfully, false otherwise."]
17297pub type NfcDeviceSave = ::core::option::Option<
17298 unsafe extern "C" fn(data: *const NfcDeviceData, ff: *mut FlipperFormat) -> bool,
17299>;
17300#[doc = "Compare two NFC device data instances.\n\n # Arguments\n\n* `data` (direction in) - pointer to the first instance to be compared.\n * `other` (direction in) - pointer to the second instance to be compared.\n # Returns\n\ntrue if instances are equal, false otherwise."]
17301pub type NfcDeviceEqual = ::core::option::Option<
17302 unsafe extern "C" fn(data: *const NfcDeviceData, other: *const NfcDeviceData) -> bool,
17303>;
17304#[doc = "Get a protocol-specific stateful NFC device name.\n\n The return value may change depending on the instance's internal state and the name_type parameter.\n\n # Arguments\n\n* `data` (direction in) - pointer to the instance to be queried.\n * `name_type` (direction in) - type of the name to be displayed.\n # Returns\n\npointer to a statically allocated character string containing the appropriate name."]
17305pub type NfcDeviceGetName = ::core::option::Option<
17306 unsafe extern "C" fn(
17307 data: *const NfcDeviceData,
17308 name_type: NfcDeviceNameType,
17309 ) -> *const core::ffi::c_char,
17310>;
17311#[doc = "Get the NFC device's unique identifier (UID).\n\n The UID length is protocol-dependent. Additionally, a particular protocol might support\n several UID lengths.\n\n # Arguments\n\n* `data` (direction in) - pointer to the instance to be queried.\n * `uid_len` (direction out) - pointer to the variable to contain the UID length.\n # Returns\n\npointer to the byte array containing the device's UID."]
17312pub type NfcDeviceGetUid = ::core::option::Option<
17313 unsafe extern "C" fn(data: *const NfcDeviceData, uid_len: *mut usize) -> *const u8,
17314>;
17315#[doc = "Set the NFC device's unique identifier (UID).\n\n The UID length must be supported by the protocol in question.\n\n # Arguments\n\n* `data` (direction in, out) - pointer to the instance to be modified.\n * `uid` (direction in) - pointer to the byte array containing the new UID.\n * `uid_len` (direction in) - length of the UID.\n # Returns\n\ntrue if the UID was valid and set, false otherwise."]
17316pub type NfcDeviceSetUid = ::core::option::Option<
17317 unsafe extern "C" fn(data: *mut NfcDeviceData, uid: *const u8, uid_len: usize) -> bool,
17318>;
17319#[doc = "Get the NFC device data associated with the parent protocol.\n\n The protocol the instance's data is associated with must have a parent.\n\n # Arguments\n\n* `data` (direction in) - pointer to the instance to be queried.\n # Returns\n\npointer to the data instance associated with the parent protocol."]
17320pub type NfcDeviceGetBaseData =
17321 ::core::option::Option<unsafe extern "C" fn(data: *const NfcDeviceData) -> *mut NfcDeviceData>;
17322#[doc = "Generic NFC device interface.\n\n Each protocol must fill this structure with its own function implementations."]
17323#[repr(C)]
17324#[derive(Debug, Copy, Clone)]
17325pub struct NfcDeviceBase {
17326 #[doc = "< Pointer to a statically-allocated string with the protocol name."]
17327 pub protocol_name: *const core::ffi::c_char,
17328 #[doc = "< Pointer to the alloc() function."]
17329 pub alloc: NfcDeviceAlloc,
17330 #[doc = "< Pointer to the free() function."]
17331 pub free: NfcDeviceFree,
17332 #[doc = "< Pointer to the reset() function."]
17333 pub reset: NfcDeviceReset,
17334 #[doc = "< Pointer to the copy() function."]
17335 pub copy: NfcDeviceCopy,
17336 #[doc = "< Deprecated. Set to NULL in new protocols."]
17337 pub verify: NfcDeviceVerify,
17338 #[doc = "< Pointer to the load() function."]
17339 pub load: NfcDeviceLoad,
17340 #[doc = "< Pointer to the save() function."]
17341 pub save: NfcDeviceSave,
17342 #[doc = "< Pointer to the is_equal() function."]
17343 pub is_equal: NfcDeviceEqual,
17344 #[doc = "< Pointer to the get_name() function."]
17345 pub get_name: NfcDeviceGetName,
17346 #[doc = "< Pointer to the get_uid() function."]
17347 pub get_uid: NfcDeviceGetUid,
17348 #[doc = "< Pointer to the set_uid() function."]
17349 pub set_uid: NfcDeviceSetUid,
17350 #[doc = "< Pointer to the get_base_data() function."]
17351 pub get_base_data: NfcDeviceGetBaseData,
17352}
17353#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17354const _: () = {
17355 ["Size of NfcDeviceBase"][::core::mem::size_of::<NfcDeviceBase>() - 52usize];
17356 ["Alignment of NfcDeviceBase"][::core::mem::align_of::<NfcDeviceBase>() - 4usize];
17357 ["Offset of field: NfcDeviceBase::protocol_name"]
17358 [::core::mem::offset_of!(NfcDeviceBase, protocol_name) - 0usize];
17359 ["Offset of field: NfcDeviceBase::alloc"]
17360 [::core::mem::offset_of!(NfcDeviceBase, alloc) - 4usize];
17361 ["Offset of field: NfcDeviceBase::free"][::core::mem::offset_of!(NfcDeviceBase, free) - 8usize];
17362 ["Offset of field: NfcDeviceBase::reset"]
17363 [::core::mem::offset_of!(NfcDeviceBase, reset) - 12usize];
17364 ["Offset of field: NfcDeviceBase::copy"]
17365 [::core::mem::offset_of!(NfcDeviceBase, copy) - 16usize];
17366 ["Offset of field: NfcDeviceBase::verify"]
17367 [::core::mem::offset_of!(NfcDeviceBase, verify) - 20usize];
17368 ["Offset of field: NfcDeviceBase::load"]
17369 [::core::mem::offset_of!(NfcDeviceBase, load) - 24usize];
17370 ["Offset of field: NfcDeviceBase::save"]
17371 [::core::mem::offset_of!(NfcDeviceBase, save) - 28usize];
17372 ["Offset of field: NfcDeviceBase::is_equal"]
17373 [::core::mem::offset_of!(NfcDeviceBase, is_equal) - 32usize];
17374 ["Offset of field: NfcDeviceBase::get_name"]
17375 [::core::mem::offset_of!(NfcDeviceBase, get_name) - 36usize];
17376 ["Offset of field: NfcDeviceBase::get_uid"]
17377 [::core::mem::offset_of!(NfcDeviceBase, get_uid) - 40usize];
17378 ["Offset of field: NfcDeviceBase::set_uid"]
17379 [::core::mem::offset_of!(NfcDeviceBase, set_uid) - 44usize];
17380 ["Offset of field: NfcDeviceBase::get_base_data"]
17381 [::core::mem::offset_of!(NfcDeviceBase, get_base_data) - 48usize];
17382};
17383pub const Iso14443_3aErrorNone: Iso14443_3aError = Iso14443_3aError(0);
17384pub const Iso14443_3aErrorNotPresent: Iso14443_3aError = Iso14443_3aError(1);
17385pub const Iso14443_3aErrorColResFailed: Iso14443_3aError = Iso14443_3aError(2);
17386pub const Iso14443_3aErrorBufferOverflow: Iso14443_3aError = Iso14443_3aError(3);
17387pub const Iso14443_3aErrorCommunication: Iso14443_3aError = Iso14443_3aError(4);
17388pub const Iso14443_3aErrorFieldOff: Iso14443_3aError = Iso14443_3aError(5);
17389pub const Iso14443_3aErrorWrongCrc: Iso14443_3aError = Iso14443_3aError(6);
17390pub const Iso14443_3aErrorTimeout: Iso14443_3aError = Iso14443_3aError(7);
17391#[repr(transparent)]
17392#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17393pub struct Iso14443_3aError(pub core::ffi::c_uchar);
17394#[repr(C)]
17395#[derive(Debug, Copy, Clone)]
17396pub struct Iso14443_3aSensResp {
17397 pub sens_resp: [u8; 2usize],
17398}
17399#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17400const _: () = {
17401 ["Size of Iso14443_3aSensResp"][::core::mem::size_of::<Iso14443_3aSensResp>() - 2usize];
17402 ["Alignment of Iso14443_3aSensResp"][::core::mem::align_of::<Iso14443_3aSensResp>() - 1usize];
17403 ["Offset of field: Iso14443_3aSensResp::sens_resp"]
17404 [::core::mem::offset_of!(Iso14443_3aSensResp, sens_resp) - 0usize];
17405};
17406#[repr(C)]
17407#[derive(Debug, Copy, Clone)]
17408pub struct Iso14443_3aSddReq {
17409 pub sel_cmd: u8,
17410 pub sel_par: u8,
17411 pub data: [u8; 4usize],
17412}
17413#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17414const _: () = {
17415 ["Size of Iso14443_3aSddReq"][::core::mem::size_of::<Iso14443_3aSddReq>() - 6usize];
17416 ["Alignment of Iso14443_3aSddReq"][::core::mem::align_of::<Iso14443_3aSddReq>() - 1usize];
17417 ["Offset of field: Iso14443_3aSddReq::sel_cmd"]
17418 [::core::mem::offset_of!(Iso14443_3aSddReq, sel_cmd) - 0usize];
17419 ["Offset of field: Iso14443_3aSddReq::sel_par"]
17420 [::core::mem::offset_of!(Iso14443_3aSddReq, sel_par) - 1usize];
17421 ["Offset of field: Iso14443_3aSddReq::data"]
17422 [::core::mem::offset_of!(Iso14443_3aSddReq, data) - 2usize];
17423};
17424#[repr(C)]
17425#[derive(Debug, Copy, Clone)]
17426pub struct Iso14443_3aSddResp {
17427 pub nfcid: [u8; 4usize],
17428 pub bss: u8,
17429}
17430#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17431const _: () = {
17432 ["Size of Iso14443_3aSddResp"][::core::mem::size_of::<Iso14443_3aSddResp>() - 5usize];
17433 ["Alignment of Iso14443_3aSddResp"][::core::mem::align_of::<Iso14443_3aSddResp>() - 1usize];
17434 ["Offset of field: Iso14443_3aSddResp::nfcid"]
17435 [::core::mem::offset_of!(Iso14443_3aSddResp, nfcid) - 0usize];
17436 ["Offset of field: Iso14443_3aSddResp::bss"]
17437 [::core::mem::offset_of!(Iso14443_3aSddResp, bss) - 4usize];
17438};
17439#[repr(C)]
17440#[derive(Debug, Copy, Clone)]
17441pub struct Iso14443_3aSelReq {
17442 pub sel_cmd: u8,
17443 pub sel_par: u8,
17444 pub nfcid: [u8; 4usize],
17445 pub bcc: u8,
17446}
17447#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17448const _: () = {
17449 ["Size of Iso14443_3aSelReq"][::core::mem::size_of::<Iso14443_3aSelReq>() - 7usize];
17450 ["Alignment of Iso14443_3aSelReq"][::core::mem::align_of::<Iso14443_3aSelReq>() - 1usize];
17451 ["Offset of field: Iso14443_3aSelReq::sel_cmd"]
17452 [::core::mem::offset_of!(Iso14443_3aSelReq, sel_cmd) - 0usize];
17453 ["Offset of field: Iso14443_3aSelReq::sel_par"]
17454 [::core::mem::offset_of!(Iso14443_3aSelReq, sel_par) - 1usize];
17455 ["Offset of field: Iso14443_3aSelReq::nfcid"]
17456 [::core::mem::offset_of!(Iso14443_3aSelReq, nfcid) - 2usize];
17457 ["Offset of field: Iso14443_3aSelReq::bcc"]
17458 [::core::mem::offset_of!(Iso14443_3aSelReq, bcc) - 6usize];
17459};
17460#[repr(C)]
17461#[derive(Debug, Copy, Clone)]
17462pub struct Iso14443_3aSelResp {
17463 pub sak: u8,
17464}
17465#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17466const _: () = {
17467 ["Size of Iso14443_3aSelResp"][::core::mem::size_of::<Iso14443_3aSelResp>() - 1usize];
17468 ["Alignment of Iso14443_3aSelResp"][::core::mem::align_of::<Iso14443_3aSelResp>() - 1usize];
17469 ["Offset of field: Iso14443_3aSelResp::sak"]
17470 [::core::mem::offset_of!(Iso14443_3aSelResp, sak) - 0usize];
17471};
17472#[repr(C)]
17473#[derive(Debug, Copy, Clone)]
17474pub struct Iso14443_3aData {
17475 pub uid: [u8; 10usize],
17476 pub uid_len: u8,
17477 pub atqa: [u8; 2usize],
17478 pub sak: u8,
17479}
17480#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17481const _: () = {
17482 ["Size of Iso14443_3aData"][::core::mem::size_of::<Iso14443_3aData>() - 14usize];
17483 ["Alignment of Iso14443_3aData"][::core::mem::align_of::<Iso14443_3aData>() - 1usize];
17484 ["Offset of field: Iso14443_3aData::uid"]
17485 [::core::mem::offset_of!(Iso14443_3aData, uid) - 0usize];
17486 ["Offset of field: Iso14443_3aData::uid_len"]
17487 [::core::mem::offset_of!(Iso14443_3aData, uid_len) - 10usize];
17488 ["Offset of field: Iso14443_3aData::atqa"]
17489 [::core::mem::offset_of!(Iso14443_3aData, atqa) - 11usize];
17490 ["Offset of field: Iso14443_3aData::sak"]
17491 [::core::mem::offset_of!(Iso14443_3aData, sak) - 13usize];
17492};
17493unsafe extern "C" {
17494 pub fn iso14443_3a_alloc() -> *mut Iso14443_3aData;
17495}
17496unsafe extern "C" {
17497 pub fn iso14443_3a_free(data: *mut Iso14443_3aData);
17498}
17499unsafe extern "C" {
17500 pub fn iso14443_3a_reset(data: *mut Iso14443_3aData);
17501}
17502unsafe extern "C" {
17503 pub fn iso14443_3a_copy(data: *mut Iso14443_3aData, other: *const Iso14443_3aData);
17504}
17505unsafe extern "C" {
17506 pub fn iso14443_3a_verify(data: *mut Iso14443_3aData, device_type: *const FuriString) -> bool;
17507}
17508unsafe extern "C" {
17509 pub fn iso14443_3a_load(
17510 data: *mut Iso14443_3aData,
17511 ff: *mut FlipperFormat,
17512 version: u32,
17513 ) -> bool;
17514}
17515unsafe extern "C" {
17516 pub fn iso14443_3a_save(data: *const Iso14443_3aData, ff: *mut FlipperFormat) -> bool;
17517}
17518unsafe extern "C" {
17519 pub fn iso14443_3a_is_equal(
17520 data: *const Iso14443_3aData,
17521 other: *const Iso14443_3aData,
17522 ) -> bool;
17523}
17524unsafe extern "C" {
17525 pub fn iso14443_3a_get_device_name(
17526 data: *const Iso14443_3aData,
17527 name_type: NfcDeviceNameType,
17528 ) -> *const core::ffi::c_char;
17529}
17530unsafe extern "C" {
17531 pub fn iso14443_3a_get_uid(data: *const Iso14443_3aData, uid_len: *mut usize) -> *const u8;
17532}
17533unsafe extern "C" {
17534 pub fn iso14443_3a_set_uid(data: *mut Iso14443_3aData, uid: *const u8, uid_len: usize) -> bool;
17535}
17536unsafe extern "C" {
17537 pub fn iso14443_3a_get_base_data(data: *const Iso14443_3aData) -> *mut Iso14443_3aData;
17538}
17539unsafe extern "C" {
17540 pub fn iso14443_3a_get_cuid(data: *const Iso14443_3aData) -> u32;
17541}
17542unsafe extern "C" {
17543 pub fn iso14443_3a_supports_iso14443_4(data: *const Iso14443_3aData) -> bool;
17544}
17545unsafe extern "C" {
17546 pub fn iso14443_3a_get_sak(data: *const Iso14443_3aData) -> u8;
17547}
17548unsafe extern "C" {
17549 pub fn iso14443_3a_get_atqa(data: *const Iso14443_3aData, atqa: *mut u8);
17550}
17551unsafe extern "C" {
17552 pub fn iso14443_3a_set_sak(data: *mut Iso14443_3aData, sak: u8);
17553}
17554unsafe extern "C" {
17555 pub fn iso14443_3a_set_atqa(data: *mut Iso14443_3aData, atqa: *const u8);
17556}
17557pub const MfClassicErrorNone: MfClassicError = MfClassicError(0);
17558pub const MfClassicErrorNotPresent: MfClassicError = MfClassicError(1);
17559pub const MfClassicErrorProtocol: MfClassicError = MfClassicError(2);
17560pub const MfClassicErrorAuth: MfClassicError = MfClassicError(3);
17561pub const MfClassicErrorPartialRead: MfClassicError = MfClassicError(4);
17562pub const MfClassicErrorTimeout: MfClassicError = MfClassicError(5);
17563#[repr(transparent)]
17564#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17565pub struct MfClassicError(pub core::ffi::c_uchar);
17566pub const MfClassicTypeMini: MfClassicType = MfClassicType(0);
17567pub const MfClassicType1k: MfClassicType = MfClassicType(1);
17568pub const MfClassicType4k: MfClassicType = MfClassicType(2);
17569pub const MfClassicTypeNum: MfClassicType = MfClassicType(3);
17570#[repr(transparent)]
17571#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17572pub struct MfClassicType(pub core::ffi::c_uchar);
17573pub const MfClassicActionDataRead: MfClassicAction = MfClassicAction(0);
17574pub const MfClassicActionDataWrite: MfClassicAction = MfClassicAction(1);
17575pub const MfClassicActionDataInc: MfClassicAction = MfClassicAction(2);
17576pub const MfClassicActionDataDec: MfClassicAction = MfClassicAction(3);
17577pub const MfClassicActionKeyARead: MfClassicAction = MfClassicAction(4);
17578pub const MfClassicActionKeyAWrite: MfClassicAction = MfClassicAction(5);
17579pub const MfClassicActionKeyBRead: MfClassicAction = MfClassicAction(6);
17580pub const MfClassicActionKeyBWrite: MfClassicAction = MfClassicAction(7);
17581pub const MfClassicActionACRead: MfClassicAction = MfClassicAction(8);
17582pub const MfClassicActionACWrite: MfClassicAction = MfClassicAction(9);
17583#[repr(transparent)]
17584#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17585pub struct MfClassicAction(pub core::ffi::c_uchar);
17586pub const MfClassicValueCommandIncrement: MfClassicValueCommand = MfClassicValueCommand(0);
17587pub const MfClassicValueCommandDecrement: MfClassicValueCommand = MfClassicValueCommand(1);
17588pub const MfClassicValueCommandRestore: MfClassicValueCommand = MfClassicValueCommand(2);
17589pub const MfClassicValueCommandInvalid: MfClassicValueCommand = MfClassicValueCommand(3);
17590#[repr(transparent)]
17591#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17592pub struct MfClassicValueCommand(pub core::ffi::c_uchar);
17593#[repr(C)]
17594#[derive(Debug, Copy, Clone)]
17595pub struct MfClassicBlock {
17596 pub data: [u8; 16usize],
17597}
17598#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17599const _: () = {
17600 ["Size of MfClassicBlock"][::core::mem::size_of::<MfClassicBlock>() - 16usize];
17601 ["Alignment of MfClassicBlock"][::core::mem::align_of::<MfClassicBlock>() - 1usize];
17602 ["Offset of field: MfClassicBlock::data"]
17603 [::core::mem::offset_of!(MfClassicBlock, data) - 0usize];
17604};
17605pub const MfClassicKeyTypeA: MfClassicKeyType = MfClassicKeyType(0);
17606pub const MfClassicKeyTypeB: MfClassicKeyType = MfClassicKeyType(1);
17607#[repr(transparent)]
17608#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17609pub struct MfClassicKeyType(pub core::ffi::c_uchar);
17610#[repr(C)]
17611#[derive(Debug, Copy, Clone)]
17612pub struct MfClassicKey {
17613 pub data: [u8; 6usize],
17614}
17615#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17616const _: () = {
17617 ["Size of MfClassicKey"][::core::mem::size_of::<MfClassicKey>() - 6usize];
17618 ["Alignment of MfClassicKey"][::core::mem::align_of::<MfClassicKey>() - 1usize];
17619 ["Offset of field: MfClassicKey::data"][::core::mem::offset_of!(MfClassicKey, data) - 0usize];
17620};
17621#[repr(C)]
17622#[derive(Debug, Copy, Clone)]
17623pub struct MfClassicAccessBits {
17624 pub data: [u8; 4usize],
17625}
17626#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17627const _: () = {
17628 ["Size of MfClassicAccessBits"][::core::mem::size_of::<MfClassicAccessBits>() - 4usize];
17629 ["Alignment of MfClassicAccessBits"][::core::mem::align_of::<MfClassicAccessBits>() - 1usize];
17630 ["Offset of field: MfClassicAccessBits::data"]
17631 [::core::mem::offset_of!(MfClassicAccessBits, data) - 0usize];
17632};
17633#[repr(C)]
17634#[derive(Debug, Copy, Clone)]
17635pub struct MfClassicNt {
17636 pub data: [u8; 4usize],
17637}
17638#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17639const _: () = {
17640 ["Size of MfClassicNt"][::core::mem::size_of::<MfClassicNt>() - 4usize];
17641 ["Alignment of MfClassicNt"][::core::mem::align_of::<MfClassicNt>() - 1usize];
17642 ["Offset of field: MfClassicNt::data"][::core::mem::offset_of!(MfClassicNt, data) - 0usize];
17643};
17644#[repr(C)]
17645#[derive(Debug, Copy, Clone)]
17646pub struct MfClassicAt {
17647 pub data: [u8; 4usize],
17648}
17649#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17650const _: () = {
17651 ["Size of MfClassicAt"][::core::mem::size_of::<MfClassicAt>() - 4usize];
17652 ["Alignment of MfClassicAt"][::core::mem::align_of::<MfClassicAt>() - 1usize];
17653 ["Offset of field: MfClassicAt::data"][::core::mem::offset_of!(MfClassicAt, data) - 0usize];
17654};
17655#[repr(C)]
17656#[derive(Debug, Copy, Clone)]
17657pub struct MfClassicNr {
17658 pub data: [u8; 4usize],
17659}
17660#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17661const _: () = {
17662 ["Size of MfClassicNr"][::core::mem::size_of::<MfClassicNr>() - 4usize];
17663 ["Alignment of MfClassicNr"][::core::mem::align_of::<MfClassicNr>() - 1usize];
17664 ["Offset of field: MfClassicNr::data"][::core::mem::offset_of!(MfClassicNr, data) - 0usize];
17665};
17666#[repr(C)]
17667#[derive(Debug, Copy, Clone)]
17668pub struct MfClassicAr {
17669 pub data: [u8; 4usize],
17670}
17671#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17672const _: () = {
17673 ["Size of MfClassicAr"][::core::mem::size_of::<MfClassicAr>() - 4usize];
17674 ["Alignment of MfClassicAr"][::core::mem::align_of::<MfClassicAr>() - 1usize];
17675 ["Offset of field: MfClassicAr::data"][::core::mem::offset_of!(MfClassicAr, data) - 0usize];
17676};
17677#[repr(C)]
17678#[derive(Debug, Copy, Clone)]
17679pub struct MfClassicAuthContext {
17680 pub block_num: u8,
17681 pub key: MfClassicKey,
17682 pub key_type: MfClassicKeyType,
17683 pub nt: MfClassicNt,
17684 pub nr: MfClassicNr,
17685 pub ar: MfClassicAr,
17686 pub at: MfClassicAt,
17687}
17688#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17689const _: () = {
17690 ["Size of MfClassicAuthContext"][::core::mem::size_of::<MfClassicAuthContext>() - 24usize];
17691 ["Alignment of MfClassicAuthContext"][::core::mem::align_of::<MfClassicAuthContext>() - 1usize];
17692 ["Offset of field: MfClassicAuthContext::block_num"]
17693 [::core::mem::offset_of!(MfClassicAuthContext, block_num) - 0usize];
17694 ["Offset of field: MfClassicAuthContext::key"]
17695 [::core::mem::offset_of!(MfClassicAuthContext, key) - 1usize];
17696 ["Offset of field: MfClassicAuthContext::key_type"]
17697 [::core::mem::offset_of!(MfClassicAuthContext, key_type) - 7usize];
17698 ["Offset of field: MfClassicAuthContext::nt"]
17699 [::core::mem::offset_of!(MfClassicAuthContext, nt) - 8usize];
17700 ["Offset of field: MfClassicAuthContext::nr"]
17701 [::core::mem::offset_of!(MfClassicAuthContext, nr) - 12usize];
17702 ["Offset of field: MfClassicAuthContext::ar"]
17703 [::core::mem::offset_of!(MfClassicAuthContext, ar) - 16usize];
17704 ["Offset of field: MfClassicAuthContext::at"]
17705 [::core::mem::offset_of!(MfClassicAuthContext, at) - 20usize];
17706};
17707#[repr(C)]
17708#[derive(Copy, Clone)]
17709pub union MfClassicSectorTrailer {
17710 pub block: MfClassicBlock,
17711 pub __bindgen_anon_1: MfClassicSectorTrailer__bindgen_ty_1,
17712}
17713#[repr(C)]
17714#[derive(Debug, Copy, Clone)]
17715pub struct MfClassicSectorTrailer__bindgen_ty_1 {
17716 pub key_a: MfClassicKey,
17717 pub access_bits: MfClassicAccessBits,
17718 pub key_b: MfClassicKey,
17719}
17720#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17721const _: () = {
17722 ["Size of MfClassicSectorTrailer__bindgen_ty_1"]
17723 [::core::mem::size_of::<MfClassicSectorTrailer__bindgen_ty_1>() - 16usize];
17724 ["Alignment of MfClassicSectorTrailer__bindgen_ty_1"]
17725 [::core::mem::align_of::<MfClassicSectorTrailer__bindgen_ty_1>() - 1usize];
17726 ["Offset of field: MfClassicSectorTrailer__bindgen_ty_1::key_a"]
17727 [::core::mem::offset_of!(MfClassicSectorTrailer__bindgen_ty_1, key_a) - 0usize];
17728 ["Offset of field: MfClassicSectorTrailer__bindgen_ty_1::access_bits"]
17729 [::core::mem::offset_of!(MfClassicSectorTrailer__bindgen_ty_1, access_bits) - 6usize];
17730 ["Offset of field: MfClassicSectorTrailer__bindgen_ty_1::key_b"]
17731 [::core::mem::offset_of!(MfClassicSectorTrailer__bindgen_ty_1, key_b) - 10usize];
17732};
17733#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17734const _: () = {
17735 ["Size of MfClassicSectorTrailer"][::core::mem::size_of::<MfClassicSectorTrailer>() - 16usize];
17736 ["Alignment of MfClassicSectorTrailer"]
17737 [::core::mem::align_of::<MfClassicSectorTrailer>() - 1usize];
17738 ["Offset of field: MfClassicSectorTrailer::block"]
17739 [::core::mem::offset_of!(MfClassicSectorTrailer, block) - 0usize];
17740};
17741#[repr(C)]
17742#[derive(Debug, Copy, Clone)]
17743pub struct MfClassicDeviceKeys {
17744 pub key_a_mask: u64,
17745 pub key_a: [MfClassicKey; 40usize],
17746 pub key_b_mask: u64,
17747 pub key_b: [MfClassicKey; 40usize],
17748}
17749#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17750const _: () = {
17751 ["Size of MfClassicDeviceKeys"][::core::mem::size_of::<MfClassicDeviceKeys>() - 496usize];
17752 ["Alignment of MfClassicDeviceKeys"][::core::mem::align_of::<MfClassicDeviceKeys>() - 8usize];
17753 ["Offset of field: MfClassicDeviceKeys::key_a_mask"]
17754 [::core::mem::offset_of!(MfClassicDeviceKeys, key_a_mask) - 0usize];
17755 ["Offset of field: MfClassicDeviceKeys::key_a"]
17756 [::core::mem::offset_of!(MfClassicDeviceKeys, key_a) - 8usize];
17757 ["Offset of field: MfClassicDeviceKeys::key_b_mask"]
17758 [::core::mem::offset_of!(MfClassicDeviceKeys, key_b_mask) - 248usize];
17759 ["Offset of field: MfClassicDeviceKeys::key_b"]
17760 [::core::mem::offset_of!(MfClassicDeviceKeys, key_b) - 256usize];
17761};
17762#[repr(C)]
17763#[derive(Debug, Copy, Clone)]
17764pub struct MfClassicData {
17765 pub iso14443_3a_data: *mut Iso14443_3aData,
17766 pub type_: MfClassicType,
17767 pub block_read_mask: [u32; 8usize],
17768 pub key_a_mask: u64,
17769 pub key_b_mask: u64,
17770 pub block: [MfClassicBlock; 256usize],
17771}
17772#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17773const _: () = {
17774 ["Size of MfClassicData"][::core::mem::size_of::<MfClassicData>() - 4152usize];
17775 ["Alignment of MfClassicData"][::core::mem::align_of::<MfClassicData>() - 8usize];
17776 ["Offset of field: MfClassicData::iso14443_3a_data"]
17777 [::core::mem::offset_of!(MfClassicData, iso14443_3a_data) - 0usize];
17778 ["Offset of field: MfClassicData::type_"]
17779 [::core::mem::offset_of!(MfClassicData, type_) - 4usize];
17780 ["Offset of field: MfClassicData::block_read_mask"]
17781 [::core::mem::offset_of!(MfClassicData, block_read_mask) - 8usize];
17782 ["Offset of field: MfClassicData::key_a_mask"]
17783 [::core::mem::offset_of!(MfClassicData, key_a_mask) - 40usize];
17784 ["Offset of field: MfClassicData::key_b_mask"]
17785 [::core::mem::offset_of!(MfClassicData, key_b_mask) - 48usize];
17786 ["Offset of field: MfClassicData::block"]
17787 [::core::mem::offset_of!(MfClassicData, block) - 56usize];
17788};
17789unsafe extern "C" {
17790 pub fn mf_classic_alloc() -> *mut MfClassicData;
17791}
17792unsafe extern "C" {
17793 pub fn mf_classic_free(data: *mut MfClassicData);
17794}
17795unsafe extern "C" {
17796 pub fn mf_classic_reset(data: *mut MfClassicData);
17797}
17798unsafe extern "C" {
17799 pub fn mf_classic_copy(data: *mut MfClassicData, other: *const MfClassicData);
17800}
17801unsafe extern "C" {
17802 pub fn mf_classic_verify(data: *mut MfClassicData, device_type: *const FuriString) -> bool;
17803}
17804unsafe extern "C" {
17805 pub fn mf_classic_load(data: *mut MfClassicData, ff: *mut FlipperFormat, version: u32) -> bool;
17806}
17807unsafe extern "C" {
17808 pub fn mf_classic_save(data: *const MfClassicData, ff: *mut FlipperFormat) -> bool;
17809}
17810unsafe extern "C" {
17811 pub fn mf_classic_is_equal(data: *const MfClassicData, other: *const MfClassicData) -> bool;
17812}
17813unsafe extern "C" {
17814 pub fn mf_classic_get_device_name(
17815 data: *const MfClassicData,
17816 name_type: NfcDeviceNameType,
17817 ) -> *const core::ffi::c_char;
17818}
17819unsafe extern "C" {
17820 pub fn mf_classic_get_uid(data: *const MfClassicData, uid_len: *mut usize) -> *const u8;
17821}
17822unsafe extern "C" {
17823 pub fn mf_classic_set_uid(data: *mut MfClassicData, uid: *const u8, uid_len: usize) -> bool;
17824}
17825unsafe extern "C" {
17826 pub fn mf_classic_get_base_data(data: *const MfClassicData) -> *mut Iso14443_3aData;
17827}
17828unsafe extern "C" {
17829 pub fn mf_classic_get_total_sectors_num(type_: MfClassicType) -> u8;
17830}
17831unsafe extern "C" {
17832 pub fn mf_classic_get_total_block_num(type_: MfClassicType) -> u16;
17833}
17834unsafe extern "C" {
17835 pub fn mf_classic_get_first_block_num_of_sector(sector: u8) -> u8;
17836}
17837unsafe extern "C" {
17838 pub fn mf_classic_get_blocks_num_in_sector(sector: u8) -> u8;
17839}
17840unsafe extern "C" {
17841 pub fn mf_classic_get_sector_trailer_num_by_sector(sector: u8) -> u8;
17842}
17843unsafe extern "C" {
17844 pub fn mf_classic_get_sector_trailer_num_by_block(block: u8) -> u8;
17845}
17846unsafe extern "C" {
17847 pub fn mf_classic_get_sector_trailer_by_sector(
17848 data: *const MfClassicData,
17849 sector_num: u8,
17850 ) -> *mut MfClassicSectorTrailer;
17851}
17852unsafe extern "C" {
17853 pub fn mf_classic_is_sector_trailer(block: u8) -> bool;
17854}
17855unsafe extern "C" {
17856 pub fn mf_classic_set_sector_trailer_read(
17857 data: *mut MfClassicData,
17858 block_num: u8,
17859 sec_tr: *mut MfClassicSectorTrailer,
17860 );
17861}
17862unsafe extern "C" {
17863 pub fn mf_classic_get_sector_by_block(block: u8) -> u8;
17864}
17865unsafe extern "C" {
17866 pub fn mf_classic_block_to_value(
17867 block: *const MfClassicBlock,
17868 value: *mut i32,
17869 addr: *mut u8,
17870 ) -> bool;
17871}
17872unsafe extern "C" {
17873 pub fn mf_classic_value_to_block(value: i32, addr: u8, block: *mut MfClassicBlock);
17874}
17875unsafe extern "C" {
17876 pub fn mf_classic_is_key_found(
17877 data: *const MfClassicData,
17878 sector_num: u8,
17879 key_type: MfClassicKeyType,
17880 ) -> bool;
17881}
17882unsafe extern "C" {
17883 pub fn mf_classic_set_key_found(
17884 data: *mut MfClassicData,
17885 sector_num: u8,
17886 key_type: MfClassicKeyType,
17887 key: u64,
17888 );
17889}
17890unsafe extern "C" {
17891 pub fn mf_classic_set_key_not_found(
17892 data: *mut MfClassicData,
17893 sector_num: u8,
17894 key_type: MfClassicKeyType,
17895 );
17896}
17897unsafe extern "C" {
17898 pub fn mf_classic_get_key(
17899 data: *const MfClassicData,
17900 sector_num: u8,
17901 key_type: MfClassicKeyType,
17902 ) -> MfClassicKey;
17903}
17904unsafe extern "C" {
17905 pub fn mf_classic_is_block_read(data: *const MfClassicData, block_num: u8) -> bool;
17906}
17907unsafe extern "C" {
17908 pub fn mf_classic_set_block_read(
17909 data: *mut MfClassicData,
17910 block_num: u8,
17911 block_data: *mut MfClassicBlock,
17912 );
17913}
17914unsafe extern "C" {
17915 pub fn mf_classic_is_sector_read(data: *const MfClassicData, sector_num: u8) -> bool;
17916}
17917unsafe extern "C" {
17918 pub fn mf_classic_get_read_sectors_and_keys(
17919 data: *const MfClassicData,
17920 sectors_read: *mut u8,
17921 keys_found: *mut u8,
17922 );
17923}
17924unsafe extern "C" {
17925 pub fn mf_classic_is_card_read(data: *const MfClassicData) -> bool;
17926}
17927unsafe extern "C" {
17928 pub fn mf_classic_is_value_block(sec_tr: *mut MfClassicSectorTrailer, block_num: u8) -> bool;
17929}
17930unsafe extern "C" {
17931 pub fn mf_classic_is_allowed_access_data_block(
17932 sec_tr: *mut MfClassicSectorTrailer,
17933 block_num: u8,
17934 key_type: MfClassicKeyType,
17935 action: MfClassicAction,
17936 ) -> bool;
17937}
17938unsafe extern "C" {
17939 pub fn mf_classic_is_allowed_access(
17940 data: *mut MfClassicData,
17941 block_num: u8,
17942 key_type: MfClassicKeyType,
17943 action: MfClassicAction,
17944 ) -> bool;
17945}
17946#[repr(C)]
17947#[derive(Debug, Copy, Clone)]
17948pub struct Crypto1 {
17949 pub odd: u32,
17950 pub even: u32,
17951}
17952#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17953const _: () = {
17954 ["Size of Crypto1"][::core::mem::size_of::<Crypto1>() - 8usize];
17955 ["Alignment of Crypto1"][::core::mem::align_of::<Crypto1>() - 4usize];
17956 ["Offset of field: Crypto1::odd"][::core::mem::offset_of!(Crypto1, odd) - 0usize];
17957 ["Offset of field: Crypto1::even"][::core::mem::offset_of!(Crypto1, even) - 4usize];
17958};
17959unsafe extern "C" {
17960 pub fn crypto1_alloc() -> *mut Crypto1;
17961}
17962unsafe extern "C" {
17963 pub fn crypto1_free(instance: *mut Crypto1);
17964}
17965unsafe extern "C" {
17966 pub fn crypto1_reset(crypto1: *mut Crypto1);
17967}
17968unsafe extern "C" {
17969 pub fn crypto1_init(crypto1: *mut Crypto1, key: u64);
17970}
17971unsafe extern "C" {
17972 pub fn crypto1_bit(crypto1: *mut Crypto1, in_: u8, is_encrypted: core::ffi::c_int) -> u8;
17973}
17974unsafe extern "C" {
17975 pub fn crypto1_byte(crypto1: *mut Crypto1, in_: u8, is_encrypted: core::ffi::c_int) -> u8;
17976}
17977unsafe extern "C" {
17978 pub fn crypto1_word(crypto1: *mut Crypto1, in_: u32, is_encrypted: core::ffi::c_int) -> u32;
17979}
17980unsafe extern "C" {
17981 pub fn crypto1_decrypt(crypto: *mut Crypto1, buff: *const BitBuffer, out: *mut BitBuffer);
17982}
17983unsafe extern "C" {
17984 pub fn crypto1_encrypt(
17985 crypto: *mut Crypto1,
17986 keystream: *mut u8,
17987 buff: *const BitBuffer,
17988 out: *mut BitBuffer,
17989 );
17990}
17991unsafe extern "C" {
17992 pub fn crypto1_encrypt_reader_nonce(
17993 crypto: *mut Crypto1,
17994 key: u64,
17995 cuid: u32,
17996 nt: *mut u8,
17997 nr: *mut u8,
17998 out: *mut BitBuffer,
17999 is_nested: bool,
18000 );
18001}
18002unsafe extern "C" {
18003 pub fn crypto1_lfsr_rollback_word(crypto1: *mut Crypto1, in_: u32, fb: core::ffi::c_int)
18004 -> u32;
18005}
18006unsafe extern "C" {
18007 pub fn crypto1_nonce_matches_encrypted_parity_bits(nt: u32, ks: u32, nt_par_enc: u8) -> bool;
18008}
18009unsafe extern "C" {
18010 pub fn crypto1_is_weak_prng_nonce(nonce: u32) -> bool;
18011}
18012unsafe extern "C" {
18013 pub fn crypto1_decrypt_nt_enc(cuid: u32, nt_enc: u32, known_key: MfClassicKey) -> u32;
18014}
18015unsafe extern "C" {
18016 pub fn crypto1_prng_successor(x: u32, n: u32) -> u32;
18017}
18018unsafe extern "C" {
18019 pub fn felica_crc_append(buf: *mut BitBuffer);
18020}
18021unsafe extern "C" {
18022 pub fn felica_crc_check(buf: *const BitBuffer) -> bool;
18023}
18024unsafe extern "C" {
18025 pub fn felica_crc_trim(buf: *mut BitBuffer);
18026}
18027pub const Iso13239CrcTypeDefault: Iso13239CrcType = Iso13239CrcType(0);
18028pub const Iso13239CrcTypePicopass: Iso13239CrcType = Iso13239CrcType(1);
18029#[repr(transparent)]
18030#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18031pub struct Iso13239CrcType(pub core::ffi::c_uchar);
18032unsafe extern "C" {
18033 pub fn iso13239_crc_append(type_: Iso13239CrcType, buf: *mut BitBuffer);
18034}
18035unsafe extern "C" {
18036 pub fn iso13239_crc_check(type_: Iso13239CrcType, buf: *const BitBuffer) -> bool;
18037}
18038unsafe extern "C" {
18039 pub fn iso13239_crc_trim(buf: *mut BitBuffer);
18040}
18041pub const Iso14443CrcTypeA: Iso14443CrcType = Iso14443CrcType(0);
18042pub const Iso14443CrcTypeB: Iso14443CrcType = Iso14443CrcType(1);
18043#[repr(transparent)]
18044#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18045pub struct Iso14443CrcType(pub core::ffi::c_uchar);
18046unsafe extern "C" {
18047 pub fn iso14443_crc_append(type_: Iso14443CrcType, buf: *mut BitBuffer);
18048}
18049unsafe extern "C" {
18050 pub fn iso14443_crc_check(type_: Iso14443CrcType, buf: *const BitBuffer) -> bool;
18051}
18052unsafe extern "C" {
18053 pub fn iso14443_crc_trim(buf: *mut BitBuffer);
18054}
18055pub const NfcProtocolIso14443_3a: NfcProtocol = NfcProtocol(0);
18056pub const NfcProtocolIso14443_3b: NfcProtocol = NfcProtocol(1);
18057pub const NfcProtocolIso14443_4a: NfcProtocol = NfcProtocol(2);
18058pub const NfcProtocolIso14443_4b: NfcProtocol = NfcProtocol(3);
18059pub const NfcProtocolIso15693_3: NfcProtocol = NfcProtocol(4);
18060pub const NfcProtocolFelica: NfcProtocol = NfcProtocol(5);
18061pub const NfcProtocolMfUltralight: NfcProtocol = NfcProtocol(6);
18062pub const NfcProtocolMfClassic: NfcProtocol = NfcProtocol(7);
18063pub const NfcProtocolMfPlus: NfcProtocol = NfcProtocol(8);
18064pub const NfcProtocolMfDesfire: NfcProtocol = NfcProtocol(9);
18065pub const NfcProtocolSlix: NfcProtocol = NfcProtocol(10);
18066pub const NfcProtocolSt25tb: NfcProtocol = NfcProtocol(11);
18067#[doc = "< Special value representing the number of available protocols."]
18068pub const NfcProtocolNum: NfcProtocol = NfcProtocol(12);
18069#[doc = "< Special value representing an invalid state."]
18070pub const NfcProtocolInvalid: NfcProtocol = NfcProtocol(13);
18071#[repr(transparent)]
18072#[doc = "Enumeration of all available NFC protocols.\n\n When implementing a new protocol, add its identifier before the\n NfcProtocolNum entry."]
18073#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18074pub struct NfcProtocol(pub core::ffi::c_uchar);
18075unsafe extern "C" {
18076 #[doc = "Get the immediate parent of a specific protocol.\n\n # Arguments\n\n* `protocol` (direction in) - identifier of the protocol in question.\n # Returns\n\nparent protocol identifier if it has one, or NfcProtocolInvalid otherwise."]
18077 pub fn nfc_protocol_get_parent(protocol: NfcProtocol) -> NfcProtocol;
18078}
18079unsafe extern "C" {
18080 #[doc = "Determine if a specific protocol has a parent on an arbitrary level.\n\n Unlike nfc_protocol_get_parent(), this function will traverse the full protocol hierarchy\n and check each parent node for the matching protocol type.\n\n # Arguments\n\n* `protocol` (direction in) - identifier of the protocol in question.\n * `parent_protocol` (direction in) - identifier of the parent protocol in question.\n # Returns\n\ntrue if the parent of given type exists, false otherwise."]
18081 pub fn nfc_protocol_has_parent(protocol: NfcProtocol, parent_protocol: NfcProtocol) -> bool;
18082}
18083#[repr(C)]
18084#[derive(Debug, Copy, Clone)]
18085pub struct NfcDevice {
18086 _unused: [u8; 0],
18087}
18088#[doc = "Loading callback function signature.\n\n A function with such signature can be set as a callback to indicate\n the completion (or a failure) of nfc_device_load() and nfc_device_save() functions.\n\n This facility is commonly used to control GUI elements, such as progress dialogs.\n\n # Arguments\n\n* `context` (direction in) - user-defined context that was passed in nfc_device_set_loading_callback().\n * `state` (direction in) - true if the data was loaded successfully, false otherwise."]
18089pub type NfcLoadingCallback =
18090 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, state: bool)>;
18091unsafe extern "C" {
18092 #[doc = "Allocate an NfcDevice instance.\n\n A newly created instance does not hold any data and thus is considered invalid. The most common\n use case would be to set its data by calling nfc_device_set_data() right afterwards.\n\n # Returns\n\npointer to the allocated instance."]
18093 pub fn nfc_device_alloc() -> *mut NfcDevice;
18094}
18095unsafe extern "C" {
18096 #[doc = "Delete an NfcDevice instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18097 pub fn nfc_device_free(instance: *mut NfcDevice);
18098}
18099unsafe extern "C" {
18100 #[doc = "Clear an NfcDevice instance.\n\n All data contained in the instance will be deleted and the instance itself will become invalid\n as if it was just allocated.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be cleared."]
18101 pub fn nfc_device_clear(instance: *mut NfcDevice);
18102}
18103unsafe extern "C" {
18104 #[doc = "Reset an NfcDevice instance.\n\n The data contained in the instance will be reset according to the protocol-defined procedure.\n Unlike the nfc_device_clear() function, the instance will remain valid.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be reset."]
18105 pub fn nfc_device_reset(instance: *mut NfcDevice);
18106}
18107unsafe extern "C" {
18108 #[doc = "Get the protocol identifier from an NfcDevice instance.\n\n If the instance is invalid, the return value will be NfcProtocolInvalid.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n # Returns\n\nprotocol identifier contained in the instance."]
18109 pub fn nfc_device_get_protocol(instance: *const NfcDevice) -> NfcProtocol;
18110}
18111unsafe extern "C" {
18112 #[doc = "Get the protocol-specific data from an NfcDevice instance.\n\n The protocol parameter's behaviour is a bit tricky. The function will check\n whether there is such a protocol somewhere in the protocol hierarchy and return\n the data exactly from that level.\n\n Example: Call nfc_device_get_data() on an instance with Mf DESFire protocol.\n The protocol hierarchy will look like the following:\n\n `Mf DESFire --> ISO14443-4A --> ISO14443-3A`\n\n Thus, the following values of the protocol parameter are valid:\n\n * NfcProtocolIso14443_3a\n * NfcProtocolIso14443_4a\n * NfcProtocolMfDesfire\n\n and passing them to the call would result in the respective data being returned.\n\n However, supplying a protocol identifier which is not in the hierarchy will\n result in a crash. This is to improve type safety.\n\n # Arguments\n\n* `instance` - pointer to the instance to be queried\n * `protocol` - protocol identifier of the data to be retrieved.\n # Returns\n\npointer to the instance's data."]
18113 pub fn nfc_device_get_data(
18114 instance: *const NfcDevice,
18115 protocol: NfcProtocol,
18116 ) -> *const NfcDeviceData;
18117}
18118unsafe extern "C" {
18119 #[doc = "Get the protocol name by its identifier.\n\n This function does not require an instance as its return result depends only\n the protocol identifier.\n\n # Arguments\n\n* `protocol` (direction in) - numeric identifier of the protocol in question.\n # Returns\n\npointer to a statically allocated string containing the protocol name."]
18120 pub fn nfc_device_get_protocol_name(protocol: NfcProtocol) -> *const core::ffi::c_char;
18121}
18122unsafe extern "C" {
18123 #[doc = "Get the name of an NfcDevice instance.\n\n The return value may change depending on the instance's internal state and the name_type parameter.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n * `name_type` (direction in) - type of the name to be displayed.\n # Returns\n\npointer to a statically allocated string containing the device name."]
18124 pub fn nfc_device_get_name(
18125 instance: *const NfcDevice,
18126 name_type: NfcDeviceNameType,
18127 ) -> *const core::ffi::c_char;
18128}
18129unsafe extern "C" {
18130 #[doc = "Get the unique identifier (UID) of an NfcDevice instance.\n\n The UID length is protocol-dependent. Additionally, a particular protocol might support\n several UID lengths.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n * `uid_len` (direction out) - pointer to the variable to contain the UID length.\n # Returns\n\npointer to the byte array containing the instance's UID."]
18131 pub fn nfc_device_get_uid(instance: *const NfcDevice, uid_len: *mut usize) -> *const u8;
18132}
18133unsafe extern "C" {
18134 #[doc = "Set the unique identifier (UID) of an NfcDevice instance.\n\n The UID length must be supported by the instance's protocol.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `uid` (direction in) - pointer to the byte array containing the new UID.\n * `uid_len` (direction in) - length of the UID.\n # Returns\n\ntrue if the UID was valid and set, false otherwise."]
18135 pub fn nfc_device_set_uid(instance: *mut NfcDevice, uid: *const u8, uid_len: usize) -> bool;
18136}
18137unsafe extern "C" {
18138 #[doc = "Set the data and protocol of an NfcDevice instance.\n\n Any data previously contained in the instance will be deleted.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `protocol` (direction in) - numeric identifier of the data's protocol.\n * `protocol_data` (direction in) - pointer to the protocol-specific data."]
18139 pub fn nfc_device_set_data(
18140 instance: *mut NfcDevice,
18141 protocol: NfcProtocol,
18142 protocol_data: *const NfcDeviceData,
18143 );
18144}
18145unsafe extern "C" {
18146 #[doc = "Copy (export) the data contained in an NfcDevice instance to an outside NfcDeviceData instance.\n\n This function does the inverse of nfc_device_set_data().\n\n The protocol identifier passed as the protocol parameter MUST match the one\n stored in the instance, otherwise a crash will occur.\n This is to improve type safety.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be copied from.\n * `protocol` (direction in) - numeric identifier of the instance's protocol.\n * `protocol_data` (direction out) - pointer to the destination data."]
18147 pub fn nfc_device_copy_data(
18148 instance: *const NfcDevice,
18149 protocol: NfcProtocol,
18150 protocol_data: *mut NfcDeviceData,
18151 );
18152}
18153unsafe extern "C" {
18154 #[doc = "Check whether an NfcDevice instance holds certain data.\n\n This function's behaviour is similar to nfc_device_is_equal(), with the difference\n that it takes NfcProtocol and NfcDeviceData* instead of the second NfcDevice*.\n\n The following code snippets [1] and [2] are equivalent:\n\n [1]\n ```c\n bool is_equal = nfc_device_is_equal(device1, device2);\n ```\n [2]\n ```c\n NfcProtocol protocol = nfc_device_get_protocol(device2);\n const NfcDeviceData* data = nfc_device_get_data(device2, protocol);\n bool is_equal = nfc_device_is_equal_data(device1, protocol, data);\n ```\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be compared.\n * `protocol` (direction in) - protocol identifier of the data to be compared.\n * `protocol_data` (direction in) - pointer to the NFC device data to be compared.\n # Returns\n\ntrue if the instance is of the right type and the data matches, false otherwise."]
18155 pub fn nfc_device_is_equal_data(
18156 instance: *const NfcDevice,
18157 protocol: NfcProtocol,
18158 protocol_data: *const NfcDeviceData,
18159 ) -> bool;
18160}
18161unsafe extern "C" {
18162 #[doc = "Compare two NfcDevice instances to determine whether they are equal.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the first instance to be compared.\n * `other` (direction in) - pointer to the second instance to be compared.\n # Returns\n\ntrue if both instances are considered equal, false otherwise."]
18163 pub fn nfc_device_is_equal(instance: *const NfcDevice, other: *const NfcDevice) -> bool;
18164}
18165unsafe extern "C" {
18166 #[doc = "Set the loading callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `callback` (direction in) - pointer to a function to be called when the load operation completes.\n * `context` (direction in) - pointer to a user-specific context (will be passed to the callback)."]
18167 pub fn nfc_device_set_loading_callback(
18168 instance: *mut NfcDevice,
18169 callback: NfcLoadingCallback,
18170 context: *mut core::ffi::c_void,
18171 );
18172}
18173unsafe extern "C" {
18174 #[doc = "Save NFC device data form an NfcDevice instance to a file.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be saved.\n * `path` (direction in) - pointer to a character string with a full file path.\n # Returns\n\ntrue if the data was successfully saved, false otherwise."]
18175 pub fn nfc_device_save(instance: *mut NfcDevice, path: *const core::ffi::c_char) -> bool;
18176}
18177unsafe extern "C" {
18178 #[doc = "Load NFC device data to an NfcDevice instance from a file.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be loaded into.\n * `path` (direction in) - pointer to a character string with a full file path.\n # Returns\n\ntrue if the data was successfully loaded, false otherwise."]
18179 pub fn nfc_device_load(instance: *mut NfcDevice, path: *const core::ffi::c_char) -> bool;
18180}
18181pub const NfcDataGeneratorTypeMfUltralight: NfcDataGeneratorType = NfcDataGeneratorType(0);
18182pub const NfcDataGeneratorTypeMfUltralightEV1_11: NfcDataGeneratorType = NfcDataGeneratorType(1);
18183pub const NfcDataGeneratorTypeMfUltralightEV1_H11: NfcDataGeneratorType = NfcDataGeneratorType(2);
18184pub const NfcDataGeneratorTypeMfUltralightEV1_21: NfcDataGeneratorType = NfcDataGeneratorType(3);
18185pub const NfcDataGeneratorTypeMfUltralightEV1_H21: NfcDataGeneratorType = NfcDataGeneratorType(4);
18186pub const NfcDataGeneratorTypeNTAG203: NfcDataGeneratorType = NfcDataGeneratorType(5);
18187pub const NfcDataGeneratorTypeNTAG213: NfcDataGeneratorType = NfcDataGeneratorType(6);
18188pub const NfcDataGeneratorTypeNTAG215: NfcDataGeneratorType = NfcDataGeneratorType(7);
18189pub const NfcDataGeneratorTypeNTAG216: NfcDataGeneratorType = NfcDataGeneratorType(8);
18190pub const NfcDataGeneratorTypeNTAGI2C1k: NfcDataGeneratorType = NfcDataGeneratorType(9);
18191pub const NfcDataGeneratorTypeNTAGI2C2k: NfcDataGeneratorType = NfcDataGeneratorType(10);
18192pub const NfcDataGeneratorTypeNTAGI2CPlus1k: NfcDataGeneratorType = NfcDataGeneratorType(11);
18193pub const NfcDataGeneratorTypeNTAGI2CPlus2k: NfcDataGeneratorType = NfcDataGeneratorType(12);
18194pub const NfcDataGeneratorTypeMfClassicMini: NfcDataGeneratorType = NfcDataGeneratorType(13);
18195pub const NfcDataGeneratorTypeMfClassic1k_4b: NfcDataGeneratorType = NfcDataGeneratorType(14);
18196pub const NfcDataGeneratorTypeMfClassic1k_7b: NfcDataGeneratorType = NfcDataGeneratorType(15);
18197pub const NfcDataGeneratorTypeMfClassic4k_4b: NfcDataGeneratorType = NfcDataGeneratorType(16);
18198pub const NfcDataGeneratorTypeMfClassic4k_7b: NfcDataGeneratorType = NfcDataGeneratorType(17);
18199pub const NfcDataGeneratorTypeNum: NfcDataGeneratorType = NfcDataGeneratorType(18);
18200#[repr(transparent)]
18201#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18202pub struct NfcDataGeneratorType(pub core::ffi::c_uchar);
18203unsafe extern "C" {
18204 pub fn nfc_data_generator_get_name(type_: NfcDataGeneratorType) -> *const core::ffi::c_char;
18205}
18206unsafe extern "C" {
18207 pub fn nfc_data_generator_fill_data(type_: NfcDataGeneratorType, nfc_device: *mut NfcDevice);
18208}
18209unsafe extern "C" {
18210 pub fn nfc_util_even_parity8(data: u8) -> u8;
18211}
18212unsafe extern "C" {
18213 pub fn nfc_util_even_parity32(data: u32) -> u8;
18214}
18215unsafe extern "C" {
18216 pub fn nfc_util_odd_parity8(data: u8) -> u8;
18217}
18218unsafe extern "C" {
18219 pub fn nfc_util_odd_parity(src: *const u8, dst: *mut u8, len: u8);
18220}
18221#[repr(C)]
18222#[derive(Debug, Copy, Clone)]
18223pub struct Nfc {
18224 _unused: [u8; 0],
18225}
18226#[doc = "< User code explicitly aborted the current operation."]
18227pub const NfcEventTypeUserAbort: NfcEventType = NfcEventType(0);
18228#[doc = "< Reader's field was detected by the NFC hardware."]
18229pub const NfcEventTypeFieldOn: NfcEventType = NfcEventType(1);
18230#[doc = "< Reader's field was lost."]
18231pub const NfcEventTypeFieldOff: NfcEventType = NfcEventType(2);
18232#[doc = "< Data transmission has started."]
18233pub const NfcEventTypeTxStart: NfcEventType = NfcEventType(3);
18234#[doc = "< Data transmission has ended."]
18235pub const NfcEventTypeTxEnd: NfcEventType = NfcEventType(4);
18236#[doc = "< Data reception has started."]
18237pub const NfcEventTypeRxStart: NfcEventType = NfcEventType(5);
18238#[doc = "< Data reception has ended."]
18239pub const NfcEventTypeRxEnd: NfcEventType = NfcEventType(6);
18240#[doc = "< The listener has been activated by the reader."]
18241pub const NfcEventTypeListenerActivated: NfcEventType = NfcEventType(7);
18242#[doc = "< The card has been activated by the poller."]
18243pub const NfcEventTypePollerReady: NfcEventType = NfcEventType(8);
18244#[repr(transparent)]
18245#[doc = "Enumeration of possible Nfc event types.\n\n Not all technologies implement all events (this is due to hardware limitations)."]
18246#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18247pub struct NfcEventType(pub core::ffi::c_uchar);
18248#[doc = "Nfc event data structure."]
18249#[repr(C)]
18250#[derive(Debug, Copy, Clone)]
18251pub struct NfcEventData {
18252 #[doc = "< Pointer to the received data buffer."]
18253 pub buffer: *mut BitBuffer,
18254}
18255#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18256const _: () = {
18257 ["Size of NfcEventData"][::core::mem::size_of::<NfcEventData>() - 4usize];
18258 ["Alignment of NfcEventData"][::core::mem::align_of::<NfcEventData>() - 4usize];
18259 ["Offset of field: NfcEventData::buffer"]
18260 [::core::mem::offset_of!(NfcEventData, buffer) - 0usize];
18261};
18262#[doc = "Nfc event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
18263#[repr(C)]
18264#[derive(Debug, Copy, Clone)]
18265pub struct NfcEvent {
18266 #[doc = "< Type of the emitted event."]
18267 pub type_: NfcEventType,
18268 #[doc = "< Event-specific data."]
18269 pub data: NfcEventData,
18270}
18271#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18272const _: () = {
18273 ["Size of NfcEvent"][::core::mem::size_of::<NfcEvent>() - 8usize];
18274 ["Alignment of NfcEvent"][::core::mem::align_of::<NfcEvent>() - 4usize];
18275 ["Offset of field: NfcEvent::type_"][::core::mem::offset_of!(NfcEvent, type_) - 0usize];
18276 ["Offset of field: NfcEvent::data"][::core::mem::offset_of!(NfcEvent, data) - 4usize];
18277};
18278#[doc = "< Continue operation normally."]
18279pub const NfcCommandContinue: NfcCommand = NfcCommand(0);
18280#[doc = "< Reset the current state."]
18281pub const NfcCommandReset: NfcCommand = NfcCommand(1);
18282#[doc = "< Stop the current operation."]
18283pub const NfcCommandStop: NfcCommand = NfcCommand(2);
18284#[doc = "< Switch Nfc hardware to low-power mode."]
18285pub const NfcCommandSleep: NfcCommand = NfcCommand(3);
18286#[repr(transparent)]
18287#[doc = "Enumeration of possible Nfc commands.\n\n The event callback must return one of these to determine the next action."]
18288#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18289pub struct NfcCommand(pub core::ffi::c_uchar);
18290#[doc = "Nfc event callback type.\n\n A function of this type must be passed as the callback parameter upon start of a an Nfc instance.\n\n # Arguments\n\n* `[in]` - event Nfc event, passed by value, complete with protocol type and data.\n * `[in,out]` - context pointer to the user-specific context (set when starting an Nfc instance).\n # Returns\n\ncommand which the event producer must execute."]
18291pub type NfcEventCallback = ::core::option::Option<
18292 unsafe extern "C" fn(event: NfcEvent, context: *mut core::ffi::c_void) -> NfcCommand,
18293>;
18294#[doc = "< Configure the Nfc instance as a poller."]
18295pub const NfcModePoller: NfcMode = NfcMode(0);
18296#[doc = "< Configure the Nfc instance as a listener."]
18297pub const NfcModeListener: NfcMode = NfcMode(1);
18298#[doc = "< Operating mode count. Internal use."]
18299pub const NfcModeNum: NfcMode = NfcMode(2);
18300#[repr(transparent)]
18301#[doc = "Enumeration of possible operating modes.\n\n Not all technologies implement the listener operating mode."]
18302#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18303pub struct NfcMode(pub core::ffi::c_uchar);
18304#[doc = "< Configure the Nfc instance to use the ISO14443-3A technology."]
18305pub const NfcTechIso14443a: NfcTech = NfcTech(0);
18306#[doc = "< Configure the Nfc instance to use the ISO14443-3B technology."]
18307pub const NfcTechIso14443b: NfcTech = NfcTech(1);
18308#[doc = "< Configure the Nfc instance to use the ISO15693 technology."]
18309pub const NfcTechIso15693: NfcTech = NfcTech(2);
18310#[doc = "< Configure the Nfc instance to use the FeliCa technology."]
18311pub const NfcTechFelica: NfcTech = NfcTech(3);
18312#[doc = "< Technologies count. Internal use."]
18313pub const NfcTechNum: NfcTech = NfcTech(4);
18314#[repr(transparent)]
18315#[doc = "Enumeration of available technologies."]
18316#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18317pub struct NfcTech(pub core::ffi::c_uchar);
18318#[doc = "< No error has occurred."]
18319pub const NfcErrorNone: NfcError = NfcError(0);
18320#[doc = "< An unknown error has occured on the lower level."]
18321pub const NfcErrorInternal: NfcError = NfcError(1);
18322#[doc = "< Operation is taking too long (e.g. card does not respond)."]
18323pub const NfcErrorTimeout: NfcError = NfcError(2);
18324#[doc = "< An incomplete data frame has been received."]
18325pub const NfcErrorIncompleteFrame: NfcError = NfcError(3);
18326#[doc = "< Data has not been parsed due to wrong/unknown format."]
18327pub const NfcErrorDataFormat: NfcError = NfcError(4);
18328#[repr(transparent)]
18329#[doc = "Enumeration of possible Nfc error codes."]
18330#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18331pub struct NfcError(pub core::ffi::c_uchar);
18332unsafe extern "C" {
18333 #[doc = "Allocate an Nfc instance.\n\n Will exclusively take over the NFC HAL until deleted.\n\n # Returns\n\npointer to the allocated Nfc instance."]
18334 pub fn nfc_alloc() -> *mut Nfc;
18335}
18336unsafe extern "C" {
18337 #[doc = "Delete an Nfc instance.\n\n Will release the NFC HAL lock, making it available for use by others.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18338 pub fn nfc_free(instance: *mut Nfc);
18339}
18340unsafe extern "C" {
18341 #[doc = "Configure the Nfc instance to work in a particular mode.\n\n Not all technologies implement the listener operating mode.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be configured.\n * `mode` (direction in) - required operating mode.\n * `tech` (direction in) - required technology configuration."]
18342 pub fn nfc_config(instance: *mut Nfc, mode: NfcMode, tech: NfcTech);
18343}
18344unsafe extern "C" {
18345 #[doc = "Set poller frame delay time.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `fdt_poll_fc` (direction in) - frame delay time, in carrier cycles."]
18346 pub fn nfc_set_fdt_poll_fc(instance: *mut Nfc, fdt_poll_fc: u32);
18347}
18348unsafe extern "C" {
18349 #[doc = "Set listener frame delay time.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `fdt_listen_fc` (direction in) - frame delay time, in carrier cycles."]
18350 pub fn nfc_set_fdt_listen_fc(instance: *mut Nfc, fdt_listen_fc: u32);
18351}
18352unsafe extern "C" {
18353 #[doc = "Set mask receive time.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `mask_rx_time_fc` (direction in) - mask receive time, in carrier cycles."]
18354 pub fn nfc_set_mask_receive_time_fc(instance: *mut Nfc, mask_rx_time_fc: u32);
18355}
18356unsafe extern "C" {
18357 #[doc = "Set frame delay time.\n\n Frame delay time is the minimum time between two consecutive poll frames.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `fdt_poll_poll_us` (direction in) - frame delay time, in microseconds."]
18358 pub fn nfc_set_fdt_poll_poll_us(instance: *mut Nfc, fdt_poll_poll_us: u32);
18359}
18360unsafe extern "C" {
18361 #[doc = "Set guard time.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be modified.\n * `guard_time_us` (direction in) - guard time, in microseconds."]
18362 pub fn nfc_set_guard_time_us(instance: *mut Nfc, guard_time_us: u32);
18363}
18364unsafe extern "C" {
18365 #[doc = "Start the Nfc instance.\n\n The instance must be configured to work with a specific technology\n in a specific operating mode with a nfc_config() call before starting.\n\n Once started, the user code will be receiving events through the provided\n callback which must handle them according to the logic required.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be started.\n * `callback` (direction in) - pointer to a user-defined callback function which will receive events.\n * `context` (direction in) - pointer to a user-specific context (will be passed to the callback)."]
18366 pub fn nfc_start(
18367 instance: *mut Nfc,
18368 callback: NfcEventCallback,
18369 context: *mut core::ffi::c_void,
18370 );
18371}
18372unsafe extern "C" {
18373 #[doc = "Stop Nfc instance.\n\n The instance can only be stopped if it is running.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be stopped."]
18374 pub fn nfc_stop(instance: *mut Nfc);
18375}
18376unsafe extern "C" {
18377 #[doc = "Transmit and receive a data frame in poller mode.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n The data being transmitted and received may be either bit- or byte-oriented.\n It shall not contain any technology-specific sequences as start or stop bits\n and/or other special symbols, as this is handled on the underlying HAL level.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18378 pub fn nfc_poller_trx(
18379 instance: *mut Nfc,
18380 tx_buffer: *const BitBuffer,
18381 rx_buffer: *mut BitBuffer,
18382 fwt: u32,
18383 ) -> NfcError;
18384}
18385unsafe extern "C" {
18386 #[doc = "Transmit a data frame in listener mode.\n\n Used to transmit a response to the reader request in listener mode.\n\n The data being transmitted may be either bit- or byte-oriented.\n It shall not contain any technology-specific sequences as start or stop bits\n and/or other special symbols, as this is handled on the underlying HAL level.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18387 pub fn nfc_listener_tx(instance: *mut Nfc, tx_buffer: *const BitBuffer) -> NfcError;
18388}
18389pub const NfcIso14443aShortFrameSensReq: NfcIso14443aShortFrame = NfcIso14443aShortFrame(0);
18390pub const NfcIso14443aShortFrameAllReqa: NfcIso14443aShortFrame = NfcIso14443aShortFrame(1);
18391#[repr(transparent)]
18392#[doc = "Enumeration of possible ISO14443-3A short frame types."]
18393#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18394pub struct NfcIso14443aShortFrame(pub core::ffi::c_uchar);
18395unsafe extern "C" {
18396 #[doc = "Transmit an ISO14443-3A short frame and receive the response in poller mode.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `frame` (direction in) - type of short frame to be sent.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18397 pub fn nfc_iso14443a_poller_trx_short_frame(
18398 instance: *mut Nfc,
18399 frame: NfcIso14443aShortFrame,
18400 rx_buffer: *mut BitBuffer,
18401 fwt: u32,
18402 ) -> NfcError;
18403}
18404unsafe extern "C" {
18405 #[doc = "Transmit an ISO14443-3A SDD frame and receive the response in poller mode.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18406 pub fn nfc_iso14443a_poller_trx_sdd_frame(
18407 instance: *mut Nfc,
18408 tx_buffer: *const BitBuffer,
18409 rx_buffer: *mut BitBuffer,
18410 fwt: u32,
18411 ) -> NfcError;
18412}
18413unsafe extern "C" {
18414 #[doc = "Transmit an ISO14443-3A data frame with custom parity bits and receive the response in poller mode.\n\n Same as nfc_poller_trx(), but uses the parity bits provided by the user code\n instead of calculating them automatically.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18415 pub fn nfc_iso14443a_poller_trx_custom_parity(
18416 instance: *mut Nfc,
18417 tx_buffer: *const BitBuffer,
18418 rx_buffer: *mut BitBuffer,
18419 fwt: u32,
18420 ) -> NfcError;
18421}
18422unsafe extern "C" {
18423 #[doc = "Transmit an ISO14443-3A frame with custom parity bits in listener mode.\n\n Same as nfc_listener_tx(), but uses the parity bits provided by the user code\n instead of calculating them automatically.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18424 pub fn nfc_iso14443a_listener_tx_custom_parity(
18425 instance: *mut Nfc,
18426 tx_buffer: *const BitBuffer,
18427 ) -> NfcError;
18428}
18429unsafe extern "C" {
18430 #[doc = "Set ISO14443-3A collision resolution parameters in listener mode.\n\n Configures the NFC hardware for automatic collision resolution.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be configured.\n * `uid` (direction in) - pointer to a byte array containing the UID.\n * `uid_len` (direction in) - UID length in bytes (must be supported by the protocol).\n * `atqa` (direction in) - ATQA byte value.\n * `sak` (direction in) - SAK byte value.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18431 pub fn nfc_iso14443a_listener_set_col_res_data(
18432 instance: *mut Nfc,
18433 uid: *mut u8,
18434 uid_len: u8,
18435 atqa: *mut u8,
18436 sak: u8,
18437 ) -> NfcError;
18438}
18439unsafe extern "C" {
18440 #[doc = "Set FeliCa collision resolution parameters in listener mode.\n\n Configures the NFC hardware for automatic collision resolution.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be configured.\n * `idm` (direction in) - pointer to a byte array containing the IDm.\n * `idm_len` (direction in) - IDm length in bytes.\n * `pmm` (direction in) - pointer to a byte array containing the PMm.\n * `pmm_len` (direction in) - PMm length in bytes.\n * `sys_code` (direction in) - System code from SYS_C block\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18441 pub fn nfc_felica_listener_set_sensf_res_data(
18442 instance: *mut Nfc,
18443 idm: *const u8,
18444 idm_len: u8,
18445 pmm: *const u8,
18446 pmm_len: u8,
18447 sys_code: u16,
18448 ) -> NfcError;
18449}
18450unsafe extern "C" {
18451 #[doc = "Send ISO15693 Start of Frame pattern in listener mode\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be configured.\n # Returns\n\nNfcErrorNone on success, any other error code on failure."]
18452 pub fn nfc_iso15693_listener_tx_sof(instance: *mut Nfc) -> NfcError;
18453}
18454unsafe extern "C" {
18455 #[doc = "Start the timer used for manual FeliCa collision resolution in listener mode.\n\n This blocks TX until the desired Time Slot, and should be called as soon as the listener\n determines that a collision resolution needs to be handled manually.\n\n # Arguments\n\n* `instance` (direction in, out) - instance pointer to the instance to be configured.\n * `target_time_slot` (direction in) - Target Time Slot number. Should be a value within the range of 0-15 (double-inclusive)."]
18456 pub fn nfc_felica_listener_timer_anticol_start(instance: *mut Nfc, target_time_slot: u8);
18457}
18458unsafe extern "C" {
18459 #[doc = "Cancel the timer used for manual FeliCa collision resolution in listener mode.\n\n # Arguments\n\n* `instance` (direction in, out) - instance pointer to the instance to be configured."]
18460 pub fn nfc_felica_listener_timer_anticol_stop(instance: *mut Nfc);
18461}
18462#[doc = "Generic Nfc instance type.\n\n Must be cast to a concrete type before use.\n Depending on the context, a pointer of this type\n may point to an object of the following types:\n - Nfc type,\n - Concrete poller type,\n - Concrete listener type."]
18463pub type NfcGenericInstance = core::ffi::c_void;
18464#[doc = "Generic Nfc event data type.\n\n Must be cast to a concrete type before use.\n Usually, it will be the protocol-specific event type."]
18465pub type NfcGenericEventData = core::ffi::c_void;
18466#[doc = "Generic Nfc event type.\n\n A generic Nfc event contains a protocol identifier, can be used to determine\n the remaing fields' type.\n\n If the value of the protocol field is NfcProtocolInvalid, then it means that\n the event was emitted from an Nfc instance, otherwise it originated from\n a concrete poller or listener instance.\n\n The event_data field is protocol-specific and should be cast to the appropriate type before use."]
18467#[repr(C)]
18468#[derive(Debug, Copy, Clone)]
18469pub struct NfcGenericEvent {
18470 #[doc = "< Protocol identifier of the instance that produced the event."]
18471 pub protocol: NfcProtocol,
18472 #[doc = "< Pointer to the protocol-specific instance that produced the event."]
18473 pub instance: *mut NfcGenericInstance,
18474 #[doc = "< Pointer to the protocol-specific event."]
18475 pub event_data: *mut NfcGenericEventData,
18476}
18477#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18478const _: () = {
18479 ["Size of NfcGenericEvent"][::core::mem::size_of::<NfcGenericEvent>() - 12usize];
18480 ["Alignment of NfcGenericEvent"][::core::mem::align_of::<NfcGenericEvent>() - 4usize];
18481 ["Offset of field: NfcGenericEvent::protocol"]
18482 [::core::mem::offset_of!(NfcGenericEvent, protocol) - 0usize];
18483 ["Offset of field: NfcGenericEvent::instance"]
18484 [::core::mem::offset_of!(NfcGenericEvent, instance) - 4usize];
18485 ["Offset of field: NfcGenericEvent::event_data"]
18486 [::core::mem::offset_of!(NfcGenericEvent, event_data) - 8usize];
18487};
18488#[doc = "Generic Nfc event callback type.\n\n A function of this type must be passed as the callback parameter upon start\n of a poller, listener or Nfc instance.\n\n # Arguments\n\n* `[in]` - event Nfc generic event, passed by value, complete with protocol type and data.\n * `[in,out]` - context pointer to the user-specific context (set when starting a poller/listener instance).\n # Returns\n\nthe command which the event producer must execute."]
18489pub type NfcGenericCallback = ::core::option::Option<
18490 unsafe extern "C" fn(event: NfcGenericEvent, context: *mut core::ffi::c_void) -> NfcCommand,
18491>;
18492#[repr(C)]
18493#[derive(Debug, Copy, Clone)]
18494pub struct NfcListener {
18495 _unused: [u8; 0],
18496}
18497unsafe extern "C" {
18498 #[doc = "Allocate an NfcListener instance.\n\n # Arguments\n\n* `nfc` (direction in) - pointer to an Nfc instance.\n * `protocol` (direction in) - identifier of the protocol to be used.\n * `data` (direction in) - pointer to the data to use during emulation.\n # Returns\n\npointer to an allocated instance.\n\n [`nfc.h`]"]
18499 pub fn nfc_listener_alloc(
18500 nfc: *mut Nfc,
18501 protocol: NfcProtocol,
18502 data: *const NfcDeviceData,
18503 ) -> *mut NfcListener;
18504}
18505unsafe extern "C" {
18506 #[doc = "Delete an NfcListener instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18507 pub fn nfc_listener_free(instance: *mut NfcListener);
18508}
18509unsafe extern "C" {
18510 #[doc = "Start an NfcListener instance.\n\n The callback logic is protocol-specific, so it cannot be described here in detail.\n However, the callback return value ALWAYS determines what the listener should do next:\n to continue whatever it was doing prior to the callback run or to stop.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be started.\n * `callback` (direction in) - pointer to a user-defined callback function which will receive events.\n * `context` (direction in) - pointer to a user-specific context (will be passed to the callback)."]
18511 pub fn nfc_listener_start(
18512 instance: *mut NfcListener,
18513 callback: NfcGenericCallback,
18514 context: *mut core::ffi::c_void,
18515 );
18516}
18517unsafe extern "C" {
18518 #[doc = "Stop an NfcListener instance.\n\n The emulation process can be stopped explicitly (the other way is via the callback return value).\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be stopped."]
18519 pub fn nfc_listener_stop(instance: *mut NfcListener);
18520}
18521unsafe extern "C" {
18522 #[doc = "Get the protocol identifier an NfcListener instance was created with.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n # Returns\n\nidentifier of the protocol used by the instance."]
18523 pub fn nfc_listener_get_protocol(instance: *const NfcListener) -> NfcProtocol;
18524}
18525unsafe extern "C" {
18526 #[doc = "Get the data that was that was provided for emulation.\n\n The protocol identifier passed as the protocol parameter MUST match the one\n stored in the instance, otherwise a crash will occur.\n This is to improve type safety.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n * `protocol` (direction in) - assumed protocol identifier of the data to be retrieved.\n # Returns\n\npointer to the NFC device data."]
18527 pub fn nfc_listener_get_data(
18528 instance: *const NfcListener,
18529 protocol: NfcProtocol,
18530 ) -> *const NfcDeviceData;
18531}
18532#[repr(C)]
18533#[derive(Debug, Copy, Clone)]
18534pub struct NfcPoller {
18535 _unused: [u8; 0],
18536}
18537#[doc = "Extended generic Nfc event type.\n\n An extended generic Nfc event contains protocol poller and it's parent protocol event data.\n If protocol has no parent, then events are produced by Nfc instance.\n\n The parent_event_data field is protocol-specific and should be cast to the appropriate type before use."]
18538#[repr(C)]
18539#[derive(Debug, Copy, Clone)]
18540pub struct NfcGenericEventEx {
18541 #[doc = "< Pointer to the protocol poller."]
18542 pub poller: *mut NfcGenericInstance,
18543 #[doc = "< Pointer to the protocol's parent poller event data."]
18544 pub parent_event_data: *mut NfcGenericEventData,
18545}
18546#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18547const _: () = {
18548 ["Size of NfcGenericEventEx"][::core::mem::size_of::<NfcGenericEventEx>() - 8usize];
18549 ["Alignment of NfcGenericEventEx"][::core::mem::align_of::<NfcGenericEventEx>() - 4usize];
18550 ["Offset of field: NfcGenericEventEx::poller"]
18551 [::core::mem::offset_of!(NfcGenericEventEx, poller) - 0usize];
18552 ["Offset of field: NfcGenericEventEx::parent_event_data"]
18553 [::core::mem::offset_of!(NfcGenericEventEx, parent_event_data) - 4usize];
18554};
18555#[doc = "Extended generic Nfc event callback type.\n\n A function of this type must be passed as the callback parameter upon extended start of a poller.\n\n # Arguments\n\n* `[in]` - event Nfc extended generic event, passed by value, complete with protocol type and data.\n * `[in,out]` - context pointer to the user-specific context (set when starting a poller/listener instance).\n # Returns\n\nthe command which the event producer must execute."]
18556pub type NfcGenericCallbackEx = ::core::option::Option<
18557 unsafe extern "C" fn(event: NfcGenericEventEx, context: *mut core::ffi::c_void) -> NfcCommand,
18558>;
18559unsafe extern "C" {
18560 #[doc = "Allocate an NfcPoller instance.\n\n # Arguments\n\n* `nfc` (direction in) - pointer to an Nfc instance.\n * `protocol` (direction in) - identifier of the protocol to be used.\n # Returns\n\npointer to an allocated instance.\n\n [`nfc.h`]"]
18561 pub fn nfc_poller_alloc(nfc: *mut Nfc, protocol: NfcProtocol) -> *mut NfcPoller;
18562}
18563unsafe extern "C" {
18564 #[doc = "Delete an NfcPoller instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18565 pub fn nfc_poller_free(instance: *mut NfcPoller);
18566}
18567unsafe extern "C" {
18568 #[doc = "Start an NfcPoller instance.\n\n The callback logic is protocol-specific, so it cannot be described here in detail.\n However, the callback return value ALWAYS determines what the poller should do next:\n to continue whatever it was doing prior to the callback run or to stop.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be started.\n * `callback` (direction in) - pointer to a user-defined callback function which will receive events.\n * `context` (direction in) - pointer to a user-specific context (will be passed to the callback)."]
18569 pub fn nfc_poller_start(
18570 instance: *mut NfcPoller,
18571 callback: NfcGenericCallback,
18572 context: *mut core::ffi::c_void,
18573 );
18574}
18575unsafe extern "C" {
18576 #[doc = "Start an NfcPoller instance in extended mode.\n\n When nfc poller is started in extended mode, callback will be called with parent protocol events\n and protocol instance. This mode enables to make custom poller state machines.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be started.\n * `callback` (direction in) - pointer to a user-defined callback function which will receive events.\n * `context` (direction in) - pointer to a user-specific context (will be passed to the callback)."]
18577 pub fn nfc_poller_start_ex(
18578 instance: *mut NfcPoller,
18579 callback: NfcGenericCallbackEx,
18580 context: *mut core::ffi::c_void,
18581 );
18582}
18583unsafe extern "C" {
18584 #[doc = "Stop an NfcPoller instance.\n\n The reading process can be stopped explicitly (the other way is via the callback return value).\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be stopped."]
18585 pub fn nfc_poller_stop(instance: *mut NfcPoller);
18586}
18587unsafe extern "C" {
18588 #[doc = "Detect whether there is a card supporting a particular protocol in the vicinity.\n\n The behaviour of this function is protocol-defined, in general, it will do whatever is\n necessary to determine whether a card supporting the current protocol is in the vicinity\n and whether it is functioning normally.\n\n It is used automatically inside NfcScanner, so there is usually no need\n to call it explicitly.\n\n [`nfc_scanner.h`]\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to perform the detection with.\n # Returns\n\ntrue if a supported card was detected, false otherwise."]
18589 pub fn nfc_poller_detect(instance: *mut NfcPoller) -> bool;
18590}
18591unsafe extern "C" {
18592 #[doc = "Get the protocol identifier an NfcPoller instance was created with.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n # Returns\n\nidentifier of the protocol used by the instance."]
18593 pub fn nfc_poller_get_protocol(instance: *const NfcPoller) -> NfcProtocol;
18594}
18595unsafe extern "C" {
18596 #[doc = "Get the data that was that was gathered during the reading process.\n\n # Arguments\n\n* `instance` (direction in) - pointer to the instance to be queried.\n # Returns\n\npointer to the NFC device data."]
18597 pub fn nfc_poller_get_data(instance: *const NfcPoller) -> *const NfcDeviceData;
18598}
18599#[repr(C)]
18600#[derive(Debug, Copy, Clone)]
18601pub struct NfcScanner {
18602 _unused: [u8; 0],
18603}
18604#[doc = "< One or more protocols have been detected."]
18605pub const NfcScannerEventTypeDetected: NfcScannerEventType = NfcScannerEventType(0);
18606#[repr(transparent)]
18607#[doc = "Event type passed to the user callback."]
18608#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18609pub struct NfcScannerEventType(pub core::ffi::c_uchar);
18610#[doc = "Event data passed to the user callback."]
18611#[repr(C)]
18612#[derive(Debug, Copy, Clone)]
18613pub struct NfcScannerEventData {
18614 #[doc = "< Number of detected protocols (one or more)."]
18615 pub protocol_num: usize,
18616 #[doc = "< Pointer to the array of detected protocol identifiers."]
18617 pub protocols: *mut NfcProtocol,
18618}
18619#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18620const _: () = {
18621 ["Size of NfcScannerEventData"][::core::mem::size_of::<NfcScannerEventData>() - 8usize];
18622 ["Alignment of NfcScannerEventData"][::core::mem::align_of::<NfcScannerEventData>() - 4usize];
18623 ["Offset of field: NfcScannerEventData::protocol_num"]
18624 [::core::mem::offset_of!(NfcScannerEventData, protocol_num) - 0usize];
18625 ["Offset of field: NfcScannerEventData::protocols"]
18626 [::core::mem::offset_of!(NfcScannerEventData, protocols) - 4usize];
18627};
18628#[doc = "Event passed to the user callback."]
18629#[repr(C)]
18630#[derive(Debug, Copy, Clone)]
18631pub struct NfcScannerEvent {
18632 #[doc = "< Type of event. Determines how the data must be handled."]
18633 pub type_: NfcScannerEventType,
18634 #[doc = "< Event-specific data. Handled accordingly to the even type."]
18635 pub data: NfcScannerEventData,
18636}
18637#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18638const _: () = {
18639 ["Size of NfcScannerEvent"][::core::mem::size_of::<NfcScannerEvent>() - 12usize];
18640 ["Alignment of NfcScannerEvent"][::core::mem::align_of::<NfcScannerEvent>() - 4usize];
18641 ["Offset of field: NfcScannerEvent::type_"]
18642 [::core::mem::offset_of!(NfcScannerEvent, type_) - 0usize];
18643 ["Offset of field: NfcScannerEvent::data"]
18644 [::core::mem::offset_of!(NfcScannerEvent, data) - 4usize];
18645};
18646#[doc = "User callback function signature.\n\n A function with such signature must be provided by the user upon calling nfc_scanner_start().\n\n # Arguments\n\n* `event` (direction in) - occurred event, complete with type and data.\n * `context` (direction in) - pointer to the context data provided in nfc_scanner_start() call."]
18647pub type NfcScannerCallback = ::core::option::Option<
18648 unsafe extern "C" fn(event: NfcScannerEvent, context: *mut core::ffi::c_void),
18649>;
18650unsafe extern "C" {
18651 #[doc = "Allocate an NfcScanner instance.\n\n # Arguments\n\n* `nfc` (direction in) - pointer to an Nfc instance.\n # Returns\n\npointer to the allocated NfcScanner instance.\n\n [`nfc.h`]"]
18652 pub fn nfc_scanner_alloc(nfc: *mut Nfc) -> *mut NfcScanner;
18653}
18654unsafe extern "C" {
18655 #[doc = "Delete an NfcScanner instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18656 pub fn nfc_scanner_free(instance: *mut NfcScanner);
18657}
18658unsafe extern "C" {
18659 #[doc = "Start an NfcScanner.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be started.\n * `callback` (direction in) - pointer to the callback function (will be called upon a detection event).\n * `context` (direction in) - pointer to the caller-specific context (will be passed to the callback)."]
18660 pub fn nfc_scanner_start(
18661 instance: *mut NfcScanner,
18662 callback: NfcScannerCallback,
18663 context: *mut core::ffi::c_void,
18664 );
18665}
18666unsafe extern "C" {
18667 #[doc = "Stop an NfcScanner.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be stopped."]
18668 pub fn nfc_scanner_stop(instance: *mut NfcScanner);
18669}
18670#[repr(C)]
18671#[derive(Debug, Copy, Clone)]
18672pub struct SimpleArray {
18673 _unused: [u8; 0],
18674}
18675pub type SimpleArrayData = core::ffi::c_void;
18676pub type SimpleArrayElement = core::ffi::c_void;
18677pub type SimpleArrayInit =
18678 ::core::option::Option<unsafe extern "C" fn(elem: *mut SimpleArrayElement)>;
18679pub type SimpleArrayReset =
18680 ::core::option::Option<unsafe extern "C" fn(elem: *mut SimpleArrayElement)>;
18681pub type SimpleArrayCopy = ::core::option::Option<
18682 unsafe extern "C" fn(elem: *mut SimpleArrayElement, other: *const SimpleArrayElement),
18683>;
18684#[doc = "Simple Array configuration structure. Defined per type."]
18685#[repr(C)]
18686#[derive(Debug, Copy, Clone)]
18687pub struct SimpleArrayConfig {
18688 #[doc = "< Initialisation (in-place constructor) method."]
18689 pub init: SimpleArrayInit,
18690 #[doc = "< Reset (custom destructor) method."]
18691 pub reset: SimpleArrayReset,
18692 #[doc = "< Copy (custom copy-constructor) method."]
18693 pub copy: SimpleArrayCopy,
18694 pub type_size: usize,
18695}
18696#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18697const _: () = {
18698 ["Size of SimpleArrayConfig"][::core::mem::size_of::<SimpleArrayConfig>() - 16usize];
18699 ["Alignment of SimpleArrayConfig"][::core::mem::align_of::<SimpleArrayConfig>() - 4usize];
18700 ["Offset of field: SimpleArrayConfig::init"]
18701 [::core::mem::offset_of!(SimpleArrayConfig, init) - 0usize];
18702 ["Offset of field: SimpleArrayConfig::reset"]
18703 [::core::mem::offset_of!(SimpleArrayConfig, reset) - 4usize];
18704 ["Offset of field: SimpleArrayConfig::copy"]
18705 [::core::mem::offset_of!(SimpleArrayConfig, copy) - 8usize];
18706 ["Offset of field: SimpleArrayConfig::type_size"]
18707 [::core::mem::offset_of!(SimpleArrayConfig, type_size) - 12usize];
18708};
18709unsafe extern "C" {
18710 #[doc = "Allocate a SimpleArray instance with the given configuration.\n\n # Arguments\n\n* `[in]` - config Pointer to the type-specific configuration\n # Returns\n\nPointer to the allocated SimpleArray instance"]
18711 pub fn simple_array_alloc(config: *const SimpleArrayConfig) -> *mut SimpleArray;
18712}
18713unsafe extern "C" {
18714 #[doc = "Free a SimpleArray instance and release its contents.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to be freed"]
18715 pub fn simple_array_free(instance: *mut SimpleArray);
18716}
18717unsafe extern "C" {
18718 #[doc = "Initialise a SimpleArray instance by allocating additional space to contain\n the requested number of elements.\n If init() is specified in the config, then it is called for each element,\n otherwise the data is filled with zeroes.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to be init'd\n * `[in]` - count Number of elements to be allocated and init'd"]
18719 pub fn simple_array_init(instance: *mut SimpleArray, count: u32);
18720}
18721unsafe extern "C" {
18722 #[doc = "Reset a SimpleArray instance and delete all of its elements.\n If reset() is specified in the config, then it is called for each element,\n otherwise the data is simply free()'d.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to be reset"]
18723 pub fn simple_array_reset(instance: *mut SimpleArray);
18724}
18725unsafe extern "C" {
18726 #[doc = "Copy (duplicate) another SimpleArray instance to this one.\n If copy() is specified in the config, then it is called for each element,\n otherwise the data is simply memcpy()'d.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to copy to\n * `[in]` - other Pointer to the SimpleArray instance to copy from"]
18727 pub fn simple_array_copy(instance: *mut SimpleArray, other: *const SimpleArray);
18728}
18729unsafe extern "C" {
18730 #[doc = "Check if another SimpleArray instance is equal (the same object or holds the\n same data) to this one.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to be compared\n * `[in]` - other Pointer to the SimpleArray instance to be compared\n # Returns\n\nTrue if instances are considered equal, false otherwise"]
18731 pub fn simple_array_is_equal(instance: *const SimpleArray, other: *const SimpleArray) -> bool;
18732}
18733unsafe extern "C" {
18734 #[doc = "Get the count of elements currently contained in a SimpleArray instance.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to query the count from\n # Returns\n\nCount of elements contained in the instance"]
18735 pub fn simple_array_get_count(instance: *const SimpleArray) -> u32;
18736}
18737unsafe extern "C" {
18738 #[doc = "Get a pointer to an element contained in a SimpleArray instance.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to get an element from\n * `[in]` - index Index of the element in question. MUST be less than total element count\n # Returns\n\nPointer to the element specified by index"]
18739 pub fn simple_array_get(instance: *mut SimpleArray, index: u32) -> *mut SimpleArrayElement;
18740}
18741unsafe extern "C" {
18742 #[doc = "Get a const pointer to an element contained in a SimpleArray instance.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to get an element from\n * `[in]` - index Index of the element in question. MUST be less than total element count\n # Returns\n\nConst pointer to the element specified by index"]
18743 pub fn simple_array_cget(instance: *const SimpleArray, index: u32)
18744 -> *const SimpleArrayElement;
18745}
18746unsafe extern "C" {
18747 #[doc = "Get a pointer to the internal data of a SimpleArray instance.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to get the data of\n # Returns\n\nPointer to the instance's internal data"]
18748 pub fn simple_array_get_data(instance: *mut SimpleArray) -> *mut SimpleArrayData;
18749}
18750unsafe extern "C" {
18751 #[doc = "Get a constant pointer to the internal data of a SimpleArray instance.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to get the data of\n # Returns\n\nConstant pointer to the instance's internal data"]
18752 pub fn simple_array_cget_data(instance: *const SimpleArray) -> *const SimpleArrayData;
18753}
18754unsafe extern "C" {
18755 pub static simple_array_config_uint8_t: SimpleArrayConfig;
18756}
18757pub const FelicaErrorNone: FelicaError = FelicaError(0);
18758pub const FelicaErrorNotPresent: FelicaError = FelicaError(1);
18759pub const FelicaErrorColResFailed: FelicaError = FelicaError(2);
18760pub const FelicaErrorBufferOverflow: FelicaError = FelicaError(3);
18761pub const FelicaErrorCommunication: FelicaError = FelicaError(4);
18762pub const FelicaErrorFieldOff: FelicaError = FelicaError(5);
18763pub const FelicaErrorWrongCrc: FelicaError = FelicaError(6);
18764pub const FelicaErrorProtocol: FelicaError = FelicaError(7);
18765pub const FelicaErrorTimeout: FelicaError = FelicaError(8);
18766pub const FelicaErrorFeatureUnsupported: FelicaError = FelicaError(9);
18767#[repr(transparent)]
18768#[doc = "Type of possible Felica errors"]
18769#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18770pub struct FelicaError(pub core::ffi::c_uchar);
18771pub const FelicaUnknown: FelicaWorkflowType = FelicaWorkflowType(0);
18772pub const FelicaStandard: FelicaWorkflowType = FelicaWorkflowType(1);
18773pub const FelicaLite: FelicaWorkflowType = FelicaWorkflowType(2);
18774#[repr(transparent)]
18775#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18776pub struct FelicaWorkflowType(pub core::ffi::c_uchar);
18777#[repr(C)]
18778#[derive(Debug, Copy, Clone)]
18779pub struct FelicaBlockData {
18780 pub data: [u8; 16usize],
18781}
18782#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18783const _: () = {
18784 ["Size of FelicaBlockData"][::core::mem::size_of::<FelicaBlockData>() - 16usize];
18785 ["Alignment of FelicaBlockData"][::core::mem::align_of::<FelicaBlockData>() - 1usize];
18786 ["Offset of field: FelicaBlockData::data"]
18787 [::core::mem::offset_of!(FelicaBlockData, data) - 0usize];
18788};
18789#[doc = "Separate type for card key block. Used in authentication process"]
18790#[repr(C)]
18791#[derive(Debug, Copy, Clone)]
18792pub struct FelicaCardKey {
18793 pub data: [u8; 16usize],
18794}
18795#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18796const _: () = {
18797 ["Size of FelicaCardKey"][::core::mem::size_of::<FelicaCardKey>() - 16usize];
18798 ["Alignment of FelicaCardKey"][::core::mem::align_of::<FelicaCardKey>() - 1usize];
18799 ["Offset of field: FelicaCardKey::data"][::core::mem::offset_of!(FelicaCardKey, data) - 0usize];
18800};
18801#[doc = "In Felica there two types of auth. Internal is the first one, after\n which external became possible. Here are two flags representing which one\n was passed"]
18802#[repr(C)]
18803#[derive(Debug, Copy, Clone)]
18804pub struct FelicaAuthenticationStatus {
18805 pub _bitfield_align_1: [u8; 0],
18806 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
18807}
18808#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18809const _: () = {
18810 ["Size of FelicaAuthenticationStatus"]
18811 [::core::mem::size_of::<FelicaAuthenticationStatus>() - 1usize];
18812 ["Alignment of FelicaAuthenticationStatus"]
18813 [::core::mem::align_of::<FelicaAuthenticationStatus>() - 1usize];
18814};
18815impl FelicaAuthenticationStatus {
18816 #[inline]
18817 pub fn internal(&self) -> bool {
18818 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
18819 }
18820 #[inline]
18821 pub fn set_internal(&mut self, val: bool) {
18822 unsafe {
18823 let val: u8 = ::core::mem::transmute(val);
18824 self._bitfield_1.set(0usize, 1u8, val as u64)
18825 }
18826 }
18827 #[inline]
18828 pub unsafe fn internal_raw(this: *const Self) -> bool {
18829 unsafe {
18830 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
18831 ::core::ptr::addr_of!((*this)._bitfield_1),
18832 0usize,
18833 1u8,
18834 ) as u8)
18835 }
18836 }
18837 #[inline]
18838 pub unsafe fn set_internal_raw(this: *mut Self, val: bool) {
18839 unsafe {
18840 let val: u8 = ::core::mem::transmute(val);
18841 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
18842 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
18843 0usize,
18844 1u8,
18845 val as u64,
18846 )
18847 }
18848 }
18849 #[inline]
18850 pub fn external(&self) -> bool {
18851 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
18852 }
18853 #[inline]
18854 pub fn set_external(&mut self, val: bool) {
18855 unsafe {
18856 let val: u8 = ::core::mem::transmute(val);
18857 self._bitfield_1.set(1usize, 1u8, val as u64)
18858 }
18859 }
18860 #[inline]
18861 pub unsafe fn external_raw(this: *const Self) -> bool {
18862 unsafe {
18863 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
18864 ::core::ptr::addr_of!((*this)._bitfield_1),
18865 1usize,
18866 1u8,
18867 ) as u8)
18868 }
18869 }
18870 #[inline]
18871 pub unsafe fn set_external_raw(this: *mut Self, val: bool) {
18872 unsafe {
18873 let val: u8 = ::core::mem::transmute(val);
18874 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
18875 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
18876 1usize,
18877 1u8,
18878 val as u64,
18879 )
18880 }
18881 }
18882 #[inline]
18883 pub fn new_bitfield_1(internal: bool, external: bool) -> __BindgenBitfieldUnit<[u8; 1usize]> {
18884 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
18885 __bindgen_bitfield_unit.set(0usize, 1u8, {
18886 let internal: u8 = unsafe { ::core::mem::transmute(internal) };
18887 internal as u64
18888 });
18889 __bindgen_bitfield_unit.set(1usize, 1u8, {
18890 let external: u8 = unsafe { ::core::mem::transmute(external) };
18891 external as u64
18892 });
18893 __bindgen_bitfield_unit
18894 }
18895}
18896#[doc = "Struct which controls the process of authentication and can be passed as\n a parameter to the application level. In order to force user to fill card key block data."]
18897#[repr(C)]
18898#[derive(Debug, Copy, Clone)]
18899pub struct FelicaAuthenticationContext {
18900 #[doc = "< By default it is true, so auth is skipped. By setting this to false several auth steps will be performed in order to pass auth"]
18901 pub skip_auth: bool,
18902 #[doc = "< User must fill this field with known card key in order to pass auth"]
18903 pub card_key: FelicaCardKey,
18904 #[doc = "< Authentication status"]
18905 pub auth_status: FelicaAuthenticationStatus,
18906}
18907#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18908const _: () = {
18909 ["Size of FelicaAuthenticationContext"]
18910 [::core::mem::size_of::<FelicaAuthenticationContext>() - 18usize];
18911 ["Alignment of FelicaAuthenticationContext"]
18912 [::core::mem::align_of::<FelicaAuthenticationContext>() - 1usize];
18913 ["Offset of field: FelicaAuthenticationContext::skip_auth"]
18914 [::core::mem::offset_of!(FelicaAuthenticationContext, skip_auth) - 0usize];
18915 ["Offset of field: FelicaAuthenticationContext::card_key"]
18916 [::core::mem::offset_of!(FelicaAuthenticationContext, card_key) - 1usize];
18917 ["Offset of field: FelicaAuthenticationContext::auth_status"]
18918 [::core::mem::offset_of!(FelicaAuthenticationContext, auth_status) - 17usize];
18919};
18920#[doc = "Stucture for holding Felica session key which is calculated from rc and ck."]
18921#[repr(C)]
18922#[derive(Debug, Copy, Clone)]
18923pub struct FelicaSessionKey {
18924 pub data: [u8; 16usize],
18925}
18926#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18927const _: () = {
18928 ["Size of FelicaSessionKey"][::core::mem::size_of::<FelicaSessionKey>() - 16usize];
18929 ["Alignment of FelicaSessionKey"][::core::mem::align_of::<FelicaSessionKey>() - 1usize];
18930 ["Offset of field: FelicaSessionKey::data"]
18931 [::core::mem::offset_of!(FelicaSessionKey, data) - 0usize];
18932};
18933#[doc = "Structure used to hold authentication related fields."]
18934#[repr(C)]
18935#[derive(Debug, Copy, Clone)]
18936pub struct FelicaAuthentication {
18937 #[doc = "< Context for mbedtls des functions."]
18938 pub des_context: mbedtls_des3_context,
18939 #[doc = "< Calculated session key."]
18940 pub session_key: FelicaSessionKey,
18941 #[doc = "< Public auth context provided to upper levels."]
18942 pub context: FelicaAuthenticationContext,
18943}
18944#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18945const _: () = {
18946 ["Size of FelicaAuthentication"][::core::mem::size_of::<FelicaAuthentication>() - 420usize];
18947 ["Alignment of FelicaAuthentication"][::core::mem::align_of::<FelicaAuthentication>() - 4usize];
18948 ["Offset of field: FelicaAuthentication::des_context"]
18949 [::core::mem::offset_of!(FelicaAuthentication, des_context) - 0usize];
18950 ["Offset of field: FelicaAuthentication::session_key"]
18951 [::core::mem::offset_of!(FelicaAuthentication, session_key) - 384usize];
18952 ["Offset of field: FelicaAuthentication::context"]
18953 [::core::mem::offset_of!(FelicaAuthentication, context) - 400usize];
18954};
18955#[doc = "Felica ID block"]
18956#[repr(C)]
18957#[derive(Debug, Copy, Clone)]
18958pub struct FelicaIDm {
18959 pub data: [u8; 8usize],
18960}
18961#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18962const _: () = {
18963 ["Size of FelicaIDm"][::core::mem::size_of::<FelicaIDm>() - 8usize];
18964 ["Alignment of FelicaIDm"][::core::mem::align_of::<FelicaIDm>() - 1usize];
18965 ["Offset of field: FelicaIDm::data"][::core::mem::offset_of!(FelicaIDm, data) - 0usize];
18966};
18967#[doc = "Felica PMm block"]
18968#[repr(C)]
18969#[derive(Debug, Copy, Clone)]
18970pub struct FelicaPMm {
18971 pub data: [u8; 8usize],
18972}
18973#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18974const _: () = {
18975 ["Size of FelicaPMm"][::core::mem::size_of::<FelicaPMm>() - 8usize];
18976 ["Alignment of FelicaPMm"][::core::mem::align_of::<FelicaPMm>() - 1usize];
18977 ["Offset of field: FelicaPMm::data"][::core::mem::offset_of!(FelicaPMm, data) - 0usize];
18978};
18979#[doc = "Felica block with status flags indicating last operation with it.\n See Felica manual for more details on status codes."]
18980#[repr(C)]
18981#[derive(Debug, Copy, Clone)]
18982pub struct FelicaBlock {
18983 #[doc = "< Status flag 1, equals to 0 when success"]
18984 pub SF1: u8,
18985 #[doc = "< Status flag 2, equals to 0 when success"]
18986 pub SF2: u8,
18987 #[doc = "< Block data"]
18988 pub data: [u8; 16usize],
18989}
18990#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18991const _: () = {
18992 ["Size of FelicaBlock"][::core::mem::size_of::<FelicaBlock>() - 18usize];
18993 ["Alignment of FelicaBlock"][::core::mem::align_of::<FelicaBlock>() - 1usize];
18994 ["Offset of field: FelicaBlock::SF1"][::core::mem::offset_of!(FelicaBlock, SF1) - 0usize];
18995 ["Offset of field: FelicaBlock::SF2"][::core::mem::offset_of!(FelicaBlock, SF2) - 1usize];
18996 ["Offset of field: FelicaBlock::data"][::core::mem::offset_of!(FelicaBlock, data) - 2usize];
18997};
18998#[doc = "Felica filesystem structure"]
18999#[repr(C)]
19000#[derive(Debug, Copy, Clone)]
19001pub struct FelicaFileSystem {
19002 pub spad: [FelicaBlock; 14usize],
19003 pub reg: FelicaBlock,
19004 pub rc: FelicaBlock,
19005 pub mac: FelicaBlock,
19006 pub id: FelicaBlock,
19007 pub d_id: FelicaBlock,
19008 pub ser_c: FelicaBlock,
19009 pub sys_c: FelicaBlock,
19010 pub ckv: FelicaBlock,
19011 pub ck: FelicaBlock,
19012 pub mc: FelicaBlock,
19013 pub wcnt: FelicaBlock,
19014 pub mac_a: FelicaBlock,
19015 pub state: FelicaBlock,
19016 pub crc_check: FelicaBlock,
19017}
19018#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19019const _: () = {
19020 ["Size of FelicaFileSystem"][::core::mem::size_of::<FelicaFileSystem>() - 504usize];
19021 ["Alignment of FelicaFileSystem"][::core::mem::align_of::<FelicaFileSystem>() - 1usize];
19022 ["Offset of field: FelicaFileSystem::spad"]
19023 [::core::mem::offset_of!(FelicaFileSystem, spad) - 0usize];
19024 ["Offset of field: FelicaFileSystem::reg"]
19025 [::core::mem::offset_of!(FelicaFileSystem, reg) - 252usize];
19026 ["Offset of field: FelicaFileSystem::rc"]
19027 [::core::mem::offset_of!(FelicaFileSystem, rc) - 270usize];
19028 ["Offset of field: FelicaFileSystem::mac"]
19029 [::core::mem::offset_of!(FelicaFileSystem, mac) - 288usize];
19030 ["Offset of field: FelicaFileSystem::id"]
19031 [::core::mem::offset_of!(FelicaFileSystem, id) - 306usize];
19032 ["Offset of field: FelicaFileSystem::d_id"]
19033 [::core::mem::offset_of!(FelicaFileSystem, d_id) - 324usize];
19034 ["Offset of field: FelicaFileSystem::ser_c"]
19035 [::core::mem::offset_of!(FelicaFileSystem, ser_c) - 342usize];
19036 ["Offset of field: FelicaFileSystem::sys_c"]
19037 [::core::mem::offset_of!(FelicaFileSystem, sys_c) - 360usize];
19038 ["Offset of field: FelicaFileSystem::ckv"]
19039 [::core::mem::offset_of!(FelicaFileSystem, ckv) - 378usize];
19040 ["Offset of field: FelicaFileSystem::ck"]
19041 [::core::mem::offset_of!(FelicaFileSystem, ck) - 396usize];
19042 ["Offset of field: FelicaFileSystem::mc"]
19043 [::core::mem::offset_of!(FelicaFileSystem, mc) - 414usize];
19044 ["Offset of field: FelicaFileSystem::wcnt"]
19045 [::core::mem::offset_of!(FelicaFileSystem, wcnt) - 432usize];
19046 ["Offset of field: FelicaFileSystem::mac_a"]
19047 [::core::mem::offset_of!(FelicaFileSystem, mac_a) - 450usize];
19048 ["Offset of field: FelicaFileSystem::state"]
19049 [::core::mem::offset_of!(FelicaFileSystem, state) - 468usize];
19050 ["Offset of field: FelicaFileSystem::crc_check"]
19051 [::core::mem::offset_of!(FelicaFileSystem, crc_check) - 486usize];
19052};
19053#[doc = "Union which represents filesystem in junction with plain data dump"]
19054#[repr(C)]
19055#[derive(Copy, Clone)]
19056pub union FelicaFSUnion {
19057 pub fs: FelicaFileSystem,
19058 pub dump: [u8; 504usize],
19059}
19060#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19061const _: () = {
19062 ["Size of FelicaFSUnion"][::core::mem::size_of::<FelicaFSUnion>() - 504usize];
19063 ["Alignment of FelicaFSUnion"][::core::mem::align_of::<FelicaFSUnion>() - 1usize];
19064 ["Offset of field: FelicaFSUnion::fs"][::core::mem::offset_of!(FelicaFSUnion, fs) - 0usize];
19065 ["Offset of field: FelicaFSUnion::dump"][::core::mem::offset_of!(FelicaFSUnion, dump) - 0usize];
19066};
19067#[repr(C)]
19068#[derive(Debug, Copy, Clone)]
19069pub struct FelicaService {
19070 pub code: u16,
19071 pub attr: u8,
19072}
19073#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19074const _: () = {
19075 ["Size of FelicaService"][::core::mem::size_of::<FelicaService>() - 4usize];
19076 ["Alignment of FelicaService"][::core::mem::align_of::<FelicaService>() - 2usize];
19077 ["Offset of field: FelicaService::code"][::core::mem::offset_of!(FelicaService, code) - 0usize];
19078 ["Offset of field: FelicaService::attr"][::core::mem::offset_of!(FelicaService, attr) - 2usize];
19079};
19080#[repr(C)]
19081#[derive(Debug, Copy, Clone)]
19082pub struct FelicaArea {
19083 pub code: u16,
19084 pub first_idx: u16,
19085 pub last_idx: u16,
19086}
19087#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19088const _: () = {
19089 ["Size of FelicaArea"][::core::mem::size_of::<FelicaArea>() - 6usize];
19090 ["Alignment of FelicaArea"][::core::mem::align_of::<FelicaArea>() - 2usize];
19091 ["Offset of field: FelicaArea::code"][::core::mem::offset_of!(FelicaArea, code) - 0usize];
19092 ["Offset of field: FelicaArea::first_idx"]
19093 [::core::mem::offset_of!(FelicaArea, first_idx) - 2usize];
19094 ["Offset of field: FelicaArea::last_idx"]
19095 [::core::mem::offset_of!(FelicaArea, last_idx) - 4usize];
19096};
19097#[repr(C)]
19098#[derive(Debug, Copy, Clone)]
19099pub struct FelicaPublicBlock {
19100 pub block: FelicaBlock,
19101 pub service_code: u16,
19102 pub block_idx: u8,
19103}
19104#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19105const _: () = {
19106 ["Size of FelicaPublicBlock"][::core::mem::size_of::<FelicaPublicBlock>() - 22usize];
19107 ["Alignment of FelicaPublicBlock"][::core::mem::align_of::<FelicaPublicBlock>() - 2usize];
19108 ["Offset of field: FelicaPublicBlock::block"]
19109 [::core::mem::offset_of!(FelicaPublicBlock, block) - 0usize];
19110 ["Offset of field: FelicaPublicBlock::service_code"]
19111 [::core::mem::offset_of!(FelicaPublicBlock, service_code) - 18usize];
19112 ["Offset of field: FelicaPublicBlock::block_idx"]
19113 [::core::mem::offset_of!(FelicaPublicBlock, block_idx) - 20usize];
19114};
19115#[repr(C)]
19116#[derive(Debug, Copy, Clone)]
19117pub struct FelicaSystem {
19118 pub system_code_idx: u8,
19119 pub system_code: u16,
19120 pub services: *mut SimpleArray,
19121 pub areas: *mut SimpleArray,
19122 pub public_blocks: *mut SimpleArray,
19123}
19124#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19125const _: () = {
19126 ["Size of FelicaSystem"][::core::mem::size_of::<FelicaSystem>() - 16usize];
19127 ["Alignment of FelicaSystem"][::core::mem::align_of::<FelicaSystem>() - 4usize];
19128 ["Offset of field: FelicaSystem::system_code_idx"]
19129 [::core::mem::offset_of!(FelicaSystem, system_code_idx) - 0usize];
19130 ["Offset of field: FelicaSystem::system_code"]
19131 [::core::mem::offset_of!(FelicaSystem, system_code) - 2usize];
19132 ["Offset of field: FelicaSystem::services"]
19133 [::core::mem::offset_of!(FelicaSystem, services) - 4usize];
19134 ["Offset of field: FelicaSystem::areas"][::core::mem::offset_of!(FelicaSystem, areas) - 8usize];
19135 ["Offset of field: FelicaSystem::public_blocks"]
19136 [::core::mem::offset_of!(FelicaSystem, public_blocks) - 12usize];
19137};
19138#[doc = "Structure used to store Felica data and additional values about reading"]
19139#[repr(C)]
19140#[derive(Copy, Clone)]
19141pub struct FelicaData {
19142 pub idm: FelicaIDm,
19143 pub pmm: FelicaPMm,
19144 pub blocks_total: u8,
19145 pub blocks_read: u8,
19146 pub data: FelicaFSUnion,
19147 pub systems: *mut SimpleArray,
19148 pub workflow_type: FelicaWorkflowType,
19149}
19150#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19151const _: () = {
19152 ["Size of FelicaData"][::core::mem::size_of::<FelicaData>() - 532usize];
19153 ["Alignment of FelicaData"][::core::mem::align_of::<FelicaData>() - 4usize];
19154 ["Offset of field: FelicaData::idm"][::core::mem::offset_of!(FelicaData, idm) - 0usize];
19155 ["Offset of field: FelicaData::pmm"][::core::mem::offset_of!(FelicaData, pmm) - 8usize];
19156 ["Offset of field: FelicaData::blocks_total"]
19157 [::core::mem::offset_of!(FelicaData, blocks_total) - 16usize];
19158 ["Offset of field: FelicaData::blocks_read"]
19159 [::core::mem::offset_of!(FelicaData, blocks_read) - 17usize];
19160 ["Offset of field: FelicaData::data"][::core::mem::offset_of!(FelicaData, data) - 18usize];
19161 ["Offset of field: FelicaData::systems"]
19162 [::core::mem::offset_of!(FelicaData, systems) - 524usize];
19163 ["Offset of field: FelicaData::workflow_type"]
19164 [::core::mem::offset_of!(FelicaData, workflow_type) - 528usize];
19165};
19166#[repr(C, packed)]
19167#[derive(Debug, Copy, Clone)]
19168pub struct FelicaCommandHeader {
19169 pub code: u8,
19170 pub idm: FelicaIDm,
19171 pub service_num: u8,
19172 pub service_code: u16,
19173 pub block_count: u8,
19174}
19175#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19176const _: () = {
19177 ["Size of FelicaCommandHeader"][::core::mem::size_of::<FelicaCommandHeader>() - 13usize];
19178 ["Alignment of FelicaCommandHeader"][::core::mem::align_of::<FelicaCommandHeader>() - 1usize];
19179 ["Offset of field: FelicaCommandHeader::code"]
19180 [::core::mem::offset_of!(FelicaCommandHeader, code) - 0usize];
19181 ["Offset of field: FelicaCommandHeader::idm"]
19182 [::core::mem::offset_of!(FelicaCommandHeader, idm) - 1usize];
19183 ["Offset of field: FelicaCommandHeader::service_num"]
19184 [::core::mem::offset_of!(FelicaCommandHeader, service_num) - 9usize];
19185 ["Offset of field: FelicaCommandHeader::service_code"]
19186 [::core::mem::offset_of!(FelicaCommandHeader, service_code) - 10usize];
19187 ["Offset of field: FelicaCommandHeader::block_count"]
19188 [::core::mem::offset_of!(FelicaCommandHeader, block_count) - 12usize];
19189};
19190#[repr(C)]
19191#[derive(Debug, Copy, Clone)]
19192pub struct FelicaCommandResponseHeader {
19193 pub length: u8,
19194 pub response_code: u8,
19195 pub idm: FelicaIDm,
19196 pub SF1: u8,
19197 pub SF2: u8,
19198}
19199#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19200const _: () = {
19201 ["Size of FelicaCommandResponseHeader"]
19202 [::core::mem::size_of::<FelicaCommandResponseHeader>() - 12usize];
19203 ["Alignment of FelicaCommandResponseHeader"]
19204 [::core::mem::align_of::<FelicaCommandResponseHeader>() - 1usize];
19205 ["Offset of field: FelicaCommandResponseHeader::length"]
19206 [::core::mem::offset_of!(FelicaCommandResponseHeader, length) - 0usize];
19207 ["Offset of field: FelicaCommandResponseHeader::response_code"]
19208 [::core::mem::offset_of!(FelicaCommandResponseHeader, response_code) - 1usize];
19209 ["Offset of field: FelicaCommandResponseHeader::idm"]
19210 [::core::mem::offset_of!(FelicaCommandResponseHeader, idm) - 2usize];
19211 ["Offset of field: FelicaCommandResponseHeader::SF1"]
19212 [::core::mem::offset_of!(FelicaCommandResponseHeader, SF1) - 10usize];
19213 ["Offset of field: FelicaCommandResponseHeader::SF2"]
19214 [::core::mem::offset_of!(FelicaCommandResponseHeader, SF2) - 11usize];
19215};
19216#[repr(C)]
19217#[derive(Debug, Copy, Clone)]
19218pub struct FelicaCommandHeaderRaw {
19219 pub length: u8,
19220 pub command: u8,
19221 pub idm: FelicaIDm,
19222}
19223#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19224const _: () = {
19225 ["Size of FelicaCommandHeaderRaw"][::core::mem::size_of::<FelicaCommandHeaderRaw>() - 10usize];
19226 ["Alignment of FelicaCommandHeaderRaw"]
19227 [::core::mem::align_of::<FelicaCommandHeaderRaw>() - 1usize];
19228 ["Offset of field: FelicaCommandHeaderRaw::length"]
19229 [::core::mem::offset_of!(FelicaCommandHeaderRaw, length) - 0usize];
19230 ["Offset of field: FelicaCommandHeaderRaw::command"]
19231 [::core::mem::offset_of!(FelicaCommandHeaderRaw, command) - 1usize];
19232 ["Offset of field: FelicaCommandHeaderRaw::idm"]
19233 [::core::mem::offset_of!(FelicaCommandHeaderRaw, idm) - 2usize];
19234};
19235#[repr(C)]
19236#[derive(Debug, Copy, Clone)]
19237pub struct FelicaBlockListElement {
19238 pub _bitfield_align_1: [u8; 0],
19239 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
19240 pub block_number: u8,
19241}
19242#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19243const _: () = {
19244 ["Size of FelicaBlockListElement"][::core::mem::size_of::<FelicaBlockListElement>() - 2usize];
19245 ["Alignment of FelicaBlockListElement"]
19246 [::core::mem::align_of::<FelicaBlockListElement>() - 1usize];
19247 ["Offset of field: FelicaBlockListElement::block_number"]
19248 [::core::mem::offset_of!(FelicaBlockListElement, block_number) - 1usize];
19249};
19250impl FelicaBlockListElement {
19251 #[inline]
19252 pub fn service_code(&self) -> u8 {
19253 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
19254 }
19255 #[inline]
19256 pub fn set_service_code(&mut self, val: u8) {
19257 unsafe {
19258 let val: u8 = ::core::mem::transmute(val);
19259 self._bitfield_1.set(0usize, 4u8, val as u64)
19260 }
19261 }
19262 #[inline]
19263 pub unsafe fn service_code_raw(this: *const Self) -> u8 {
19264 unsafe {
19265 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
19266 ::core::ptr::addr_of!((*this)._bitfield_1),
19267 0usize,
19268 4u8,
19269 ) as u8)
19270 }
19271 }
19272 #[inline]
19273 pub unsafe fn set_service_code_raw(this: *mut Self, val: u8) {
19274 unsafe {
19275 let val: u8 = ::core::mem::transmute(val);
19276 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
19277 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
19278 0usize,
19279 4u8,
19280 val as u64,
19281 )
19282 }
19283 }
19284 #[inline]
19285 pub fn access_mode(&self) -> u8 {
19286 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) }
19287 }
19288 #[inline]
19289 pub fn set_access_mode(&mut self, val: u8) {
19290 unsafe {
19291 let val: u8 = ::core::mem::transmute(val);
19292 self._bitfield_1.set(4usize, 3u8, val as u64)
19293 }
19294 }
19295 #[inline]
19296 pub unsafe fn access_mode_raw(this: *const Self) -> u8 {
19297 unsafe {
19298 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
19299 ::core::ptr::addr_of!((*this)._bitfield_1),
19300 4usize,
19301 3u8,
19302 ) as u8)
19303 }
19304 }
19305 #[inline]
19306 pub unsafe fn set_access_mode_raw(this: *mut Self, val: u8) {
19307 unsafe {
19308 let val: u8 = ::core::mem::transmute(val);
19309 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
19310 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
19311 4usize,
19312 3u8,
19313 val as u64,
19314 )
19315 }
19316 }
19317 #[inline]
19318 pub fn length(&self) -> u8 {
19319 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
19320 }
19321 #[inline]
19322 pub fn set_length(&mut self, val: u8) {
19323 unsafe {
19324 let val: u8 = ::core::mem::transmute(val);
19325 self._bitfield_1.set(7usize, 1u8, val as u64)
19326 }
19327 }
19328 #[inline]
19329 pub unsafe fn length_raw(this: *const Self) -> u8 {
19330 unsafe {
19331 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
19332 ::core::ptr::addr_of!((*this)._bitfield_1),
19333 7usize,
19334 1u8,
19335 ) as u8)
19336 }
19337 }
19338 #[inline]
19339 pub unsafe fn set_length_raw(this: *mut Self, val: u8) {
19340 unsafe {
19341 let val: u8 = ::core::mem::transmute(val);
19342 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
19343 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
19344 7usize,
19345 1u8,
19346 val as u64,
19347 )
19348 }
19349 }
19350 #[inline]
19351 pub fn new_bitfield_1(
19352 service_code: u8,
19353 access_mode: u8,
19354 length: u8,
19355 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
19356 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
19357 __bindgen_bitfield_unit.set(0usize, 4u8, {
19358 let service_code: u8 = unsafe { ::core::mem::transmute(service_code) };
19359 service_code as u64
19360 });
19361 __bindgen_bitfield_unit.set(4usize, 3u8, {
19362 let access_mode: u8 = unsafe { ::core::mem::transmute(access_mode) };
19363 access_mode as u64
19364 });
19365 __bindgen_bitfield_unit.set(7usize, 1u8, {
19366 let length: u8 = unsafe { ::core::mem::transmute(length) };
19367 length as u64
19368 });
19369 __bindgen_bitfield_unit
19370 }
19371}
19372#[repr(C)]
19373#[derive(Debug)]
19374pub struct FelicaPollerReadCommandResponse {
19375 pub length: u8,
19376 pub response_code: u8,
19377 pub idm: FelicaIDm,
19378 pub SF1: u8,
19379 pub SF2: u8,
19380 pub block_count: u8,
19381 pub data: __IncompleteArrayField<u8>,
19382}
19383#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19384const _: () = {
19385 ["Size of FelicaPollerReadCommandResponse"]
19386 [::core::mem::size_of::<FelicaPollerReadCommandResponse>() - 13usize];
19387 ["Alignment of FelicaPollerReadCommandResponse"]
19388 [::core::mem::align_of::<FelicaPollerReadCommandResponse>() - 1usize];
19389 ["Offset of field: FelicaPollerReadCommandResponse::length"]
19390 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, length) - 0usize];
19391 ["Offset of field: FelicaPollerReadCommandResponse::response_code"]
19392 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, response_code) - 1usize];
19393 ["Offset of field: FelicaPollerReadCommandResponse::idm"]
19394 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, idm) - 2usize];
19395 ["Offset of field: FelicaPollerReadCommandResponse::SF1"]
19396 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, SF1) - 10usize];
19397 ["Offset of field: FelicaPollerReadCommandResponse::SF2"]
19398 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, SF2) - 11usize];
19399 ["Offset of field: FelicaPollerReadCommandResponse::block_count"]
19400 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, block_count) - 12usize];
19401 ["Offset of field: FelicaPollerReadCommandResponse::data"]
19402 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, data) - 13usize];
19403};
19404#[repr(C)]
19405#[derive(Debug)]
19406pub struct FelicaListenerReadCommandResponse {
19407 pub header: FelicaCommandResponseHeader,
19408 pub block_count: u8,
19409 pub data: __IncompleteArrayField<u8>,
19410}
19411#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19412const _: () = {
19413 ["Size of FelicaListenerReadCommandResponse"]
19414 [::core::mem::size_of::<FelicaListenerReadCommandResponse>() - 13usize];
19415 ["Alignment of FelicaListenerReadCommandResponse"]
19416 [::core::mem::align_of::<FelicaListenerReadCommandResponse>() - 1usize];
19417 ["Offset of field: FelicaListenerReadCommandResponse::header"]
19418 [::core::mem::offset_of!(FelicaListenerReadCommandResponse, header) - 0usize];
19419 ["Offset of field: FelicaListenerReadCommandResponse::block_count"]
19420 [::core::mem::offset_of!(FelicaListenerReadCommandResponse, block_count) - 12usize];
19421 ["Offset of field: FelicaListenerReadCommandResponse::data"]
19422 [::core::mem::offset_of!(FelicaListenerReadCommandResponse, data) - 13usize];
19423};
19424#[repr(C)]
19425#[derive(Debug)]
19426pub struct FelicaListServiceCommandResponse {
19427 pub header: FelicaCommandHeaderRaw,
19428 pub data: __IncompleteArrayField<u8>,
19429}
19430#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19431const _: () = {
19432 ["Size of FelicaListServiceCommandResponse"]
19433 [::core::mem::size_of::<FelicaListServiceCommandResponse>() - 10usize];
19434 ["Alignment of FelicaListServiceCommandResponse"]
19435 [::core::mem::align_of::<FelicaListServiceCommandResponse>() - 1usize];
19436 ["Offset of field: FelicaListServiceCommandResponse::header"]
19437 [::core::mem::offset_of!(FelicaListServiceCommandResponse, header) - 0usize];
19438 ["Offset of field: FelicaListServiceCommandResponse::data"]
19439 [::core::mem::offset_of!(FelicaListServiceCommandResponse, data) - 10usize];
19440};
19441#[repr(C)]
19442#[derive(Debug)]
19443pub struct FelicaListSystemCodeCommandResponse {
19444 pub header: FelicaCommandHeaderRaw,
19445 pub system_count: u8,
19446 pub system_code: __IncompleteArrayField<u8>,
19447}
19448#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19449const _: () = {
19450 ["Size of FelicaListSystemCodeCommandResponse"]
19451 [::core::mem::size_of::<FelicaListSystemCodeCommandResponse>() - 11usize];
19452 ["Alignment of FelicaListSystemCodeCommandResponse"]
19453 [::core::mem::align_of::<FelicaListSystemCodeCommandResponse>() - 1usize];
19454 ["Offset of field: FelicaListSystemCodeCommandResponse::header"]
19455 [::core::mem::offset_of!(FelicaListSystemCodeCommandResponse, header) - 0usize];
19456 ["Offset of field: FelicaListSystemCodeCommandResponse::system_count"]
19457 [::core::mem::offset_of!(FelicaListSystemCodeCommandResponse, system_count) - 10usize];
19458 ["Offset of field: FelicaListSystemCodeCommandResponse::system_code"]
19459 [::core::mem::offset_of!(FelicaListSystemCodeCommandResponse, system_code) - 11usize];
19460};
19461pub type FelicaListenerWriteCommandResponse = FelicaCommandResponseHeader;
19462pub type FelicaPollerWriteCommandResponse = FelicaCommandResponseHeader;
19463unsafe extern "C" {
19464 pub fn felica_alloc() -> *mut FelicaData;
19465}
19466unsafe extern "C" {
19467 pub fn felica_free(data: *mut FelicaData);
19468}
19469unsafe extern "C" {
19470 pub fn felica_reset(data: *mut FelicaData);
19471}
19472unsafe extern "C" {
19473 pub fn felica_copy(data: *mut FelicaData, other: *const FelicaData);
19474}
19475unsafe extern "C" {
19476 pub fn felica_verify(data: *mut FelicaData, device_type: *const FuriString) -> bool;
19477}
19478unsafe extern "C" {
19479 pub fn felica_load(data: *mut FelicaData, ff: *mut FlipperFormat, version: u32) -> bool;
19480}
19481unsafe extern "C" {
19482 pub fn felica_save(data: *const FelicaData, ff: *mut FlipperFormat) -> bool;
19483}
19484unsafe extern "C" {
19485 pub fn felica_is_equal(data: *const FelicaData, other: *const FelicaData) -> bool;
19486}
19487unsafe extern "C" {
19488 pub fn felica_get_device_name(
19489 data: *const FelicaData,
19490 name_type: NfcDeviceNameType,
19491 ) -> *const core::ffi::c_char;
19492}
19493unsafe extern "C" {
19494 pub fn felica_get_uid(data: *const FelicaData, uid_len: *mut usize) -> *const u8;
19495}
19496unsafe extern "C" {
19497 pub fn felica_set_uid(data: *mut FelicaData, uid: *const u8, uid_len: usize) -> bool;
19498}
19499unsafe extern "C" {
19500 pub fn felica_get_base_data(data: *const FelicaData) -> *mut FelicaData;
19501}
19502unsafe extern "C" {
19503 pub fn felica_calculate_session_key(
19504 ctx: *mut mbedtls_des3_context,
19505 ck: *const u8,
19506 rc: *const u8,
19507 out: *mut u8,
19508 );
19509}
19510unsafe extern "C" {
19511 pub fn felica_check_mac(
19512 ctx: *mut mbedtls_des3_context,
19513 session_key: *const u8,
19514 rc: *const u8,
19515 blocks: *const u8,
19516 block_count: u8,
19517 data: *mut u8,
19518 ) -> bool;
19519}
19520unsafe extern "C" {
19521 pub fn felica_calculate_mac_read(
19522 ctx: *mut mbedtls_des3_context,
19523 session_key: *const u8,
19524 rc: *const u8,
19525 blocks: *const u8,
19526 block_count: u8,
19527 data: *const u8,
19528 mac: *mut u8,
19529 );
19530}
19531unsafe extern "C" {
19532 pub fn felica_calculate_mac_write(
19533 ctx: *mut mbedtls_des3_context,
19534 session_key: *const u8,
19535 rc: *const u8,
19536 wcnt: *const u8,
19537 data: *const u8,
19538 mac: *mut u8,
19539 );
19540}
19541unsafe extern "C" {
19542 pub fn felica_write_directory_tree(system: *const FelicaSystem, str_: *mut FuriString);
19543}
19544unsafe extern "C" {
19545 pub fn felica_get_workflow_type(data: *mut FelicaData);
19546}
19547unsafe extern "C" {
19548 pub fn felica_get_ic_name(data: *const FelicaData, ic_name: *mut FuriString);
19549}
19550unsafe extern "C" {
19551 pub fn felica_service_get_attribute_string(
19552 service: *const FelicaService,
19553 str_: *mut FuriString,
19554 );
19555}
19556#[repr(C)]
19557#[derive(Debug, Copy, Clone)]
19558pub struct FelicaListener {
19559 _unused: [u8; 0],
19560}
19561#[repr(C)]
19562#[derive(Debug, Copy, Clone)]
19563pub struct FelicaPoller {
19564 _unused: [u8; 0],
19565}
19566#[doc = "< An error occured during activation procedure."]
19567pub const FelicaPollerEventTypeError: FelicaPollerEventType = FelicaPollerEventType(0);
19568#[doc = "< The card was activated and fully read by the poller."]
19569pub const FelicaPollerEventTypeReady: FelicaPollerEventType = FelicaPollerEventType(1);
19570#[doc = "< The card was activated and partly read by the poller."]
19571pub const FelicaPollerEventTypeIncomplete: FelicaPollerEventType = FelicaPollerEventType(2);
19572#[doc = "< Authentication context was requested by poller."]
19573pub const FelicaPollerEventTypeRequestAuthContext: FelicaPollerEventType = FelicaPollerEventType(3);
19574#[repr(transparent)]
19575#[doc = "Enumeration of possible Felica poller event types."]
19576#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19577pub struct FelicaPollerEventType(pub core::ffi::c_uchar);
19578#[doc = "Felica poller event data."]
19579#[repr(C)]
19580#[derive(Copy, Clone)]
19581pub union FelicaPollerEventData {
19582 #[doc = "< Error code indicating card activation fail reason."]
19583 pub error: FelicaError,
19584 #[doc = "< Authentication context to be filled by user."]
19585 pub auth_context: *mut FelicaAuthenticationContext,
19586}
19587#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19588const _: () = {
19589 ["Size of FelicaPollerEventData"][::core::mem::size_of::<FelicaPollerEventData>() - 4usize];
19590 ["Alignment of FelicaPollerEventData"]
19591 [::core::mem::align_of::<FelicaPollerEventData>() - 4usize];
19592 ["Offset of field: FelicaPollerEventData::error"]
19593 [::core::mem::offset_of!(FelicaPollerEventData, error) - 0usize];
19594 ["Offset of field: FelicaPollerEventData::auth_context"]
19595 [::core::mem::offset_of!(FelicaPollerEventData, auth_context) - 0usize];
19596};
19597#[doc = "FelicaPoller poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
19598#[repr(C)]
19599#[derive(Debug, Copy, Clone)]
19600pub struct FelicaPollerEvent {
19601 #[doc = "< Type of emmitted event."]
19602 pub type_: FelicaPollerEventType,
19603 #[doc = "< Pointer to event specific data."]
19604 pub data: *mut FelicaPollerEventData,
19605}
19606#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19607const _: () = {
19608 ["Size of FelicaPollerEvent"][::core::mem::size_of::<FelicaPollerEvent>() - 8usize];
19609 ["Alignment of FelicaPollerEvent"][::core::mem::align_of::<FelicaPollerEvent>() - 4usize];
19610 ["Offset of field: FelicaPollerEvent::type_"]
19611 [::core::mem::offset_of!(FelicaPollerEvent, type_) - 0usize];
19612 ["Offset of field: FelicaPollerEvent::data"]
19613 [::core::mem::offset_of!(FelicaPollerEvent, data) - 4usize];
19614};
19615unsafe extern "C" {
19616 #[doc = "Perform collision resolution procedure.\n\n Must ONLY be used inside the callback function.\n\n Perfoms the collision resolution procedure as defined in FeliCa standars. The data\n field will be filled with Felica data on success.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the Felica data structure to be filled.\n # Returns\n\nFelicaErrorNone on success, an error code on failure."]
19617 pub fn felica_poller_activate(
19618 instance: *mut FelicaPoller,
19619 data: *mut FelicaData,
19620 ) -> FelicaError;
19621}
19622unsafe extern "C" {
19623 #[doc = "Performs felica read operation for blocks provided as parameters\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_count` (direction in) - Amount of blocks involved in reading procedure\n * `block_numbers` (direction in) - Array with block indexes according to felica docs\n * `service_code` (direction in) - Service code for the read operation\n * `response_ptr` (direction out) - Pointer to the response structure\n # Returns\n\nFelicaErrorNone on success, an error code on failure."]
19624 pub fn felica_poller_read_blocks(
19625 instance: *mut FelicaPoller,
19626 block_count: u8,
19627 block_numbers: *const u8,
19628 service_code: u16,
19629 response_ptr: *mut *mut FelicaPollerReadCommandResponse,
19630 ) -> FelicaError;
19631}
19632unsafe extern "C" {
19633 pub fn felica_poller_sync_read(
19634 nfc: *mut Nfc,
19635 data: *mut FelicaData,
19636 card_key: *const FelicaCardKey,
19637 ) -> FelicaError;
19638}
19639#[repr(C)]
19640#[derive(Debug, Copy, Clone)]
19641pub struct Iso14443_3aListener {
19642 _unused: [u8; 0],
19643}
19644pub const Iso14443_3aListenerEventTypeFieldOff: Iso14443_3aListenerEventType =
19645 Iso14443_3aListenerEventType(0);
19646pub const Iso14443_3aListenerEventTypeHalted: Iso14443_3aListenerEventType =
19647 Iso14443_3aListenerEventType(1);
19648pub const Iso14443_3aListenerEventTypeReceivedStandardFrame: Iso14443_3aListenerEventType =
19649 Iso14443_3aListenerEventType(2);
19650pub const Iso14443_3aListenerEventTypeReceivedData: Iso14443_3aListenerEventType =
19651 Iso14443_3aListenerEventType(3);
19652#[repr(transparent)]
19653#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19654pub struct Iso14443_3aListenerEventType(pub core::ffi::c_uchar);
19655#[repr(C)]
19656#[derive(Debug, Copy, Clone)]
19657pub struct Iso14443_3aListenerEventData {
19658 pub buffer: *mut BitBuffer,
19659}
19660#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19661const _: () = {
19662 ["Size of Iso14443_3aListenerEventData"]
19663 [::core::mem::size_of::<Iso14443_3aListenerEventData>() - 4usize];
19664 ["Alignment of Iso14443_3aListenerEventData"]
19665 [::core::mem::align_of::<Iso14443_3aListenerEventData>() - 4usize];
19666 ["Offset of field: Iso14443_3aListenerEventData::buffer"]
19667 [::core::mem::offset_of!(Iso14443_3aListenerEventData, buffer) - 0usize];
19668};
19669#[repr(C)]
19670#[derive(Debug, Copy, Clone)]
19671pub struct Iso14443_3aListenerEvent {
19672 pub type_: Iso14443_3aListenerEventType,
19673 pub data: *mut Iso14443_3aListenerEventData,
19674}
19675#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19676const _: () = {
19677 ["Size of Iso14443_3aListenerEvent"]
19678 [::core::mem::size_of::<Iso14443_3aListenerEvent>() - 8usize];
19679 ["Alignment of Iso14443_3aListenerEvent"]
19680 [::core::mem::align_of::<Iso14443_3aListenerEvent>() - 4usize];
19681 ["Offset of field: Iso14443_3aListenerEvent::type_"]
19682 [::core::mem::offset_of!(Iso14443_3aListenerEvent, type_) - 0usize];
19683 ["Offset of field: Iso14443_3aListenerEvent::data"]
19684 [::core::mem::offset_of!(Iso14443_3aListenerEvent, data) - 4usize];
19685};
19686#[repr(C)]
19687#[derive(Debug, Copy, Clone)]
19688pub struct Iso14443_3aPoller {
19689 _unused: [u8; 0],
19690}
19691#[doc = "< An error occured during activation procedure."]
19692pub const Iso14443_3aPollerEventTypeError: Iso14443_3aPollerEventType =
19693 Iso14443_3aPollerEventType(0);
19694#[doc = "< The card was activated by the poller."]
19695pub const Iso14443_3aPollerEventTypeReady: Iso14443_3aPollerEventType =
19696 Iso14443_3aPollerEventType(1);
19697#[repr(transparent)]
19698#[doc = "Enumeration of possible Iso14443_3a poller event types."]
19699#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19700pub struct Iso14443_3aPollerEventType(pub core::ffi::c_uchar);
19701#[doc = "Iso14443_3a poller event data."]
19702#[repr(C)]
19703#[derive(Copy, Clone)]
19704pub union Iso14443_3aPollerEventData {
19705 #[doc = "< Error code indicating card activation fail reason."]
19706 pub error: Iso14443_3aError,
19707}
19708#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19709const _: () = {
19710 ["Size of Iso14443_3aPollerEventData"]
19711 [::core::mem::size_of::<Iso14443_3aPollerEventData>() - 1usize];
19712 ["Alignment of Iso14443_3aPollerEventData"]
19713 [::core::mem::align_of::<Iso14443_3aPollerEventData>() - 1usize];
19714 ["Offset of field: Iso14443_3aPollerEventData::error"]
19715 [::core::mem::offset_of!(Iso14443_3aPollerEventData, error) - 0usize];
19716};
19717#[doc = "Iso14443_3a poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
19718#[repr(C)]
19719#[derive(Debug, Copy, Clone)]
19720pub struct Iso14443_3aPollerEvent {
19721 #[doc = "< Type of emmitted event."]
19722 pub type_: Iso14443_3aPollerEventType,
19723 #[doc = "< Pointer to event specific data."]
19724 pub data: *mut Iso14443_3aPollerEventData,
19725}
19726#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19727const _: () = {
19728 ["Size of Iso14443_3aPollerEvent"][::core::mem::size_of::<Iso14443_3aPollerEvent>() - 8usize];
19729 ["Alignment of Iso14443_3aPollerEvent"]
19730 [::core::mem::align_of::<Iso14443_3aPollerEvent>() - 4usize];
19731 ["Offset of field: Iso14443_3aPollerEvent::type_"]
19732 [::core::mem::offset_of!(Iso14443_3aPollerEvent, type_) - 0usize];
19733 ["Offset of field: Iso14443_3aPollerEvent::data"]
19734 [::core::mem::offset_of!(Iso14443_3aPollerEvent, data) - 4usize];
19735};
19736unsafe extern "C" {
19737 #[doc = "Transmit and receive Iso14443_3a frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nIso14443_3aErrorNone on success, an error code on failure."]
19738 pub fn iso14443_3a_poller_txrx(
19739 instance: *mut Iso14443_3aPoller,
19740 tx_buffer: *const BitBuffer,
19741 rx_buffer: *mut BitBuffer,
19742 fwt: u32,
19743 ) -> Iso14443_3aError;
19744}
19745unsafe extern "C" {
19746 #[doc = "Transmit and receive Iso14443_3a standard frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nIso14443_3aErrorNone on success, an error code on failure."]
19747 pub fn iso14443_3a_poller_send_standard_frame(
19748 instance: *mut Iso14443_3aPoller,
19749 tx_buffer: *const BitBuffer,
19750 rx_buffer: *mut BitBuffer,
19751 fwt: u32,
19752 ) -> Iso14443_3aError;
19753}
19754unsafe extern "C" {
19755 #[doc = "Transmit and receive Iso14443_3a frames with custom parity bits in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n Custom parity bits must be set in the tx_buffer. The rx_buffer will contain\n the received data with the parity bits.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nIso14443_3aErrorNone on success, an error code on failure."]
19756 pub fn iso14443_3a_poller_txrx_custom_parity(
19757 instance: *mut Iso14443_3aPoller,
19758 tx_buffer: *const BitBuffer,
19759 rx_buffer: *mut BitBuffer,
19760 fwt: u32,
19761 ) -> Iso14443_3aError;
19762}
19763unsafe extern "C" {
19764 #[doc = "Checks presence of Iso14443_3a complient card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n # Returns\n\nIso14443_3aErrorNone if card is present, an error code otherwise."]
19765 pub fn iso14443_3a_poller_check_presence(instance: *mut Iso14443_3aPoller) -> Iso14443_3aError;
19766}
19767unsafe extern "C" {
19768 #[doc = "Perform collision resolution procedure.\n\n Must ONLY be used inside the callback function.\n\n Perfoms the collision resolution procedure as defined in Iso14443-3a. The iso14443_3a_data\n field will be filled with Iso14443-3a data on success.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `iso14443_3a_data` (direction out) - pointer to the Iso14443_3a data structure to be filled.\n # Returns\n\nIso14443_3aErrorNone on success, an error code on failure."]
19769 pub fn iso14443_3a_poller_activate(
19770 instance: *mut Iso14443_3aPoller,
19771 iso14443_3a_data: *mut Iso14443_3aData,
19772 ) -> Iso14443_3aError;
19773}
19774unsafe extern "C" {
19775 #[doc = "Send HALT command to the card.\n\n Must ONLY be used inside the callback function.\n\n Halts card and changes internal Iso14443_3aPoller state to Idle.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n # Returns\n\nIso14443_3aErrorNone on success, an error code on failure."]
19776 pub fn iso14443_3a_poller_halt(instance: *mut Iso14443_3aPoller) -> Iso14443_3aError;
19777}
19778unsafe extern "C" {
19779 pub fn iso14443_3a_poller_sync_read(
19780 nfc: *mut Nfc,
19781 iso14443_3a_data: *mut Iso14443_3aData,
19782 ) -> Iso14443_3aError;
19783}
19784pub const Iso14443_3bErrorNone: Iso14443_3bError = Iso14443_3bError(0);
19785pub const Iso14443_3bErrorNotPresent: Iso14443_3bError = Iso14443_3bError(1);
19786pub const Iso14443_3bErrorColResFailed: Iso14443_3bError = Iso14443_3bError(2);
19787pub const Iso14443_3bErrorBufferOverflow: Iso14443_3bError = Iso14443_3bError(3);
19788pub const Iso14443_3bErrorCommunication: Iso14443_3bError = Iso14443_3bError(4);
19789pub const Iso14443_3bErrorFieldOff: Iso14443_3bError = Iso14443_3bError(5);
19790pub const Iso14443_3bErrorWrongCrc: Iso14443_3bError = Iso14443_3bError(6);
19791pub const Iso14443_3bErrorTimeout: Iso14443_3bError = Iso14443_3bError(7);
19792#[repr(transparent)]
19793#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19794pub struct Iso14443_3bError(pub core::ffi::c_uchar);
19795pub const Iso14443_3bBitRateBoth106Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(0);
19796pub const Iso14443_3bBitRatePiccToPcd212Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(1);
19797pub const Iso14443_3bBitRatePiccToPcd424Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(2);
19798pub const Iso14443_3bBitRatePiccToPcd848Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(3);
19799pub const Iso14443_3bBitRatePcdToPicc212Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(4);
19800pub const Iso14443_3bBitRatePcdToPicc424Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(5);
19801pub const Iso14443_3bBitRatePcdToPicc848Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(6);
19802#[repr(transparent)]
19803#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19804pub struct Iso14443_3bBitRate(pub core::ffi::c_uchar);
19805pub const Iso14443_3bFrameOptionNad: Iso14443_3bFrameOption = Iso14443_3bFrameOption(0);
19806pub const Iso14443_3bFrameOptionCid: Iso14443_3bFrameOption = Iso14443_3bFrameOption(1);
19807#[repr(transparent)]
19808#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19809pub struct Iso14443_3bFrameOption(pub core::ffi::c_uchar);
19810#[repr(C)]
19811#[derive(Debug, Copy, Clone)]
19812pub struct Iso14443_3bData {
19813 _unused: [u8; 0],
19814}
19815unsafe extern "C" {
19816 pub fn iso14443_3b_alloc() -> *mut Iso14443_3bData;
19817}
19818unsafe extern "C" {
19819 pub fn iso14443_3b_free(data: *mut Iso14443_3bData);
19820}
19821unsafe extern "C" {
19822 pub fn iso14443_3b_reset(data: *mut Iso14443_3bData);
19823}
19824unsafe extern "C" {
19825 pub fn iso14443_3b_copy(data: *mut Iso14443_3bData, other: *const Iso14443_3bData);
19826}
19827unsafe extern "C" {
19828 pub fn iso14443_3b_verify(data: *mut Iso14443_3bData, device_type: *const FuriString) -> bool;
19829}
19830unsafe extern "C" {
19831 pub fn iso14443_3b_load(
19832 data: *mut Iso14443_3bData,
19833 ff: *mut FlipperFormat,
19834 version: u32,
19835 ) -> bool;
19836}
19837unsafe extern "C" {
19838 pub fn iso14443_3b_save(data: *const Iso14443_3bData, ff: *mut FlipperFormat) -> bool;
19839}
19840unsafe extern "C" {
19841 pub fn iso14443_3b_is_equal(
19842 data: *const Iso14443_3bData,
19843 other: *const Iso14443_3bData,
19844 ) -> bool;
19845}
19846unsafe extern "C" {
19847 pub fn iso14443_3b_get_device_name(
19848 data: *const Iso14443_3bData,
19849 name_type: NfcDeviceNameType,
19850 ) -> *const core::ffi::c_char;
19851}
19852unsafe extern "C" {
19853 pub fn iso14443_3b_get_uid(data: *const Iso14443_3bData, uid_len: *mut usize) -> *const u8;
19854}
19855unsafe extern "C" {
19856 pub fn iso14443_3b_set_uid(data: *mut Iso14443_3bData, uid: *const u8, uid_len: usize) -> bool;
19857}
19858unsafe extern "C" {
19859 pub fn iso14443_3b_get_base_data(data: *const Iso14443_3bData) -> *mut Iso14443_3bData;
19860}
19861unsafe extern "C" {
19862 pub fn iso14443_3b_supports_iso14443_4(data: *const Iso14443_3bData) -> bool;
19863}
19864unsafe extern "C" {
19865 pub fn iso14443_3b_supports_bit_rate(
19866 data: *const Iso14443_3bData,
19867 bit_rate: Iso14443_3bBitRate,
19868 ) -> bool;
19869}
19870unsafe extern "C" {
19871 pub fn iso14443_3b_supports_frame_option(
19872 data: *const Iso14443_3bData,
19873 option: Iso14443_3bFrameOption,
19874 ) -> bool;
19875}
19876unsafe extern "C" {
19877 pub fn iso14443_3b_get_application_data(
19878 data: *const Iso14443_3bData,
19879 data_size: *mut usize,
19880 ) -> *const u8;
19881}
19882unsafe extern "C" {
19883 pub fn iso14443_3b_get_frame_size_max(data: *const Iso14443_3bData) -> u16;
19884}
19885unsafe extern "C" {
19886 pub fn iso14443_3b_get_fwt_fc_max(data: *const Iso14443_3bData) -> u32;
19887}
19888#[repr(C)]
19889#[derive(Debug, Copy, Clone)]
19890pub struct Iso14443_3bPoller {
19891 _unused: [u8; 0],
19892}
19893#[doc = "< An error occured during activation procedure."]
19894pub const Iso14443_3bPollerEventTypeError: Iso14443_3bPollerEventType =
19895 Iso14443_3bPollerEventType(0);
19896#[doc = "< The card was activated by the poller."]
19897pub const Iso14443_3bPollerEventTypeReady: Iso14443_3bPollerEventType =
19898 Iso14443_3bPollerEventType(1);
19899#[repr(transparent)]
19900#[doc = "Enumeration of possible Iso14443_3b poller event types."]
19901#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19902pub struct Iso14443_3bPollerEventType(pub core::ffi::c_uchar);
19903#[doc = "Iso14443_3b poller event data."]
19904#[repr(C)]
19905#[derive(Copy, Clone)]
19906pub union Iso14443_3bPollerEventData {
19907 #[doc = "< Error code indicating card activation fail reason."]
19908 pub error: Iso14443_3bError,
19909}
19910#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19911const _: () = {
19912 ["Size of Iso14443_3bPollerEventData"]
19913 [::core::mem::size_of::<Iso14443_3bPollerEventData>() - 1usize];
19914 ["Alignment of Iso14443_3bPollerEventData"]
19915 [::core::mem::align_of::<Iso14443_3bPollerEventData>() - 1usize];
19916 ["Offset of field: Iso14443_3bPollerEventData::error"]
19917 [::core::mem::offset_of!(Iso14443_3bPollerEventData, error) - 0usize];
19918};
19919#[doc = "Iso14443_3b poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
19920#[repr(C)]
19921#[derive(Debug, Copy, Clone)]
19922pub struct Iso14443_3bPollerEvent {
19923 #[doc = "< Type of emmitted event."]
19924 pub type_: Iso14443_3bPollerEventType,
19925 #[doc = "< Pointer to event specific data."]
19926 pub data: *mut Iso14443_3bPollerEventData,
19927}
19928#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19929const _: () = {
19930 ["Size of Iso14443_3bPollerEvent"][::core::mem::size_of::<Iso14443_3bPollerEvent>() - 8usize];
19931 ["Alignment of Iso14443_3bPollerEvent"]
19932 [::core::mem::align_of::<Iso14443_3bPollerEvent>() - 4usize];
19933 ["Offset of field: Iso14443_3bPollerEvent::type_"]
19934 [::core::mem::offset_of!(Iso14443_3bPollerEvent, type_) - 0usize];
19935 ["Offset of field: Iso14443_3bPollerEvent::data"]
19936 [::core::mem::offset_of!(Iso14443_3bPollerEvent, data) - 4usize];
19937};
19938unsafe extern "C" {
19939 #[doc = "Transmit and receive Iso14443_3b frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nIso14443_3bErrorNone on success, an error code on failure."]
19940 pub fn iso14443_3b_poller_send_frame(
19941 instance: *mut Iso14443_3bPoller,
19942 tx_buffer: *const BitBuffer,
19943 rx_buffer: *mut BitBuffer,
19944 ) -> Iso14443_3bError;
19945}
19946unsafe extern "C" {
19947 #[doc = "Perform collision resolution procedure.\n\n Must ONLY be used inside the callback function.\n\n Perfoms the collision resolution procedure as defined in Iso14443-3b. The data\n field will be filled with Iso14443-3b data on success.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the Iso14443_3b data structure to be filled.\n # Returns\n\nIso14443_3bErrorNone on success, an error code on failure."]
19948 pub fn iso14443_3b_poller_activate(
19949 instance: *mut Iso14443_3bPoller,
19950 data: *mut Iso14443_3bData,
19951 ) -> Iso14443_3bError;
19952}
19953unsafe extern "C" {
19954 #[doc = "Send HALT command to the card.\n\n Must ONLY be used inside the callback function.\n\n Halts card and changes internal Iso14443_3bPoller state to Idle.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n # Returns\n\nIso14443_3bErrorNone on success, an error code on failure."]
19955 pub fn iso14443_3b_poller_halt(instance: *mut Iso14443_3bPoller) -> Iso14443_3bError;
19956}
19957pub const Iso14443_4aErrorNone: Iso14443_4aError = Iso14443_4aError(0);
19958pub const Iso14443_4aErrorNotPresent: Iso14443_4aError = Iso14443_4aError(1);
19959pub const Iso14443_4aErrorProtocol: Iso14443_4aError = Iso14443_4aError(2);
19960pub const Iso14443_4aErrorTimeout: Iso14443_4aError = Iso14443_4aError(3);
19961#[repr(transparent)]
19962#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19963pub struct Iso14443_4aError(pub core::ffi::c_uchar);
19964pub const Iso14443_4aBitRateBoth106Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(0);
19965pub const Iso14443_4aBitRatePiccToPcd212Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(1);
19966pub const Iso14443_4aBitRatePiccToPcd424Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(2);
19967pub const Iso14443_4aBitRatePiccToPcd848Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(3);
19968pub const Iso14443_4aBitRatePcdToPicc212Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(4);
19969pub const Iso14443_4aBitRatePcdToPicc424Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(5);
19970pub const Iso14443_4aBitRatePcdToPicc848Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(6);
19971#[repr(transparent)]
19972#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19973pub struct Iso14443_4aBitRate(pub core::ffi::c_uchar);
19974pub const Iso14443_4aFrameOptionNad: Iso14443_4aFrameOption = Iso14443_4aFrameOption(0);
19975pub const Iso14443_4aFrameOptionCid: Iso14443_4aFrameOption = Iso14443_4aFrameOption(1);
19976#[repr(transparent)]
19977#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19978pub struct Iso14443_4aFrameOption(pub core::ffi::c_uchar);
19979#[repr(C)]
19980#[derive(Debug, Copy, Clone)]
19981pub struct Iso14443_4aAtsData {
19982 pub tl: u8,
19983 pub t0: u8,
19984 pub ta_1: u8,
19985 pub tb_1: u8,
19986 pub tc_1: u8,
19987 pub t1_tk: *mut SimpleArray,
19988}
19989#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19990const _: () = {
19991 ["Size of Iso14443_4aAtsData"][::core::mem::size_of::<Iso14443_4aAtsData>() - 12usize];
19992 ["Alignment of Iso14443_4aAtsData"][::core::mem::align_of::<Iso14443_4aAtsData>() - 4usize];
19993 ["Offset of field: Iso14443_4aAtsData::tl"]
19994 [::core::mem::offset_of!(Iso14443_4aAtsData, tl) - 0usize];
19995 ["Offset of field: Iso14443_4aAtsData::t0"]
19996 [::core::mem::offset_of!(Iso14443_4aAtsData, t0) - 1usize];
19997 ["Offset of field: Iso14443_4aAtsData::ta_1"]
19998 [::core::mem::offset_of!(Iso14443_4aAtsData, ta_1) - 2usize];
19999 ["Offset of field: Iso14443_4aAtsData::tb_1"]
20000 [::core::mem::offset_of!(Iso14443_4aAtsData, tb_1) - 3usize];
20001 ["Offset of field: Iso14443_4aAtsData::tc_1"]
20002 [::core::mem::offset_of!(Iso14443_4aAtsData, tc_1) - 4usize];
20003 ["Offset of field: Iso14443_4aAtsData::t1_tk"]
20004 [::core::mem::offset_of!(Iso14443_4aAtsData, t1_tk) - 8usize];
20005};
20006#[repr(C)]
20007#[derive(Debug, Copy, Clone)]
20008pub struct Iso14443_4aData {
20009 pub iso14443_3a_data: *mut Iso14443_3aData,
20010 pub ats_data: Iso14443_4aAtsData,
20011}
20012#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20013const _: () = {
20014 ["Size of Iso14443_4aData"][::core::mem::size_of::<Iso14443_4aData>() - 16usize];
20015 ["Alignment of Iso14443_4aData"][::core::mem::align_of::<Iso14443_4aData>() - 4usize];
20016 ["Offset of field: Iso14443_4aData::iso14443_3a_data"]
20017 [::core::mem::offset_of!(Iso14443_4aData, iso14443_3a_data) - 0usize];
20018 ["Offset of field: Iso14443_4aData::ats_data"]
20019 [::core::mem::offset_of!(Iso14443_4aData, ats_data) - 4usize];
20020};
20021unsafe extern "C" {
20022 pub fn iso14443_4a_alloc() -> *mut Iso14443_4aData;
20023}
20024unsafe extern "C" {
20025 pub fn iso14443_4a_free(data: *mut Iso14443_4aData);
20026}
20027unsafe extern "C" {
20028 pub fn iso14443_4a_reset(data: *mut Iso14443_4aData);
20029}
20030unsafe extern "C" {
20031 pub fn iso14443_4a_copy(data: *mut Iso14443_4aData, other: *const Iso14443_4aData);
20032}
20033unsafe extern "C" {
20034 pub fn iso14443_4a_verify(data: *mut Iso14443_4aData, device_type: *const FuriString) -> bool;
20035}
20036unsafe extern "C" {
20037 pub fn iso14443_4a_load(
20038 data: *mut Iso14443_4aData,
20039 ff: *mut FlipperFormat,
20040 version: u32,
20041 ) -> bool;
20042}
20043unsafe extern "C" {
20044 pub fn iso14443_4a_save(data: *const Iso14443_4aData, ff: *mut FlipperFormat) -> bool;
20045}
20046unsafe extern "C" {
20047 pub fn iso14443_4a_is_equal(
20048 data: *const Iso14443_4aData,
20049 other: *const Iso14443_4aData,
20050 ) -> bool;
20051}
20052unsafe extern "C" {
20053 pub fn iso14443_4a_get_device_name(
20054 data: *const Iso14443_4aData,
20055 name_type: NfcDeviceNameType,
20056 ) -> *const core::ffi::c_char;
20057}
20058unsafe extern "C" {
20059 pub fn iso14443_4a_get_uid(data: *const Iso14443_4aData, uid_len: *mut usize) -> *const u8;
20060}
20061unsafe extern "C" {
20062 pub fn iso14443_4a_set_uid(data: *mut Iso14443_4aData, uid: *const u8, uid_len: usize) -> bool;
20063}
20064unsafe extern "C" {
20065 pub fn iso14443_4a_get_base_data(data: *const Iso14443_4aData) -> *mut Iso14443_3aData;
20066}
20067unsafe extern "C" {
20068 pub fn iso14443_4a_get_frame_size_max(data: *const Iso14443_4aData) -> u16;
20069}
20070unsafe extern "C" {
20071 pub fn iso14443_4a_get_fwt_fc_max(data: *const Iso14443_4aData) -> u32;
20072}
20073unsafe extern "C" {
20074 pub fn iso14443_4a_get_historical_bytes(
20075 data: *const Iso14443_4aData,
20076 count: *mut u32,
20077 ) -> *const u8;
20078}
20079unsafe extern "C" {
20080 pub fn iso14443_4a_supports_bit_rate(
20081 data: *const Iso14443_4aData,
20082 bit_rate: Iso14443_4aBitRate,
20083 ) -> bool;
20084}
20085unsafe extern "C" {
20086 pub fn iso14443_4a_supports_frame_option(
20087 data: *const Iso14443_4aData,
20088 option: Iso14443_4aFrameOption,
20089 ) -> bool;
20090}
20091#[repr(C)]
20092#[derive(Debug, Copy, Clone)]
20093pub struct Iso14443_4aListener {
20094 _unused: [u8; 0],
20095}
20096pub const Iso14443_4aListenerEventTypeHalted: Iso14443_4aListenerEventType =
20097 Iso14443_4aListenerEventType(0);
20098pub const Iso14443_4aListenerEventTypeFieldOff: Iso14443_4aListenerEventType =
20099 Iso14443_4aListenerEventType(1);
20100pub const Iso14443_4aListenerEventTypeReceivedData: Iso14443_4aListenerEventType =
20101 Iso14443_4aListenerEventType(2);
20102#[repr(transparent)]
20103#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20104pub struct Iso14443_4aListenerEventType(pub core::ffi::c_uchar);
20105#[repr(C)]
20106#[derive(Debug, Copy, Clone)]
20107pub struct Iso14443_4aListenerEventData {
20108 pub buffer: *mut BitBuffer,
20109}
20110#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20111const _: () = {
20112 ["Size of Iso14443_4aListenerEventData"]
20113 [::core::mem::size_of::<Iso14443_4aListenerEventData>() - 4usize];
20114 ["Alignment of Iso14443_4aListenerEventData"]
20115 [::core::mem::align_of::<Iso14443_4aListenerEventData>() - 4usize];
20116 ["Offset of field: Iso14443_4aListenerEventData::buffer"]
20117 [::core::mem::offset_of!(Iso14443_4aListenerEventData, buffer) - 0usize];
20118};
20119#[repr(C)]
20120#[derive(Debug, Copy, Clone)]
20121pub struct Iso14443_4aListenerEvent {
20122 pub type_: Iso14443_4aListenerEventType,
20123 pub data: *mut Iso14443_4aListenerEventData,
20124}
20125#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20126const _: () = {
20127 ["Size of Iso14443_4aListenerEvent"]
20128 [::core::mem::size_of::<Iso14443_4aListenerEvent>() - 8usize];
20129 ["Alignment of Iso14443_4aListenerEvent"]
20130 [::core::mem::align_of::<Iso14443_4aListenerEvent>() - 4usize];
20131 ["Offset of field: Iso14443_4aListenerEvent::type_"]
20132 [::core::mem::offset_of!(Iso14443_4aListenerEvent, type_) - 0usize];
20133 ["Offset of field: Iso14443_4aListenerEvent::data"]
20134 [::core::mem::offset_of!(Iso14443_4aListenerEvent, data) - 4usize];
20135};
20136#[repr(C)]
20137#[derive(Debug, Copy, Clone)]
20138pub struct Iso14443_4aPoller {
20139 _unused: [u8; 0],
20140}
20141#[doc = "< An error occured during activation procedure."]
20142pub const Iso14443_4aPollerEventTypeError: Iso14443_4aPollerEventType =
20143 Iso14443_4aPollerEventType(0);
20144#[doc = "< The card was activated by the poller."]
20145pub const Iso14443_4aPollerEventTypeReady: Iso14443_4aPollerEventType =
20146 Iso14443_4aPollerEventType(1);
20147#[repr(transparent)]
20148#[doc = "Enumeration of possible Iso14443_4a poller event types."]
20149#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20150pub struct Iso14443_4aPollerEventType(pub core::ffi::c_uchar);
20151#[doc = "Iso14443_4a poller event data."]
20152#[repr(C)]
20153#[derive(Copy, Clone)]
20154pub union Iso14443_4aPollerEventData {
20155 #[doc = "< Error code indicating card activation fail reason."]
20156 pub error: Iso14443_4aError,
20157}
20158#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20159const _: () = {
20160 ["Size of Iso14443_4aPollerEventData"]
20161 [::core::mem::size_of::<Iso14443_4aPollerEventData>() - 1usize];
20162 ["Alignment of Iso14443_4aPollerEventData"]
20163 [::core::mem::align_of::<Iso14443_4aPollerEventData>() - 1usize];
20164 ["Offset of field: Iso14443_4aPollerEventData::error"]
20165 [::core::mem::offset_of!(Iso14443_4aPollerEventData, error) - 0usize];
20166};
20167#[doc = "Iso14443_4a poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
20168#[repr(C)]
20169#[derive(Debug, Copy, Clone)]
20170pub struct Iso14443_4aPollerEvent {
20171 #[doc = "< Type of emmitted event."]
20172 pub type_: Iso14443_4aPollerEventType,
20173 #[doc = "< Pointer to event specific data."]
20174 pub data: *mut Iso14443_4aPollerEventData,
20175}
20176#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20177const _: () = {
20178 ["Size of Iso14443_4aPollerEvent"][::core::mem::size_of::<Iso14443_4aPollerEvent>() - 8usize];
20179 ["Alignment of Iso14443_4aPollerEvent"]
20180 [::core::mem::align_of::<Iso14443_4aPollerEvent>() - 4usize];
20181 ["Offset of field: Iso14443_4aPollerEvent::type_"]
20182 [::core::mem::offset_of!(Iso14443_4aPollerEvent, type_) - 0usize];
20183 ["Offset of field: Iso14443_4aPollerEvent::data"]
20184 [::core::mem::offset_of!(Iso14443_4aPollerEvent, data) - 4usize];
20185};
20186unsafe extern "C" {
20187 #[doc = "Transmit and receive Iso14443_4a blocks in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer. The fwt parameter is calculated during activation procedure.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n # Returns\n\nIso14443_4aErrorNone on success, an error code on failure."]
20188 pub fn iso14443_4a_poller_send_block(
20189 instance: *mut Iso14443_4aPoller,
20190 tx_buffer: *const BitBuffer,
20191 rx_buffer: *mut BitBuffer,
20192 ) -> Iso14443_4aError;
20193}
20194unsafe extern "C" {
20195 #[doc = "Transmit and receive Iso14443_4a chained block in poller mode. Also it\n automatically modifies PCB packet byte with appropriate bits then resets them back\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer. The fwt parameter is calculated during activation procedure.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n # Returns\n\nIso14443_4aErrorNone on success, an error code on failure."]
20196 pub fn iso14443_4a_poller_send_chain_block(
20197 instance: *mut Iso14443_4aPoller,
20198 tx_buffer: *const BitBuffer,
20199 rx_buffer: *mut BitBuffer,
20200 ) -> Iso14443_4aError;
20201}
20202unsafe extern "C" {
20203 #[doc = "Transmit Iso14443_4a R-block in poller mode. This block never contains\n data, but can contain CID and NAD, therefore in tx_buffer only two bytes can be added.\n The first one will represent CID, the second one will represent NAD.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with R-block repsonse\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `acknowledged` (direction in) - Sets appropriate bit in PCB byte. True - ACK, false - NAK\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n # Returns\n\nIso14443_4aErrorNone on success, an error code on failure."]
20204 pub fn iso14443_4a_poller_send_receive_ready_block(
20205 instance: *mut Iso14443_4aPoller,
20206 acknowledged: bool,
20207 tx_buffer: *const BitBuffer,
20208 rx_buffer: *mut BitBuffer,
20209 ) -> Iso14443_4aError;
20210}
20211unsafe extern "C" {
20212 #[doc = "Transmit Iso14443_4a S-block in poller mode. S-block used to exchange control\n information between the card and the reader. Two different types of S-blocks\n are defined:\n - Waiting time extension containing a 1 byte long INF field and (deselect = false)\n - DESELECT containing no INF field (deselect = true)\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with R-block repsonse\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `deselect` (direction in) - Sets appropriate bit in PCB byte.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n # Returns\n\nIso14443_4aErrorNone on success, an error code on failure."]
20213 pub fn iso14443_4a_poller_send_supervisory_block(
20214 instance: *mut Iso14443_4aPoller,
20215 deselect: bool,
20216 tx_buffer: *const BitBuffer,
20217 rx_buffer: *mut BitBuffer,
20218 ) -> Iso14443_4aError;
20219}
20220unsafe extern "C" {
20221 #[doc = "Send HALT command to the card.\n\n Must ONLY be used inside the callback function.\n\n Halts card and changes internal Iso14443_4aPoller state to Idle.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n # Returns\n\nIso14443_4aErrorNone on success, an error code on failure."]
20222 pub fn iso14443_4a_poller_halt(instance: *mut Iso14443_4aPoller) -> Iso14443_4aError;
20223}
20224unsafe extern "C" {
20225 #[doc = "Read Answer To Select (ATS) from the card.\n\n Must ONLY be used inside the callback function.\n\n Send Request Answer To Select (RATS) command to the card and parse the response.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the buffer to be filled with ATS data.\n # Returns\n\nIso14443_4aErrorNone on success, an error code on failure."]
20226 pub fn iso14443_4a_poller_read_ats(
20227 instance: *mut Iso14443_4aPoller,
20228 data: *mut Iso14443_4aAtsData,
20229 ) -> Iso14443_4aError;
20230}
20231pub const Iso14443_4bErrorNone: Iso14443_4bError = Iso14443_4bError(0);
20232pub const Iso14443_4bErrorNotPresent: Iso14443_4bError = Iso14443_4bError(1);
20233pub const Iso14443_4bErrorProtocol: Iso14443_4bError = Iso14443_4bError(2);
20234pub const Iso14443_4bErrorTimeout: Iso14443_4bError = Iso14443_4bError(3);
20235#[repr(transparent)]
20236#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20237pub struct Iso14443_4bError(pub core::ffi::c_uchar);
20238#[repr(C)]
20239#[derive(Debug, Copy, Clone)]
20240pub struct Iso14443_4bData {
20241 _unused: [u8; 0],
20242}
20243unsafe extern "C" {
20244 pub fn iso14443_4b_alloc() -> *mut Iso14443_4bData;
20245}
20246unsafe extern "C" {
20247 pub fn iso14443_4b_free(data: *mut Iso14443_4bData);
20248}
20249unsafe extern "C" {
20250 pub fn iso14443_4b_reset(data: *mut Iso14443_4bData);
20251}
20252unsafe extern "C" {
20253 pub fn iso14443_4b_copy(data: *mut Iso14443_4bData, other: *const Iso14443_4bData);
20254}
20255unsafe extern "C" {
20256 pub fn iso14443_4b_verify(data: *mut Iso14443_4bData, device_type: *const FuriString) -> bool;
20257}
20258unsafe extern "C" {
20259 pub fn iso14443_4b_load(
20260 data: *mut Iso14443_4bData,
20261 ff: *mut FlipperFormat,
20262 version: u32,
20263 ) -> bool;
20264}
20265unsafe extern "C" {
20266 pub fn iso14443_4b_save(data: *const Iso14443_4bData, ff: *mut FlipperFormat) -> bool;
20267}
20268unsafe extern "C" {
20269 pub fn iso14443_4b_is_equal(
20270 data: *const Iso14443_4bData,
20271 other: *const Iso14443_4bData,
20272 ) -> bool;
20273}
20274unsafe extern "C" {
20275 pub fn iso14443_4b_get_device_name(
20276 data: *const Iso14443_4bData,
20277 name_type: NfcDeviceNameType,
20278 ) -> *const core::ffi::c_char;
20279}
20280unsafe extern "C" {
20281 pub fn iso14443_4b_get_uid(data: *const Iso14443_4bData, uid_len: *mut usize) -> *const u8;
20282}
20283unsafe extern "C" {
20284 pub fn iso14443_4b_set_uid(data: *mut Iso14443_4bData, uid: *const u8, uid_len: usize) -> bool;
20285}
20286unsafe extern "C" {
20287 pub fn iso14443_4b_get_base_data(data: *const Iso14443_4bData) -> *mut Iso14443_3bData;
20288}
20289#[repr(C)]
20290#[derive(Debug, Copy, Clone)]
20291pub struct Iso14443_4bPoller {
20292 _unused: [u8; 0],
20293}
20294#[doc = "< An error occured during activation procedure."]
20295pub const Iso14443_4bPollerEventTypeError: Iso14443_4bPollerEventType =
20296 Iso14443_4bPollerEventType(0);
20297#[doc = "< The card was activated by the poller."]
20298pub const Iso14443_4bPollerEventTypeReady: Iso14443_4bPollerEventType =
20299 Iso14443_4bPollerEventType(1);
20300#[repr(transparent)]
20301#[doc = "Enumeration of possible Iso14443_4b poller event types."]
20302#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20303pub struct Iso14443_4bPollerEventType(pub core::ffi::c_uchar);
20304#[doc = "Iso14443_4b poller event data."]
20305#[repr(C)]
20306#[derive(Copy, Clone)]
20307pub union Iso14443_4bPollerEventData {
20308 #[doc = "< Error code indicating card activation fail reason."]
20309 pub error: Iso14443_4bError,
20310}
20311#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20312const _: () = {
20313 ["Size of Iso14443_4bPollerEventData"]
20314 [::core::mem::size_of::<Iso14443_4bPollerEventData>() - 1usize];
20315 ["Alignment of Iso14443_4bPollerEventData"]
20316 [::core::mem::align_of::<Iso14443_4bPollerEventData>() - 1usize];
20317 ["Offset of field: Iso14443_4bPollerEventData::error"]
20318 [::core::mem::offset_of!(Iso14443_4bPollerEventData, error) - 0usize];
20319};
20320#[doc = "Iso14443_4b poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
20321#[repr(C)]
20322#[derive(Debug, Copy, Clone)]
20323pub struct Iso14443_4bPollerEvent {
20324 #[doc = "< Type of emmitted event."]
20325 pub type_: Iso14443_4bPollerEventType,
20326 #[doc = "< Pointer to event specific data."]
20327 pub data: *mut Iso14443_4bPollerEventData,
20328}
20329#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20330const _: () = {
20331 ["Size of Iso14443_4bPollerEvent"][::core::mem::size_of::<Iso14443_4bPollerEvent>() - 8usize];
20332 ["Alignment of Iso14443_4bPollerEvent"]
20333 [::core::mem::align_of::<Iso14443_4bPollerEvent>() - 4usize];
20334 ["Offset of field: Iso14443_4bPollerEvent::type_"]
20335 [::core::mem::offset_of!(Iso14443_4bPollerEvent, type_) - 0usize];
20336 ["Offset of field: Iso14443_4bPollerEvent::data"]
20337 [::core::mem::offset_of!(Iso14443_4bPollerEvent, data) - 4usize];
20338};
20339unsafe extern "C" {
20340 #[doc = "Transmit and receive Iso14443_4b blocks in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer. The fwt parameter is calculated during activation procedure.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n # Returns\n\nIso14443_4bErrorNone on success, an error code on failure."]
20341 pub fn iso14443_4b_poller_send_block(
20342 instance: *mut Iso14443_4bPoller,
20343 tx_buffer: *const BitBuffer,
20344 rx_buffer: *mut BitBuffer,
20345 ) -> Iso14443_4bError;
20346}
20347unsafe extern "C" {
20348 #[doc = "Send HALT command to the card.\n\n Must ONLY be used inside the callback function.\n\n Halts card and changes internal Iso14443_4aPoller state to Idle.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n # Returns\n\nIso14443_4bErrorNone on success, an error code on failure."]
20349 pub fn iso14443_4b_poller_halt(instance: *mut Iso14443_4bPoller) -> Iso14443_4bError;
20350}
20351pub const Iso15693_3ErrorNone: Iso15693_3Error = Iso15693_3Error(0);
20352pub const Iso15693_3ErrorNotPresent: Iso15693_3Error = Iso15693_3Error(1);
20353pub const Iso15693_3ErrorBufferEmpty: Iso15693_3Error = Iso15693_3Error(2);
20354pub const Iso15693_3ErrorBufferOverflow: Iso15693_3Error = Iso15693_3Error(3);
20355pub const Iso15693_3ErrorFieldOff: Iso15693_3Error = Iso15693_3Error(4);
20356pub const Iso15693_3ErrorWrongCrc: Iso15693_3Error = Iso15693_3Error(5);
20357pub const Iso15693_3ErrorTimeout: Iso15693_3Error = Iso15693_3Error(6);
20358pub const Iso15693_3ErrorFormat: Iso15693_3Error = Iso15693_3Error(7);
20359pub const Iso15693_3ErrorIgnore: Iso15693_3Error = Iso15693_3Error(8);
20360pub const Iso15693_3ErrorNotSupported: Iso15693_3Error = Iso15693_3Error(9);
20361pub const Iso15693_3ErrorUidMismatch: Iso15693_3Error = Iso15693_3Error(10);
20362pub const Iso15693_3ErrorFullyHandled: Iso15693_3Error = Iso15693_3Error(11);
20363pub const Iso15693_3ErrorUnexpectedResponse: Iso15693_3Error = Iso15693_3Error(12);
20364pub const Iso15693_3ErrorInternal: Iso15693_3Error = Iso15693_3Error(13);
20365pub const Iso15693_3ErrorCustom: Iso15693_3Error = Iso15693_3Error(14);
20366pub const Iso15693_3ErrorUnknown: Iso15693_3Error = Iso15693_3Error(15);
20367#[repr(transparent)]
20368#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20369pub struct Iso15693_3Error(pub core::ffi::c_uchar);
20370#[repr(C)]
20371#[derive(Debug, Copy, Clone)]
20372pub struct Iso15693_3SystemInfo {
20373 pub flags: u8,
20374 pub dsfid: u8,
20375 pub afi: u8,
20376 pub ic_ref: u8,
20377 pub block_count: u16,
20378 pub block_size: u8,
20379}
20380#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20381const _: () = {
20382 ["Size of Iso15693_3SystemInfo"][::core::mem::size_of::<Iso15693_3SystemInfo>() - 8usize];
20383 ["Alignment of Iso15693_3SystemInfo"][::core::mem::align_of::<Iso15693_3SystemInfo>() - 2usize];
20384 ["Offset of field: Iso15693_3SystemInfo::flags"]
20385 [::core::mem::offset_of!(Iso15693_3SystemInfo, flags) - 0usize];
20386 ["Offset of field: Iso15693_3SystemInfo::dsfid"]
20387 [::core::mem::offset_of!(Iso15693_3SystemInfo, dsfid) - 1usize];
20388 ["Offset of field: Iso15693_3SystemInfo::afi"]
20389 [::core::mem::offset_of!(Iso15693_3SystemInfo, afi) - 2usize];
20390 ["Offset of field: Iso15693_3SystemInfo::ic_ref"]
20391 [::core::mem::offset_of!(Iso15693_3SystemInfo, ic_ref) - 3usize];
20392 ["Offset of field: Iso15693_3SystemInfo::block_count"]
20393 [::core::mem::offset_of!(Iso15693_3SystemInfo, block_count) - 4usize];
20394 ["Offset of field: Iso15693_3SystemInfo::block_size"]
20395 [::core::mem::offset_of!(Iso15693_3SystemInfo, block_size) - 6usize];
20396};
20397#[repr(C)]
20398#[derive(Debug, Copy, Clone)]
20399pub struct Iso15693_3LockBits {
20400 pub dsfid: bool,
20401 pub afi: bool,
20402}
20403#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20404const _: () = {
20405 ["Size of Iso15693_3LockBits"][::core::mem::size_of::<Iso15693_3LockBits>() - 2usize];
20406 ["Alignment of Iso15693_3LockBits"][::core::mem::align_of::<Iso15693_3LockBits>() - 1usize];
20407 ["Offset of field: Iso15693_3LockBits::dsfid"]
20408 [::core::mem::offset_of!(Iso15693_3LockBits, dsfid) - 0usize];
20409 ["Offset of field: Iso15693_3LockBits::afi"]
20410 [::core::mem::offset_of!(Iso15693_3LockBits, afi) - 1usize];
20411};
20412#[repr(C)]
20413#[derive(Debug, Copy, Clone)]
20414pub struct Iso15693_3Settings {
20415 pub lock_bits: Iso15693_3LockBits,
20416}
20417#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20418const _: () = {
20419 ["Size of Iso15693_3Settings"][::core::mem::size_of::<Iso15693_3Settings>() - 2usize];
20420 ["Alignment of Iso15693_3Settings"][::core::mem::align_of::<Iso15693_3Settings>() - 1usize];
20421 ["Offset of field: Iso15693_3Settings::lock_bits"]
20422 [::core::mem::offset_of!(Iso15693_3Settings, lock_bits) - 0usize];
20423};
20424#[repr(C)]
20425#[derive(Debug, Copy, Clone)]
20426pub struct Iso15693_3Data {
20427 pub uid: [u8; 8usize],
20428 pub system_info: Iso15693_3SystemInfo,
20429 pub settings: Iso15693_3Settings,
20430 pub block_data: *mut SimpleArray,
20431 pub block_security: *mut SimpleArray,
20432}
20433#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20434const _: () = {
20435 ["Size of Iso15693_3Data"][::core::mem::size_of::<Iso15693_3Data>() - 28usize];
20436 ["Alignment of Iso15693_3Data"][::core::mem::align_of::<Iso15693_3Data>() - 4usize];
20437 ["Offset of field: Iso15693_3Data::uid"][::core::mem::offset_of!(Iso15693_3Data, uid) - 0usize];
20438 ["Offset of field: Iso15693_3Data::system_info"]
20439 [::core::mem::offset_of!(Iso15693_3Data, system_info) - 8usize];
20440 ["Offset of field: Iso15693_3Data::settings"]
20441 [::core::mem::offset_of!(Iso15693_3Data, settings) - 16usize];
20442 ["Offset of field: Iso15693_3Data::block_data"]
20443 [::core::mem::offset_of!(Iso15693_3Data, block_data) - 20usize];
20444 ["Offset of field: Iso15693_3Data::block_security"]
20445 [::core::mem::offset_of!(Iso15693_3Data, block_security) - 24usize];
20446};
20447unsafe extern "C" {
20448 pub fn iso15693_3_alloc() -> *mut Iso15693_3Data;
20449}
20450unsafe extern "C" {
20451 pub fn iso15693_3_free(data: *mut Iso15693_3Data);
20452}
20453unsafe extern "C" {
20454 pub fn iso15693_3_reset(data: *mut Iso15693_3Data);
20455}
20456unsafe extern "C" {
20457 pub fn iso15693_3_copy(data: *mut Iso15693_3Data, other: *const Iso15693_3Data);
20458}
20459unsafe extern "C" {
20460 pub fn iso15693_3_verify(data: *mut Iso15693_3Data, device_type: *const FuriString) -> bool;
20461}
20462unsafe extern "C" {
20463 pub fn iso15693_3_load(data: *mut Iso15693_3Data, ff: *mut FlipperFormat, version: u32)
20464 -> bool;
20465}
20466unsafe extern "C" {
20467 pub fn iso15693_3_save(data: *const Iso15693_3Data, ff: *mut FlipperFormat) -> bool;
20468}
20469unsafe extern "C" {
20470 pub fn iso15693_3_is_equal(data: *const Iso15693_3Data, other: *const Iso15693_3Data) -> bool;
20471}
20472unsafe extern "C" {
20473 pub fn iso15693_3_get_device_name(
20474 data: *const Iso15693_3Data,
20475 name_type: NfcDeviceNameType,
20476 ) -> *const core::ffi::c_char;
20477}
20478unsafe extern "C" {
20479 pub fn iso15693_3_get_uid(data: *const Iso15693_3Data, uid_len: *mut usize) -> *const u8;
20480}
20481unsafe extern "C" {
20482 pub fn iso15693_3_set_uid(data: *mut Iso15693_3Data, uid: *const u8, uid_len: usize) -> bool;
20483}
20484unsafe extern "C" {
20485 pub fn iso15693_3_get_base_data(data: *const Iso15693_3Data) -> *mut Iso15693_3Data;
20486}
20487unsafe extern "C" {
20488 pub fn iso15693_3_is_block_locked(data: *const Iso15693_3Data, block_index: u8) -> bool;
20489}
20490unsafe extern "C" {
20491 pub fn iso15693_3_get_manufacturer_id(data: *const Iso15693_3Data) -> u8;
20492}
20493unsafe extern "C" {
20494 pub fn iso15693_3_get_block_count(data: *const Iso15693_3Data) -> u16;
20495}
20496unsafe extern "C" {
20497 pub fn iso15693_3_get_block_size(data: *const Iso15693_3Data) -> u8;
20498}
20499unsafe extern "C" {
20500 pub fn iso15693_3_get_block_data(data: *const Iso15693_3Data, block_index: u8) -> *const u8;
20501}
20502#[repr(C)]
20503#[derive(Debug, Copy, Clone)]
20504pub struct Iso15693_3Poller {
20505 _unused: [u8; 0],
20506}
20507#[doc = "< An error occured during activation procedure."]
20508pub const Iso15693_3PollerEventTypeError: Iso15693_3PollerEventType = Iso15693_3PollerEventType(0);
20509#[doc = "< The card was activated by the poller."]
20510pub const Iso15693_3PollerEventTypeReady: Iso15693_3PollerEventType = Iso15693_3PollerEventType(1);
20511#[repr(transparent)]
20512#[doc = "Enumeration of possible Iso15693_3 poller event types."]
20513#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20514pub struct Iso15693_3PollerEventType(pub core::ffi::c_uchar);
20515#[doc = "Iso15693_3 poller event data."]
20516#[repr(C)]
20517#[derive(Copy, Clone)]
20518pub union Iso15693_3PollerEventData {
20519 #[doc = "< Error code indicating card activation fail reason."]
20520 pub error: Iso15693_3Error,
20521}
20522#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20523const _: () = {
20524 ["Size of Iso15693_3PollerEventData"]
20525 [::core::mem::size_of::<Iso15693_3PollerEventData>() - 1usize];
20526 ["Alignment of Iso15693_3PollerEventData"]
20527 [::core::mem::align_of::<Iso15693_3PollerEventData>() - 1usize];
20528 ["Offset of field: Iso15693_3PollerEventData::error"]
20529 [::core::mem::offset_of!(Iso15693_3PollerEventData, error) - 0usize];
20530};
20531#[doc = "Iso15693_3 poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
20532#[repr(C)]
20533#[derive(Debug, Copy, Clone)]
20534pub struct Iso15693_3PollerEvent {
20535 #[doc = "< Type of emmitted event."]
20536 pub type_: Iso15693_3PollerEventType,
20537 #[doc = "< Pointer to event specific data."]
20538 pub data: *mut Iso15693_3PollerEventData,
20539}
20540#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20541const _: () = {
20542 ["Size of Iso15693_3PollerEvent"][::core::mem::size_of::<Iso15693_3PollerEvent>() - 8usize];
20543 ["Alignment of Iso15693_3PollerEvent"]
20544 [::core::mem::align_of::<Iso15693_3PollerEvent>() - 4usize];
20545 ["Offset of field: Iso15693_3PollerEvent::type_"]
20546 [::core::mem::offset_of!(Iso15693_3PollerEvent, type_) - 0usize];
20547 ["Offset of field: Iso15693_3PollerEvent::data"]
20548 [::core::mem::offset_of!(Iso15693_3PollerEvent, data) - 4usize];
20549};
20550unsafe extern "C" {
20551 #[doc = "Transmit and receive Iso15693_3 frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20552 pub fn iso15693_3_poller_send_frame(
20553 instance: *mut Iso15693_3Poller,
20554 tx_buffer: *const BitBuffer,
20555 rx_buffer: *mut BitBuffer,
20556 fwt: u32,
20557 ) -> Iso15693_3Error;
20558}
20559unsafe extern "C" {
20560 #[doc = "Perform activation procedure.\n\n Must ONLY be used inside the callback function.\n\n Perfoms the activation procedure as defined in Iso15693_3. The data\n field will be filled with Iso15693_3Data data on success.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the Iso15693_3 data structure to be filled.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20561 pub fn iso15693_3_poller_activate(
20562 instance: *mut Iso15693_3Poller,
20563 data: *mut Iso15693_3Data,
20564 ) -> Iso15693_3Error;
20565}
20566unsafe extern "C" {
20567 #[doc = "Send invertory command and parse response.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `uid` (direction out) - pointer to the buffer to be filled with the UID.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20568 pub fn iso15693_3_poller_inventory(
20569 instance: *mut Iso15693_3Poller,
20570 uid: *mut u8,
20571 ) -> Iso15693_3Error;
20572}
20573unsafe extern "C" {
20574 #[doc = "Send get system info command and parse response.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the Iso15693_3SystemInfo structure to be filled.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20575 pub fn iso15693_3_poller_get_system_info(
20576 instance: *mut Iso15693_3Poller,
20577 data: *mut Iso15693_3SystemInfo,
20578 ) -> Iso15693_3Error;
20579}
20580unsafe extern "C" {
20581 #[doc = "Read Iso15693_3 block.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the buffer to be filled with the block data.\n * `block_number` (direction in) - block number to be read.\n * `block_size` (direction in) - size of the block to be read.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20582 pub fn iso15693_3_poller_read_block(
20583 instance: *mut Iso15693_3Poller,
20584 data: *mut u8,
20585 block_number: u8,
20586 block_size: u8,
20587 ) -> Iso15693_3Error;
20588}
20589unsafe extern "C" {
20590 #[doc = "Read multiple Iso15693_3 blocks.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the buffer to be filled with the block data.\n * `block_count` (direction in) - number of blocks to be read.\n * `block_size` (direction in) - size of the blocks to be read.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20591 pub fn iso15693_3_poller_read_blocks(
20592 instance: *mut Iso15693_3Poller,
20593 data: *mut u8,
20594 block_count: u16,
20595 block_size: u8,
20596 ) -> Iso15693_3Error;
20597}
20598unsafe extern "C" {
20599 #[doc = "Get Iso15693_3 block security status.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the buffer to be filled with the block security status.\n * `block_count` (direction in) - block security number to be read.\n # Returns\n\nIso15693_3ErrorNone on success, an error code on failure."]
20600 pub fn iso15693_3_poller_get_blocks_security(
20601 instance: *mut Iso15693_3Poller,
20602 data: *mut u8,
20603 block_count: u16,
20604 ) -> Iso15693_3Error;
20605}
20606#[repr(C)]
20607#[derive(Debug, Copy, Clone)]
20608pub struct MfClassicListener {
20609 _unused: [u8; 0],
20610}
20611pub const MfClassicListenerEventTypeAuthContextPartCollected: MfClassicListenerEventType =
20612 MfClassicListenerEventType(0);
20613pub const MfClassicListenerEventTypeAuthContextFullCollected: MfClassicListenerEventType =
20614 MfClassicListenerEventType(1);
20615#[repr(transparent)]
20616#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20617pub struct MfClassicListenerEventType(pub core::ffi::c_uchar);
20618#[repr(C)]
20619#[derive(Copy, Clone)]
20620pub union MfClassicListenerEventData {
20621 pub auth_context: MfClassicAuthContext,
20622}
20623#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20624const _: () = {
20625 ["Size of MfClassicListenerEventData"]
20626 [::core::mem::size_of::<MfClassicListenerEventData>() - 24usize];
20627 ["Alignment of MfClassicListenerEventData"]
20628 [::core::mem::align_of::<MfClassicListenerEventData>() - 1usize];
20629 ["Offset of field: MfClassicListenerEventData::auth_context"]
20630 [::core::mem::offset_of!(MfClassicListenerEventData, auth_context) - 0usize];
20631};
20632#[repr(C)]
20633#[derive(Debug, Copy, Clone)]
20634pub struct MfClassicListenerEvent {
20635 pub type_: MfClassicListenerEventType,
20636 pub data: *mut MfClassicListenerEventData,
20637}
20638#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20639const _: () = {
20640 ["Size of MfClassicListenerEvent"][::core::mem::size_of::<MfClassicListenerEvent>() - 8usize];
20641 ["Alignment of MfClassicListenerEvent"]
20642 [::core::mem::align_of::<MfClassicListenerEvent>() - 4usize];
20643 ["Offset of field: MfClassicListenerEvent::type_"]
20644 [::core::mem::offset_of!(MfClassicListenerEvent, type_) - 0usize];
20645 ["Offset of field: MfClassicListenerEvent::data"]
20646 [::core::mem::offset_of!(MfClassicListenerEvent, data) - 4usize];
20647};
20648#[repr(C)]
20649#[derive(Debug, Copy, Clone)]
20650pub struct MfClassicPoller {
20651 _unused: [u8; 0],
20652}
20653#[doc = "< Poller requests to fill the mode."]
20654pub const MfClassicPollerEventTypeRequestMode: MfClassicPollerEventType =
20655 MfClassicPollerEventType(0);
20656#[doc = "< Poller requests data to read sector."]
20657pub const MfClassicPollerEventTypeRequestReadSector: MfClassicPollerEventType =
20658 MfClassicPollerEventType(1);
20659#[doc = "< Poller requests sector trailer for writing block."]
20660pub const MfClassicPollerEventTypeRequestSectorTrailer: MfClassicPollerEventType =
20661 MfClassicPollerEventType(2);
20662#[doc = "< Poller requests data to write block."]
20663pub const MfClassicPollerEventTypeRequestWriteBlock: MfClassicPollerEventType =
20664 MfClassicPollerEventType(3);
20665#[doc = "< Poller requests key for sector authentication."]
20666pub const MfClassicPollerEventTypeRequestKey: MfClassicPollerEventType =
20667 MfClassicPollerEventType(4);
20668#[doc = "< Poller switches to next sector during dictionary attack."]
20669pub const MfClassicPollerEventTypeNextSector: MfClassicPollerEventType =
20670 MfClassicPollerEventType(5);
20671#[doc = "< Poller updates data."]
20672pub const MfClassicPollerEventTypeDataUpdate: MfClassicPollerEventType =
20673 MfClassicPollerEventType(6);
20674#[doc = "< Poller found key A."]
20675pub const MfClassicPollerEventTypeFoundKeyA: MfClassicPollerEventType = MfClassicPollerEventType(7);
20676#[doc = "< Poller found key B."]
20677pub const MfClassicPollerEventTypeFoundKeyB: MfClassicPollerEventType = MfClassicPollerEventType(8);
20678#[doc = "< Poller starts key attack."]
20679pub const MfClassicPollerEventTypeKeyAttackStart: MfClassicPollerEventType =
20680 MfClassicPollerEventType(9);
20681#[doc = "< Poller stops key attack."]
20682pub const MfClassicPollerEventTypeKeyAttackStop: MfClassicPollerEventType =
20683 MfClassicPollerEventType(10);
20684#[doc = "< Poller switches to next sector during key attack."]
20685pub const MfClassicPollerEventTypeKeyAttackNextSector: MfClassicPollerEventType =
20686 MfClassicPollerEventType(11);
20687#[doc = "< Poller detected card."]
20688pub const MfClassicPollerEventTypeCardDetected: MfClassicPollerEventType =
20689 MfClassicPollerEventType(12);
20690#[doc = "< Poller lost card."]
20691pub const MfClassicPollerEventTypeCardLost: MfClassicPollerEventType = MfClassicPollerEventType(13);
20692#[doc = "< Poller succeeded."]
20693pub const MfClassicPollerEventTypeSuccess: MfClassicPollerEventType = MfClassicPollerEventType(14);
20694#[doc = "< Poller failed."]
20695pub const MfClassicPollerEventTypeFail: MfClassicPollerEventType = MfClassicPollerEventType(15);
20696#[repr(transparent)]
20697#[doc = "Enumeration of possible MfClassic poller event types."]
20698#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20699pub struct MfClassicPollerEventType(pub core::ffi::c_uchar);
20700#[doc = "< Poller reading mode."]
20701pub const MfClassicPollerModeRead: MfClassicPollerMode = MfClassicPollerMode(0);
20702#[doc = "< Poller writing mode."]
20703pub const MfClassicPollerModeWrite: MfClassicPollerMode = MfClassicPollerMode(1);
20704#[doc = "< Poller dictionary attack mode."]
20705pub const MfClassicPollerModeDictAttackStandard: MfClassicPollerMode = MfClassicPollerMode(2);
20706#[doc = "< Poller enhanced dictionary attack mode."]
20707pub const MfClassicPollerModeDictAttackEnhanced: MfClassicPollerMode = MfClassicPollerMode(3);
20708#[repr(transparent)]
20709#[doc = "MfClassic poller mode."]
20710#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20711pub struct MfClassicPollerMode(pub core::ffi::c_uchar);
20712#[doc = "< No nested attack has taken place yet."]
20713pub const MfClassicNestedPhaseNone: MfClassicNestedPhase = MfClassicNestedPhase(0);
20714#[doc = "< Analyze nonces produced by the PRNG to determine if they fit a weak PRNG"]
20715pub const MfClassicNestedPhaseAnalyzePRNG: MfClassicNestedPhase = MfClassicNestedPhase(1);
20716#[doc = "< Search keys which match the expected PRNG properties and parity for collected nonces"]
20717pub const MfClassicNestedPhaseDictAttack: MfClassicNestedPhase = MfClassicNestedPhase(2);
20718#[doc = "< Verify candidate keys by authenticating to the sector with the key"]
20719pub const MfClassicNestedPhaseDictAttackVerify: MfClassicNestedPhase = MfClassicNestedPhase(3);
20720#[doc = "< Resume nested dictionary attack from the last tested (invalid) key"]
20721pub const MfClassicNestedPhaseDictAttackResume: MfClassicNestedPhase = MfClassicNestedPhase(4);
20722#[doc = "< Perform necessary calculations to recover the plaintext nonce during later collection phase (weak PRNG tags only)"]
20723pub const MfClassicNestedPhaseCalibrate: MfClassicNestedPhase = MfClassicNestedPhase(5);
20724#[doc = "< Collect the next plaintext static encrypted nonce for backdoor static encrypted nonce nested attack"]
20725pub const MfClassicNestedPhaseRecalibrate: MfClassicNestedPhase = MfClassicNestedPhase(6);
20726#[doc = "< Log nonces collected during nested authentication for key recovery"]
20727pub const MfClassicNestedPhaseCollectNtEnc: MfClassicNestedPhase = MfClassicNestedPhase(7);
20728#[doc = "< Nested attack has finished"]
20729pub const MfClassicNestedPhaseFinished: MfClassicNestedPhase = MfClassicNestedPhase(8);
20730#[repr(transparent)]
20731#[doc = "MfClassic poller nested attack phase."]
20732#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20733pub struct MfClassicNestedPhase(pub core::ffi::c_uchar);
20734pub const MfClassicPrngTypeUnknown: MfClassicPrngType = MfClassicPrngType(0);
20735pub const MfClassicPrngTypeNoTag: MfClassicPrngType = MfClassicPrngType(1);
20736pub const MfClassicPrngTypeWeak: MfClassicPrngType = MfClassicPrngType(2);
20737pub const MfClassicPrngTypeHard: MfClassicPrngType = MfClassicPrngType(3);
20738#[repr(transparent)]
20739#[doc = "MfClassic pseudorandom number generator (PRNG) type."]
20740#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20741pub struct MfClassicPrngType(pub core::ffi::c_uchar);
20742pub const MfClassicBackdoorUnknown: MfClassicBackdoor = MfClassicBackdoor(0);
20743pub const MfClassicBackdoorNone: MfClassicBackdoor = MfClassicBackdoor(1);
20744pub const MfClassicBackdoorAuth1: MfClassicBackdoor = MfClassicBackdoor(2);
20745pub const MfClassicBackdoorAuth2: MfClassicBackdoor = MfClassicBackdoor(3);
20746pub const MfClassicBackdoorAuth3: MfClassicBackdoor = MfClassicBackdoor(4);
20747#[repr(transparent)]
20748#[doc = "MfClassic authentication backdoor type."]
20749#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20750pub struct MfClassicBackdoor(pub core::ffi::c_uchar);
20751#[doc = "MfClassic poller request mode event data.\n\n This instance of this structure must be filled on MfClassicPollerEventTypeRequestMode event."]
20752#[repr(C)]
20753#[derive(Debug, Copy, Clone)]
20754pub struct MfClassicPollerEventDataRequestMode {
20755 #[doc = "< Mode to be used by poller."]
20756 pub mode: MfClassicPollerMode,
20757 #[doc = "< Data to be used by poller."]
20758 pub data: *const MfClassicData,
20759}
20760#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20761const _: () = {
20762 ["Size of MfClassicPollerEventDataRequestMode"]
20763 [::core::mem::size_of::<MfClassicPollerEventDataRequestMode>() - 8usize];
20764 ["Alignment of MfClassicPollerEventDataRequestMode"]
20765 [::core::mem::align_of::<MfClassicPollerEventDataRequestMode>() - 4usize];
20766 ["Offset of field: MfClassicPollerEventDataRequestMode::mode"]
20767 [::core::mem::offset_of!(MfClassicPollerEventDataRequestMode, mode) - 0usize];
20768 ["Offset of field: MfClassicPollerEventDataRequestMode::data"]
20769 [::core::mem::offset_of!(MfClassicPollerEventDataRequestMode, data) - 4usize];
20770};
20771#[doc = "MfClassic poller next sector event data.\n\n The instance of this structure is filled by poller and passed with\n MfClassicPollerEventTypeNextSector event."]
20772#[repr(C)]
20773#[derive(Debug, Copy, Clone)]
20774pub struct MfClassicPollerEventDataDictAttackNextSector {
20775 #[doc = "< Current sector number."]
20776 pub current_sector: u8,
20777}
20778#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20779const _: () = {
20780 ["Size of MfClassicPollerEventDataDictAttackNextSector"]
20781 [::core::mem::size_of::<MfClassicPollerEventDataDictAttackNextSector>() - 1usize];
20782 ["Alignment of MfClassicPollerEventDataDictAttackNextSector"]
20783 [::core::mem::align_of::<MfClassicPollerEventDataDictAttackNextSector>() - 1usize];
20784 ["Offset of field: MfClassicPollerEventDataDictAttackNextSector::current_sector"][::core::mem::offset_of!(
20785 MfClassicPollerEventDataDictAttackNextSector,
20786 current_sector
20787 ) - 0usize];
20788};
20789#[doc = "MfClassic poller update event data.\n\n The instance of this structure is filled by poller and passed with\n MfClassicPollerEventTypeDataUpdate event."]
20790#[repr(C)]
20791#[derive(Debug, Copy, Clone)]
20792pub struct MfClassicPollerEventDataUpdate {
20793 #[doc = "< Number of sectors read."]
20794 pub sectors_read: u8,
20795 #[doc = "< Number of keys found."]
20796 pub keys_found: u8,
20797 #[doc = "< Current sector number."]
20798 pub current_sector: u8,
20799 #[doc = "< Nested attack phase."]
20800 pub nested_phase: MfClassicNestedPhase,
20801 #[doc = "< PRNG (weak or hard)."]
20802 pub prng_type: MfClassicPrngType,
20803 #[doc = "< Backdoor type."]
20804 pub backdoor: MfClassicBackdoor,
20805 #[doc = "< Target key for nested attack."]
20806 pub nested_target_key: u16,
20807 #[doc = "< Number of unique most significant bytes seen during Hardnested attack."]
20808 pub msb_count: u16,
20809}
20810#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20811const _: () = {
20812 ["Size of MfClassicPollerEventDataUpdate"]
20813 [::core::mem::size_of::<MfClassicPollerEventDataUpdate>() - 10usize];
20814 ["Alignment of MfClassicPollerEventDataUpdate"]
20815 [::core::mem::align_of::<MfClassicPollerEventDataUpdate>() - 2usize];
20816 ["Offset of field: MfClassicPollerEventDataUpdate::sectors_read"]
20817 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, sectors_read) - 0usize];
20818 ["Offset of field: MfClassicPollerEventDataUpdate::keys_found"]
20819 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, keys_found) - 1usize];
20820 ["Offset of field: MfClassicPollerEventDataUpdate::current_sector"]
20821 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, current_sector) - 2usize];
20822 ["Offset of field: MfClassicPollerEventDataUpdate::nested_phase"]
20823 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, nested_phase) - 3usize];
20824 ["Offset of field: MfClassicPollerEventDataUpdate::prng_type"]
20825 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, prng_type) - 4usize];
20826 ["Offset of field: MfClassicPollerEventDataUpdate::backdoor"]
20827 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, backdoor) - 5usize];
20828 ["Offset of field: MfClassicPollerEventDataUpdate::nested_target_key"]
20829 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, nested_target_key) - 6usize];
20830 ["Offset of field: MfClassicPollerEventDataUpdate::msb_count"]
20831 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, msb_count) - 8usize];
20832};
20833#[doc = "MfClassic poller key request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestKey event."]
20834#[repr(C)]
20835#[derive(Debug, Copy, Clone)]
20836pub struct MfClassicPollerEventDataKeyRequest {
20837 #[doc = "< Key to be used by poller."]
20838 pub key: MfClassicKey,
20839 #[doc = "< Flag indicating if key is provided."]
20840 pub key_provided: bool,
20841}
20842#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20843const _: () = {
20844 ["Size of MfClassicPollerEventDataKeyRequest"]
20845 [::core::mem::size_of::<MfClassicPollerEventDataKeyRequest>() - 7usize];
20846 ["Alignment of MfClassicPollerEventDataKeyRequest"]
20847 [::core::mem::align_of::<MfClassicPollerEventDataKeyRequest>() - 1usize];
20848 ["Offset of field: MfClassicPollerEventDataKeyRequest::key"]
20849 [::core::mem::offset_of!(MfClassicPollerEventDataKeyRequest, key) - 0usize];
20850 ["Offset of field: MfClassicPollerEventDataKeyRequest::key_provided"]
20851 [::core::mem::offset_of!(MfClassicPollerEventDataKeyRequest, key_provided) - 6usize];
20852};
20853#[doc = "MfClassic poller read sector request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestReadSector event."]
20854#[repr(C)]
20855#[derive(Debug, Copy, Clone)]
20856pub struct MfClassicPollerEventDataReadSectorRequest {
20857 #[doc = "< Sector number to be read."]
20858 pub sector_num: u8,
20859 #[doc = "< Key to be used by poller."]
20860 pub key: MfClassicKey,
20861 #[doc = "< Key type to be used by poller."]
20862 pub key_type: MfClassicKeyType,
20863 #[doc = "< Flag indicating if key is provided."]
20864 pub key_provided: bool,
20865}
20866#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20867const _: () = {
20868 ["Size of MfClassicPollerEventDataReadSectorRequest"]
20869 [::core::mem::size_of::<MfClassicPollerEventDataReadSectorRequest>() - 9usize];
20870 ["Alignment of MfClassicPollerEventDataReadSectorRequest"]
20871 [::core::mem::align_of::<MfClassicPollerEventDataReadSectorRequest>() - 1usize];
20872 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::sector_num"]
20873 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, sector_num) - 0usize];
20874 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::key"]
20875 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, key) - 1usize];
20876 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::key_type"]
20877 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, key_type) - 7usize];
20878 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::key_provided"]
20879 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, key_provided) - 8usize];
20880};
20881#[doc = "MfClassic poller sector trailer request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestSectorTrailer event."]
20882#[repr(C)]
20883#[derive(Debug, Copy, Clone)]
20884pub struct MfClassicPollerEventDataSectorTrailerRequest {
20885 #[doc = "< Sector number to be read."]
20886 pub sector_num: u8,
20887 #[doc = "< Sector trailer to be used by poller."]
20888 pub sector_trailer: MfClassicBlock,
20889 #[doc = "< Flag indicating if sector trailer is provided."]
20890 pub sector_trailer_provided: bool,
20891}
20892#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20893const _: () = {
20894 ["Size of MfClassicPollerEventDataSectorTrailerRequest"]
20895 [::core::mem::size_of::<MfClassicPollerEventDataSectorTrailerRequest>() - 18usize];
20896 ["Alignment of MfClassicPollerEventDataSectorTrailerRequest"]
20897 [::core::mem::align_of::<MfClassicPollerEventDataSectorTrailerRequest>() - 1usize];
20898 ["Offset of field: MfClassicPollerEventDataSectorTrailerRequest::sector_num"][::core::mem::offset_of!(
20899 MfClassicPollerEventDataSectorTrailerRequest,
20900 sector_num
20901 ) - 0usize];
20902 ["Offset of field: MfClassicPollerEventDataSectorTrailerRequest::sector_trailer"][::core::mem::offset_of!(
20903 MfClassicPollerEventDataSectorTrailerRequest,
20904 sector_trailer
20905 ) - 1usize];
20906 ["Offset of field: MfClassicPollerEventDataSectorTrailerRequest::sector_trailer_provided"][::core::mem::offset_of!(
20907 MfClassicPollerEventDataSectorTrailerRequest,
20908 sector_trailer_provided
20909 )
20910 - 17usize];
20911};
20912#[doc = "MfClassic poller write block request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestWriteBlock event."]
20913#[repr(C)]
20914#[derive(Debug, Copy, Clone)]
20915pub struct MfClassicPollerEventDataWriteBlockRequest {
20916 #[doc = "< Block number to be written."]
20917 pub block_num: u8,
20918 #[doc = "< Block to be written."]
20919 pub write_block: MfClassicBlock,
20920 #[doc = "< Flag indicating if block is provided."]
20921 pub write_block_provided: bool,
20922}
20923#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20924const _: () = {
20925 ["Size of MfClassicPollerEventDataWriteBlockRequest"]
20926 [::core::mem::size_of::<MfClassicPollerEventDataWriteBlockRequest>() - 18usize];
20927 ["Alignment of MfClassicPollerEventDataWriteBlockRequest"]
20928 [::core::mem::align_of::<MfClassicPollerEventDataWriteBlockRequest>() - 1usize];
20929 ["Offset of field: MfClassicPollerEventDataWriteBlockRequest::block_num"]
20930 [::core::mem::offset_of!(MfClassicPollerEventDataWriteBlockRequest, block_num) - 0usize];
20931 ["Offset of field: MfClassicPollerEventDataWriteBlockRequest::write_block"]
20932 [::core::mem::offset_of!(MfClassicPollerEventDataWriteBlockRequest, write_block) - 1usize];
20933 ["Offset of field: MfClassicPollerEventDataWriteBlockRequest::write_block_provided"][::core::mem::offset_of!(
20934 MfClassicPollerEventDataWriteBlockRequest,
20935 write_block_provided
20936 )
20937 - 17usize];
20938};
20939#[doc = "MfClassic poller key attack event data.\n\n The instance of this structure is filled by poller and passed with\n MfClassicPollerEventTypeKeyAttackNextSector event."]
20940#[repr(C)]
20941#[derive(Debug, Copy, Clone)]
20942pub struct MfClassicPollerEventKeyAttackData {
20943 #[doc = "< Current sector number."]
20944 pub current_sector: u8,
20945}
20946#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20947const _: () = {
20948 ["Size of MfClassicPollerEventKeyAttackData"]
20949 [::core::mem::size_of::<MfClassicPollerEventKeyAttackData>() - 1usize];
20950 ["Alignment of MfClassicPollerEventKeyAttackData"]
20951 [::core::mem::align_of::<MfClassicPollerEventKeyAttackData>() - 1usize];
20952 ["Offset of field: MfClassicPollerEventKeyAttackData::current_sector"]
20953 [::core::mem::offset_of!(MfClassicPollerEventKeyAttackData, current_sector) - 0usize];
20954};
20955#[doc = "MfClassic poller event data."]
20956#[repr(C)]
20957#[derive(Copy, Clone)]
20958pub union MfClassicPollerEventData {
20959 #[doc = "< Error code on MfClassicPollerEventTypeFail event."]
20960 pub error: MfClassicError,
20961 #[doc = "< Poller mode context."]
20962 pub poller_mode: MfClassicPollerEventDataRequestMode,
20963 #[doc = "< Next sector context."]
20964 pub next_sector_data: MfClassicPollerEventDataDictAttackNextSector,
20965 #[doc = "< Key request context."]
20966 pub key_request_data: MfClassicPollerEventDataKeyRequest,
20967 #[doc = "< Data update context."]
20968 pub data_update: MfClassicPollerEventDataUpdate,
20969 #[doc = "< Read sector request context."]
20970 pub read_sector_request_data: MfClassicPollerEventDataReadSectorRequest,
20971 #[doc = "< Key attack context."]
20972 pub key_attack_data: MfClassicPollerEventKeyAttackData,
20973 #[doc = "< Sector trailer request context."]
20974 pub sec_tr_data: MfClassicPollerEventDataSectorTrailerRequest,
20975 #[doc = "< Write block request context."]
20976 pub write_block_data: MfClassicPollerEventDataWriteBlockRequest,
20977}
20978#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20979const _: () = {
20980 ["Size of MfClassicPollerEventData"]
20981 [::core::mem::size_of::<MfClassicPollerEventData>() - 20usize];
20982 ["Alignment of MfClassicPollerEventData"]
20983 [::core::mem::align_of::<MfClassicPollerEventData>() - 4usize];
20984 ["Offset of field: MfClassicPollerEventData::error"]
20985 [::core::mem::offset_of!(MfClassicPollerEventData, error) - 0usize];
20986 ["Offset of field: MfClassicPollerEventData::poller_mode"]
20987 [::core::mem::offset_of!(MfClassicPollerEventData, poller_mode) - 0usize];
20988 ["Offset of field: MfClassicPollerEventData::next_sector_data"]
20989 [::core::mem::offset_of!(MfClassicPollerEventData, next_sector_data) - 0usize];
20990 ["Offset of field: MfClassicPollerEventData::key_request_data"]
20991 [::core::mem::offset_of!(MfClassicPollerEventData, key_request_data) - 0usize];
20992 ["Offset of field: MfClassicPollerEventData::data_update"]
20993 [::core::mem::offset_of!(MfClassicPollerEventData, data_update) - 0usize];
20994 ["Offset of field: MfClassicPollerEventData::read_sector_request_data"]
20995 [::core::mem::offset_of!(MfClassicPollerEventData, read_sector_request_data) - 0usize];
20996 ["Offset of field: MfClassicPollerEventData::key_attack_data"]
20997 [::core::mem::offset_of!(MfClassicPollerEventData, key_attack_data) - 0usize];
20998 ["Offset of field: MfClassicPollerEventData::sec_tr_data"]
20999 [::core::mem::offset_of!(MfClassicPollerEventData, sec_tr_data) - 0usize];
21000 ["Offset of field: MfClassicPollerEventData::write_block_data"]
21001 [::core::mem::offset_of!(MfClassicPollerEventData, write_block_data) - 0usize];
21002};
21003#[doc = "MfClassic poller event.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
21004#[repr(C)]
21005#[derive(Debug, Copy, Clone)]
21006pub struct MfClassicPollerEvent {
21007 #[doc = "< Event type."]
21008 pub type_: MfClassicPollerEventType,
21009 #[doc = "< Pointer to event specific data."]
21010 pub data: *mut MfClassicPollerEventData,
21011}
21012#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21013const _: () = {
21014 ["Size of MfClassicPollerEvent"][::core::mem::size_of::<MfClassicPollerEvent>() - 8usize];
21015 ["Alignment of MfClassicPollerEvent"][::core::mem::align_of::<MfClassicPollerEvent>() - 4usize];
21016 ["Offset of field: MfClassicPollerEvent::type_"]
21017 [::core::mem::offset_of!(MfClassicPollerEvent, type_) - 0usize];
21018 ["Offset of field: MfClassicPollerEvent::data"]
21019 [::core::mem::offset_of!(MfClassicPollerEvent, data) - 4usize];
21020};
21021unsafe extern "C" {
21022 #[doc = "Collect tag nonce during authentication.\n\n Must ONLY be used inside the callback function.\n\n Starts authentication procedure and collects tag nonce.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number for authentication.\n * `key_type` (direction in) - key type to be used for authentication.\n * `nt` (direction out) - pointer to the MfClassicNt structure to be filled with nonce data.\n * `backdoor_auth` (direction in) - flag indicating if backdoor authentication is used.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21023 pub fn mf_classic_poller_get_nt(
21024 instance: *mut MfClassicPoller,
21025 block_num: u8,
21026 key_type: MfClassicKeyType,
21027 nt: *mut MfClassicNt,
21028 backdoor_auth: bool,
21029 ) -> MfClassicError;
21030}
21031unsafe extern "C" {
21032 #[doc = "Collect tag nonce during nested authentication.\n\n Must ONLY be used inside the callback function.\n\n Starts nested authentication procedure and collects tag nonce.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number for authentication.\n * `key_type` (direction in) - key type to be used for authentication.\n * `nt` (direction out) - pointer to the MfClassicNt structure to be filled with nonce data.\n * `backdoor_auth` (direction in) - flag indicating if backdoor authentication is used.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21033 pub fn mf_classic_poller_get_nt_nested(
21034 instance: *mut MfClassicPoller,
21035 block_num: u8,
21036 key_type: MfClassicKeyType,
21037 nt: *mut MfClassicNt,
21038 backdoor_auth: bool,
21039 ) -> MfClassicError;
21040}
21041unsafe extern "C" {
21042 #[doc = "Perform authentication.\n\n Must ONLY be used inside the callback function.\n\n Perform authentication as specified in Mf Classic protocol. Initialize crypto state for futher\n communication with the tag.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number for authentication.\n * `key` (direction in) - key to be used for authentication.\n * `key_type` (direction in) - key type to be used for authentication.\n * `data` (direction out) - pointer to MfClassicAuthContext structure to be filled with authentication data.\n * `backdoor_auth` (direction in) - flag indicating if backdoor authentication is used.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21043 pub fn mf_classic_poller_auth(
21044 instance: *mut MfClassicPoller,
21045 block_num: u8,
21046 key: *mut MfClassicKey,
21047 key_type: MfClassicKeyType,
21048 data: *mut MfClassicAuthContext,
21049 backdoor_auth: bool,
21050 ) -> MfClassicError;
21051}
21052unsafe extern "C" {
21053 #[doc = "Perform nested authentication.\n\n Must ONLY be used inside the callback function.\n\n Perform nested authentication as specified in Mf Classic protocol.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number for authentication.\n * `key` (direction in) - key to be used for authentication.\n * `key_type` (direction in) - key type to be used for authentication.\n * `data` (direction out) - pointer to MfClassicAuthContext structure to be filled with authentication data.\n * `backdoor_auth` (direction in) - flag indicating if backdoor authentication is used.\n * `early_ret` (direction in) - return immediately after receiving encrypted nonce.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21054 pub fn mf_classic_poller_auth_nested(
21055 instance: *mut MfClassicPoller,
21056 block_num: u8,
21057 key: *mut MfClassicKey,
21058 key_type: MfClassicKeyType,
21059 data: *mut MfClassicAuthContext,
21060 backdoor_auth: bool,
21061 early_ret: bool,
21062 ) -> MfClassicError;
21063}
21064unsafe extern "C" {
21065 #[doc = "Halt the tag.\n\n Must ONLY be used inside the callback function.\n\n Halt the tag and reset crypto state of the poller.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21066 pub fn mf_classic_poller_halt(instance: *mut MfClassicPoller) -> MfClassicError;
21067}
21068unsafe extern "C" {
21069 #[doc = "Read block from tag.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number to be read.\n * `data` (direction out) - pointer to the MfClassicBlock structure to be filled with block data.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21070 pub fn mf_classic_poller_read_block(
21071 instance: *mut MfClassicPoller,
21072 block_num: u8,
21073 data: *mut MfClassicBlock,
21074 ) -> MfClassicError;
21075}
21076unsafe extern "C" {
21077 #[doc = "Write block to tag.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number to be written.\n * `data` (direction in) - pointer to the MfClassicBlock structure to be written.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21078 pub fn mf_classic_poller_write_block(
21079 instance: *mut MfClassicPoller,
21080 block_num: u8,
21081 data: *mut MfClassicBlock,
21082 ) -> MfClassicError;
21083}
21084unsafe extern "C" {
21085 #[doc = "Perform value command on tag.\n\n Must ONLY be used inside the callback function.\n\n Perform Increment, Decrement or Restore command on tag. The result is stored in internal transfer\n block of the tag. Use mf_classic_poller_value_transfer to transfer the result to the tag.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number to be used for value command.\n * `cmd` (direction in) - value command to be performed.\n * `data` (direction in) - value to be used for value command.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21086 pub fn mf_classic_poller_value_cmd(
21087 instance: *mut MfClassicPoller,
21088 block_num: u8,
21089 cmd: MfClassicValueCommand,
21090 data: i32,
21091 ) -> MfClassicError;
21092}
21093unsafe extern "C" {
21094 #[doc = "Transfer internal transfer block to tag.\n\n Must ONLY be used inside the callback function.\n\n Transfer internal transfer block to tag. The block is filled by mf_classic_poller_value_cmd.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `block_num` (direction in) - block number to be used for value command.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21095 pub fn mf_classic_poller_value_transfer(
21096 instance: *mut MfClassicPoller,
21097 block_num: u8,
21098 ) -> MfClassicError;
21099}
21100unsafe extern "C" {
21101 #[doc = "Transmit and receive Iso14443_3a standard frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21102 pub fn mf_classic_poller_send_standard_frame(
21103 instance: *mut MfClassicPoller,
21104 tx_buffer: *const BitBuffer,
21105 rx_buffer: *mut BitBuffer,
21106 fwt_fc: u32,
21107 ) -> MfClassicError;
21108}
21109unsafe extern "C" {
21110 #[doc = "Transmit and receive Iso14443_3a frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21111 pub fn mf_classic_poller_send_frame(
21112 instance: *mut MfClassicPoller,
21113 tx_buffer: *const BitBuffer,
21114 rx_buffer: *mut BitBuffer,
21115 fwt_fc: u32,
21116 ) -> MfClassicError;
21117}
21118unsafe extern "C" {
21119 #[doc = "Transmit and receive Iso14443_3a frames with custom parity bits in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n Custom parity bits must be set in the tx_buffer. The rx_buffer will contain\n the received data with the parity bits.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21120 pub fn mf_classic_poller_send_custom_parity_frame(
21121 instance: *mut MfClassicPoller,
21122 tx_buffer: *const BitBuffer,
21123 rx_buffer: *mut BitBuffer,
21124 fwt_fc: u32,
21125 ) -> MfClassicError;
21126}
21127unsafe extern "C" {
21128 #[doc = "Transmit and receive Mifare Classic encrypted frames with custom parity bits in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the plain data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with decyphered received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nMfClassicErrorNone on success, an error code on failure."]
21129 pub fn mf_classic_poller_send_encrypted_frame(
21130 instance: *mut MfClassicPoller,
21131 tx_buffer: *const BitBuffer,
21132 rx_buffer: *mut BitBuffer,
21133 fwt_fc: u32,
21134 ) -> MfClassicError;
21135}
21136unsafe extern "C" {
21137 pub fn mf_classic_poller_sync_collect_nt(
21138 nfc: *mut Nfc,
21139 block_num: u8,
21140 key_type: MfClassicKeyType,
21141 nt: *mut MfClassicNt,
21142 ) -> MfClassicError;
21143}
21144unsafe extern "C" {
21145 pub fn mf_classic_poller_sync_auth(
21146 nfc: *mut Nfc,
21147 block_num: u8,
21148 key: *mut MfClassicKey,
21149 key_type: MfClassicKeyType,
21150 data: *mut MfClassicAuthContext,
21151 ) -> MfClassicError;
21152}
21153unsafe extern "C" {
21154 pub fn mf_classic_poller_sync_read_block(
21155 nfc: *mut Nfc,
21156 block_num: u8,
21157 key: *mut MfClassicKey,
21158 key_type: MfClassicKeyType,
21159 data: *mut MfClassicBlock,
21160 ) -> MfClassicError;
21161}
21162unsafe extern "C" {
21163 pub fn mf_classic_poller_sync_write_block(
21164 nfc: *mut Nfc,
21165 block_num: u8,
21166 key: *mut MfClassicKey,
21167 key_type: MfClassicKeyType,
21168 data: *mut MfClassicBlock,
21169 ) -> MfClassicError;
21170}
21171unsafe extern "C" {
21172 pub fn mf_classic_poller_sync_read_value(
21173 nfc: *mut Nfc,
21174 block_num: u8,
21175 key: *mut MfClassicKey,
21176 key_type: MfClassicKeyType,
21177 value: *mut i32,
21178 ) -> MfClassicError;
21179}
21180unsafe extern "C" {
21181 pub fn mf_classic_poller_sync_change_value(
21182 nfc: *mut Nfc,
21183 block_num: u8,
21184 key: *mut MfClassicKey,
21185 key_type: MfClassicKeyType,
21186 data: i32,
21187 new_value: *mut i32,
21188 ) -> MfClassicError;
21189}
21190unsafe extern "C" {
21191 pub fn mf_classic_poller_sync_detect_type(
21192 nfc: *mut Nfc,
21193 type_: *mut MfClassicType,
21194 ) -> MfClassicError;
21195}
21196unsafe extern "C" {
21197 pub fn mf_classic_poller_sync_read(
21198 nfc: *mut Nfc,
21199 keys: *const MfClassicDeviceKeys,
21200 data: *mut MfClassicData,
21201 ) -> MfClassicError;
21202}
21203pub const MfDesfireTypeMF3ICD40: MfDesfireType = MfDesfireType(0);
21204pub const MfDesfireTypeEV1: MfDesfireType = MfDesfireType(1);
21205pub const MfDesfireTypeEV2: MfDesfireType = MfDesfireType(2);
21206pub const MfDesfireTypeEV2XL: MfDesfireType = MfDesfireType(3);
21207pub const MfDesfireTypeEV3: MfDesfireType = MfDesfireType(4);
21208pub const MfDesfireTypeUnknown: MfDesfireType = MfDesfireType(5);
21209pub const MfDesfireTypeNum: MfDesfireType = MfDesfireType(6);
21210#[repr(transparent)]
21211#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21212pub struct MfDesfireType(pub core::ffi::c_uchar);
21213pub const MfDesfireSize2k: MfDesfireSize = MfDesfireSize(0);
21214pub const MfDesfireSize4k: MfDesfireSize = MfDesfireSize(1);
21215pub const MfDesfireSize8k: MfDesfireSize = MfDesfireSize(2);
21216pub const MfDesfireSize16k: MfDesfireSize = MfDesfireSize(3);
21217pub const MfDesfireSize32k: MfDesfireSize = MfDesfireSize(4);
21218pub const MfDesfireSizeUnknown: MfDesfireSize = MfDesfireSize(5);
21219pub const MfDesfireSizeNum: MfDesfireSize = MfDesfireSize(6);
21220#[repr(transparent)]
21221#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21222pub struct MfDesfireSize(pub core::ffi::c_uchar);
21223#[repr(C)]
21224#[derive(Debug, Copy, Clone)]
21225pub struct MfDesfireVersion {
21226 pub hw_vendor: u8,
21227 pub hw_type: u8,
21228 pub hw_subtype: u8,
21229 pub hw_major: u8,
21230 pub hw_minor: u8,
21231 pub hw_storage: u8,
21232 pub hw_proto: u8,
21233 pub sw_vendor: u8,
21234 pub sw_type: u8,
21235 pub sw_subtype: u8,
21236 pub sw_major: u8,
21237 pub sw_minor: u8,
21238 pub sw_storage: u8,
21239 pub sw_proto: u8,
21240 pub uid: [u8; 7usize],
21241 pub batch: [u8; 5usize],
21242 pub prod_week: u8,
21243 pub prod_year: u8,
21244}
21245#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21246const _: () = {
21247 ["Size of MfDesfireVersion"][::core::mem::size_of::<MfDesfireVersion>() - 28usize];
21248 ["Alignment of MfDesfireVersion"][::core::mem::align_of::<MfDesfireVersion>() - 1usize];
21249 ["Offset of field: MfDesfireVersion::hw_vendor"]
21250 [::core::mem::offset_of!(MfDesfireVersion, hw_vendor) - 0usize];
21251 ["Offset of field: MfDesfireVersion::hw_type"]
21252 [::core::mem::offset_of!(MfDesfireVersion, hw_type) - 1usize];
21253 ["Offset of field: MfDesfireVersion::hw_subtype"]
21254 [::core::mem::offset_of!(MfDesfireVersion, hw_subtype) - 2usize];
21255 ["Offset of field: MfDesfireVersion::hw_major"]
21256 [::core::mem::offset_of!(MfDesfireVersion, hw_major) - 3usize];
21257 ["Offset of field: MfDesfireVersion::hw_minor"]
21258 [::core::mem::offset_of!(MfDesfireVersion, hw_minor) - 4usize];
21259 ["Offset of field: MfDesfireVersion::hw_storage"]
21260 [::core::mem::offset_of!(MfDesfireVersion, hw_storage) - 5usize];
21261 ["Offset of field: MfDesfireVersion::hw_proto"]
21262 [::core::mem::offset_of!(MfDesfireVersion, hw_proto) - 6usize];
21263 ["Offset of field: MfDesfireVersion::sw_vendor"]
21264 [::core::mem::offset_of!(MfDesfireVersion, sw_vendor) - 7usize];
21265 ["Offset of field: MfDesfireVersion::sw_type"]
21266 [::core::mem::offset_of!(MfDesfireVersion, sw_type) - 8usize];
21267 ["Offset of field: MfDesfireVersion::sw_subtype"]
21268 [::core::mem::offset_of!(MfDesfireVersion, sw_subtype) - 9usize];
21269 ["Offset of field: MfDesfireVersion::sw_major"]
21270 [::core::mem::offset_of!(MfDesfireVersion, sw_major) - 10usize];
21271 ["Offset of field: MfDesfireVersion::sw_minor"]
21272 [::core::mem::offset_of!(MfDesfireVersion, sw_minor) - 11usize];
21273 ["Offset of field: MfDesfireVersion::sw_storage"]
21274 [::core::mem::offset_of!(MfDesfireVersion, sw_storage) - 12usize];
21275 ["Offset of field: MfDesfireVersion::sw_proto"]
21276 [::core::mem::offset_of!(MfDesfireVersion, sw_proto) - 13usize];
21277 ["Offset of field: MfDesfireVersion::uid"]
21278 [::core::mem::offset_of!(MfDesfireVersion, uid) - 14usize];
21279 ["Offset of field: MfDesfireVersion::batch"]
21280 [::core::mem::offset_of!(MfDesfireVersion, batch) - 21usize];
21281 ["Offset of field: MfDesfireVersion::prod_week"]
21282 [::core::mem::offset_of!(MfDesfireVersion, prod_week) - 26usize];
21283 ["Offset of field: MfDesfireVersion::prod_year"]
21284 [::core::mem::offset_of!(MfDesfireVersion, prod_year) - 27usize];
21285};
21286#[repr(C)]
21287#[derive(Debug, Copy, Clone)]
21288pub struct MfDesfireFreeMemory {
21289 pub bytes_free: u32,
21290 pub is_present: bool,
21291}
21292#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21293const _: () = {
21294 ["Size of MfDesfireFreeMemory"][::core::mem::size_of::<MfDesfireFreeMemory>() - 8usize];
21295 ["Alignment of MfDesfireFreeMemory"][::core::mem::align_of::<MfDesfireFreeMemory>() - 4usize];
21296 ["Offset of field: MfDesfireFreeMemory::bytes_free"]
21297 [::core::mem::offset_of!(MfDesfireFreeMemory, bytes_free) - 0usize];
21298 ["Offset of field: MfDesfireFreeMemory::is_present"]
21299 [::core::mem::offset_of!(MfDesfireFreeMemory, is_present) - 4usize];
21300};
21301#[repr(C)]
21302#[derive(Debug, Copy, Clone)]
21303pub struct MfDesfireKeySettings {
21304 pub is_master_key_changeable: bool,
21305 pub is_free_directory_list: bool,
21306 pub is_free_create_delete: bool,
21307 pub is_config_changeable: bool,
21308 pub change_key_id: u8,
21309 pub max_keys: u8,
21310 pub flags: u8,
21311}
21312#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21313const _: () = {
21314 ["Size of MfDesfireKeySettings"][::core::mem::size_of::<MfDesfireKeySettings>() - 7usize];
21315 ["Alignment of MfDesfireKeySettings"][::core::mem::align_of::<MfDesfireKeySettings>() - 1usize];
21316 ["Offset of field: MfDesfireKeySettings::is_master_key_changeable"]
21317 [::core::mem::offset_of!(MfDesfireKeySettings, is_master_key_changeable) - 0usize];
21318 ["Offset of field: MfDesfireKeySettings::is_free_directory_list"]
21319 [::core::mem::offset_of!(MfDesfireKeySettings, is_free_directory_list) - 1usize];
21320 ["Offset of field: MfDesfireKeySettings::is_free_create_delete"]
21321 [::core::mem::offset_of!(MfDesfireKeySettings, is_free_create_delete) - 2usize];
21322 ["Offset of field: MfDesfireKeySettings::is_config_changeable"]
21323 [::core::mem::offset_of!(MfDesfireKeySettings, is_config_changeable) - 3usize];
21324 ["Offset of field: MfDesfireKeySettings::change_key_id"]
21325 [::core::mem::offset_of!(MfDesfireKeySettings, change_key_id) - 4usize];
21326 ["Offset of field: MfDesfireKeySettings::max_keys"]
21327 [::core::mem::offset_of!(MfDesfireKeySettings, max_keys) - 5usize];
21328 ["Offset of field: MfDesfireKeySettings::flags"]
21329 [::core::mem::offset_of!(MfDesfireKeySettings, flags) - 6usize];
21330};
21331pub type MfDesfireKeyVersion = u8;
21332pub const MfDesfireFileTypeStandard: MfDesfireFileType = MfDesfireFileType(0);
21333pub const MfDesfireFileTypeBackup: MfDesfireFileType = MfDesfireFileType(1);
21334pub const MfDesfireFileTypeValue: MfDesfireFileType = MfDesfireFileType(2);
21335pub const MfDesfireFileTypeLinearRecord: MfDesfireFileType = MfDesfireFileType(3);
21336pub const MfDesfireFileTypeCyclicRecord: MfDesfireFileType = MfDesfireFileType(4);
21337pub const MfDesfireFileTypeTransactionMac: MfDesfireFileType = MfDesfireFileType(5);
21338#[repr(transparent)]
21339#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21340pub struct MfDesfireFileType(pub core::ffi::c_uchar);
21341pub const MfDesfireFileCommunicationSettingsPlaintext: MfDesfireFileCommunicationSettings =
21342 MfDesfireFileCommunicationSettings(0);
21343pub const MfDesfireFileCommunicationSettingsAuthenticated: MfDesfireFileCommunicationSettings =
21344 MfDesfireFileCommunicationSettings(1);
21345pub const MfDesfireFileCommunicationSettingsEnciphered: MfDesfireFileCommunicationSettings =
21346 MfDesfireFileCommunicationSettings(3);
21347#[repr(transparent)]
21348#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21349pub struct MfDesfireFileCommunicationSettings(pub core::ffi::c_uchar);
21350pub type MfDesfireFileId = u8;
21351pub type MfDesfireFileAccessRights = u16;
21352#[repr(C)]
21353#[derive(Copy, Clone)]
21354pub struct MfDesfireFileSettings {
21355 pub type_: MfDesfireFileType,
21356 pub comm: MfDesfireFileCommunicationSettings,
21357 pub access_rights: [MfDesfireFileAccessRights; 14usize],
21358 pub access_rights_len: u8,
21359 pub __bindgen_anon_1: MfDesfireFileSettings__bindgen_ty_1,
21360}
21361#[repr(C)]
21362#[derive(Copy, Clone)]
21363pub union MfDesfireFileSettings__bindgen_ty_1 {
21364 pub data: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1,
21365 pub value: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21366 pub record: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3,
21367 pub transaction_mac: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21368}
21369#[repr(C)]
21370#[derive(Debug, Copy, Clone)]
21371pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1 {
21372 pub size: u32,
21373}
21374#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21375const _: () = {
21376 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1"]
21377 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1>() - 4usize];
21378 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1"]
21379 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1>() - 4usize];
21380 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1::size"]
21381 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1, size) - 0usize];
21382};
21383#[repr(C)]
21384#[derive(Debug, Copy, Clone)]
21385pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2 {
21386 pub lo_limit: u32,
21387 pub hi_limit: u32,
21388 pub limited_credit_value: u32,
21389 pub limited_credit_enabled: bool,
21390}
21391#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21392const _: () = {
21393 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2"]
21394 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2>() - 16usize];
21395 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2"]
21396 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2>() - 4usize];
21397 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::lo_limit"][::core::mem::offset_of!(
21398 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21399 lo_limit
21400 ) - 0usize];
21401 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::hi_limit"][::core::mem::offset_of!(
21402 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21403 hi_limit
21404 ) - 4usize];
21405 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::limited_credit_value"][::core::mem::offset_of!(
21406 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21407 limited_credit_value
21408 )
21409 - 8usize];
21410 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::limited_credit_enabled"]
21411 [::core::mem::offset_of!(
21412 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21413 limited_credit_enabled
21414 ) - 12usize];
21415};
21416#[repr(C)]
21417#[derive(Debug, Copy, Clone)]
21418pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3 {
21419 pub size: u32,
21420 pub max: u32,
21421 pub cur: u32,
21422}
21423#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21424const _: () = {
21425 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3"]
21426 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3>() - 12usize];
21427 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3"]
21428 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3>() - 4usize];
21429 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3::size"]
21430 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3, size) - 0usize];
21431 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3::max"]
21432 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3, max) - 4usize];
21433 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3::cur"]
21434 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3, cur) - 8usize];
21435};
21436#[repr(C)]
21437#[derive(Debug, Copy, Clone)]
21438pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4 {
21439 pub key_option: u8,
21440 pub key_version: u8,
21441 pub counter_limit: u32,
21442}
21443#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21444const _: () = {
21445 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4"]
21446 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4>() - 8usize];
21447 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4"]
21448 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4>() - 4usize];
21449 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4::key_option"][::core::mem::offset_of!(
21450 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21451 key_option
21452 ) - 0usize];
21453 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4::key_version"][::core::mem::offset_of!(
21454 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21455 key_version
21456 ) - 1usize];
21457 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4::counter_limit"][::core::mem::offset_of!(
21458 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21459 counter_limit
21460 )
21461 - 4usize];
21462};
21463#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21464const _: () = {
21465 ["Size of MfDesfireFileSettings__bindgen_ty_1"]
21466 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1>() - 16usize];
21467 ["Alignment of MfDesfireFileSettings__bindgen_ty_1"]
21468 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1>() - 4usize];
21469 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::data"]
21470 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, data) - 0usize];
21471 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::value"]
21472 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, value) - 0usize];
21473 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::record"]
21474 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, record) - 0usize];
21475 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::transaction_mac"]
21476 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, transaction_mac) - 0usize];
21477};
21478#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21479const _: () = {
21480 ["Size of MfDesfireFileSettings"][::core::mem::size_of::<MfDesfireFileSettings>() - 48usize];
21481 ["Alignment of MfDesfireFileSettings"]
21482 [::core::mem::align_of::<MfDesfireFileSettings>() - 4usize];
21483 ["Offset of field: MfDesfireFileSettings::type_"]
21484 [::core::mem::offset_of!(MfDesfireFileSettings, type_) - 0usize];
21485 ["Offset of field: MfDesfireFileSettings::comm"]
21486 [::core::mem::offset_of!(MfDesfireFileSettings, comm) - 1usize];
21487 ["Offset of field: MfDesfireFileSettings::access_rights"]
21488 [::core::mem::offset_of!(MfDesfireFileSettings, access_rights) - 2usize];
21489 ["Offset of field: MfDesfireFileSettings::access_rights_len"]
21490 [::core::mem::offset_of!(MfDesfireFileSettings, access_rights_len) - 30usize];
21491};
21492#[repr(C)]
21493#[derive(Debug, Copy, Clone)]
21494pub struct MfDesfireFileData {
21495 pub data: *mut SimpleArray,
21496}
21497#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21498const _: () = {
21499 ["Size of MfDesfireFileData"][::core::mem::size_of::<MfDesfireFileData>() - 4usize];
21500 ["Alignment of MfDesfireFileData"][::core::mem::align_of::<MfDesfireFileData>() - 4usize];
21501 ["Offset of field: MfDesfireFileData::data"]
21502 [::core::mem::offset_of!(MfDesfireFileData, data) - 0usize];
21503};
21504#[repr(C)]
21505#[derive(Debug, Copy, Clone)]
21506pub struct MfDesfireApplicationId {
21507 pub data: [u8; 3usize],
21508}
21509#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21510const _: () = {
21511 ["Size of MfDesfireApplicationId"][::core::mem::size_of::<MfDesfireApplicationId>() - 3usize];
21512 ["Alignment of MfDesfireApplicationId"]
21513 [::core::mem::align_of::<MfDesfireApplicationId>() - 1usize];
21514 ["Offset of field: MfDesfireApplicationId::data"]
21515 [::core::mem::offset_of!(MfDesfireApplicationId, data) - 0usize];
21516};
21517#[repr(C)]
21518#[derive(Debug, Copy, Clone)]
21519pub struct MfDesfireApplication {
21520 pub key_settings: MfDesfireKeySettings,
21521 pub key_versions: *mut SimpleArray,
21522 pub file_ids: *mut SimpleArray,
21523 pub file_settings: *mut SimpleArray,
21524 pub file_data: *mut SimpleArray,
21525}
21526#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21527const _: () = {
21528 ["Size of MfDesfireApplication"][::core::mem::size_of::<MfDesfireApplication>() - 24usize];
21529 ["Alignment of MfDesfireApplication"][::core::mem::align_of::<MfDesfireApplication>() - 4usize];
21530 ["Offset of field: MfDesfireApplication::key_settings"]
21531 [::core::mem::offset_of!(MfDesfireApplication, key_settings) - 0usize];
21532 ["Offset of field: MfDesfireApplication::key_versions"]
21533 [::core::mem::offset_of!(MfDesfireApplication, key_versions) - 8usize];
21534 ["Offset of field: MfDesfireApplication::file_ids"]
21535 [::core::mem::offset_of!(MfDesfireApplication, file_ids) - 12usize];
21536 ["Offset of field: MfDesfireApplication::file_settings"]
21537 [::core::mem::offset_of!(MfDesfireApplication, file_settings) - 16usize];
21538 ["Offset of field: MfDesfireApplication::file_data"]
21539 [::core::mem::offset_of!(MfDesfireApplication, file_data) - 20usize];
21540};
21541pub const MfDesfireErrorNone: MfDesfireError = MfDesfireError(0);
21542pub const MfDesfireErrorNotPresent: MfDesfireError = MfDesfireError(1);
21543pub const MfDesfireErrorProtocol: MfDesfireError = MfDesfireError(2);
21544pub const MfDesfireErrorTimeout: MfDesfireError = MfDesfireError(3);
21545pub const MfDesfireErrorAuthentication: MfDesfireError = MfDesfireError(4);
21546pub const MfDesfireErrorCommandNotSupported: MfDesfireError = MfDesfireError(5);
21547#[repr(transparent)]
21548#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21549pub struct MfDesfireError(pub core::ffi::c_uchar);
21550#[repr(C)]
21551#[derive(Debug, Copy, Clone)]
21552pub struct MfDesfireData {
21553 pub iso14443_4a_data: *mut Iso14443_4aData,
21554 pub version: MfDesfireVersion,
21555 pub free_memory: MfDesfireFreeMemory,
21556 pub master_key_settings: MfDesfireKeySettings,
21557 pub master_key_versions: *mut SimpleArray,
21558 pub application_ids: *mut SimpleArray,
21559 pub applications: *mut SimpleArray,
21560 pub device_name: *mut FuriString,
21561}
21562#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21563const _: () = {
21564 ["Size of MfDesfireData"][::core::mem::size_of::<MfDesfireData>() - 64usize];
21565 ["Alignment of MfDesfireData"][::core::mem::align_of::<MfDesfireData>() - 4usize];
21566 ["Offset of field: MfDesfireData::iso14443_4a_data"]
21567 [::core::mem::offset_of!(MfDesfireData, iso14443_4a_data) - 0usize];
21568 ["Offset of field: MfDesfireData::version"]
21569 [::core::mem::offset_of!(MfDesfireData, version) - 4usize];
21570 ["Offset of field: MfDesfireData::free_memory"]
21571 [::core::mem::offset_of!(MfDesfireData, free_memory) - 32usize];
21572 ["Offset of field: MfDesfireData::master_key_settings"]
21573 [::core::mem::offset_of!(MfDesfireData, master_key_settings) - 40usize];
21574 ["Offset of field: MfDesfireData::master_key_versions"]
21575 [::core::mem::offset_of!(MfDesfireData, master_key_versions) - 48usize];
21576 ["Offset of field: MfDesfireData::application_ids"]
21577 [::core::mem::offset_of!(MfDesfireData, application_ids) - 52usize];
21578 ["Offset of field: MfDesfireData::applications"]
21579 [::core::mem::offset_of!(MfDesfireData, applications) - 56usize];
21580 ["Offset of field: MfDesfireData::device_name"]
21581 [::core::mem::offset_of!(MfDesfireData, device_name) - 60usize];
21582};
21583unsafe extern "C" {
21584 pub fn mf_desfire_alloc() -> *mut MfDesfireData;
21585}
21586unsafe extern "C" {
21587 pub fn mf_desfire_free(data: *mut MfDesfireData);
21588}
21589unsafe extern "C" {
21590 pub fn mf_desfire_reset(data: *mut MfDesfireData);
21591}
21592unsafe extern "C" {
21593 pub fn mf_desfire_copy(data: *mut MfDesfireData, other: *const MfDesfireData);
21594}
21595unsafe extern "C" {
21596 pub fn mf_desfire_verify(data: *mut MfDesfireData, device_type: *const FuriString) -> bool;
21597}
21598unsafe extern "C" {
21599 pub fn mf_desfire_load(data: *mut MfDesfireData, ff: *mut FlipperFormat, version: u32) -> bool;
21600}
21601unsafe extern "C" {
21602 pub fn mf_desfire_save(data: *const MfDesfireData, ff: *mut FlipperFormat) -> bool;
21603}
21604unsafe extern "C" {
21605 pub fn mf_desfire_is_equal(data: *const MfDesfireData, other: *const MfDesfireData) -> bool;
21606}
21607unsafe extern "C" {
21608 pub fn mf_desfire_get_device_name(
21609 data: *const MfDesfireData,
21610 name_type: NfcDeviceNameType,
21611 ) -> *const core::ffi::c_char;
21612}
21613unsafe extern "C" {
21614 pub fn mf_desfire_get_uid(data: *const MfDesfireData, uid_len: *mut usize) -> *const u8;
21615}
21616unsafe extern "C" {
21617 pub fn mf_desfire_set_uid(data: *mut MfDesfireData, uid: *const u8, uid_len: usize) -> bool;
21618}
21619unsafe extern "C" {
21620 pub fn mf_desfire_get_base_data(data: *const MfDesfireData) -> *mut Iso14443_4aData;
21621}
21622unsafe extern "C" {
21623 pub fn mf_desfire_get_application(
21624 data: *const MfDesfireData,
21625 app_id: *const MfDesfireApplicationId,
21626 ) -> *const MfDesfireApplication;
21627}
21628unsafe extern "C" {
21629 pub fn mf_desfire_get_file_settings(
21630 data: *const MfDesfireApplication,
21631 file_id: *const MfDesfireFileId,
21632 ) -> *const MfDesfireFileSettings;
21633}
21634unsafe extern "C" {
21635 pub fn mf_desfire_get_file_data(
21636 data: *const MfDesfireApplication,
21637 file_id: *const MfDesfireFileId,
21638 ) -> *const MfDesfireFileData;
21639}
21640#[repr(C)]
21641#[derive(Debug, Copy, Clone)]
21642pub struct MfDesfirePoller {
21643 _unused: [u8; 0],
21644}
21645#[doc = "< Card was read successfully."]
21646pub const MfDesfirePollerEventTypeReadSuccess: MfDesfirePollerEventType =
21647 MfDesfirePollerEventType(0);
21648#[doc = "< Poller failed to read card."]
21649pub const MfDesfirePollerEventTypeReadFailed: MfDesfirePollerEventType =
21650 MfDesfirePollerEventType(1);
21651#[repr(transparent)]
21652#[doc = "Enumeration of possible MfDesfire poller event types."]
21653#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21654pub struct MfDesfirePollerEventType(pub core::ffi::c_uchar);
21655#[doc = "MfDesfire poller event data."]
21656#[repr(C)]
21657#[derive(Copy, Clone)]
21658pub union MfDesfirePollerEventData {
21659 #[doc = "< Error code indicating card reading fail reason."]
21660 pub error: MfDesfireError,
21661}
21662#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21663const _: () = {
21664 ["Size of MfDesfirePollerEventData"]
21665 [::core::mem::size_of::<MfDesfirePollerEventData>() - 1usize];
21666 ["Alignment of MfDesfirePollerEventData"]
21667 [::core::mem::align_of::<MfDesfirePollerEventData>() - 1usize];
21668 ["Offset of field: MfDesfirePollerEventData::error"]
21669 [::core::mem::offset_of!(MfDesfirePollerEventData, error) - 0usize];
21670};
21671#[doc = "MfDesfire poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
21672#[repr(C)]
21673#[derive(Debug, Copy, Clone)]
21674pub struct MfDesfirePollerEvent {
21675 #[doc = "< Type of emmitted event."]
21676 pub type_: MfDesfirePollerEventType,
21677 #[doc = "< Pointer to event specific data."]
21678 pub data: *mut MfDesfirePollerEventData,
21679}
21680#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21681const _: () = {
21682 ["Size of MfDesfirePollerEvent"][::core::mem::size_of::<MfDesfirePollerEvent>() - 8usize];
21683 ["Alignment of MfDesfirePollerEvent"][::core::mem::align_of::<MfDesfirePollerEvent>() - 4usize];
21684 ["Offset of field: MfDesfirePollerEvent::type_"]
21685 [::core::mem::offset_of!(MfDesfirePollerEvent, type_) - 0usize];
21686 ["Offset of field: MfDesfirePollerEvent::data"]
21687 [::core::mem::offset_of!(MfDesfirePollerEvent, data) - 4usize];
21688};
21689unsafe extern "C" {
21690 #[doc = "Transmit and receive MfDesfire chunks in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21691 pub fn mf_desfire_send_chunks(
21692 instance: *mut MfDesfirePoller,
21693 tx_buffer: *const BitBuffer,
21694 rx_buffer: *mut BitBuffer,
21695 ) -> MfDesfireError;
21696}
21697unsafe extern "C" {
21698 #[doc = "Read MfDesfire card version.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfDesfireVersion structure to be filled with version data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21699 pub fn mf_desfire_poller_read_version(
21700 instance: *mut MfDesfirePoller,
21701 data: *mut MfDesfireVersion,
21702 ) -> MfDesfireError;
21703}
21704unsafe extern "C" {
21705 #[doc = "Read free memory available on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfDesfireFreeMemory structure to be filled with free memory data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21706 pub fn mf_desfire_poller_read_free_memory(
21707 instance: *mut MfDesfirePoller,
21708 data: *mut MfDesfireFreeMemory,
21709 ) -> MfDesfireError;
21710}
21711unsafe extern "C" {
21712 #[doc = "Read key settings on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfDesfireKeySettings structure to be filled with key settings data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21713 pub fn mf_desfire_poller_read_key_settings(
21714 instance: *mut MfDesfirePoller,
21715 data: *mut MfDesfireKeySettings,
21716 ) -> MfDesfireError;
21717}
21718unsafe extern "C" {
21719 #[doc = "Read key version on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `key_num` (direction out) - key number.\n * `data` (direction in) - pointer to the MfDesfireKeyVersion structure to be filled with key version data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21720 pub fn mf_desfire_poller_read_key_version(
21721 instance: *mut MfDesfirePoller,
21722 key_num: u8,
21723 data: *mut MfDesfireKeyVersion,
21724 ) -> MfDesfireError;
21725}
21726unsafe extern "C" {
21727 #[doc = "Read key versions on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the SimpleArray structure to be filled with key versions data.\n * `count` (direction in) - number of key versions to read.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21728 pub fn mf_desfire_poller_read_key_versions(
21729 instance: *mut MfDesfirePoller,
21730 data: *mut SimpleArray,
21731 count: u32,
21732 ) -> MfDesfireError;
21733}
21734unsafe extern "C" {
21735 #[doc = "Read applications IDs on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the SimpleArray structure to be filled with application ids data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21736 pub fn mf_desfire_poller_read_application_ids(
21737 instance: *mut MfDesfirePoller,
21738 data: *mut SimpleArray,
21739 ) -> MfDesfireError;
21740}
21741unsafe extern "C" {
21742 #[doc = "Select application on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `id` (direction in) - pointer to the MfDesfireApplicationId structure with application id to select.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21743 pub fn mf_desfire_poller_select_application(
21744 instance: *mut MfDesfirePoller,
21745 id: *const MfDesfireApplicationId,
21746 ) -> MfDesfireError;
21747}
21748unsafe extern "C" {
21749 #[doc = "Read file IDs for selected application on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the SimpleArray structure to be filled with file ids data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21750 pub fn mf_desfire_poller_read_file_ids(
21751 instance: *mut MfDesfirePoller,
21752 data: *mut SimpleArray,
21753 ) -> MfDesfireError;
21754}
21755unsafe extern "C" {
21756 #[doc = "Read file settings on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `id` (direction in) - file id to read settings for.\n * `data` (direction out) - pointer to the MfDesfireFileSettings structure to be filled with file settings data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21757 pub fn mf_desfire_poller_read_file_settings(
21758 instance: *mut MfDesfirePoller,
21759 id: MfDesfireFileId,
21760 data: *mut MfDesfireFileSettings,
21761 ) -> MfDesfireError;
21762}
21763unsafe extern "C" {
21764 #[doc = "Read multiple file settings on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `file_ids` (direction in) - pointer to the SimpleArray structure array with file ids to read settings for.\n * `data` (direction out) - pointer to the SimpleArray structure array to be filled with file settings data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21765 pub fn mf_desfire_poller_read_file_settings_multi(
21766 instance: *mut MfDesfirePoller,
21767 file_ids: *const SimpleArray,
21768 data: *mut SimpleArray,
21769 ) -> MfDesfireError;
21770}
21771unsafe extern "C" {
21772 #[doc = "Read file data on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `id` (direction in) - file id to read data from.\n * `offset` (direction in) - offset in bytes to start reading from.\n * `size` (direction in) - number of bytes to read.\n * `data` (direction out) - pointer to the MfDesfireFileData structure to be filled with file data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21773 pub fn mf_desfire_poller_read_file_data(
21774 instance: *mut MfDesfirePoller,
21775 id: MfDesfireFileId,
21776 offset: u32,
21777 size: usize,
21778 data: *mut MfDesfireFileData,
21779 ) -> MfDesfireError;
21780}
21781unsafe extern "C" {
21782 #[doc = "Read file value on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `id` (direction in) - file id to read value from.\n * `data` (direction out) - pointer to the MfDesfireFileData structure to be filled with file value.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21783 pub fn mf_desfire_poller_read_file_value(
21784 instance: *mut MfDesfirePoller,
21785 id: MfDesfireFileId,
21786 data: *mut MfDesfireFileData,
21787 ) -> MfDesfireError;
21788}
21789unsafe extern "C" {
21790 #[doc = "Read file records on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `id` (direction in) - file id to read data from.\n * `offset` (direction in) - offset in bytes to start reading from.\n * `size` (direction in) - number of bytes to read.\n * `data` (direction out) - pointer to the MfDesfireFileData structure to be filled with file records data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21791 pub fn mf_desfire_poller_read_file_records(
21792 instance: *mut MfDesfirePoller,
21793 id: MfDesfireFileId,
21794 offset: u32,
21795 size: usize,
21796 data: *mut MfDesfireFileData,
21797 ) -> MfDesfireError;
21798}
21799unsafe extern "C" {
21800 #[doc = "Read data from multiple files on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `file_ids` (direction in) - pointer to the SimpleArray structure array with files ids to read data from.\n * `file_settings` (direction in) - pointer to the SimpleArray structure array with files settings to read data from.\n * `data` (direction out) - pointer to the SimpleArray structure array to be filled with files data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21801 pub fn mf_desfire_poller_read_file_data_multi(
21802 instance: *mut MfDesfirePoller,
21803 file_ids: *const SimpleArray,
21804 file_settings: *const SimpleArray,
21805 data: *mut SimpleArray,
21806 ) -> MfDesfireError;
21807}
21808unsafe extern "C" {
21809 #[doc = "Read application data for selected application on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfDesfireApplication structure to be filled with application data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21810 pub fn mf_desfire_poller_read_application(
21811 instance: *mut MfDesfirePoller,
21812 data: *mut MfDesfireApplication,
21813 ) -> MfDesfireError;
21814}
21815unsafe extern "C" {
21816 #[doc = "Read multiple applications data on MfDesfire card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `app_ids` (direction in) - pointer to the SimpleArray structure array with application ids to read data from.\n * `data` (direction out) - pointer to the SimpleArray structure array to be filled with applications data.\n # Returns\n\nMfDesfireErrorNone on success, an error code on failure."]
21817 pub fn mf_desfire_poller_read_applications(
21818 instance: *mut MfDesfirePoller,
21819 app_ids: *const SimpleArray,
21820 data: *mut SimpleArray,
21821 ) -> MfDesfireError;
21822}
21823pub const MfPlusErrorNone: MfPlusError = MfPlusError(0);
21824pub const MfPlusErrorUnknown: MfPlusError = MfPlusError(1);
21825pub const MfPlusErrorNotPresent: MfPlusError = MfPlusError(2);
21826pub const MfPlusErrorProtocol: MfPlusError = MfPlusError(3);
21827pub const MfPlusErrorAuth: MfPlusError = MfPlusError(4);
21828pub const MfPlusErrorPartialRead: MfPlusError = MfPlusError(5);
21829pub const MfPlusErrorTimeout: MfPlusError = MfPlusError(6);
21830#[repr(transparent)]
21831#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21832pub struct MfPlusError(pub core::ffi::c_uchar);
21833pub const MfPlusTypePlus: MfPlusType = MfPlusType(0);
21834pub const MfPlusTypeEV1: MfPlusType = MfPlusType(1);
21835pub const MfPlusTypeEV2: MfPlusType = MfPlusType(2);
21836pub const MfPlusTypeS: MfPlusType = MfPlusType(3);
21837pub const MfPlusTypeSE: MfPlusType = MfPlusType(4);
21838pub const MfPlusTypeX: MfPlusType = MfPlusType(5);
21839pub const MfPlusTypeUnknown: MfPlusType = MfPlusType(6);
21840pub const MfPlusTypeNum: MfPlusType = MfPlusType(7);
21841#[repr(transparent)]
21842#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21843pub struct MfPlusType(pub core::ffi::c_uchar);
21844pub const MfPlusSize1K: MfPlusSize = MfPlusSize(0);
21845pub const MfPlusSize2K: MfPlusSize = MfPlusSize(1);
21846pub const MfPlusSize4K: MfPlusSize = MfPlusSize(2);
21847pub const MfPlusSizeUnknown: MfPlusSize = MfPlusSize(3);
21848pub const MfPlusSizeNum: MfPlusSize = MfPlusSize(4);
21849#[repr(transparent)]
21850#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21851pub struct MfPlusSize(pub core::ffi::c_uchar);
21852pub const MfPlusSecurityLevel0: MfPlusSecurityLevel = MfPlusSecurityLevel(0);
21853pub const MfPlusSecurityLevel1: MfPlusSecurityLevel = MfPlusSecurityLevel(1);
21854pub const MfPlusSecurityLevel2: MfPlusSecurityLevel = MfPlusSecurityLevel(2);
21855pub const MfPlusSecurityLevel3: MfPlusSecurityLevel = MfPlusSecurityLevel(3);
21856pub const MfPlusSecurityLevelUnknown: MfPlusSecurityLevel = MfPlusSecurityLevel(4);
21857pub const MfPlusSecurityLevelNum: MfPlusSecurityLevel = MfPlusSecurityLevel(5);
21858#[repr(transparent)]
21859#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21860pub struct MfPlusSecurityLevel(pub core::ffi::c_uchar);
21861#[repr(C)]
21862#[derive(Debug, Copy, Clone)]
21863pub struct MfPlusVersion {
21864 pub hw_vendor: u8,
21865 pub hw_type: u8,
21866 pub hw_subtype: u8,
21867 pub hw_major: u8,
21868 pub hw_minor: u8,
21869 pub hw_storage: u8,
21870 pub hw_proto: u8,
21871 pub sw_vendor: u8,
21872 pub sw_type: u8,
21873 pub sw_subtype: u8,
21874 pub sw_major: u8,
21875 pub sw_minor: u8,
21876 pub sw_storage: u8,
21877 pub sw_proto: u8,
21878 pub uid: [u8; 7usize],
21879 pub batch: [u8; 5usize],
21880 pub prod_week: u8,
21881 pub prod_year: u8,
21882}
21883#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21884const _: () = {
21885 ["Size of MfPlusVersion"][::core::mem::size_of::<MfPlusVersion>() - 28usize];
21886 ["Alignment of MfPlusVersion"][::core::mem::align_of::<MfPlusVersion>() - 1usize];
21887 ["Offset of field: MfPlusVersion::hw_vendor"]
21888 [::core::mem::offset_of!(MfPlusVersion, hw_vendor) - 0usize];
21889 ["Offset of field: MfPlusVersion::hw_type"]
21890 [::core::mem::offset_of!(MfPlusVersion, hw_type) - 1usize];
21891 ["Offset of field: MfPlusVersion::hw_subtype"]
21892 [::core::mem::offset_of!(MfPlusVersion, hw_subtype) - 2usize];
21893 ["Offset of field: MfPlusVersion::hw_major"]
21894 [::core::mem::offset_of!(MfPlusVersion, hw_major) - 3usize];
21895 ["Offset of field: MfPlusVersion::hw_minor"]
21896 [::core::mem::offset_of!(MfPlusVersion, hw_minor) - 4usize];
21897 ["Offset of field: MfPlusVersion::hw_storage"]
21898 [::core::mem::offset_of!(MfPlusVersion, hw_storage) - 5usize];
21899 ["Offset of field: MfPlusVersion::hw_proto"]
21900 [::core::mem::offset_of!(MfPlusVersion, hw_proto) - 6usize];
21901 ["Offset of field: MfPlusVersion::sw_vendor"]
21902 [::core::mem::offset_of!(MfPlusVersion, sw_vendor) - 7usize];
21903 ["Offset of field: MfPlusVersion::sw_type"]
21904 [::core::mem::offset_of!(MfPlusVersion, sw_type) - 8usize];
21905 ["Offset of field: MfPlusVersion::sw_subtype"]
21906 [::core::mem::offset_of!(MfPlusVersion, sw_subtype) - 9usize];
21907 ["Offset of field: MfPlusVersion::sw_major"]
21908 [::core::mem::offset_of!(MfPlusVersion, sw_major) - 10usize];
21909 ["Offset of field: MfPlusVersion::sw_minor"]
21910 [::core::mem::offset_of!(MfPlusVersion, sw_minor) - 11usize];
21911 ["Offset of field: MfPlusVersion::sw_storage"]
21912 [::core::mem::offset_of!(MfPlusVersion, sw_storage) - 12usize];
21913 ["Offset of field: MfPlusVersion::sw_proto"]
21914 [::core::mem::offset_of!(MfPlusVersion, sw_proto) - 13usize];
21915 ["Offset of field: MfPlusVersion::uid"][::core::mem::offset_of!(MfPlusVersion, uid) - 14usize];
21916 ["Offset of field: MfPlusVersion::batch"]
21917 [::core::mem::offset_of!(MfPlusVersion, batch) - 21usize];
21918 ["Offset of field: MfPlusVersion::prod_week"]
21919 [::core::mem::offset_of!(MfPlusVersion, prod_week) - 26usize];
21920 ["Offset of field: MfPlusVersion::prod_year"]
21921 [::core::mem::offset_of!(MfPlusVersion, prod_year) - 27usize];
21922};
21923#[repr(C)]
21924#[derive(Debug, Copy, Clone)]
21925pub struct MfPlusData {
21926 pub iso14443_4a_data: *mut Iso14443_4aData,
21927 pub version: MfPlusVersion,
21928 pub type_: MfPlusType,
21929 pub size: MfPlusSize,
21930 pub security_level: MfPlusSecurityLevel,
21931 pub device_name: *mut FuriString,
21932}
21933#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21934const _: () = {
21935 ["Size of MfPlusData"][::core::mem::size_of::<MfPlusData>() - 40usize];
21936 ["Alignment of MfPlusData"][::core::mem::align_of::<MfPlusData>() - 4usize];
21937 ["Offset of field: MfPlusData::iso14443_4a_data"]
21938 [::core::mem::offset_of!(MfPlusData, iso14443_4a_data) - 0usize];
21939 ["Offset of field: MfPlusData::version"][::core::mem::offset_of!(MfPlusData, version) - 4usize];
21940 ["Offset of field: MfPlusData::type_"][::core::mem::offset_of!(MfPlusData, type_) - 32usize];
21941 ["Offset of field: MfPlusData::size"][::core::mem::offset_of!(MfPlusData, size) - 33usize];
21942 ["Offset of field: MfPlusData::security_level"]
21943 [::core::mem::offset_of!(MfPlusData, security_level) - 34usize];
21944 ["Offset of field: MfPlusData::device_name"]
21945 [::core::mem::offset_of!(MfPlusData, device_name) - 36usize];
21946};
21947unsafe extern "C" {
21948 pub fn mf_plus_alloc() -> *mut MfPlusData;
21949}
21950unsafe extern "C" {
21951 pub fn mf_plus_free(data: *mut MfPlusData);
21952}
21953unsafe extern "C" {
21954 pub fn mf_plus_reset(data: *mut MfPlusData);
21955}
21956unsafe extern "C" {
21957 pub fn mf_plus_copy(data: *mut MfPlusData, other: *const MfPlusData);
21958}
21959unsafe extern "C" {
21960 pub fn mf_plus_verify(data: *mut MfPlusData, device_type: *const FuriString) -> bool;
21961}
21962unsafe extern "C" {
21963 pub fn mf_plus_load(data: *mut MfPlusData, ff: *mut FlipperFormat, version: u32) -> bool;
21964}
21965unsafe extern "C" {
21966 pub fn mf_plus_save(data: *const MfPlusData, ff: *mut FlipperFormat) -> bool;
21967}
21968unsafe extern "C" {
21969 pub fn mf_plus_is_equal(data: *const MfPlusData, other: *const MfPlusData) -> bool;
21970}
21971unsafe extern "C" {
21972 pub fn mf_plus_get_device_name(
21973 data: *const MfPlusData,
21974 name_type: NfcDeviceNameType,
21975 ) -> *const core::ffi::c_char;
21976}
21977unsafe extern "C" {
21978 pub fn mf_plus_get_uid(data: *const MfPlusData, uid_len: *mut usize) -> *const u8;
21979}
21980unsafe extern "C" {
21981 pub fn mf_plus_set_uid(data: *mut MfPlusData, uid: *const u8, uid_len: usize) -> bool;
21982}
21983unsafe extern "C" {
21984 pub fn mf_plus_get_base_data(data: *const MfPlusData) -> *mut Iso14443_4aData;
21985}
21986#[repr(C)]
21987#[derive(Debug, Copy, Clone)]
21988pub struct MfPlusPoller {
21989 _unused: [u8; 0],
21990}
21991#[doc = "< Card was read successfully."]
21992pub const MfPlusPollerEventTypeReadSuccess: MfPlusPollerEventType = MfPlusPollerEventType(0);
21993#[doc = "< Poller failed to read the card."]
21994pub const MfPlusPollerEventTypeReadFailed: MfPlusPollerEventType = MfPlusPollerEventType(1);
21995#[repr(transparent)]
21996#[doc = "Enumeration of possible MfPlus poller event types."]
21997#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21998pub struct MfPlusPollerEventType(pub core::ffi::c_uchar);
21999#[doc = "MIFARE Plus poller event data."]
22000#[repr(C)]
22001#[derive(Copy, Clone)]
22002pub union MfPlusPollerEventData {
22003 #[doc = "< Error code indicating card reading fail reason."]
22004 pub error: MfPlusError,
22005}
22006#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22007const _: () = {
22008 ["Size of MfPlusPollerEventData"][::core::mem::size_of::<MfPlusPollerEventData>() - 1usize];
22009 ["Alignment of MfPlusPollerEventData"]
22010 [::core::mem::align_of::<MfPlusPollerEventData>() - 1usize];
22011 ["Offset of field: MfPlusPollerEventData::error"]
22012 [::core::mem::offset_of!(MfPlusPollerEventData, error) - 0usize];
22013};
22014#[doc = "MIFARE Plus poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
22015#[repr(C)]
22016#[derive(Debug, Copy, Clone)]
22017pub struct MfPlusPollerEvent {
22018 #[doc = "< Type of emitted event."]
22019 pub type_: MfPlusPollerEventType,
22020 #[doc = "< Pointer to event specific data."]
22021 pub data: *mut MfPlusPollerEventData,
22022}
22023#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22024const _: () = {
22025 ["Size of MfPlusPollerEvent"][::core::mem::size_of::<MfPlusPollerEvent>() - 8usize];
22026 ["Alignment of MfPlusPollerEvent"][::core::mem::align_of::<MfPlusPollerEvent>() - 4usize];
22027 ["Offset of field: MfPlusPollerEvent::type_"]
22028 [::core::mem::offset_of!(MfPlusPollerEvent, type_) - 0usize];
22029 ["Offset of field: MfPlusPollerEvent::data"]
22030 [::core::mem::offset_of!(MfPlusPollerEvent, data) - 4usize];
22031};
22032unsafe extern "C" {
22033 #[doc = "Read MfPlus card version.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfPlusVersion structure to be filled with version data.\n # Returns\n\nMfPlusErrorNone on success, an error code on failure."]
22034 pub fn mf_plus_poller_read_version(
22035 instance: *mut MfPlusPoller,
22036 data: *mut MfPlusVersion,
22037 ) -> MfPlusError;
22038}
22039pub const MfUltralightErrorNone: MfUltralightError = MfUltralightError(0);
22040pub const MfUltralightErrorNotPresent: MfUltralightError = MfUltralightError(1);
22041pub const MfUltralightErrorProtocol: MfUltralightError = MfUltralightError(2);
22042pub const MfUltralightErrorAuth: MfUltralightError = MfUltralightError(3);
22043pub const MfUltralightErrorTimeout: MfUltralightError = MfUltralightError(4);
22044#[repr(transparent)]
22045#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22046pub struct MfUltralightError(pub core::ffi::c_uchar);
22047pub const MfUltralightTypeOrigin: MfUltralightType = MfUltralightType(0);
22048pub const MfUltralightTypeNTAG203: MfUltralightType = MfUltralightType(1);
22049pub const MfUltralightTypeMfulC: MfUltralightType = MfUltralightType(2);
22050pub const MfUltralightTypeUL11: MfUltralightType = MfUltralightType(3);
22051pub const MfUltralightTypeUL21: MfUltralightType = MfUltralightType(4);
22052pub const MfUltralightTypeNTAG213: MfUltralightType = MfUltralightType(5);
22053pub const MfUltralightTypeNTAG215: MfUltralightType = MfUltralightType(6);
22054pub const MfUltralightTypeNTAG216: MfUltralightType = MfUltralightType(7);
22055pub const MfUltralightTypeNTAGI2C1K: MfUltralightType = MfUltralightType(8);
22056pub const MfUltralightTypeNTAGI2C2K: MfUltralightType = MfUltralightType(9);
22057pub const MfUltralightTypeNTAGI2CPlus1K: MfUltralightType = MfUltralightType(10);
22058pub const MfUltralightTypeNTAGI2CPlus2K: MfUltralightType = MfUltralightType(11);
22059pub const MfUltralightTypeNum: MfUltralightType = MfUltralightType(12);
22060#[repr(transparent)]
22061#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22062pub struct MfUltralightType(pub core::ffi::c_uchar);
22063pub const MfUltralightFeatureSupportReadVersion: MfUltralightFeatureSupport =
22064 MfUltralightFeatureSupport(1);
22065pub const MfUltralightFeatureSupportReadSignature: MfUltralightFeatureSupport =
22066 MfUltralightFeatureSupport(2);
22067pub const MfUltralightFeatureSupportReadCounter: MfUltralightFeatureSupport =
22068 MfUltralightFeatureSupport(4);
22069pub const MfUltralightFeatureSupportCheckTearingFlag: MfUltralightFeatureSupport =
22070 MfUltralightFeatureSupport(8);
22071pub const MfUltralightFeatureSupportFastRead: MfUltralightFeatureSupport =
22072 MfUltralightFeatureSupport(16);
22073pub const MfUltralightFeatureSupportIncCounter: MfUltralightFeatureSupport =
22074 MfUltralightFeatureSupport(32);
22075pub const MfUltralightFeatureSupportFastWrite: MfUltralightFeatureSupport =
22076 MfUltralightFeatureSupport(64);
22077pub const MfUltralightFeatureSupportCompatibleWrite: MfUltralightFeatureSupport =
22078 MfUltralightFeatureSupport(128);
22079pub const MfUltralightFeatureSupportPasswordAuth: MfUltralightFeatureSupport =
22080 MfUltralightFeatureSupport(256);
22081pub const MfUltralightFeatureSupportVcsl: MfUltralightFeatureSupport =
22082 MfUltralightFeatureSupport(512);
22083pub const MfUltralightFeatureSupportSectorSelect: MfUltralightFeatureSupport =
22084 MfUltralightFeatureSupport(1024);
22085pub const MfUltralightFeatureSupportSingleCounter: MfUltralightFeatureSupport =
22086 MfUltralightFeatureSupport(2048);
22087pub const MfUltralightFeatureSupportAsciiMirror: MfUltralightFeatureSupport =
22088 MfUltralightFeatureSupport(4096);
22089pub const MfUltralightFeatureSupportCounterInMemory: MfUltralightFeatureSupport =
22090 MfUltralightFeatureSupport(8192);
22091pub const MfUltralightFeatureSupportDynamicLock: MfUltralightFeatureSupport =
22092 MfUltralightFeatureSupport(16384);
22093pub const MfUltralightFeatureSupportAuthenticate: MfUltralightFeatureSupport =
22094 MfUltralightFeatureSupport(32768);
22095#[repr(transparent)]
22096#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22097pub struct MfUltralightFeatureSupport(pub core::ffi::c_ushort);
22098#[repr(C)]
22099#[derive(Debug, Copy, Clone)]
22100pub struct MfUltralightPage {
22101 pub data: [u8; 4usize],
22102}
22103#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22104const _: () = {
22105 ["Size of MfUltralightPage"][::core::mem::size_of::<MfUltralightPage>() - 4usize];
22106 ["Alignment of MfUltralightPage"][::core::mem::align_of::<MfUltralightPage>() - 1usize];
22107 ["Offset of field: MfUltralightPage::data"]
22108 [::core::mem::offset_of!(MfUltralightPage, data) - 0usize];
22109};
22110#[repr(C)]
22111#[derive(Debug, Copy, Clone)]
22112pub struct MfUltralightPageReadCommandData {
22113 pub page: [MfUltralightPage; 4usize],
22114}
22115#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22116const _: () = {
22117 ["Size of MfUltralightPageReadCommandData"]
22118 [::core::mem::size_of::<MfUltralightPageReadCommandData>() - 16usize];
22119 ["Alignment of MfUltralightPageReadCommandData"]
22120 [::core::mem::align_of::<MfUltralightPageReadCommandData>() - 1usize];
22121 ["Offset of field: MfUltralightPageReadCommandData::page"]
22122 [::core::mem::offset_of!(MfUltralightPageReadCommandData, page) - 0usize];
22123};
22124#[repr(C)]
22125#[derive(Debug, Copy, Clone)]
22126pub struct MfUltralightVersion {
22127 pub header: u8,
22128 pub vendor_id: u8,
22129 pub prod_type: u8,
22130 pub prod_subtype: u8,
22131 pub prod_ver_major: u8,
22132 pub prod_ver_minor: u8,
22133 pub storage_size: u8,
22134 pub protocol_type: u8,
22135}
22136#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22137const _: () = {
22138 ["Size of MfUltralightVersion"][::core::mem::size_of::<MfUltralightVersion>() - 8usize];
22139 ["Alignment of MfUltralightVersion"][::core::mem::align_of::<MfUltralightVersion>() - 1usize];
22140 ["Offset of field: MfUltralightVersion::header"]
22141 [::core::mem::offset_of!(MfUltralightVersion, header) - 0usize];
22142 ["Offset of field: MfUltralightVersion::vendor_id"]
22143 [::core::mem::offset_of!(MfUltralightVersion, vendor_id) - 1usize];
22144 ["Offset of field: MfUltralightVersion::prod_type"]
22145 [::core::mem::offset_of!(MfUltralightVersion, prod_type) - 2usize];
22146 ["Offset of field: MfUltralightVersion::prod_subtype"]
22147 [::core::mem::offset_of!(MfUltralightVersion, prod_subtype) - 3usize];
22148 ["Offset of field: MfUltralightVersion::prod_ver_major"]
22149 [::core::mem::offset_of!(MfUltralightVersion, prod_ver_major) - 4usize];
22150 ["Offset of field: MfUltralightVersion::prod_ver_minor"]
22151 [::core::mem::offset_of!(MfUltralightVersion, prod_ver_minor) - 5usize];
22152 ["Offset of field: MfUltralightVersion::storage_size"]
22153 [::core::mem::offset_of!(MfUltralightVersion, storage_size) - 6usize];
22154 ["Offset of field: MfUltralightVersion::protocol_type"]
22155 [::core::mem::offset_of!(MfUltralightVersion, protocol_type) - 7usize];
22156};
22157#[repr(C)]
22158#[derive(Debug, Copy, Clone)]
22159pub struct MfUltralightSignature {
22160 pub data: [u8; 32usize],
22161}
22162#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22163const _: () = {
22164 ["Size of MfUltralightSignature"][::core::mem::size_of::<MfUltralightSignature>() - 32usize];
22165 ["Alignment of MfUltralightSignature"]
22166 [::core::mem::align_of::<MfUltralightSignature>() - 1usize];
22167 ["Offset of field: MfUltralightSignature::data"]
22168 [::core::mem::offset_of!(MfUltralightSignature, data) - 0usize];
22169};
22170#[repr(C)]
22171#[derive(Copy, Clone)]
22172pub union MfUltralightCounter {
22173 pub counter: u32,
22174 pub data: [u8; 3usize],
22175}
22176#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22177const _: () = {
22178 ["Size of MfUltralightCounter"][::core::mem::size_of::<MfUltralightCounter>() - 4usize];
22179 ["Alignment of MfUltralightCounter"][::core::mem::align_of::<MfUltralightCounter>() - 4usize];
22180 ["Offset of field: MfUltralightCounter::counter"]
22181 [::core::mem::offset_of!(MfUltralightCounter, counter) - 0usize];
22182 ["Offset of field: MfUltralightCounter::data"]
22183 [::core::mem::offset_of!(MfUltralightCounter, data) - 0usize];
22184};
22185#[repr(C)]
22186#[derive(Debug, Copy, Clone)]
22187pub struct MfUltralightTearingFlag {
22188 pub data: u8,
22189}
22190#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22191const _: () = {
22192 ["Size of MfUltralightTearingFlag"][::core::mem::size_of::<MfUltralightTearingFlag>() - 1usize];
22193 ["Alignment of MfUltralightTearingFlag"]
22194 [::core::mem::align_of::<MfUltralightTearingFlag>() - 1usize];
22195 ["Offset of field: MfUltralightTearingFlag::data"]
22196 [::core::mem::offset_of!(MfUltralightTearingFlag, data) - 0usize];
22197};
22198#[repr(C)]
22199#[derive(Debug, Copy, Clone)]
22200pub struct MfUltralightAuthPassword {
22201 pub data: [u8; 4usize],
22202}
22203#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22204const _: () = {
22205 ["Size of MfUltralightAuthPassword"]
22206 [::core::mem::size_of::<MfUltralightAuthPassword>() - 4usize];
22207 ["Alignment of MfUltralightAuthPassword"]
22208 [::core::mem::align_of::<MfUltralightAuthPassword>() - 1usize];
22209 ["Offset of field: MfUltralightAuthPassword::data"]
22210 [::core::mem::offset_of!(MfUltralightAuthPassword, data) - 0usize];
22211};
22212#[repr(C)]
22213#[derive(Debug, Copy, Clone)]
22214pub struct MfUltralightC3DesAuthKey {
22215 pub data: [u8; 16usize],
22216}
22217#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22218const _: () = {
22219 ["Size of MfUltralightC3DesAuthKey"]
22220 [::core::mem::size_of::<MfUltralightC3DesAuthKey>() - 16usize];
22221 ["Alignment of MfUltralightC3DesAuthKey"]
22222 [::core::mem::align_of::<MfUltralightC3DesAuthKey>() - 1usize];
22223 ["Offset of field: MfUltralightC3DesAuthKey::data"]
22224 [::core::mem::offset_of!(MfUltralightC3DesAuthKey, data) - 0usize];
22225};
22226#[repr(C)]
22227#[derive(Debug, Copy, Clone)]
22228pub struct MfUltralightAuthPack {
22229 pub data: [u8; 2usize],
22230}
22231#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22232const _: () = {
22233 ["Size of MfUltralightAuthPack"][::core::mem::size_of::<MfUltralightAuthPack>() - 2usize];
22234 ["Alignment of MfUltralightAuthPack"][::core::mem::align_of::<MfUltralightAuthPack>() - 1usize];
22235 ["Offset of field: MfUltralightAuthPack::data"]
22236 [::core::mem::offset_of!(MfUltralightAuthPack, data) - 0usize];
22237};
22238pub const MfUltralightMirrorNone: MfUltralightMirrorConf = MfUltralightMirrorConf(0);
22239pub const MfUltralightMirrorUid: MfUltralightMirrorConf = MfUltralightMirrorConf(1);
22240pub const MfUltralightMirrorCounter: MfUltralightMirrorConf = MfUltralightMirrorConf(2);
22241pub const MfUltralightMirrorUidCounter: MfUltralightMirrorConf = MfUltralightMirrorConf(3);
22242#[repr(transparent)]
22243#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22244pub struct MfUltralightMirrorConf(pub core::ffi::c_uchar);
22245#[repr(C, packed)]
22246#[derive(Copy, Clone)]
22247pub struct MfUltralightConfigPages {
22248 pub mirror: MfUltralightConfigPages__bindgen_ty_1,
22249 pub rfui1: u8,
22250 pub mirror_page: u8,
22251 pub auth0: u8,
22252 pub access: MfUltralightConfigPages__bindgen_ty_2,
22253 pub vctid: u8,
22254 pub rfui2: [u8; 2usize],
22255 pub password: MfUltralightAuthPassword,
22256 pub pack: MfUltralightAuthPack,
22257 pub rfui3: [u8; 2usize],
22258}
22259#[repr(C)]
22260#[derive(Copy, Clone)]
22261pub union MfUltralightConfigPages__bindgen_ty_1 {
22262 pub value: u8,
22263 pub __bindgen_anon_1: MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1,
22264}
22265#[repr(C)]
22266#[derive(Debug, Copy, Clone)]
22267pub struct MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1 {
22268 pub _bitfield_align_1: [u8; 0],
22269 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
22270}
22271#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22272const _: () = {
22273 ["Size of MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1"]
22274 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1>() - 1usize];
22275 ["Alignment of MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1"]
22276 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1>() - 1usize];
22277};
22278impl MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1 {
22279 #[inline]
22280 pub fn rfui1(&self) -> u8 {
22281 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
22282 }
22283 #[inline]
22284 pub fn set_rfui1(&mut self, val: u8) {
22285 unsafe {
22286 let val: u8 = ::core::mem::transmute(val);
22287 self._bitfield_1.set(0usize, 2u8, val as u64)
22288 }
22289 }
22290 #[inline]
22291 pub unsafe fn rfui1_raw(this: *const Self) -> u8 {
22292 unsafe {
22293 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22294 ::core::ptr::addr_of!((*this)._bitfield_1),
22295 0usize,
22296 2u8,
22297 ) as u8)
22298 }
22299 }
22300 #[inline]
22301 pub unsafe fn set_rfui1_raw(this: *mut Self, val: u8) {
22302 unsafe {
22303 let val: u8 = ::core::mem::transmute(val);
22304 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22305 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22306 0usize,
22307 2u8,
22308 val as u64,
22309 )
22310 }
22311 }
22312 #[inline]
22313 pub fn strg_mod_en(&self) -> bool {
22314 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
22315 }
22316 #[inline]
22317 pub fn set_strg_mod_en(&mut self, val: bool) {
22318 unsafe {
22319 let val: u8 = ::core::mem::transmute(val);
22320 self._bitfield_1.set(2usize, 1u8, val as u64)
22321 }
22322 }
22323 #[inline]
22324 pub unsafe fn strg_mod_en_raw(this: *const Self) -> bool {
22325 unsafe {
22326 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22327 ::core::ptr::addr_of!((*this)._bitfield_1),
22328 2usize,
22329 1u8,
22330 ) as u8)
22331 }
22332 }
22333 #[inline]
22334 pub unsafe fn set_strg_mod_en_raw(this: *mut Self, val: bool) {
22335 unsafe {
22336 let val: u8 = ::core::mem::transmute(val);
22337 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22338 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22339 2usize,
22340 1u8,
22341 val as u64,
22342 )
22343 }
22344 }
22345 #[inline]
22346 pub fn rfui2(&self) -> bool {
22347 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
22348 }
22349 #[inline]
22350 pub fn set_rfui2(&mut self, val: bool) {
22351 unsafe {
22352 let val: u8 = ::core::mem::transmute(val);
22353 self._bitfield_1.set(3usize, 1u8, val as u64)
22354 }
22355 }
22356 #[inline]
22357 pub unsafe fn rfui2_raw(this: *const Self) -> bool {
22358 unsafe {
22359 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22360 ::core::ptr::addr_of!((*this)._bitfield_1),
22361 3usize,
22362 1u8,
22363 ) as u8)
22364 }
22365 }
22366 #[inline]
22367 pub unsafe fn set_rfui2_raw(this: *mut Self, val: bool) {
22368 unsafe {
22369 let val: u8 = ::core::mem::transmute(val);
22370 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22371 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22372 3usize,
22373 1u8,
22374 val as u64,
22375 )
22376 }
22377 }
22378 #[inline]
22379 pub fn mirror_byte(&self) -> u8 {
22380 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) }
22381 }
22382 #[inline]
22383 pub fn set_mirror_byte(&mut self, val: u8) {
22384 unsafe {
22385 let val: u8 = ::core::mem::transmute(val);
22386 self._bitfield_1.set(4usize, 2u8, val as u64)
22387 }
22388 }
22389 #[inline]
22390 pub unsafe fn mirror_byte_raw(this: *const Self) -> u8 {
22391 unsafe {
22392 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22393 ::core::ptr::addr_of!((*this)._bitfield_1),
22394 4usize,
22395 2u8,
22396 ) as u8)
22397 }
22398 }
22399 #[inline]
22400 pub unsafe fn set_mirror_byte_raw(this: *mut Self, val: u8) {
22401 unsafe {
22402 let val: u8 = ::core::mem::transmute(val);
22403 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22404 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22405 4usize,
22406 2u8,
22407 val as u64,
22408 )
22409 }
22410 }
22411 #[inline]
22412 pub fn mirror_conf(&self) -> MfUltralightMirrorConf {
22413 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u8) }
22414 }
22415 #[inline]
22416 pub fn set_mirror_conf(&mut self, val: MfUltralightMirrorConf) {
22417 unsafe {
22418 let val: u8 = ::core::mem::transmute(val);
22419 self._bitfield_1.set(6usize, 2u8, val as u64)
22420 }
22421 }
22422 #[inline]
22423 pub unsafe fn mirror_conf_raw(this: *const Self) -> MfUltralightMirrorConf {
22424 unsafe {
22425 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22426 ::core::ptr::addr_of!((*this)._bitfield_1),
22427 6usize,
22428 2u8,
22429 ) as u8)
22430 }
22431 }
22432 #[inline]
22433 pub unsafe fn set_mirror_conf_raw(this: *mut Self, val: MfUltralightMirrorConf) {
22434 unsafe {
22435 let val: u8 = ::core::mem::transmute(val);
22436 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22437 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22438 6usize,
22439 2u8,
22440 val as u64,
22441 )
22442 }
22443 }
22444 #[inline]
22445 pub fn new_bitfield_1(
22446 rfui1: u8,
22447 strg_mod_en: bool,
22448 rfui2: bool,
22449 mirror_byte: u8,
22450 mirror_conf: MfUltralightMirrorConf,
22451 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
22452 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
22453 __bindgen_bitfield_unit.set(0usize, 2u8, {
22454 let rfui1: u8 = unsafe { ::core::mem::transmute(rfui1) };
22455 rfui1 as u64
22456 });
22457 __bindgen_bitfield_unit.set(2usize, 1u8, {
22458 let strg_mod_en: u8 = unsafe { ::core::mem::transmute(strg_mod_en) };
22459 strg_mod_en as u64
22460 });
22461 __bindgen_bitfield_unit.set(3usize, 1u8, {
22462 let rfui2: u8 = unsafe { ::core::mem::transmute(rfui2) };
22463 rfui2 as u64
22464 });
22465 __bindgen_bitfield_unit.set(4usize, 2u8, {
22466 let mirror_byte: u8 = unsafe { ::core::mem::transmute(mirror_byte) };
22467 mirror_byte as u64
22468 });
22469 __bindgen_bitfield_unit.set(6usize, 2u8, {
22470 let mirror_conf: u8 = unsafe { ::core::mem::transmute(mirror_conf) };
22471 mirror_conf as u64
22472 });
22473 __bindgen_bitfield_unit
22474 }
22475}
22476#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22477const _: () = {
22478 ["Size of MfUltralightConfigPages__bindgen_ty_1"]
22479 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_1>() - 1usize];
22480 ["Alignment of MfUltralightConfigPages__bindgen_ty_1"]
22481 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_1>() - 1usize];
22482 ["Offset of field: MfUltralightConfigPages__bindgen_ty_1::value"]
22483 [::core::mem::offset_of!(MfUltralightConfigPages__bindgen_ty_1, value) - 0usize];
22484};
22485#[repr(C)]
22486#[derive(Copy, Clone)]
22487pub union MfUltralightConfigPages__bindgen_ty_2 {
22488 pub value: u8,
22489 pub __bindgen_anon_1: MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1,
22490}
22491#[repr(C)]
22492#[derive(Debug, Copy, Clone)]
22493pub struct MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1 {
22494 pub _bitfield_align_1: [u8; 0],
22495 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
22496}
22497#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22498const _: () = {
22499 ["Size of MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1"]
22500 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1>() - 1usize];
22501 ["Alignment of MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1"]
22502 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1>() - 1usize];
22503};
22504impl MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1 {
22505 #[inline]
22506 pub fn authlim(&self) -> u8 {
22507 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) }
22508 }
22509 #[inline]
22510 pub fn set_authlim(&mut self, val: u8) {
22511 unsafe {
22512 let val: u8 = ::core::mem::transmute(val);
22513 self._bitfield_1.set(0usize, 3u8, val as u64)
22514 }
22515 }
22516 #[inline]
22517 pub unsafe fn authlim_raw(this: *const Self) -> u8 {
22518 unsafe {
22519 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22520 ::core::ptr::addr_of!((*this)._bitfield_1),
22521 0usize,
22522 3u8,
22523 ) as u8)
22524 }
22525 }
22526 #[inline]
22527 pub unsafe fn set_authlim_raw(this: *mut Self, val: u8) {
22528 unsafe {
22529 let val: u8 = ::core::mem::transmute(val);
22530 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22531 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22532 0usize,
22533 3u8,
22534 val as u64,
22535 )
22536 }
22537 }
22538 #[inline]
22539 pub fn nfc_cnt_pwd_prot(&self) -> bool {
22540 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
22541 }
22542 #[inline]
22543 pub fn set_nfc_cnt_pwd_prot(&mut self, val: bool) {
22544 unsafe {
22545 let val: u8 = ::core::mem::transmute(val);
22546 self._bitfield_1.set(3usize, 1u8, val as u64)
22547 }
22548 }
22549 #[inline]
22550 pub unsafe fn nfc_cnt_pwd_prot_raw(this: *const Self) -> bool {
22551 unsafe {
22552 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22553 ::core::ptr::addr_of!((*this)._bitfield_1),
22554 3usize,
22555 1u8,
22556 ) as u8)
22557 }
22558 }
22559 #[inline]
22560 pub unsafe fn set_nfc_cnt_pwd_prot_raw(this: *mut Self, val: bool) {
22561 unsafe {
22562 let val: u8 = ::core::mem::transmute(val);
22563 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22564 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22565 3usize,
22566 1u8,
22567 val as u64,
22568 )
22569 }
22570 }
22571 #[inline]
22572 pub fn nfc_cnt_en(&self) -> bool {
22573 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
22574 }
22575 #[inline]
22576 pub fn set_nfc_cnt_en(&mut self, val: bool) {
22577 unsafe {
22578 let val: u8 = ::core::mem::transmute(val);
22579 self._bitfield_1.set(4usize, 1u8, val as u64)
22580 }
22581 }
22582 #[inline]
22583 pub unsafe fn nfc_cnt_en_raw(this: *const Self) -> bool {
22584 unsafe {
22585 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22586 ::core::ptr::addr_of!((*this)._bitfield_1),
22587 4usize,
22588 1u8,
22589 ) as u8)
22590 }
22591 }
22592 #[inline]
22593 pub unsafe fn set_nfc_cnt_en_raw(this: *mut Self, val: bool) {
22594 unsafe {
22595 let val: u8 = ::core::mem::transmute(val);
22596 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22597 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22598 4usize,
22599 1u8,
22600 val as u64,
22601 )
22602 }
22603 }
22604 #[inline]
22605 pub fn nfc_dis_sec1(&self) -> bool {
22606 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) }
22607 }
22608 #[inline]
22609 pub fn set_nfc_dis_sec1(&mut self, val: bool) {
22610 unsafe {
22611 let val: u8 = ::core::mem::transmute(val);
22612 self._bitfield_1.set(5usize, 1u8, val as u64)
22613 }
22614 }
22615 #[inline]
22616 pub unsafe fn nfc_dis_sec1_raw(this: *const Self) -> bool {
22617 unsafe {
22618 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22619 ::core::ptr::addr_of!((*this)._bitfield_1),
22620 5usize,
22621 1u8,
22622 ) as u8)
22623 }
22624 }
22625 #[inline]
22626 pub unsafe fn set_nfc_dis_sec1_raw(this: *mut Self, val: bool) {
22627 unsafe {
22628 let val: u8 = ::core::mem::transmute(val);
22629 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22630 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22631 5usize,
22632 1u8,
22633 val as u64,
22634 )
22635 }
22636 }
22637 #[inline]
22638 pub fn cfglck(&self) -> bool {
22639 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) }
22640 }
22641 #[inline]
22642 pub fn set_cfglck(&mut self, val: bool) {
22643 unsafe {
22644 let val: u8 = ::core::mem::transmute(val);
22645 self._bitfield_1.set(6usize, 1u8, val as u64)
22646 }
22647 }
22648 #[inline]
22649 pub unsafe fn cfglck_raw(this: *const Self) -> bool {
22650 unsafe {
22651 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22652 ::core::ptr::addr_of!((*this)._bitfield_1),
22653 6usize,
22654 1u8,
22655 ) as u8)
22656 }
22657 }
22658 #[inline]
22659 pub unsafe fn set_cfglck_raw(this: *mut Self, val: bool) {
22660 unsafe {
22661 let val: u8 = ::core::mem::transmute(val);
22662 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22663 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22664 6usize,
22665 1u8,
22666 val as u64,
22667 )
22668 }
22669 }
22670 #[inline]
22671 pub fn prot(&self) -> bool {
22672 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
22673 }
22674 #[inline]
22675 pub fn set_prot(&mut self, val: bool) {
22676 unsafe {
22677 let val: u8 = ::core::mem::transmute(val);
22678 self._bitfield_1.set(7usize, 1u8, val as u64)
22679 }
22680 }
22681 #[inline]
22682 pub unsafe fn prot_raw(this: *const Self) -> bool {
22683 unsafe {
22684 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22685 ::core::ptr::addr_of!((*this)._bitfield_1),
22686 7usize,
22687 1u8,
22688 ) as u8)
22689 }
22690 }
22691 #[inline]
22692 pub unsafe fn set_prot_raw(this: *mut Self, val: bool) {
22693 unsafe {
22694 let val: u8 = ::core::mem::transmute(val);
22695 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22696 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22697 7usize,
22698 1u8,
22699 val as u64,
22700 )
22701 }
22702 }
22703 #[inline]
22704 pub fn new_bitfield_1(
22705 authlim: u8,
22706 nfc_cnt_pwd_prot: bool,
22707 nfc_cnt_en: bool,
22708 nfc_dis_sec1: bool,
22709 cfglck: bool,
22710 prot: bool,
22711 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
22712 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
22713 __bindgen_bitfield_unit.set(0usize, 3u8, {
22714 let authlim: u8 = unsafe { ::core::mem::transmute(authlim) };
22715 authlim as u64
22716 });
22717 __bindgen_bitfield_unit.set(3usize, 1u8, {
22718 let nfc_cnt_pwd_prot: u8 = unsafe { ::core::mem::transmute(nfc_cnt_pwd_prot) };
22719 nfc_cnt_pwd_prot as u64
22720 });
22721 __bindgen_bitfield_unit.set(4usize, 1u8, {
22722 let nfc_cnt_en: u8 = unsafe { ::core::mem::transmute(nfc_cnt_en) };
22723 nfc_cnt_en as u64
22724 });
22725 __bindgen_bitfield_unit.set(5usize, 1u8, {
22726 let nfc_dis_sec1: u8 = unsafe { ::core::mem::transmute(nfc_dis_sec1) };
22727 nfc_dis_sec1 as u64
22728 });
22729 __bindgen_bitfield_unit.set(6usize, 1u8, {
22730 let cfglck: u8 = unsafe { ::core::mem::transmute(cfglck) };
22731 cfglck as u64
22732 });
22733 __bindgen_bitfield_unit.set(7usize, 1u8, {
22734 let prot: u8 = unsafe { ::core::mem::transmute(prot) };
22735 prot as u64
22736 });
22737 __bindgen_bitfield_unit
22738 }
22739}
22740#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22741const _: () = {
22742 ["Size of MfUltralightConfigPages__bindgen_ty_2"]
22743 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_2>() - 1usize];
22744 ["Alignment of MfUltralightConfigPages__bindgen_ty_2"]
22745 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_2>() - 1usize];
22746 ["Offset of field: MfUltralightConfigPages__bindgen_ty_2::value"]
22747 [::core::mem::offset_of!(MfUltralightConfigPages__bindgen_ty_2, value) - 0usize];
22748};
22749#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22750const _: () = {
22751 ["Size of MfUltralightConfigPages"]
22752 [::core::mem::size_of::<MfUltralightConfigPages>() - 16usize];
22753 ["Alignment of MfUltralightConfigPages"]
22754 [::core::mem::align_of::<MfUltralightConfigPages>() - 1usize];
22755 ["Offset of field: MfUltralightConfigPages::mirror"]
22756 [::core::mem::offset_of!(MfUltralightConfigPages, mirror) - 0usize];
22757 ["Offset of field: MfUltralightConfigPages::rfui1"]
22758 [::core::mem::offset_of!(MfUltralightConfigPages, rfui1) - 1usize];
22759 ["Offset of field: MfUltralightConfigPages::mirror_page"]
22760 [::core::mem::offset_of!(MfUltralightConfigPages, mirror_page) - 2usize];
22761 ["Offset of field: MfUltralightConfigPages::auth0"]
22762 [::core::mem::offset_of!(MfUltralightConfigPages, auth0) - 3usize];
22763 ["Offset of field: MfUltralightConfigPages::access"]
22764 [::core::mem::offset_of!(MfUltralightConfigPages, access) - 4usize];
22765 ["Offset of field: MfUltralightConfigPages::vctid"]
22766 [::core::mem::offset_of!(MfUltralightConfigPages, vctid) - 5usize];
22767 ["Offset of field: MfUltralightConfigPages::rfui2"]
22768 [::core::mem::offset_of!(MfUltralightConfigPages, rfui2) - 6usize];
22769 ["Offset of field: MfUltralightConfigPages::password"]
22770 [::core::mem::offset_of!(MfUltralightConfigPages, password) - 8usize];
22771 ["Offset of field: MfUltralightConfigPages::pack"]
22772 [::core::mem::offset_of!(MfUltralightConfigPages, pack) - 12usize];
22773 ["Offset of field: MfUltralightConfigPages::rfui3"]
22774 [::core::mem::offset_of!(MfUltralightConfigPages, rfui3) - 14usize];
22775};
22776#[repr(C)]
22777#[derive(Copy, Clone)]
22778pub struct MfUltralightData {
22779 pub iso14443_3a_data: *mut Iso14443_3aData,
22780 pub type_: MfUltralightType,
22781 pub version: MfUltralightVersion,
22782 pub signature: MfUltralightSignature,
22783 pub counter: [MfUltralightCounter; 3usize],
22784 pub tearing_flag: [MfUltralightTearingFlag; 3usize],
22785 pub page: [MfUltralightPage; 510usize],
22786 pub pages_read: u16,
22787 pub pages_total: u16,
22788 pub auth_attempts: u32,
22789}
22790#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22791const _: () = {
22792 ["Size of MfUltralightData"][::core::mem::size_of::<MfUltralightData>() - 2112usize];
22793 ["Alignment of MfUltralightData"][::core::mem::align_of::<MfUltralightData>() - 4usize];
22794 ["Offset of field: MfUltralightData::iso14443_3a_data"]
22795 [::core::mem::offset_of!(MfUltralightData, iso14443_3a_data) - 0usize];
22796 ["Offset of field: MfUltralightData::type_"]
22797 [::core::mem::offset_of!(MfUltralightData, type_) - 4usize];
22798 ["Offset of field: MfUltralightData::version"]
22799 [::core::mem::offset_of!(MfUltralightData, version) - 5usize];
22800 ["Offset of field: MfUltralightData::signature"]
22801 [::core::mem::offset_of!(MfUltralightData, signature) - 13usize];
22802 ["Offset of field: MfUltralightData::counter"]
22803 [::core::mem::offset_of!(MfUltralightData, counter) - 48usize];
22804 ["Offset of field: MfUltralightData::tearing_flag"]
22805 [::core::mem::offset_of!(MfUltralightData, tearing_flag) - 60usize];
22806 ["Offset of field: MfUltralightData::page"]
22807 [::core::mem::offset_of!(MfUltralightData, page) - 63usize];
22808 ["Offset of field: MfUltralightData::pages_read"]
22809 [::core::mem::offset_of!(MfUltralightData, pages_read) - 2104usize];
22810 ["Offset of field: MfUltralightData::pages_total"]
22811 [::core::mem::offset_of!(MfUltralightData, pages_total) - 2106usize];
22812 ["Offset of field: MfUltralightData::auth_attempts"]
22813 [::core::mem::offset_of!(MfUltralightData, auth_attempts) - 2108usize];
22814};
22815unsafe extern "C" {
22816 pub fn mf_ultralight_alloc() -> *mut MfUltralightData;
22817}
22818unsafe extern "C" {
22819 pub fn mf_ultralight_free(data: *mut MfUltralightData);
22820}
22821unsafe extern "C" {
22822 pub fn mf_ultralight_reset(data: *mut MfUltralightData);
22823}
22824unsafe extern "C" {
22825 pub fn mf_ultralight_copy(data: *mut MfUltralightData, other: *const MfUltralightData);
22826}
22827unsafe extern "C" {
22828 pub fn mf_ultralight_verify(
22829 data: *mut MfUltralightData,
22830 device_type: *const FuriString,
22831 ) -> bool;
22832}
22833unsafe extern "C" {
22834 pub fn mf_ultralight_load(
22835 data: *mut MfUltralightData,
22836 ff: *mut FlipperFormat,
22837 version: u32,
22838 ) -> bool;
22839}
22840unsafe extern "C" {
22841 pub fn mf_ultralight_save(data: *const MfUltralightData, ff: *mut FlipperFormat) -> bool;
22842}
22843unsafe extern "C" {
22844 pub fn mf_ultralight_is_equal(
22845 data: *const MfUltralightData,
22846 other: *const MfUltralightData,
22847 ) -> bool;
22848}
22849unsafe extern "C" {
22850 pub fn mf_ultralight_get_device_name(
22851 data: *const MfUltralightData,
22852 name_type: NfcDeviceNameType,
22853 ) -> *const core::ffi::c_char;
22854}
22855unsafe extern "C" {
22856 pub fn mf_ultralight_get_uid(data: *const MfUltralightData, uid_len: *mut usize) -> *const u8;
22857}
22858unsafe extern "C" {
22859 pub fn mf_ultralight_set_uid(
22860 data: *mut MfUltralightData,
22861 uid: *const u8,
22862 uid_len: usize,
22863 ) -> bool;
22864}
22865unsafe extern "C" {
22866 pub fn mf_ultralight_get_base_data(data: *const MfUltralightData) -> *mut Iso14443_3aData;
22867}
22868unsafe extern "C" {
22869 pub fn mf_ultralight_get_type_by_version(version: *mut MfUltralightVersion)
22870 -> MfUltralightType;
22871}
22872unsafe extern "C" {
22873 pub fn mf_ultralight_get_pages_total(type_: MfUltralightType) -> u16;
22874}
22875unsafe extern "C" {
22876 pub fn mf_ultralight_get_feature_support_set(type_: MfUltralightType) -> u32;
22877}
22878unsafe extern "C" {
22879 pub fn mf_ultralight_get_config_page_num(type_: MfUltralightType) -> u16;
22880}
22881unsafe extern "C" {
22882 pub fn mf_ultralight_get_write_end_page(type_: MfUltralightType) -> u8;
22883}
22884unsafe extern "C" {
22885 pub fn mf_ultralight_get_pwd_page_num(type_: MfUltralightType) -> u8;
22886}
22887unsafe extern "C" {
22888 pub fn mf_ultralight_is_page_pwd_or_pack(type_: MfUltralightType, page_num: u16) -> bool;
22889}
22890unsafe extern "C" {
22891 pub fn mf_ultralight_support_feature(feature_set: u32, features_to_check: u32) -> bool;
22892}
22893unsafe extern "C" {
22894 pub fn mf_ultralight_get_config_page(
22895 data: *const MfUltralightData,
22896 config: *mut *mut MfUltralightConfigPages,
22897 ) -> bool;
22898}
22899unsafe extern "C" {
22900 pub fn mf_ultralight_is_all_data_read(data: *const MfUltralightData) -> bool;
22901}
22902unsafe extern "C" {
22903 pub fn mf_ultralight_detect_protocol(iso14443_3a_data: *const Iso14443_3aData) -> bool;
22904}
22905unsafe extern "C" {
22906 pub fn mf_ultralight_is_counter_configured(data: *const MfUltralightData) -> bool;
22907}
22908unsafe extern "C" {
22909 pub fn mf_ultralight_3des_shift_data(arr: *mut u8);
22910}
22911unsafe extern "C" {
22912 pub fn mf_ultralight_3des_key_valid(data: *const MfUltralightData) -> bool;
22913}
22914unsafe extern "C" {
22915 pub fn mf_ultralight_3des_get_key(data: *const MfUltralightData) -> *const u8;
22916}
22917unsafe extern "C" {
22918 pub fn mf_ultralight_3des_encrypt(
22919 ctx: *mut mbedtls_des3_context,
22920 ck: *const u8,
22921 iv: *const u8,
22922 input: *const u8,
22923 length: u8,
22924 out: *mut u8,
22925 );
22926}
22927unsafe extern "C" {
22928 pub fn mf_ultralight_3des_decrypt(
22929 ctx: *mut mbedtls_des3_context,
22930 ck: *const u8,
22931 iv: *const u8,
22932 input: *const u8,
22933 length: u8,
22934 out: *mut u8,
22935 );
22936}
22937#[repr(C)]
22938#[derive(Debug, Copy, Clone)]
22939pub struct MfUltralightListener {
22940 _unused: [u8; 0],
22941}
22942pub const MfUltralightListenerEventTypeAuth: MfUltralightListenerEventType =
22943 MfUltralightListenerEventType(0);
22944#[repr(transparent)]
22945#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22946pub struct MfUltralightListenerEventType(pub core::ffi::c_uchar);
22947#[repr(C)]
22948#[derive(Copy, Clone)]
22949pub struct MfUltralightListenerEventData {
22950 pub __bindgen_anon_1: MfUltralightListenerEventData__bindgen_ty_1,
22951}
22952#[repr(C)]
22953#[derive(Copy, Clone)]
22954pub union MfUltralightListenerEventData__bindgen_ty_1 {
22955 pub password: MfUltralightAuthPassword,
22956}
22957#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22958const _: () = {
22959 ["Size of MfUltralightListenerEventData__bindgen_ty_1"]
22960 [::core::mem::size_of::<MfUltralightListenerEventData__bindgen_ty_1>() - 4usize];
22961 ["Alignment of MfUltralightListenerEventData__bindgen_ty_1"]
22962 [::core::mem::align_of::<MfUltralightListenerEventData__bindgen_ty_1>() - 1usize];
22963 ["Offset of field: MfUltralightListenerEventData__bindgen_ty_1::password"]
22964 [::core::mem::offset_of!(MfUltralightListenerEventData__bindgen_ty_1, password) - 0usize];
22965};
22966#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22967const _: () = {
22968 ["Size of MfUltralightListenerEventData"]
22969 [::core::mem::size_of::<MfUltralightListenerEventData>() - 4usize];
22970 ["Alignment of MfUltralightListenerEventData"]
22971 [::core::mem::align_of::<MfUltralightListenerEventData>() - 1usize];
22972};
22973#[repr(C)]
22974#[derive(Debug, Copy, Clone)]
22975pub struct MfUltralightListenerEvent {
22976 pub type_: MfUltralightListenerEventType,
22977 pub data: *mut MfUltralightListenerEventData,
22978}
22979#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22980const _: () = {
22981 ["Size of MfUltralightListenerEvent"]
22982 [::core::mem::size_of::<MfUltralightListenerEvent>() - 8usize];
22983 ["Alignment of MfUltralightListenerEvent"]
22984 [::core::mem::align_of::<MfUltralightListenerEvent>() - 4usize];
22985 ["Offset of field: MfUltralightListenerEvent::type_"]
22986 [::core::mem::offset_of!(MfUltralightListenerEvent, type_) - 0usize];
22987 ["Offset of field: MfUltralightListenerEvent::data"]
22988 [::core::mem::offset_of!(MfUltralightListenerEvent, data) - 4usize];
22989};
22990#[repr(C)]
22991#[derive(Debug, Copy, Clone)]
22992pub struct MfUltralightPoller {
22993 _unused: [u8; 0],
22994}
22995#[doc = "< Poller requests for operating mode."]
22996pub const MfUltralightPollerEventTypeRequestMode: MfUltralightPollerEventType =
22997 MfUltralightPollerEventType(0);
22998#[doc = "< Poller requests to fill authentication context."]
22999pub const MfUltralightPollerEventTypeAuthRequest: MfUltralightPollerEventType =
23000 MfUltralightPollerEventType(1);
23001#[doc = "< Authentication succeeded."]
23002pub const MfUltralightPollerEventTypeAuthSuccess: MfUltralightPollerEventType =
23003 MfUltralightPollerEventType(2);
23004#[doc = "< Authentication failed."]
23005pub const MfUltralightPollerEventTypeAuthFailed: MfUltralightPollerEventType =
23006 MfUltralightPollerEventType(3);
23007#[doc = "< Poller read card successfully."]
23008pub const MfUltralightPollerEventTypeReadSuccess: MfUltralightPollerEventType =
23009 MfUltralightPollerEventType(4);
23010#[doc = "< Poller failed to read card."]
23011pub const MfUltralightPollerEventTypeReadFailed: MfUltralightPollerEventType =
23012 MfUltralightPollerEventType(5);
23013#[doc = "< Poller request card data for write operation."]
23014pub const MfUltralightPollerEventTypeRequestWriteData: MfUltralightPollerEventType =
23015 MfUltralightPollerEventType(6);
23016#[doc = "< Type of card for writing differs from presented one."]
23017pub const MfUltralightPollerEventTypeCardMismatch: MfUltralightPollerEventType =
23018 MfUltralightPollerEventType(7);
23019#[doc = "< Presented card is locked by password, AUTH0 or lock bytes."]
23020pub const MfUltralightPollerEventTypeCardLocked: MfUltralightPollerEventType =
23021 MfUltralightPollerEventType(8);
23022#[doc = "< Poller wrote card successfully."]
23023pub const MfUltralightPollerEventTypeWriteSuccess: MfUltralightPollerEventType =
23024 MfUltralightPollerEventType(9);
23025#[doc = "< Poller failed to write card."]
23026pub const MfUltralightPollerEventTypeWriteFail: MfUltralightPollerEventType =
23027 MfUltralightPollerEventType(10);
23028#[doc = "< Poller requests key for dict attack."]
23029pub const MfUltralightPollerEventTypeRequestKey: MfUltralightPollerEventType =
23030 MfUltralightPollerEventType(11);
23031#[repr(transparent)]
23032#[doc = "Enumeration of possible MfUltralight poller event types."]
23033#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23034pub struct MfUltralightPollerEventType(pub core::ffi::c_uchar);
23035#[doc = "< Poller will only read card. It's a default mode."]
23036pub const MfUltralightPollerModeRead: MfUltralightPollerMode = MfUltralightPollerMode(0);
23037#[doc = "< Poller will write already saved card to another presented card."]
23038pub const MfUltralightPollerModeWrite: MfUltralightPollerMode = MfUltralightPollerMode(1);
23039#[doc = "< Poller will perform dictionary attack against card."]
23040pub const MfUltralightPollerModeDictAttack: MfUltralightPollerMode = MfUltralightPollerMode(2);
23041#[repr(transparent)]
23042#[doc = "Enumeration of possible MfUltralight poller operating modes."]
23043#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23044pub struct MfUltralightPollerMode(pub core::ffi::c_uchar);
23045#[doc = "MfUltralight poller authentication context."]
23046#[repr(C)]
23047#[derive(Debug, Copy, Clone)]
23048pub struct MfUltralightPollerAuthContext {
23049 #[doc = "< Password to be used for authentication."]
23050 pub password: MfUltralightAuthPassword,
23051 #[doc = "< 3DES key to be used for authentication."]
23052 pub tdes_key: MfUltralightC3DesAuthKey,
23053 #[doc = "< Pack received on successful authentication."]
23054 pub pack: MfUltralightAuthPack,
23055 #[doc = "< Set to true if authentication succeeded, false otherwise."]
23056 pub auth_success: bool,
23057 #[doc = "< Set to true if authentication should be skipped, false otherwise."]
23058 pub skip_auth: bool,
23059}
23060#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23061const _: () = {
23062 ["Size of MfUltralightPollerAuthContext"]
23063 [::core::mem::size_of::<MfUltralightPollerAuthContext>() - 24usize];
23064 ["Alignment of MfUltralightPollerAuthContext"]
23065 [::core::mem::align_of::<MfUltralightPollerAuthContext>() - 1usize];
23066 ["Offset of field: MfUltralightPollerAuthContext::password"]
23067 [::core::mem::offset_of!(MfUltralightPollerAuthContext, password) - 0usize];
23068 ["Offset of field: MfUltralightPollerAuthContext::tdes_key"]
23069 [::core::mem::offset_of!(MfUltralightPollerAuthContext, tdes_key) - 4usize];
23070 ["Offset of field: MfUltralightPollerAuthContext::pack"]
23071 [::core::mem::offset_of!(MfUltralightPollerAuthContext, pack) - 20usize];
23072 ["Offset of field: MfUltralightPollerAuthContext::auth_success"]
23073 [::core::mem::offset_of!(MfUltralightPollerAuthContext, auth_success) - 22usize];
23074 ["Offset of field: MfUltralightPollerAuthContext::skip_auth"]
23075 [::core::mem::offset_of!(MfUltralightPollerAuthContext, skip_auth) - 23usize];
23076};
23077#[doc = "MfUltralight poller key request data."]
23078#[repr(C)]
23079#[derive(Debug, Copy, Clone)]
23080pub struct MfUltralightPollerKeyRequestData {
23081 #[doc = "< Key to try."]
23082 pub key: MfUltralightC3DesAuthKey,
23083 #[doc = "< Set to true if key was provided, false to stop attack."]
23084 pub key_provided: bool,
23085}
23086#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23087const _: () = {
23088 ["Size of MfUltralightPollerKeyRequestData"]
23089 [::core::mem::size_of::<MfUltralightPollerKeyRequestData>() - 17usize];
23090 ["Alignment of MfUltralightPollerKeyRequestData"]
23091 [::core::mem::align_of::<MfUltralightPollerKeyRequestData>() - 1usize];
23092 ["Offset of field: MfUltralightPollerKeyRequestData::key"]
23093 [::core::mem::offset_of!(MfUltralightPollerKeyRequestData, key) - 0usize];
23094 ["Offset of field: MfUltralightPollerKeyRequestData::key_provided"]
23095 [::core::mem::offset_of!(MfUltralightPollerKeyRequestData, key_provided) - 16usize];
23096};
23097#[doc = "MfUltralight poller event data."]
23098#[repr(C)]
23099#[derive(Copy, Clone)]
23100pub union MfUltralightPollerEventData {
23101 #[doc = "< Authentication context."]
23102 pub auth_context: MfUltralightPollerAuthContext,
23103 #[doc = "< Error code indicating reading fail reason."]
23104 pub error: MfUltralightError,
23105 #[doc = "< Data to be written to card."]
23106 pub write_data: *const MfUltralightData,
23107 #[doc = "< Mode to operate in."]
23108 pub poller_mode: MfUltralightPollerMode,
23109 #[doc = "< Key request data."]
23110 pub key_request_data: MfUltralightPollerKeyRequestData,
23111}
23112#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23113const _: () = {
23114 ["Size of MfUltralightPollerEventData"]
23115 [::core::mem::size_of::<MfUltralightPollerEventData>() - 24usize];
23116 ["Alignment of MfUltralightPollerEventData"]
23117 [::core::mem::align_of::<MfUltralightPollerEventData>() - 4usize];
23118 ["Offset of field: MfUltralightPollerEventData::auth_context"]
23119 [::core::mem::offset_of!(MfUltralightPollerEventData, auth_context) - 0usize];
23120 ["Offset of field: MfUltralightPollerEventData::error"]
23121 [::core::mem::offset_of!(MfUltralightPollerEventData, error) - 0usize];
23122 ["Offset of field: MfUltralightPollerEventData::write_data"]
23123 [::core::mem::offset_of!(MfUltralightPollerEventData, write_data) - 0usize];
23124 ["Offset of field: MfUltralightPollerEventData::poller_mode"]
23125 [::core::mem::offset_of!(MfUltralightPollerEventData, poller_mode) - 0usize];
23126 ["Offset of field: MfUltralightPollerEventData::key_request_data"]
23127 [::core::mem::offset_of!(MfUltralightPollerEventData, key_request_data) - 0usize];
23128};
23129#[doc = "MfUltralight poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
23130#[repr(C)]
23131#[derive(Debug, Copy, Clone)]
23132pub struct MfUltralightPollerEvent {
23133 #[doc = "< Type of emitted event."]
23134 pub type_: MfUltralightPollerEventType,
23135 #[doc = "< Pointer to event specific data."]
23136 pub data: *mut MfUltralightPollerEventData,
23137}
23138#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23139const _: () = {
23140 ["Size of MfUltralightPollerEvent"][::core::mem::size_of::<MfUltralightPollerEvent>() - 8usize];
23141 ["Alignment of MfUltralightPollerEvent"]
23142 [::core::mem::align_of::<MfUltralightPollerEvent>() - 4usize];
23143 ["Offset of field: MfUltralightPollerEvent::type_"]
23144 [::core::mem::offset_of!(MfUltralightPollerEvent, type_) - 0usize];
23145 ["Offset of field: MfUltralightPollerEvent::data"]
23146 [::core::mem::offset_of!(MfUltralightPollerEvent, data) - 4usize];
23147};
23148unsafe extern "C" {
23149 #[doc = "Perform authentication with password.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction in, out) - pointer to the authentication context.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23150 pub fn mf_ultralight_poller_auth_pwd(
23151 instance: *mut MfUltralightPoller,
23152 data: *mut MfUltralightPollerAuthContext,
23153 ) -> MfUltralightError;
23154}
23155unsafe extern "C" {
23156 #[doc = "Start authentication procedure.\n\n Must ONLY be used inside the callback function.\n\n This function is used to start authentication process for Ultralight C cards.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `RndA` (direction in) - Randomly generated block which is required for authentication process.\n * `output` (direction out) - Authentication encryption result.\n # Returns\n\nMfUltralightErrorNone if card supports authentication command, an error code on otherwise."]
23157 pub fn mf_ultralight_poller_authenticate_start(
23158 instance: *mut MfUltralightPoller,
23159 RndA: *const u8,
23160 output: *mut u8,
23161 ) -> MfUltralightError;
23162}
23163unsafe extern "C" {
23164 #[doc = "End authentication procedure\n\n This function is used to end authentication process for Ultralight C cards.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `RndB` (direction in) - Block received from the card (card generates it randomly) which is required for authentication process.\n * `request` (direction in) - Contains data of RndA + RndB', where RndB' is decoded and shifted RndB received from the card on previous step.\n * `response` (direction out) - Must return RndA' which an encrypted shifted RndA value received from the card and decrypted by this function."]
23165 pub fn mf_ultralight_poller_authenticate_end(
23166 instance: *mut MfUltralightPoller,
23167 RndB: *const u8,
23168 request: *const u8,
23169 response: *mut u8,
23170 ) -> MfUltralightError;
23171}
23172unsafe extern "C" {
23173 #[doc = "Read page from card.\n\n Must ONLY be used inside the callback function.\n\n Send read command and parse response. The response on this command is data of 4 pages starting\n from the page specified in the command.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `start_page` (direction in) - page number to be read.\n * `data` (direction out) - pointer to the MfUltralightPageReadCommandData structure to be filled with page data.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23174 pub fn mf_ultralight_poller_read_page(
23175 instance: *mut MfUltralightPoller,
23176 start_page: u8,
23177 data: *mut MfUltralightPageReadCommandData,
23178 ) -> MfUltralightError;
23179}
23180unsafe extern "C" {
23181 #[doc = "Read page from sector.\n\n Must ONLY be used inside the callback function.\n\n This command should be used for NTAGI2C tags.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `sector` (direction in) - sector number to be read.\n * `tag` (direction in) - tag number to be read.\n * `data` (direction out) - pointer to the MfUltralightPageReadCommandData structure to be filled with page data.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23182 pub fn mf_ultralight_poller_read_page_from_sector(
23183 instance: *mut MfUltralightPoller,
23184 sector: u8,
23185 tag: u8,
23186 data: *mut MfUltralightPageReadCommandData,
23187 ) -> MfUltralightError;
23188}
23189unsafe extern "C" {
23190 #[doc = "Write page to card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `page` (direction in) - page number to be written.\n * `data` (direction in) - pointer to the MfUltralightPage structure to be written.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23191 pub fn mf_ultralight_poller_write_page(
23192 instance: *mut MfUltralightPoller,
23193 page: u8,
23194 data: *const MfUltralightPage,
23195 ) -> MfUltralightError;
23196}
23197unsafe extern "C" {
23198 #[doc = "Read version from card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfUltralightVersion structure to be filled.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23199 pub fn mf_ultralight_poller_read_version(
23200 instance: *mut MfUltralightPoller,
23201 data: *mut MfUltralightVersion,
23202 ) -> MfUltralightError;
23203}
23204unsafe extern "C" {
23205 #[doc = "Read signature from card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the MfUltralightSignature structure to be filled.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23206 pub fn mf_ultralight_poller_read_signature(
23207 instance: *mut MfUltralightPoller,
23208 data: *mut MfUltralightSignature,
23209 ) -> MfUltralightError;
23210}
23211unsafe extern "C" {
23212 #[doc = "Read counter from card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `counter_num` (direction in) - counter number to be read.\n * `data` (direction out) - pointer to the MfUltralightCounter structure to be filled.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23213 pub fn mf_ultralight_poller_read_counter(
23214 instance: *mut MfUltralightPoller,
23215 counter_num: u8,
23216 data: *mut MfUltralightCounter,
23217 ) -> MfUltralightError;
23218}
23219unsafe extern "C" {
23220 #[doc = "Read tearing flag from card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tearing_falg_num` (direction in) - tearing flag number to be read.\n * `data` (direction out) - pointer to the MfUltralightTearingFlag structure to be filled.\n # Returns\n\nMfUltralightErrorNone on success, an error code on failure."]
23221 pub fn mf_ultralight_poller_read_tearing_flag(
23222 instance: *mut MfUltralightPoller,
23223 tearing_falg_num: u8,
23224 data: *mut MfUltralightTearingFlag,
23225 ) -> MfUltralightError;
23226}
23227unsafe extern "C" {
23228 pub fn mf_ultralight_poller_sync_read_page(
23229 nfc: *mut Nfc,
23230 page: u16,
23231 data: *mut MfUltralightPage,
23232 ) -> MfUltralightError;
23233}
23234unsafe extern "C" {
23235 pub fn mf_ultralight_poller_sync_write_page(
23236 nfc: *mut Nfc,
23237 page: u16,
23238 data: *mut MfUltralightPage,
23239 ) -> MfUltralightError;
23240}
23241unsafe extern "C" {
23242 pub fn mf_ultralight_poller_sync_read_version(
23243 nfc: *mut Nfc,
23244 data: *mut MfUltralightVersion,
23245 ) -> MfUltralightError;
23246}
23247unsafe extern "C" {
23248 pub fn mf_ultralight_poller_sync_read_signature(
23249 nfc: *mut Nfc,
23250 data: *mut MfUltralightSignature,
23251 ) -> MfUltralightError;
23252}
23253unsafe extern "C" {
23254 pub fn mf_ultralight_poller_sync_read_counter(
23255 nfc: *mut Nfc,
23256 counter_num: u8,
23257 data: *mut MfUltralightCounter,
23258 ) -> MfUltralightError;
23259}
23260unsafe extern "C" {
23261 pub fn mf_ultralight_poller_sync_read_tearing_flag(
23262 nfc: *mut Nfc,
23263 flag_num: u8,
23264 data: *mut MfUltralightTearingFlag,
23265 ) -> MfUltralightError;
23266}
23267unsafe extern "C" {
23268 pub fn mf_ultralight_poller_sync_read_card(
23269 nfc: *mut Nfc,
23270 data: *mut MfUltralightData,
23271 auth_context: *const MfUltralightPollerAuthContext,
23272 ) -> MfUltralightError;
23273}
23274pub type SlixTypeFeatures = u32;
23275pub const SlixErrorNone: SlixError = SlixError(0);
23276pub const SlixErrorTimeout: SlixError = SlixError(1);
23277pub const SlixErrorFormat: SlixError = SlixError(2);
23278pub const SlixErrorNotSupported: SlixError = SlixError(3);
23279pub const SlixErrorInternal: SlixError = SlixError(4);
23280pub const SlixErrorWrongPassword: SlixError = SlixError(5);
23281pub const SlixErrorUidMismatch: SlixError = SlixError(6);
23282pub const SlixErrorUnknown: SlixError = SlixError(7);
23283#[repr(transparent)]
23284#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23285pub struct SlixError(pub core::ffi::c_uchar);
23286pub const SlixTypeSlix: SlixType = SlixType(0);
23287pub const SlixTypeSlixS: SlixType = SlixType(1);
23288pub const SlixTypeSlixL: SlixType = SlixType(2);
23289pub const SlixTypeSlix2: SlixType = SlixType(3);
23290pub const SlixTypeCount: SlixType = SlixType(4);
23291pub const SlixTypeUnknown: SlixType = SlixType(5);
23292#[repr(transparent)]
23293#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23294pub struct SlixType(pub core::ffi::c_uchar);
23295pub const SlixPasswordTypeRead: SlixPasswordType = SlixPasswordType(0);
23296pub const SlixPasswordTypeWrite: SlixPasswordType = SlixPasswordType(1);
23297pub const SlixPasswordTypePrivacy: SlixPasswordType = SlixPasswordType(2);
23298pub const SlixPasswordTypeDestroy: SlixPasswordType = SlixPasswordType(3);
23299pub const SlixPasswordTypeEasAfi: SlixPasswordType = SlixPasswordType(4);
23300pub const SlixPasswordTypeCount: SlixPasswordType = SlixPasswordType(5);
23301#[repr(transparent)]
23302#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23303pub struct SlixPasswordType(pub core::ffi::c_uchar);
23304pub type SlixPassword = u32;
23305pub type SlixSignature = [u8; 32usize];
23306pub type SlixPrivacy = bool;
23307pub type SlixRandomNumber = u16;
23308#[repr(C)]
23309#[derive(Debug, Copy, Clone)]
23310pub struct SlixProtection {
23311 pub pointer: u8,
23312 pub condition: u8,
23313}
23314#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23315const _: () = {
23316 ["Size of SlixProtection"][::core::mem::size_of::<SlixProtection>() - 2usize];
23317 ["Alignment of SlixProtection"][::core::mem::align_of::<SlixProtection>() - 1usize];
23318 ["Offset of field: SlixProtection::pointer"]
23319 [::core::mem::offset_of!(SlixProtection, pointer) - 0usize];
23320 ["Offset of field: SlixProtection::condition"]
23321 [::core::mem::offset_of!(SlixProtection, condition) - 1usize];
23322};
23323#[repr(C)]
23324#[derive(Debug, Copy, Clone)]
23325pub struct SlixLockBits {
23326 pub eas: bool,
23327 pub ppl: bool,
23328}
23329#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23330const _: () = {
23331 ["Size of SlixLockBits"][::core::mem::size_of::<SlixLockBits>() - 2usize];
23332 ["Alignment of SlixLockBits"][::core::mem::align_of::<SlixLockBits>() - 1usize];
23333 ["Offset of field: SlixLockBits::eas"][::core::mem::offset_of!(SlixLockBits, eas) - 0usize];
23334 ["Offset of field: SlixLockBits::ppl"][::core::mem::offset_of!(SlixLockBits, ppl) - 1usize];
23335};
23336#[repr(C)]
23337#[derive(Debug, Copy, Clone)]
23338pub struct SlixSystemInfo {
23339 pub protection: SlixProtection,
23340 pub lock_bits: SlixLockBits,
23341}
23342#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23343const _: () = {
23344 ["Size of SlixSystemInfo"][::core::mem::size_of::<SlixSystemInfo>() - 4usize];
23345 ["Alignment of SlixSystemInfo"][::core::mem::align_of::<SlixSystemInfo>() - 1usize];
23346 ["Offset of field: SlixSystemInfo::protection"]
23347 [::core::mem::offset_of!(SlixSystemInfo, protection) - 0usize];
23348 ["Offset of field: SlixSystemInfo::lock_bits"]
23349 [::core::mem::offset_of!(SlixSystemInfo, lock_bits) - 2usize];
23350};
23351pub const SlixCapabilitiesDefault: SlixCapabilities = SlixCapabilities(0);
23352pub const SlixCapabilitiesAcceptAllPasswords: SlixCapabilities = SlixCapabilities(1);
23353pub const SlixCapabilitiesCount: SlixCapabilities = SlixCapabilities(2);
23354#[repr(transparent)]
23355#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23356pub struct SlixCapabilities(pub core::ffi::c_uchar);
23357#[repr(C)]
23358#[derive(Debug, Copy, Clone)]
23359pub struct SlixData {
23360 pub iso15693_3_data: *mut Iso15693_3Data,
23361 pub system_info: SlixSystemInfo,
23362 pub signature: SlixSignature,
23363 pub passwords: [SlixPassword; 5usize],
23364 pub privacy: SlixPrivacy,
23365 pub capabilities: SlixCapabilities,
23366}
23367#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23368const _: () = {
23369 ["Size of SlixData"][::core::mem::size_of::<SlixData>() - 64usize];
23370 ["Alignment of SlixData"][::core::mem::align_of::<SlixData>() - 4usize];
23371 ["Offset of field: SlixData::iso15693_3_data"]
23372 [::core::mem::offset_of!(SlixData, iso15693_3_data) - 0usize];
23373 ["Offset of field: SlixData::system_info"]
23374 [::core::mem::offset_of!(SlixData, system_info) - 4usize];
23375 ["Offset of field: SlixData::signature"][::core::mem::offset_of!(SlixData, signature) - 8usize];
23376 ["Offset of field: SlixData::passwords"]
23377 [::core::mem::offset_of!(SlixData, passwords) - 40usize];
23378 ["Offset of field: SlixData::privacy"][::core::mem::offset_of!(SlixData, privacy) - 60usize];
23379 ["Offset of field: SlixData::capabilities"]
23380 [::core::mem::offset_of!(SlixData, capabilities) - 61usize];
23381};
23382unsafe extern "C" {
23383 pub fn slix_alloc() -> *mut SlixData;
23384}
23385unsafe extern "C" {
23386 pub fn slix_free(data: *mut SlixData);
23387}
23388unsafe extern "C" {
23389 pub fn slix_reset(data: *mut SlixData);
23390}
23391unsafe extern "C" {
23392 pub fn slix_copy(data: *mut SlixData, other: *const SlixData);
23393}
23394unsafe extern "C" {
23395 pub fn slix_verify(data: *mut SlixData, device_type: *const FuriString) -> bool;
23396}
23397unsafe extern "C" {
23398 pub fn slix_load(data: *mut SlixData, ff: *mut FlipperFormat, version: u32) -> bool;
23399}
23400unsafe extern "C" {
23401 pub fn slix_save(data: *const SlixData, ff: *mut FlipperFormat) -> bool;
23402}
23403unsafe extern "C" {
23404 pub fn slix_is_equal(data: *const SlixData, other: *const SlixData) -> bool;
23405}
23406unsafe extern "C" {
23407 pub fn slix_get_device_name(
23408 data: *const SlixData,
23409 name_type: NfcDeviceNameType,
23410 ) -> *const core::ffi::c_char;
23411}
23412unsafe extern "C" {
23413 pub fn slix_get_uid(data: *const SlixData, uid_len: *mut usize) -> *const u8;
23414}
23415unsafe extern "C" {
23416 pub fn slix_set_uid(data: *mut SlixData, uid: *const u8, uid_len: usize) -> bool;
23417}
23418unsafe extern "C" {
23419 pub fn slix_get_base_data(data: *const SlixData) -> *const Iso15693_3Data;
23420}
23421unsafe extern "C" {
23422 pub fn slix_get_type(data: *const SlixData) -> SlixType;
23423}
23424unsafe extern "C" {
23425 pub fn slix_get_password(
23426 data: *const SlixData,
23427 password_type: SlixPasswordType,
23428 ) -> SlixPassword;
23429}
23430unsafe extern "C" {
23431 pub fn slix_get_counter(data: *const SlixData) -> u16;
23432}
23433unsafe extern "C" {
23434 pub fn slix_is_privacy_mode(data: *const SlixData) -> bool;
23435}
23436unsafe extern "C" {
23437 pub fn slix_is_block_protected(
23438 data: *const SlixData,
23439 password_type: SlixPasswordType,
23440 block_num: u8,
23441 ) -> bool;
23442}
23443unsafe extern "C" {
23444 pub fn slix_is_counter_increment_protected(data: *const SlixData) -> bool;
23445}
23446unsafe extern "C" {
23447 pub fn slix_type_has_features(slix_type: SlixType, features: SlixTypeFeatures) -> bool;
23448}
23449unsafe extern "C" {
23450 pub fn slix_type_supports_password(
23451 slix_type: SlixType,
23452 password_type: SlixPasswordType,
23453 ) -> bool;
23454}
23455#[repr(C)]
23456#[derive(Debug, Copy, Clone)]
23457pub struct SlixPoller {
23458 _unused: [u8; 0],
23459}
23460#[doc = "< An error occured while reading card."]
23461pub const SlixPollerEventTypeError: SlixPollerEventType = SlixPollerEventType(0);
23462#[doc = "< Poller requests password to disable privacy mode."]
23463pub const SlixPollerEventTypePrivacyUnlockRequest: SlixPollerEventType = SlixPollerEventType(1);
23464#[doc = "< The card was successfully read by the poller."]
23465pub const SlixPollerEventTypeReady: SlixPollerEventType = SlixPollerEventType(2);
23466#[repr(transparent)]
23467#[doc = "Enumeration of possible Slix poller event types."]
23468#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23469pub struct SlixPollerEventType(pub core::ffi::c_uchar);
23470#[doc = "Slix poller privacy unlock context data."]
23471#[repr(C)]
23472#[derive(Debug, Copy, Clone)]
23473pub struct SlixPollerEventDataPrivacyUnlockContext {
23474 #[doc = "< Privacy password."]
23475 pub password: SlixPassword,
23476 #[doc = "< Filed to indicate that password was set or not."]
23477 pub password_set: bool,
23478}
23479#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23480const _: () = {
23481 ["Size of SlixPollerEventDataPrivacyUnlockContext"]
23482 [::core::mem::size_of::<SlixPollerEventDataPrivacyUnlockContext>() - 8usize];
23483 ["Alignment of SlixPollerEventDataPrivacyUnlockContext"]
23484 [::core::mem::align_of::<SlixPollerEventDataPrivacyUnlockContext>() - 4usize];
23485 ["Offset of field: SlixPollerEventDataPrivacyUnlockContext::password"]
23486 [::core::mem::offset_of!(SlixPollerEventDataPrivacyUnlockContext, password) - 0usize];
23487 ["Offset of field: SlixPollerEventDataPrivacyUnlockContext::password_set"]
23488 [::core::mem::offset_of!(SlixPollerEventDataPrivacyUnlockContext, password_set) - 4usize];
23489};
23490#[doc = "Slixs poller event data."]
23491#[repr(C)]
23492#[derive(Copy, Clone)]
23493pub union SlixPollerEventData {
23494 #[doc = "< Error code indicating card reaing fail reason."]
23495 pub error: SlixError,
23496 #[doc = "< Privacy unlock event context."]
23497 pub privacy_password: SlixPollerEventDataPrivacyUnlockContext,
23498}
23499#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23500const _: () = {
23501 ["Size of SlixPollerEventData"][::core::mem::size_of::<SlixPollerEventData>() - 8usize];
23502 ["Alignment of SlixPollerEventData"][::core::mem::align_of::<SlixPollerEventData>() - 4usize];
23503 ["Offset of field: SlixPollerEventData::error"]
23504 [::core::mem::offset_of!(SlixPollerEventData, error) - 0usize];
23505 ["Offset of field: SlixPollerEventData::privacy_password"]
23506 [::core::mem::offset_of!(SlixPollerEventData, privacy_password) - 0usize];
23507};
23508#[doc = "Slix poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
23509#[repr(C)]
23510#[derive(Debug, Copy, Clone)]
23511pub struct SlixPollerEvent {
23512 #[doc = "< Type of emmitted event."]
23513 pub type_: SlixPollerEventType,
23514 #[doc = "< Pointer to event specific data."]
23515 pub data: *mut SlixPollerEventData,
23516}
23517#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23518const _: () = {
23519 ["Size of SlixPollerEvent"][::core::mem::size_of::<SlixPollerEvent>() - 8usize];
23520 ["Alignment of SlixPollerEvent"][::core::mem::align_of::<SlixPollerEvent>() - 4usize];
23521 ["Offset of field: SlixPollerEvent::type_"]
23522 [::core::mem::offset_of!(SlixPollerEvent, type_) - 0usize];
23523 ["Offset of field: SlixPollerEvent::data"]
23524 [::core::mem::offset_of!(SlixPollerEvent, data) - 4usize];
23525};
23526unsafe extern "C" {
23527 #[doc = "Transmit and receive Slix frames in poller mode.\n\n Must ONLY be used inside the callback function.\n\n The rx_buffer will be filled with any data received as a response to data\n sent from tx_buffer, with a timeout defined by the fwt parameter.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `tx_buffer` (direction in) - pointer to the buffer containing the data to be transmitted.\n * `rx_buffer` (direction out) - pointer to the buffer to be filled with received data.\n * `fwt` (direction in) - frame wait time (response timeout), in carrier cycles.\n # Returns\n\nSlixErrorNone on success, an error code on failure."]
23528 pub fn slix_poller_send_frame(
23529 instance: *mut SlixPoller,
23530 tx_data: *const BitBuffer,
23531 rx_data: *mut BitBuffer,
23532 fwt: u32,
23533 ) -> SlixError;
23534}
23535unsafe extern "C" {
23536 #[doc = "Send get nxp system info command and parse response.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the SlixSystemInfo structure to be filled.\n # Returns\n\nSlixErrorNone on success, an error code on failure."]
23537 pub fn slix_poller_get_nxp_system_info(
23538 instance: *mut SlixPoller,
23539 data: *mut SlixSystemInfo,
23540 ) -> SlixError;
23541}
23542unsafe extern "C" {
23543 #[doc = "Read signature from card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the SlixSignature structure to be filled.\n # Returns\n\nSlixErrorNone on success, an error code on failure."]
23544 pub fn slix_poller_read_signature(
23545 instance: *mut SlixPoller,
23546 data: *mut SlixSignature,
23547 ) -> SlixError;
23548}
23549unsafe extern "C" {
23550 #[doc = "Get random number from card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `data` (direction out) - pointer to the SlixRandomNumber structure to be filled.\n # Returns\n\nSlixErrorNone on success, an error code on failure."]
23551 pub fn slix_poller_get_random_number(
23552 instance: *mut SlixPoller,
23553 data: *mut SlixRandomNumber,
23554 ) -> SlixError;
23555}
23556unsafe extern "C" {
23557 #[doc = "Set password to card.\n\n Must ONLY be used inside the callback function.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be used in the transaction.\n * `type` (direction in) - SlixPasswordType instance.\n * `password` (direction in) - SlixPassword instance.\n * `random_number` (direction in) - SlixRandomNumber instance.\n # Returns\n\nSlixErrorNone on success, an error code on failure."]
23558 pub fn slix_poller_set_password(
23559 instance: *mut SlixPoller,
23560 type_: SlixPasswordType,
23561 password: SlixPassword,
23562 random_number: SlixRandomNumber,
23563 ) -> SlixError;
23564}
23565pub const St25tbErrorNone: St25tbError = St25tbError(0);
23566pub const St25tbErrorNotPresent: St25tbError = St25tbError(1);
23567pub const St25tbErrorColResFailed: St25tbError = St25tbError(2);
23568pub const St25tbErrorBufferOverflow: St25tbError = St25tbError(3);
23569pub const St25tbErrorCommunication: St25tbError = St25tbError(4);
23570pub const St25tbErrorFieldOff: St25tbError = St25tbError(5);
23571pub const St25tbErrorWrongCrc: St25tbError = St25tbError(6);
23572pub const St25tbErrorTimeout: St25tbError = St25tbError(7);
23573pub const St25tbErrorWriteFailed: St25tbError = St25tbError(8);
23574#[repr(transparent)]
23575#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23576pub struct St25tbError(pub core::ffi::c_uchar);
23577pub const St25tbType512At: St25tbType = St25tbType(0);
23578pub const St25tbType512Ac: St25tbType = St25tbType(1);
23579pub const St25tbTypeX512: St25tbType = St25tbType(2);
23580pub const St25tbType02k: St25tbType = St25tbType(3);
23581pub const St25tbType04k: St25tbType = St25tbType(4);
23582pub const St25tbTypeX4k: St25tbType = St25tbType(5);
23583pub const St25tbTypeNum: St25tbType = St25tbType(6);
23584#[repr(transparent)]
23585#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23586pub struct St25tbType(pub core::ffi::c_uchar);
23587#[repr(C)]
23588#[derive(Debug, Copy, Clone)]
23589pub struct St25tbData {
23590 pub uid: [u8; 8usize],
23591 pub type_: St25tbType,
23592 pub blocks: [u32; 128usize],
23593 pub system_otp_block: u32,
23594}
23595#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23596const _: () = {
23597 ["Size of St25tbData"][::core::mem::size_of::<St25tbData>() - 528usize];
23598 ["Alignment of St25tbData"][::core::mem::align_of::<St25tbData>() - 4usize];
23599 ["Offset of field: St25tbData::uid"][::core::mem::offset_of!(St25tbData, uid) - 0usize];
23600 ["Offset of field: St25tbData::type_"][::core::mem::offset_of!(St25tbData, type_) - 8usize];
23601 ["Offset of field: St25tbData::blocks"][::core::mem::offset_of!(St25tbData, blocks) - 12usize];
23602 ["Offset of field: St25tbData::system_otp_block"]
23603 [::core::mem::offset_of!(St25tbData, system_otp_block) - 524usize];
23604};
23605unsafe extern "C" {
23606 pub fn st25tb_alloc() -> *mut St25tbData;
23607}
23608unsafe extern "C" {
23609 pub fn st25tb_free(data: *mut St25tbData);
23610}
23611unsafe extern "C" {
23612 pub fn st25tb_reset(data: *mut St25tbData);
23613}
23614unsafe extern "C" {
23615 pub fn st25tb_copy(data: *mut St25tbData, other: *const St25tbData);
23616}
23617unsafe extern "C" {
23618 pub fn st25tb_verify(data: *mut St25tbData, device_type: *const FuriString) -> bool;
23619}
23620unsafe extern "C" {
23621 pub fn st25tb_load(data: *mut St25tbData, ff: *mut FlipperFormat, version: u32) -> bool;
23622}
23623unsafe extern "C" {
23624 pub fn st25tb_save(data: *const St25tbData, ff: *mut FlipperFormat) -> bool;
23625}
23626unsafe extern "C" {
23627 pub fn st25tb_is_equal(data: *const St25tbData, other: *const St25tbData) -> bool;
23628}
23629unsafe extern "C" {
23630 pub fn st25tb_get_block_count(type_: St25tbType) -> u8;
23631}
23632unsafe extern "C" {
23633 pub fn st25tb_get_device_name(
23634 data: *const St25tbData,
23635 name_type: NfcDeviceNameType,
23636 ) -> *const core::ffi::c_char;
23637}
23638unsafe extern "C" {
23639 pub fn st25tb_get_uid(data: *const St25tbData, uid_len: *mut usize) -> *const u8;
23640}
23641unsafe extern "C" {
23642 pub fn st25tb_set_uid(data: *mut St25tbData, uid: *const u8, uid_len: usize) -> bool;
23643}
23644unsafe extern "C" {
23645 pub fn st25tb_get_base_data(data: *const St25tbData) -> *mut St25tbData;
23646}
23647unsafe extern "C" {
23648 pub fn st25tb_get_type_from_uid(uid: *const u8) -> St25tbType;
23649}
23650#[repr(C)]
23651#[derive(Debug, Copy, Clone)]
23652pub struct St25tbPoller {
23653 _unused: [u8; 0],
23654}
23655pub const St25tbPollerEventTypeReady: St25tbPollerEventType = St25tbPollerEventType(0);
23656pub const St25tbPollerEventTypeRequestMode: St25tbPollerEventType = St25tbPollerEventType(1);
23657pub const St25tbPollerEventTypeFailure: St25tbPollerEventType = St25tbPollerEventType(2);
23658pub const St25tbPollerEventTypeSuccess: St25tbPollerEventType = St25tbPollerEventType(3);
23659#[repr(transparent)]
23660#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23661pub struct St25tbPollerEventType(pub core::ffi::c_uchar);
23662#[repr(C)]
23663#[derive(Debug, Copy, Clone)]
23664pub struct St25tbPollerReadyData {
23665 pub type_: St25tbType,
23666}
23667#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23668const _: () = {
23669 ["Size of St25tbPollerReadyData"][::core::mem::size_of::<St25tbPollerReadyData>() - 1usize];
23670 ["Alignment of St25tbPollerReadyData"]
23671 [::core::mem::align_of::<St25tbPollerReadyData>() - 1usize];
23672 ["Offset of field: St25tbPollerReadyData::type_"]
23673 [::core::mem::offset_of!(St25tbPollerReadyData, type_) - 0usize];
23674};
23675pub const St25tbPollerModeRead: St25tbPollerMode = St25tbPollerMode(0);
23676pub const St25tbPollerModeWrite: St25tbPollerMode = St25tbPollerMode(1);
23677pub const St25tbPollerModeNum: St25tbPollerMode = St25tbPollerMode(2);
23678#[repr(transparent)]
23679#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23680pub struct St25tbPollerMode(pub core::ffi::c_uchar);
23681#[repr(C)]
23682#[derive(Debug, Copy, Clone)]
23683pub struct St25tbPollerEventDataModeRequestWriteParams {
23684 pub block_number: u8,
23685 pub block_data: u32,
23686}
23687#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23688const _: () = {
23689 ["Size of St25tbPollerEventDataModeRequestWriteParams"]
23690 [::core::mem::size_of::<St25tbPollerEventDataModeRequestWriteParams>() - 8usize];
23691 ["Alignment of St25tbPollerEventDataModeRequestWriteParams"]
23692 [::core::mem::align_of::<St25tbPollerEventDataModeRequestWriteParams>() - 4usize];
23693 ["Offset of field: St25tbPollerEventDataModeRequestWriteParams::block_number"][::core::mem::offset_of!(
23694 St25tbPollerEventDataModeRequestWriteParams,
23695 block_number
23696 ) - 0usize];
23697 ["Offset of field: St25tbPollerEventDataModeRequestWriteParams::block_data"]
23698 [::core::mem::offset_of!(St25tbPollerEventDataModeRequestWriteParams, block_data) - 4usize];
23699};
23700#[repr(C)]
23701#[derive(Copy, Clone)]
23702pub union St25tbPollerEventDataModeRequestParams {
23703 pub write_params: St25tbPollerEventDataModeRequestWriteParams,
23704}
23705#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23706const _: () = {
23707 ["Size of St25tbPollerEventDataModeRequestParams"]
23708 [::core::mem::size_of::<St25tbPollerEventDataModeRequestParams>() - 8usize];
23709 ["Alignment of St25tbPollerEventDataModeRequestParams"]
23710 [::core::mem::align_of::<St25tbPollerEventDataModeRequestParams>() - 4usize];
23711 ["Offset of field: St25tbPollerEventDataModeRequestParams::write_params"]
23712 [::core::mem::offset_of!(St25tbPollerEventDataModeRequestParams, write_params) - 0usize];
23713};
23714#[repr(C)]
23715#[derive(Copy, Clone)]
23716pub struct St25tbPollerEventDataModeRequest {
23717 pub mode: St25tbPollerMode,
23718 pub params: St25tbPollerEventDataModeRequestParams,
23719}
23720#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23721const _: () = {
23722 ["Size of St25tbPollerEventDataModeRequest"]
23723 [::core::mem::size_of::<St25tbPollerEventDataModeRequest>() - 12usize];
23724 ["Alignment of St25tbPollerEventDataModeRequest"]
23725 [::core::mem::align_of::<St25tbPollerEventDataModeRequest>() - 4usize];
23726 ["Offset of field: St25tbPollerEventDataModeRequest::mode"]
23727 [::core::mem::offset_of!(St25tbPollerEventDataModeRequest, mode) - 0usize];
23728 ["Offset of field: St25tbPollerEventDataModeRequest::params"]
23729 [::core::mem::offset_of!(St25tbPollerEventDataModeRequest, params) - 4usize];
23730};
23731#[repr(C)]
23732#[derive(Copy, Clone)]
23733pub union St25tbPollerEventData {
23734 pub ready: St25tbPollerReadyData,
23735 pub mode_request: St25tbPollerEventDataModeRequest,
23736 pub error: St25tbError,
23737}
23738#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23739const _: () = {
23740 ["Size of St25tbPollerEventData"][::core::mem::size_of::<St25tbPollerEventData>() - 12usize];
23741 ["Alignment of St25tbPollerEventData"]
23742 [::core::mem::align_of::<St25tbPollerEventData>() - 4usize];
23743 ["Offset of field: St25tbPollerEventData::ready"]
23744 [::core::mem::offset_of!(St25tbPollerEventData, ready) - 0usize];
23745 ["Offset of field: St25tbPollerEventData::mode_request"]
23746 [::core::mem::offset_of!(St25tbPollerEventData, mode_request) - 0usize];
23747 ["Offset of field: St25tbPollerEventData::error"]
23748 [::core::mem::offset_of!(St25tbPollerEventData, error) - 0usize];
23749};
23750#[repr(C)]
23751#[derive(Debug, Copy, Clone)]
23752pub struct St25tbPollerEvent {
23753 pub type_: St25tbPollerEventType,
23754 pub data: *mut St25tbPollerEventData,
23755}
23756#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23757const _: () = {
23758 ["Size of St25tbPollerEvent"][::core::mem::size_of::<St25tbPollerEvent>() - 8usize];
23759 ["Alignment of St25tbPollerEvent"][::core::mem::align_of::<St25tbPollerEvent>() - 4usize];
23760 ["Offset of field: St25tbPollerEvent::type_"]
23761 [::core::mem::offset_of!(St25tbPollerEvent, type_) - 0usize];
23762 ["Offset of field: St25tbPollerEvent::data"]
23763 [::core::mem::offset_of!(St25tbPollerEvent, data) - 4usize];
23764};
23765unsafe extern "C" {
23766 pub fn st25tb_poller_send_frame(
23767 instance: *mut St25tbPoller,
23768 tx_buffer: *const BitBuffer,
23769 rx_buffer: *mut BitBuffer,
23770 fwt: u32,
23771 ) -> St25tbError;
23772}
23773unsafe extern "C" {
23774 pub fn st25tb_poller_initiate(instance: *mut St25tbPoller, chip_id_ptr: *mut u8)
23775 -> St25tbError;
23776}
23777unsafe extern "C" {
23778 pub fn st25tb_poller_select(instance: *mut St25tbPoller, chip_id_ptr: *mut u8) -> St25tbError;
23779}
23780unsafe extern "C" {
23781 pub fn st25tb_poller_get_uid(instance: *mut St25tbPoller, uid: *mut u8) -> St25tbError;
23782}
23783unsafe extern "C" {
23784 pub fn st25tb_poller_read_block(
23785 instance: *mut St25tbPoller,
23786 block: *mut u32,
23787 block_number: u8,
23788 ) -> St25tbError;
23789}
23790unsafe extern "C" {
23791 pub fn st25tb_poller_write_block(
23792 instance: *mut St25tbPoller,
23793 block: u32,
23794 block_number: u8,
23795 ) -> St25tbError;
23796}
23797unsafe extern "C" {
23798 pub fn st25tb_poller_halt(instance: *mut St25tbPoller) -> St25tbError;
23799}
23800unsafe extern "C" {
23801 pub fn st25tb_poller_sync_read_block(
23802 nfc: *mut Nfc,
23803 block_num: u8,
23804 block: *mut u32,
23805 ) -> St25tbError;
23806}
23807unsafe extern "C" {
23808 pub fn st25tb_poller_sync_write_block(nfc: *mut Nfc, block_num: u8, block: u32) -> St25tbError;
23809}
23810unsafe extern "C" {
23811 pub fn st25tb_poller_sync_detect_type(nfc: *mut Nfc, type_: *mut St25tbType) -> St25tbError;
23812}
23813unsafe extern "C" {
23814 pub fn st25tb_poller_sync_read(nfc: *mut Nfc, data: *mut St25tbData) -> St25tbError;
23815}
23816unsafe extern "C" {
23817 pub fn maxim_crc8(data: *const u8, data_size: u8, crc_init: u8) -> u8;
23818}
23819#[doc = "< Search for alarmed device"]
23820pub const OneWireHostSearchModeConditional: OneWireHostSearchMode = OneWireHostSearchMode(0);
23821#[doc = "< Search for all devices"]
23822pub const OneWireHostSearchModeNormal: OneWireHostSearchMode = OneWireHostSearchMode(1);
23823#[repr(transparent)]
23824#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23825pub struct OneWireHostSearchMode(pub core::ffi::c_uchar);
23826#[repr(C)]
23827#[derive(Debug, Copy, Clone)]
23828pub struct OneWireHost {
23829 _unused: [u8; 0],
23830}
23831unsafe extern "C" {
23832 #[doc = "Allocate OneWireHost instance\n # Arguments\n\n* `[in]` - gpio_pin connection pin\n # Returns\n\npointer to OneWireHost instance"]
23833 pub fn onewire_host_alloc(gpio_pin: *const GpioPin) -> *mut OneWireHost;
23834}
23835unsafe extern "C" {
23836 #[doc = "Destroy OneWireHost instance, free resources\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23837 pub fn onewire_host_free(host: *mut OneWireHost);
23838}
23839unsafe extern "C" {
23840 #[doc = "Reset the 1-Wire bus\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n # Returns\n\ntrue if presence was detected, false otherwise"]
23841 pub fn onewire_host_reset(host: *mut OneWireHost) -> bool;
23842}
23843unsafe extern "C" {
23844 #[doc = "Read one bit\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n # Returns\n\nreceived bit value"]
23845 pub fn onewire_host_read_bit(host: *mut OneWireHost) -> bool;
23846}
23847unsafe extern "C" {
23848 #[doc = "Read one byte\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n # Returns\n\nreceived byte value"]
23849 pub fn onewire_host_read(host: *mut OneWireHost) -> u8;
23850}
23851unsafe extern "C" {
23852 #[doc = "Read one or more bytes\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `[out]` - buffer received data buffer\n * `[in]` - count number of bytes to read"]
23853 pub fn onewire_host_read_bytes(host: *mut OneWireHost, buffer: *mut u8, count: u16);
23854}
23855unsafe extern "C" {
23856 #[doc = "Write one bit\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `value` - bit value to write"]
23857 pub fn onewire_host_write_bit(host: *mut OneWireHost, value: bool);
23858}
23859unsafe extern "C" {
23860 #[doc = "Write one byte\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `value` - byte value to write"]
23861 pub fn onewire_host_write(host: *mut OneWireHost, value: u8);
23862}
23863unsafe extern "C" {
23864 #[doc = "Write one or more bytes\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `[in]` - buffer pointer to the data to write\n * `[in]` - count size of the data to write"]
23865 pub fn onewire_host_write_bytes(host: *mut OneWireHost, buffer: *const u8, count: u16);
23866}
23867unsafe extern "C" {
23868 #[doc = "Start working with the bus\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23869 pub fn onewire_host_start(host: *mut OneWireHost);
23870}
23871unsafe extern "C" {
23872 #[doc = "Stop working with the bus\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23873 pub fn onewire_host_stop(host: *mut OneWireHost);
23874}
23875unsafe extern "C" {
23876 #[doc = "Reset previous search results\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23877 pub fn onewire_host_reset_search(host: *mut OneWireHost);
23878}
23879unsafe extern "C" {
23880 #[doc = "Set the family code to search for\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `[in]` - family_code device family code"]
23881 pub fn onewire_host_target_search(host: *mut OneWireHost, family_code: u8);
23882}
23883unsafe extern "C" {
23884 #[doc = "Search for devices on the 1-Wire bus\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `[out]` - new_addr pointer to the buffer to contain the unique ROM of the found device\n * `[in]` - mode search mode\n # Returns\n\ntrue on success, false otherwise"]
23885 pub fn onewire_host_search(
23886 host: *mut OneWireHost,
23887 new_addr: *mut u8,
23888 mode: OneWireHostSearchMode,
23889 ) -> bool;
23890}
23891unsafe extern "C" {
23892 #[doc = "Enable overdrive mode\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `[in]` - set true to turn overdrive on, false to turn it off"]
23893 pub fn onewire_host_set_overdrive(host: *mut OneWireHost, set: bool);
23894}
23895unsafe extern "C" {
23896 pub fn onewire_host_set_timings_default(host: *mut OneWireHost);
23897}
23898unsafe extern "C" {
23899 pub fn onewire_host_set_timings_tm01x(host: *mut OneWireHost);
23900}
23901#[repr(C)]
23902#[derive(Debug, Copy, Clone)]
23903pub struct OneWireDevice {
23904 _unused: [u8; 0],
23905}
23906#[repr(C)]
23907#[derive(Debug, Copy, Clone)]
23908pub struct OneWireSlave {
23909 _unused: [u8; 0],
23910}
23911pub type OneWireSlaveResetCallback = ::core::option::Option<
23912 unsafe extern "C" fn(is_short: bool, context: *mut core::ffi::c_void) -> bool,
23913>;
23914pub type OneWireSlaveCommandCallback = ::core::option::Option<
23915 unsafe extern "C" fn(command: u8, context: *mut core::ffi::c_void) -> bool,
23916>;
23917pub type OneWireSlaveResultCallback =
23918 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
23919unsafe extern "C" {
23920 #[doc = "Allocate OneWireSlave instance\n # Arguments\n\n* `[in]` - gpio_pin connection pin\n # Returns\n\npointer to OneWireSlave instance"]
23921 pub fn onewire_slave_alloc(gpio_pin: *const GpioPin) -> *mut OneWireSlave;
23922}
23923unsafe extern "C" {
23924 #[doc = "Destroy OneWireSlave instance, free resources\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance"]
23925 pub fn onewire_slave_free(bus: *mut OneWireSlave);
23926}
23927unsafe extern "C" {
23928 #[doc = "Start working with the bus\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance"]
23929 pub fn onewire_slave_start(bus: *mut OneWireSlave);
23930}
23931unsafe extern "C" {
23932 #[doc = "Stop working with the bus\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance"]
23933 pub fn onewire_slave_stop(bus: *mut OneWireSlave);
23934}
23935unsafe extern "C" {
23936 #[doc = "Receive one bit\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n # Returns\n\nreceived bit value"]
23937 pub fn onewire_slave_receive_bit(bus: *mut OneWireSlave) -> bool;
23938}
23939unsafe extern "C" {
23940 #[doc = "Send one bit\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[in]` - value bit value to send\n # Returns\n\ntrue on success, false on failure"]
23941 pub fn onewire_slave_send_bit(bus: *mut OneWireSlave, value: bool) -> bool;
23942}
23943unsafe extern "C" {
23944 #[doc = "Send one or more bytes of data\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[in]` - data pointer to the data to send\n * `[in]` - data_size size of the data to send\n # Returns\n\ntrue on success, false on failure"]
23945 pub fn onewire_slave_send(bus: *mut OneWireSlave, data: *const u8, data_size: usize) -> bool;
23946}
23947unsafe extern "C" {
23948 #[doc = "Receive one or more bytes of data\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[out]` - data pointer to the receive buffer\n * `[in]` - data_size number of bytes to receive\n # Returns\n\ntrue on success, false on failure"]
23949 pub fn onewire_slave_receive(bus: *mut OneWireSlave, data: *mut u8, data_size: usize) -> bool;
23950}
23951unsafe extern "C" {
23952 #[doc = "Enable overdrive mode\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[in]` - set true to turn overdrive on, false to turn it off"]
23953 pub fn onewire_slave_set_overdrive(bus: *mut OneWireSlave, set: bool);
23954}
23955unsafe extern "C" {
23956 #[doc = "Set a callback function to be called on each reset.\n The return value of the callback determines whether the emulated device\n supports the short reset (passed as the is_short parameter).\n In most applications, it should also call onewire_slave_set_overdrive()\n to set the appropriate speed mode.\n\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[in]` - callback pointer to a callback function\n * `[in]` - context additional parameter to be passed to the callback"]
23957 pub fn onewire_slave_set_reset_callback(
23958 bus: *mut OneWireSlave,
23959 callback: OneWireSlaveResetCallback,
23960 context: *mut core::ffi::c_void,
23961 );
23962}
23963unsafe extern "C" {
23964 #[doc = "Set a callback function to be called on each command.\n The return value of the callback determines whether further operation\n is possible. As a rule of thumb, return true unless a critical error happened.\n\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[in]` - callback pointer to a callback function\n * `[in]` - context additional parameter to be passed to the callback"]
23965 pub fn onewire_slave_set_command_callback(
23966 bus: *mut OneWireSlave,
23967 callback: OneWireSlaveCommandCallback,
23968 context: *mut core::ffi::c_void,
23969 );
23970}
23971unsafe extern "C" {
23972 #[doc = "Set a callback to report emulation success\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n * `[in]` - result_cb pointer to a callback function\n * `[in]` - context additional parameter to be passed to the callback"]
23973 pub fn onewire_slave_set_result_callback(
23974 bus: *mut OneWireSlave,
23975 result_cb: OneWireSlaveResultCallback,
23976 context: *mut core::ffi::c_void,
23977 );
23978}
23979unsafe extern "C" {
23980 pub fn __wrap_printf(format: *const core::ffi::c_char, ...) -> core::ffi::c_int;
23981}
23982unsafe extern "C" {
23983 pub fn __wrap_vsnprintf(
23984 str_: *mut core::ffi::c_char,
23985 size: usize,
23986 format: *const core::ffi::c_char,
23987 args: va_list,
23988 ) -> core::ffi::c_int;
23989}
23990unsafe extern "C" {
23991 pub fn __wrap_puts(str_: *const core::ffi::c_char) -> core::ffi::c_int;
23992}
23993unsafe extern "C" {
23994 pub fn __wrap_putchar(ch: core::ffi::c_int) -> core::ffi::c_int;
23995}
23996unsafe extern "C" {
23997 pub fn __wrap_putc(ch: core::ffi::c_int, stream: *mut FILE) -> core::ffi::c_int;
23998}
23999unsafe extern "C" {
24000 pub fn __wrap_snprintf(
24001 str_: *mut core::ffi::c_char,
24002 size: usize,
24003 format: *const core::ffi::c_char,
24004 ...
24005 ) -> core::ffi::c_int;
24006}
24007unsafe extern "C" {
24008 pub fn __wrap_fflush(stream: *mut FILE) -> core::ffi::c_int;
24009}
24010unsafe extern "C" {
24011 pub fn __wrap_fgetc(stream: *mut FILE) -> core::ffi::c_int;
24012}
24013unsafe extern "C" {
24014 pub fn __wrap_getc(stream: *mut FILE) -> core::ffi::c_int;
24015}
24016unsafe extern "C" {
24017 pub fn __wrap_getchar() -> core::ffi::c_int;
24018}
24019unsafe extern "C" {
24020 pub fn __wrap_fgets(
24021 str_: *mut core::ffi::c_char,
24022 n: usize,
24023 stream: *mut FILE,
24024 ) -> *mut core::ffi::c_char;
24025}
24026unsafe extern "C" {
24027 pub fn __wrap_ungetc(ch: core::ffi::c_int, stream: *mut FILE) -> core::ffi::c_int;
24028}
24029unsafe extern "C" {
24030 pub fn __wrap___assert(
24031 file: *const core::ffi::c_char,
24032 line: core::ffi::c_int,
24033 e: *const core::ffi::c_char,
24034 ) -> !;
24035}
24036unsafe extern "C" {
24037 pub fn __wrap___assert_func(
24038 file: *const core::ffi::c_char,
24039 line: core::ffi::c_int,
24040 func: *const core::ffi::c_char,
24041 e: *const core::ffi::c_char,
24042 ) -> !;
24043}
24044pub const SignalReaderEventTypeHalfBufferFilled: SignalReaderEventType = SignalReaderEventType(0);
24045pub const SignalReaderEventTypeFullBufferFilled: SignalReaderEventType = SignalReaderEventType(1);
24046#[repr(transparent)]
24047#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24048pub struct SignalReaderEventType(pub core::ffi::c_uchar);
24049#[repr(C)]
24050#[derive(Debug, Copy, Clone)]
24051pub struct SignalReaderEventData {
24052 pub data: *mut u8,
24053 pub len: usize,
24054}
24055#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24056const _: () = {
24057 ["Size of SignalReaderEventData"][::core::mem::size_of::<SignalReaderEventData>() - 8usize];
24058 ["Alignment of SignalReaderEventData"]
24059 [::core::mem::align_of::<SignalReaderEventData>() - 4usize];
24060 ["Offset of field: SignalReaderEventData::data"]
24061 [::core::mem::offset_of!(SignalReaderEventData, data) - 0usize];
24062 ["Offset of field: SignalReaderEventData::len"]
24063 [::core::mem::offset_of!(SignalReaderEventData, len) - 4usize];
24064};
24065#[repr(C)]
24066#[derive(Debug, Copy, Clone)]
24067pub struct SignalReaderEvent {
24068 pub type_: SignalReaderEventType,
24069 pub data: *mut SignalReaderEventData,
24070}
24071#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24072const _: () = {
24073 ["Size of SignalReaderEvent"][::core::mem::size_of::<SignalReaderEvent>() - 8usize];
24074 ["Alignment of SignalReaderEvent"][::core::mem::align_of::<SignalReaderEvent>() - 4usize];
24075 ["Offset of field: SignalReaderEvent::type_"]
24076 [::core::mem::offset_of!(SignalReaderEvent, type_) - 0usize];
24077 ["Offset of field: SignalReaderEvent::data"]
24078 [::core::mem::offset_of!(SignalReaderEvent, data) - 4usize];
24079};
24080pub const SignalReaderTimeUnit64Mhz: SignalReaderTimeUnit = SignalReaderTimeUnit(0);
24081#[repr(transparent)]
24082#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24083pub struct SignalReaderTimeUnit(pub core::ffi::c_uchar);
24084pub const SignalReaderPolarityNormal: SignalReaderPolarity = SignalReaderPolarity(0);
24085pub const SignalReaderPolarityInverted: SignalReaderPolarity = SignalReaderPolarity(1);
24086#[repr(transparent)]
24087#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24088pub struct SignalReaderPolarity(pub core::ffi::c_uchar);
24089pub const SignalReaderTriggerNone: SignalReaderTrigger = SignalReaderTrigger(0);
24090pub const SignalReaderTriggerRisingFallingEdge: SignalReaderTrigger = SignalReaderTrigger(1);
24091#[repr(transparent)]
24092#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24093pub struct SignalReaderTrigger(pub core::ffi::c_uchar);
24094pub type SignalReaderCallback = ::core::option::Option<
24095 unsafe extern "C" fn(event: SignalReaderEvent, context: *mut core::ffi::c_void),
24096>;
24097#[repr(C)]
24098#[derive(Debug, Copy, Clone)]
24099pub struct SignalReader {
24100 _unused: [u8; 0],
24101}
24102unsafe extern "C" {
24103 pub fn signal_reader_alloc(gpio_pin: *const GpioPin, size: u32) -> *mut SignalReader;
24104}
24105unsafe extern "C" {
24106 pub fn signal_reader_free(instance: *mut SignalReader);
24107}
24108unsafe extern "C" {
24109 pub fn signal_reader_set_pull(instance: *mut SignalReader, pull: GpioPull);
24110}
24111unsafe extern "C" {
24112 pub fn signal_reader_set_polarity(instance: *mut SignalReader, polarity: SignalReaderPolarity);
24113}
24114unsafe extern "C" {
24115 pub fn signal_reader_set_sample_rate(
24116 instance: *mut SignalReader,
24117 time_unit: SignalReaderTimeUnit,
24118 time: u32,
24119 );
24120}
24121unsafe extern "C" {
24122 pub fn signal_reader_set_trigger(instance: *mut SignalReader, trigger: SignalReaderTrigger);
24123}
24124unsafe extern "C" {
24125 pub fn signal_reader_start(
24126 instance: *mut SignalReader,
24127 callback: SignalReaderCallback,
24128 context: *mut core::ffi::c_void,
24129 );
24130}
24131unsafe extern "C" {
24132 pub fn signal_reader_stop(instance: *mut SignalReader);
24133}
24134#[doc = "Structure definition of some features of COMP instance."]
24135#[repr(C)]
24136#[derive(Debug, Copy, Clone)]
24137pub struct LL_COMP_InitTypeDef {
24138 #[doc = "< Set comparator operating mode to adjust power and speed.\nThis parameter can be a value of COMP_LL_EC_POWERMODE\n\nThis feature can be modified afterwards using unitary function LL_COMP_SetPowerMode()."]
24139 pub PowerMode: u32,
24140 #[doc = "< Set comparator input plus (non-inverting input).\nThis parameter can be a value of COMP_LL_EC_INPUT_PLUS\n\nThis feature can be modified afterwards using unitary function LL_COMP_SetInputPlus()."]
24141 pub InputPlus: u32,
24142 #[doc = "< Set comparator input minus (inverting input).\nThis parameter can be a value of COMP_LL_EC_INPUT_MINUS\n\nThis feature can be modified afterwards using unitary function LL_COMP_SetInputMinus()."]
24143 pub InputMinus: u32,
24144 #[doc = "< Set comparator hysteresis mode of the input minus.\nThis parameter can be a value of COMP_LL_EC_INPUT_HYSTERESIS\n\nThis feature can be modified afterwards using unitary function LL_COMP_SetInputHysteresis()."]
24145 pub InputHysteresis: u32,
24146 #[doc = "< Set comparator output polarity.\nThis parameter can be a value of COMP_LL_EC_OUTPUT_POLARITY\n\nThis feature can be modified afterwards using unitary function LL_COMP_SetOutputPolarity()."]
24147 pub OutputPolarity: u32,
24148 #[doc = "< Set comparator blanking source.\nThis parameter can be a value of COMP_LL_EC_OUTPUT_BLANKING_SOURCE\n\nThis feature can be modified afterwards using unitary function LL_COMP_SetOutputBlankingSource()."]
24149 pub OutputBlankingSource: u32,
24150}
24151#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24152const _: () = {
24153 ["Size of LL_COMP_InitTypeDef"][::core::mem::size_of::<LL_COMP_InitTypeDef>() - 24usize];
24154 ["Alignment of LL_COMP_InitTypeDef"][::core::mem::align_of::<LL_COMP_InitTypeDef>() - 4usize];
24155 ["Offset of field: LL_COMP_InitTypeDef::PowerMode"]
24156 [::core::mem::offset_of!(LL_COMP_InitTypeDef, PowerMode) - 0usize];
24157 ["Offset of field: LL_COMP_InitTypeDef::InputPlus"]
24158 [::core::mem::offset_of!(LL_COMP_InitTypeDef, InputPlus) - 4usize];
24159 ["Offset of field: LL_COMP_InitTypeDef::InputMinus"]
24160 [::core::mem::offset_of!(LL_COMP_InitTypeDef, InputMinus) - 8usize];
24161 ["Offset of field: LL_COMP_InitTypeDef::InputHysteresis"]
24162 [::core::mem::offset_of!(LL_COMP_InitTypeDef, InputHysteresis) - 12usize];
24163 ["Offset of field: LL_COMP_InitTypeDef::OutputPolarity"]
24164 [::core::mem::offset_of!(LL_COMP_InitTypeDef, OutputPolarity) - 16usize];
24165 ["Offset of field: LL_COMP_InitTypeDef::OutputBlankingSource"]
24166 [::core::mem::offset_of!(LL_COMP_InitTypeDef, OutputBlankingSource) - 20usize];
24167};
24168unsafe extern "C" {
24169 pub fn LL_COMP_Init(
24170 COMPx: *mut COMP_TypeDef,
24171 COMP_InitStruct: *const LL_COMP_InitTypeDef,
24172 ) -> ErrorStatus;
24173}
24174#[doc = "DMA_LL_ES_INIT DMA Exported Init structure\n # "]
24175#[repr(C)]
24176#[derive(Debug, Copy, Clone)]
24177pub struct LL_DMA_InitTypeDef {
24178 #[doc = "< Specifies the peripheral base address for DMA transfer\nor as Source base address in case of memory to memory transfer direction.\n\nThis parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF."]
24179 pub PeriphOrM2MSrcAddress: u32,
24180 #[doc = "< Specifies the memory base address for DMA transfer\nor as Destination base address in case of memory to memory transfer direction.\n\nThis parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF."]
24181 pub MemoryOrM2MDstAddress: u32,
24182 #[doc = "< Specifies if the data will be transferred from memory to peripheral,\nfrom memory to memory or from peripheral to memory.\nThis parameter can be a value of DMA_LL_EC_DIRECTION\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetDataTransferDirection()."]
24183 pub Direction: u32,
24184 #[doc = "< Specifies the normal or circular operation mode.\nThis parameter can be a value of DMA_LL_EC_MODE\nThe circular buffer mode cannot be used if the memory to memory\ndata transfer direction is configured on the selected Channel\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetMode()."]
24185 pub Mode: u32,
24186 #[doc = "< Specifies whether the Peripheral address or Source address in case of memory to memory transfer direction\nis incremented or not.\nThis parameter can be a value of DMA_LL_EC_PERIPH\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetPeriphIncMode()."]
24187 pub PeriphOrM2MSrcIncMode: u32,
24188 #[doc = "< Specifies whether the Memory address or Destination address in case of memory to memory transfer direction\nis incremented or not.\nThis parameter can be a value of DMA_LL_EC_MEMORY\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetMemoryIncMode()."]
24189 pub MemoryOrM2MDstIncMode: u32,
24190 #[doc = "< Specifies the Peripheral data size alignment or Source data size alignment (byte, half word, word)\nin case of memory to memory transfer direction.\nThis parameter can be a value of DMA_LL_EC_PDATAALIGN\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetPeriphSize()."]
24191 pub PeriphOrM2MSrcDataSize: u32,
24192 #[doc = "< Specifies the Memory data size alignment or Destination data size alignment (byte, half word, word)\nin case of memory to memory transfer direction.\nThis parameter can be a value of DMA_LL_EC_MDATAALIGN\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetMemorySize()."]
24193 pub MemoryOrM2MDstDataSize: u32,
24194 #[doc = "< Specifies the number of data to transfer, in data unit.\nThe data unit is equal to the source buffer configuration set in PeripheralSize\nor MemorySize parameters depending in the transfer direction.\nThis parameter must be a value between Min_Data = 0 and Max_Data = 0x0000FFFF\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetDataLength()."]
24195 pub NbData: u32,
24196 #[doc = "< Specifies the peripheral request.\nThis parameter can be a value of DMAMUX_LL_EC_REQUEST\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetPeriphRequest()."]
24197 pub PeriphRequest: u32,
24198 #[doc = "< Specifies the channel priority level.\nThis parameter can be a value of DMA_LL_EC_PRIORITY\n\nThis feature can be modified afterwards using unitary function LL_DMA_SetChannelPriorityLevel()."]
24199 pub Priority: u32,
24200}
24201#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24202const _: () = {
24203 ["Size of LL_DMA_InitTypeDef"][::core::mem::size_of::<LL_DMA_InitTypeDef>() - 44usize];
24204 ["Alignment of LL_DMA_InitTypeDef"][::core::mem::align_of::<LL_DMA_InitTypeDef>() - 4usize];
24205 ["Offset of field: LL_DMA_InitTypeDef::PeriphOrM2MSrcAddress"]
24206 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphOrM2MSrcAddress) - 0usize];
24207 ["Offset of field: LL_DMA_InitTypeDef::MemoryOrM2MDstAddress"]
24208 [::core::mem::offset_of!(LL_DMA_InitTypeDef, MemoryOrM2MDstAddress) - 4usize];
24209 ["Offset of field: LL_DMA_InitTypeDef::Direction"]
24210 [::core::mem::offset_of!(LL_DMA_InitTypeDef, Direction) - 8usize];
24211 ["Offset of field: LL_DMA_InitTypeDef::Mode"]
24212 [::core::mem::offset_of!(LL_DMA_InitTypeDef, Mode) - 12usize];
24213 ["Offset of field: LL_DMA_InitTypeDef::PeriphOrM2MSrcIncMode"]
24214 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphOrM2MSrcIncMode) - 16usize];
24215 ["Offset of field: LL_DMA_InitTypeDef::MemoryOrM2MDstIncMode"]
24216 [::core::mem::offset_of!(LL_DMA_InitTypeDef, MemoryOrM2MDstIncMode) - 20usize];
24217 ["Offset of field: LL_DMA_InitTypeDef::PeriphOrM2MSrcDataSize"]
24218 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphOrM2MSrcDataSize) - 24usize];
24219 ["Offset of field: LL_DMA_InitTypeDef::MemoryOrM2MDstDataSize"]
24220 [::core::mem::offset_of!(LL_DMA_InitTypeDef, MemoryOrM2MDstDataSize) - 28usize];
24221 ["Offset of field: LL_DMA_InitTypeDef::NbData"]
24222 [::core::mem::offset_of!(LL_DMA_InitTypeDef, NbData) - 32usize];
24223 ["Offset of field: LL_DMA_InitTypeDef::PeriphRequest"]
24224 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphRequest) - 36usize];
24225 ["Offset of field: LL_DMA_InitTypeDef::Priority"]
24226 [::core::mem::offset_of!(LL_DMA_InitTypeDef, Priority) - 40usize];
24227};
24228unsafe extern "C" {
24229 #[doc = "DMA_LL_EF_Init Initialization and de-initialization functions\n # "]
24230 pub fn LL_DMA_Init(
24231 DMAx: *mut DMA_TypeDef,
24232 Channel: u32,
24233 DMA_InitStruct: *mut LL_DMA_InitTypeDef,
24234 ) -> ErrorStatus;
24235}
24236unsafe extern "C" {
24237 pub fn LL_DMA_DeInit(DMAx: *mut DMA_TypeDef, Channel: u32) -> ErrorStatus;
24238}
24239#[doc = "LPTIM Init structure definition"]
24240#[repr(C)]
24241#[derive(Debug, Copy, Clone)]
24242pub struct LL_LPTIM_InitTypeDef {
24243 #[doc = "< Specifies the source of the clock used by the LPTIM instance.\nThis parameter can be a value of LPTIM_LL_EC_CLK_SOURCE.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPTIM_SetClockSource()."]
24244 pub ClockSource: u32,
24245 #[doc = "< Specifies the prescaler division ratio.\nThis parameter can be a value of LPTIM_LL_EC_PRESCALER.\n\nThis feature can be modified afterwards using using unitary\nfunction LL_LPTIM_SetPrescaler()."]
24246 pub Prescaler: u32,
24247 #[doc = "< Specifies the waveform shape.\nThis parameter can be a value of LPTIM_LL_EC_OUTPUT_WAVEFORM.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPTIM_ConfigOutput()."]
24248 pub Waveform: u32,
24249 #[doc = "< Specifies waveform polarity.\nThis parameter can be a value of LPTIM_LL_EC_OUTPUT_POLARITY.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPTIM_ConfigOutput()."]
24250 pub Polarity: u32,
24251}
24252#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24253const _: () = {
24254 ["Size of LL_LPTIM_InitTypeDef"][::core::mem::size_of::<LL_LPTIM_InitTypeDef>() - 16usize];
24255 ["Alignment of LL_LPTIM_InitTypeDef"][::core::mem::align_of::<LL_LPTIM_InitTypeDef>() - 4usize];
24256 ["Offset of field: LL_LPTIM_InitTypeDef::ClockSource"]
24257 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, ClockSource) - 0usize];
24258 ["Offset of field: LL_LPTIM_InitTypeDef::Prescaler"]
24259 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, Prescaler) - 4usize];
24260 ["Offset of field: LL_LPTIM_InitTypeDef::Waveform"]
24261 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, Waveform) - 8usize];
24262 ["Offset of field: LL_LPTIM_InitTypeDef::Polarity"]
24263 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, Polarity) - 12usize];
24264};
24265unsafe extern "C" {
24266 #[doc = "LPTIM_LL_EF_Init Initialisation and deinitialisation functions\n # "]
24267 pub fn LL_LPTIM_DeInit(LPTIMx: *mut LPTIM_TypeDef) -> ErrorStatus;
24268}
24269unsafe extern "C" {
24270 pub fn LL_LPTIM_Init(
24271 LPTIMx: *mut LPTIM_TypeDef,
24272 LPTIM_InitStruct: *const LL_LPTIM_InitTypeDef,
24273 ) -> ErrorStatus;
24274}
24275#[doc = "LL LPUART Init Structure definition"]
24276#[repr(C)]
24277#[derive(Debug, Copy, Clone)]
24278pub struct LL_LPUART_InitTypeDef {
24279 #[doc = "< Specifies the Prescaler to compute the communication baud rate.\nThis parameter can be a value of LPUART_LL_EC_PRESCALER.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetPrescaler()."]
24280 pub PrescalerValue: u32,
24281 #[doc = "< This field defines expected LPUART communication baud rate.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetBaudRate()."]
24282 pub BaudRate: u32,
24283 #[doc = "< Specifies the number of data bits transmitted or received in a frame.\nThis parameter can be a value of LPUART_LL_EC_DATAWIDTH.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetDataWidth()."]
24284 pub DataWidth: u32,
24285 #[doc = "< Specifies the number of stop bits transmitted.\nThis parameter can be a value of LPUART_LL_EC_STOPBITS.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetStopBitsLength()."]
24286 pub StopBits: u32,
24287 #[doc = "< Specifies the parity mode.\nThis parameter can be a value of LPUART_LL_EC_PARITY.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetParity()."]
24288 pub Parity: u32,
24289 #[doc = "< Specifies whether the Receive and/or Transmit mode is enabled or disabled.\nThis parameter can be a value of LPUART_LL_EC_DIRECTION.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetTransferDirection()."]
24290 pub TransferDirection: u32,
24291 #[doc = "< Specifies whether the hardware flow control mode is enabled or disabled.\nThis parameter can be a value of LPUART_LL_EC_HWCONTROL.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetHWFlowCtrl()."]
24292 pub HardwareFlowControl: u32,
24293}
24294#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24295const _: () = {
24296 ["Size of LL_LPUART_InitTypeDef"][::core::mem::size_of::<LL_LPUART_InitTypeDef>() - 28usize];
24297 ["Alignment of LL_LPUART_InitTypeDef"]
24298 [::core::mem::align_of::<LL_LPUART_InitTypeDef>() - 4usize];
24299 ["Offset of field: LL_LPUART_InitTypeDef::PrescalerValue"]
24300 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, PrescalerValue) - 0usize];
24301 ["Offset of field: LL_LPUART_InitTypeDef::BaudRate"]
24302 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, BaudRate) - 4usize];
24303 ["Offset of field: LL_LPUART_InitTypeDef::DataWidth"]
24304 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, DataWidth) - 8usize];
24305 ["Offset of field: LL_LPUART_InitTypeDef::StopBits"]
24306 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, StopBits) - 12usize];
24307 ["Offset of field: LL_LPUART_InitTypeDef::Parity"]
24308 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, Parity) - 16usize];
24309 ["Offset of field: LL_LPUART_InitTypeDef::TransferDirection"]
24310 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, TransferDirection) - 20usize];
24311 ["Offset of field: LL_LPUART_InitTypeDef::HardwareFlowControl"]
24312 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, HardwareFlowControl) - 24usize];
24313};
24314unsafe extern "C" {
24315 pub fn LL_LPUART_Init(
24316 LPUARTx: *mut USART_TypeDef,
24317 LPUART_InitStruct: *const LL_LPUART_InitTypeDef,
24318 ) -> ErrorStatus;
24319}
24320#[doc = "RTC Init structures definition"]
24321#[repr(C)]
24322#[derive(Debug, Copy, Clone)]
24323pub struct LL_RTC_InitTypeDef {
24324 #[doc = "< Specifies the RTC Hours Format.\nThis parameter can be a value of RTC_LL_EC_HOURFORMAT\n\nThis feature can be modified afterwards using unitary function\nLL_RTC_SetHourFormat()."]
24325 pub HourFormat: u32,
24326 #[doc = "< Specifies the RTC Asynchronous Predivider value.\nThis parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F\n\nThis feature can be modified afterwards using unitary function\nLL_RTC_SetAsynchPrescaler()."]
24327 pub AsynchPrescaler: u32,
24328 #[doc = "< Specifies the RTC Synchronous Predivider value.\nThis parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF\n\nThis feature can be modified afterwards using unitary function\nLL_RTC_SetSynchPrescaler()."]
24329 pub SynchPrescaler: u32,
24330}
24331#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24332const _: () = {
24333 ["Size of LL_RTC_InitTypeDef"][::core::mem::size_of::<LL_RTC_InitTypeDef>() - 12usize];
24334 ["Alignment of LL_RTC_InitTypeDef"][::core::mem::align_of::<LL_RTC_InitTypeDef>() - 4usize];
24335 ["Offset of field: LL_RTC_InitTypeDef::HourFormat"]
24336 [::core::mem::offset_of!(LL_RTC_InitTypeDef, HourFormat) - 0usize];
24337 ["Offset of field: LL_RTC_InitTypeDef::AsynchPrescaler"]
24338 [::core::mem::offset_of!(LL_RTC_InitTypeDef, AsynchPrescaler) - 4usize];
24339 ["Offset of field: LL_RTC_InitTypeDef::SynchPrescaler"]
24340 [::core::mem::offset_of!(LL_RTC_InitTypeDef, SynchPrescaler) - 8usize];
24341};
24342unsafe extern "C" {
24343 pub fn LL_RTC_Init(
24344 RTCx: *mut RTC_TypeDef,
24345 RTC_InitStruct: *mut LL_RTC_InitTypeDef,
24346 ) -> ErrorStatus;
24347}
24348unsafe extern "C" {
24349 pub fn LL_RTC_EnterInitMode(RTCx: *mut RTC_TypeDef) -> ErrorStatus;
24350}
24351#[doc = "LL USART Init Structure definition"]
24352#[repr(C)]
24353#[derive(Debug, Copy, Clone)]
24354pub struct LL_USART_InitTypeDef {
24355 #[doc = "< Specifies the Prescaler to compute the communication baud rate.\nThis parameter can be a value of USART_LL_EC_PRESCALER.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetPrescaler()."]
24356 pub PrescalerValue: u32,
24357 #[doc = "< This field defines expected Usart communication baud rate.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetBaudRate()."]
24358 pub BaudRate: u32,
24359 #[doc = "< Specifies the number of data bits transmitted or received in a frame.\nThis parameter can be a value of USART_LL_EC_DATAWIDTH.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetDataWidth()."]
24360 pub DataWidth: u32,
24361 #[doc = "< Specifies the number of stop bits transmitted.\nThis parameter can be a value of USART_LL_EC_STOPBITS.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetStopBitsLength()."]
24362 pub StopBits: u32,
24363 #[doc = "< Specifies the parity mode.\nThis parameter can be a value of USART_LL_EC_PARITY.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetParity()."]
24364 pub Parity: u32,
24365 #[doc = "< Specifies whether the Receive and/or Transmit mode is enabled or disabled.\nThis parameter can be a value of USART_LL_EC_DIRECTION.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetTransferDirection()."]
24366 pub TransferDirection: u32,
24367 #[doc = "< Specifies whether the hardware flow control mode is enabled or disabled.\nThis parameter can be a value of USART_LL_EC_HWCONTROL.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetHWFlowCtrl()."]
24368 pub HardwareFlowControl: u32,
24369 #[doc = "< Specifies whether USART oversampling mode is 16 or 8.\nThis parameter can be a value of USART_LL_EC_OVERSAMPLING.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetOverSampling()."]
24370 pub OverSampling: u32,
24371}
24372#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24373const _: () = {
24374 ["Size of LL_USART_InitTypeDef"][::core::mem::size_of::<LL_USART_InitTypeDef>() - 32usize];
24375 ["Alignment of LL_USART_InitTypeDef"][::core::mem::align_of::<LL_USART_InitTypeDef>() - 4usize];
24376 ["Offset of field: LL_USART_InitTypeDef::PrescalerValue"]
24377 [::core::mem::offset_of!(LL_USART_InitTypeDef, PrescalerValue) - 0usize];
24378 ["Offset of field: LL_USART_InitTypeDef::BaudRate"]
24379 [::core::mem::offset_of!(LL_USART_InitTypeDef, BaudRate) - 4usize];
24380 ["Offset of field: LL_USART_InitTypeDef::DataWidth"]
24381 [::core::mem::offset_of!(LL_USART_InitTypeDef, DataWidth) - 8usize];
24382 ["Offset of field: LL_USART_InitTypeDef::StopBits"]
24383 [::core::mem::offset_of!(LL_USART_InitTypeDef, StopBits) - 12usize];
24384 ["Offset of field: LL_USART_InitTypeDef::Parity"]
24385 [::core::mem::offset_of!(LL_USART_InitTypeDef, Parity) - 16usize];
24386 ["Offset of field: LL_USART_InitTypeDef::TransferDirection"]
24387 [::core::mem::offset_of!(LL_USART_InitTypeDef, TransferDirection) - 20usize];
24388 ["Offset of field: LL_USART_InitTypeDef::HardwareFlowControl"]
24389 [::core::mem::offset_of!(LL_USART_InitTypeDef, HardwareFlowControl) - 24usize];
24390 ["Offset of field: LL_USART_InitTypeDef::OverSampling"]
24391 [::core::mem::offset_of!(LL_USART_InitTypeDef, OverSampling) - 28usize];
24392};
24393unsafe extern "C" {
24394 pub fn LL_USART_Init(
24395 USARTx: *mut USART_TypeDef,
24396 USART_InitStruct: *const LL_USART_InitTypeDef,
24397 ) -> ErrorStatus;
24398}
24399unsafe extern "C" {
24400 #[doc = "UTILS_EF_SYSTEM SYSTEM\n # "]
24401 pub fn LL_SetSystemCoreClock(HCLKFrequency: u32);
24402}
24403#[repr(C)]
24404#[derive(Debug, Copy, Clone)]
24405pub struct SubGhzBlockConst {
24406 pub te_long: u16,
24407 pub te_short: u16,
24408 pub te_delta: u16,
24409 pub min_count_bit_for_found: u8,
24410}
24411#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24412const _: () = {
24413 ["Size of SubGhzBlockConst"][::core::mem::size_of::<SubGhzBlockConst>() - 8usize];
24414 ["Alignment of SubGhzBlockConst"][::core::mem::align_of::<SubGhzBlockConst>() - 2usize];
24415 ["Offset of field: SubGhzBlockConst::te_long"]
24416 [::core::mem::offset_of!(SubGhzBlockConst, te_long) - 0usize];
24417 ["Offset of field: SubGhzBlockConst::te_short"]
24418 [::core::mem::offset_of!(SubGhzBlockConst, te_short) - 2usize];
24419 ["Offset of field: SubGhzBlockConst::te_delta"]
24420 [::core::mem::offset_of!(SubGhzBlockConst, te_delta) - 4usize];
24421 ["Offset of field: SubGhzBlockConst::min_count_bit_for_found"]
24422 [::core::mem::offset_of!(SubGhzBlockConst, min_count_bit_for_found) - 6usize];
24423};
24424#[repr(C)]
24425#[derive(Debug, Copy, Clone)]
24426pub struct SubGhzBlockDecoder {
24427 pub parser_step: u32,
24428 pub te_last: u32,
24429 pub decode_data: u64,
24430 pub decode_count_bit: u8,
24431}
24432#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24433const _: () = {
24434 ["Size of SubGhzBlockDecoder"][::core::mem::size_of::<SubGhzBlockDecoder>() - 24usize];
24435 ["Alignment of SubGhzBlockDecoder"][::core::mem::align_of::<SubGhzBlockDecoder>() - 8usize];
24436 ["Offset of field: SubGhzBlockDecoder::parser_step"]
24437 [::core::mem::offset_of!(SubGhzBlockDecoder, parser_step) - 0usize];
24438 ["Offset of field: SubGhzBlockDecoder::te_last"]
24439 [::core::mem::offset_of!(SubGhzBlockDecoder, te_last) - 4usize];
24440 ["Offset of field: SubGhzBlockDecoder::decode_data"]
24441 [::core::mem::offset_of!(SubGhzBlockDecoder, decode_data) - 8usize];
24442 ["Offset of field: SubGhzBlockDecoder::decode_count_bit"]
24443 [::core::mem::offset_of!(SubGhzBlockDecoder, decode_count_bit) - 16usize];
24444};
24445unsafe extern "C" {
24446 #[doc = "Add data bit when decoding.\n # Arguments\n\n* `decoder` - Pointer to a SubGhzBlockDecoder instance\n * `bit` - data, 1bit"]
24447 pub fn subghz_protocol_blocks_add_bit(decoder: *mut SubGhzBlockDecoder, bit: u8);
24448}
24449unsafe extern "C" {
24450 #[doc = "Add data to_128 bit when decoding.\n # Arguments\n\n* `decoder` - Pointer to a SubGhzBlockDecoder instance\n * `head_64_bit` - Pointer to a head_64_bit\n * `bit` - data, 1bit"]
24451 pub fn subghz_protocol_blocks_add_to_128_bit(
24452 decoder: *mut SubGhzBlockDecoder,
24453 bit: u8,
24454 head_64_bit: *mut u64,
24455 );
24456}
24457unsafe extern "C" {
24458 #[doc = "Getting the hash sum of the last randomly received parcel.\n # Arguments\n\n* `decoder` - Pointer to a SubGhzBlockDecoder instance\n # Returns\n\nhash Hash sum"]
24459 pub fn subghz_protocol_blocks_get_hash_data(decoder: *mut SubGhzBlockDecoder, len: usize)
24460 -> u8;
24461}
24462#[repr(C)]
24463#[derive(Debug, Copy, Clone)]
24464pub struct SubGhzProtocolBlockEncoder {
24465 pub is_running: bool,
24466 pub repeat: usize,
24467 pub front: usize,
24468 pub size_upload: usize,
24469 pub upload: *mut LevelDuration,
24470}
24471#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24472const _: () = {
24473 ["Size of SubGhzProtocolBlockEncoder"]
24474 [::core::mem::size_of::<SubGhzProtocolBlockEncoder>() - 20usize];
24475 ["Alignment of SubGhzProtocolBlockEncoder"]
24476 [::core::mem::align_of::<SubGhzProtocolBlockEncoder>() - 4usize];
24477 ["Offset of field: SubGhzProtocolBlockEncoder::is_running"]
24478 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, is_running) - 0usize];
24479 ["Offset of field: SubGhzProtocolBlockEncoder::repeat"]
24480 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, repeat) - 4usize];
24481 ["Offset of field: SubGhzProtocolBlockEncoder::front"]
24482 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, front) - 8usize];
24483 ["Offset of field: SubGhzProtocolBlockEncoder::size_upload"]
24484 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, size_upload) - 12usize];
24485 ["Offset of field: SubGhzProtocolBlockEncoder::upload"]
24486 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, upload) - 16usize];
24487};
24488pub const SubGhzProtocolBlockAlignBitLeft: SubGhzProtocolBlockAlignBit =
24489 SubGhzProtocolBlockAlignBit(0);
24490pub const SubGhzProtocolBlockAlignBitRight: SubGhzProtocolBlockAlignBit =
24491 SubGhzProtocolBlockAlignBit(1);
24492#[repr(transparent)]
24493#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24494pub struct SubGhzProtocolBlockAlignBit(pub core::ffi::c_uchar);
24495unsafe extern "C" {
24496 #[doc = "Set data bit when encoding HEX array.\n # Arguments\n\n* `bit_value` - The value of the bit to be set\n * `data_array` - Pointer to a HEX array\n * `set_index_bit` - Number set a bit in the array starting from the left\n * `max_size_array` - array size, check not to overflow"]
24497 pub fn subghz_protocol_blocks_set_bit_array(
24498 bit_value: bool,
24499 data_array: *mut u8,
24500 set_index_bit: usize,
24501 max_size_array: usize,
24502 );
24503}
24504unsafe extern "C" {
24505 #[doc = "Get data bit when encoding HEX array.\n # Arguments\n\n* `data_array` - Pointer to a HEX array\n * `read_index_bit` - Number get a bit in the array starting from the left\n # Returns\n\nbool value bit"]
24506 pub fn subghz_protocol_blocks_get_bit_array(data_array: *mut u8, read_index_bit: usize)
24507 -> bool;
24508}
24509unsafe extern "C" {
24510 #[doc = "Generating an upload from data.\n # Arguments\n\n* `data_array` - Pointer to a HEX array\n * `count_bit_data_array` - How many bits in the array are processed\n * `upload` - Pointer to a LevelDuration\n * `max_size_upload` - upload size, check not to overflow\n * `duration_bit` - duration 1 bit\n * `align_bit` - alignment of useful bits in an array"]
24511 pub fn subghz_protocol_blocks_get_upload_from_bit_array(
24512 data_array: *mut u8,
24513 count_bit_data_array: usize,
24514 upload: *mut LevelDuration,
24515 max_size_upload: usize,
24516 duration_bit: u32,
24517 align_bit: SubGhzProtocolBlockAlignBit,
24518 ) -> usize;
24519}
24520#[repr(C)]
24521#[derive(Debug, Copy, Clone)]
24522pub struct SubGhzEnvironment {
24523 _unused: [u8; 0],
24524}
24525#[repr(C)]
24526#[derive(Debug, Copy, Clone)]
24527pub struct SubGhzProtocolRegistry {
24528 pub items: *const *const SubGhzProtocol,
24529 pub size: usize,
24530}
24531#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24532const _: () = {
24533 ["Size of SubGhzProtocolRegistry"][::core::mem::size_of::<SubGhzProtocolRegistry>() - 8usize];
24534 ["Alignment of SubGhzProtocolRegistry"]
24535 [::core::mem::align_of::<SubGhzProtocolRegistry>() - 4usize];
24536 ["Offset of field: SubGhzProtocolRegistry::items"]
24537 [::core::mem::offset_of!(SubGhzProtocolRegistry, items) - 0usize];
24538 ["Offset of field: SubGhzProtocolRegistry::size"]
24539 [::core::mem::offset_of!(SubGhzProtocolRegistry, size) - 4usize];
24540};
24541unsafe extern "C" {
24542 #[doc = "Registration by name SubGhzProtocol.\n # Arguments\n\n* `protocol_registry` - SubGhzProtocolRegistry\n * `name` - Protocol name\n # Returns\n\nSubGhzProtocol* pointer to a SubGhzProtocol instance"]
24543 pub fn subghz_protocol_registry_get_by_name(
24544 protocol_registry: *const SubGhzProtocolRegistry,
24545 name: *const core::ffi::c_char,
24546 ) -> *const SubGhzProtocol;
24547}
24548unsafe extern "C" {
24549 #[doc = "Registration protocol by index in array SubGhzProtocol.\n # Arguments\n\n* `protocol_registry` - SubGhzProtocolRegistry\n * `index` - Protocol by index in array\n # Returns\n\nSubGhzProtocol* pointer to a SubGhzProtocol instance"]
24550 pub fn subghz_protocol_registry_get_by_index(
24551 protocol_registry: *const SubGhzProtocolRegistry,
24552 index: usize,
24553 ) -> *const SubGhzProtocol;
24554}
24555unsafe extern "C" {
24556 #[doc = "Getting the number of registered protocols.\n # Arguments\n\n* `protocol_registry` - SubGhzProtocolRegistry\n # Returns\n\nNumber of protocols"]
24557 pub fn subghz_protocol_registry_count(
24558 protocol_registry: *const SubGhzProtocolRegistry,
24559 ) -> usize;
24560}
24561#[repr(C)]
24562#[derive(Debug, Copy, Clone)]
24563pub struct SubGhzKey {
24564 pub name: *mut FuriString,
24565 pub key: u64,
24566 pub type_: u16,
24567}
24568#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24569const _: () = {
24570 ["Size of SubGhzKey"][::core::mem::size_of::<SubGhzKey>() - 24usize];
24571 ["Alignment of SubGhzKey"][::core::mem::align_of::<SubGhzKey>() - 8usize];
24572 ["Offset of field: SubGhzKey::name"][::core::mem::offset_of!(SubGhzKey, name) - 0usize];
24573 ["Offset of field: SubGhzKey::key"][::core::mem::offset_of!(SubGhzKey, key) - 8usize];
24574 ["Offset of field: SubGhzKey::type_"][::core::mem::offset_of!(SubGhzKey, type_) - 16usize];
24575};
24576#[repr(C)]
24577#[derive(Debug, Copy, Clone)]
24578pub struct SubGhzKeyArray_s {
24579 pub size: usize,
24580 pub alloc: usize,
24581 pub ptr: *mut SubGhzKey,
24582}
24583#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24584const _: () = {
24585 ["Size of SubGhzKeyArray_s"][::core::mem::size_of::<SubGhzKeyArray_s>() - 12usize];
24586 ["Alignment of SubGhzKeyArray_s"][::core::mem::align_of::<SubGhzKeyArray_s>() - 4usize];
24587 ["Offset of field: SubGhzKeyArray_s::size"]
24588 [::core::mem::offset_of!(SubGhzKeyArray_s, size) - 0usize];
24589 ["Offset of field: SubGhzKeyArray_s::alloc"]
24590 [::core::mem::offset_of!(SubGhzKeyArray_s, alloc) - 4usize];
24591 ["Offset of field: SubGhzKeyArray_s::ptr"]
24592 [::core::mem::offset_of!(SubGhzKeyArray_s, ptr) - 8usize];
24593};
24594pub type SubGhzKeyArray_t = [SubGhzKeyArray_s; 1usize];
24595#[repr(C)]
24596#[derive(Debug, Copy, Clone)]
24597pub struct SubGhzKeyArray_it_s {
24598 pub index: usize,
24599 pub array: *const SubGhzKeyArray_s,
24600}
24601#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24602const _: () = {
24603 ["Size of SubGhzKeyArray_it_s"][::core::mem::size_of::<SubGhzKeyArray_it_s>() - 8usize];
24604 ["Alignment of SubGhzKeyArray_it_s"][::core::mem::align_of::<SubGhzKeyArray_it_s>() - 4usize];
24605 ["Offset of field: SubGhzKeyArray_it_s::index"]
24606 [::core::mem::offset_of!(SubGhzKeyArray_it_s, index) - 0usize];
24607 ["Offset of field: SubGhzKeyArray_it_s::array"]
24608 [::core::mem::offset_of!(SubGhzKeyArray_it_s, array) - 4usize];
24609};
24610pub type SubGhzKeyArray_it_t = [SubGhzKeyArray_it_s; 1usize];
24611pub type SubGhzKeyArray_ptr = *mut SubGhzKeyArray_s;
24612pub type SubGhzKeyArray_srcptr = *const SubGhzKeyArray_s;
24613pub type SubGhzKeyArray_ct = SubGhzKeyArray_t;
24614pub type SubGhzKeyArray_it_ct = SubGhzKeyArray_it_t;
24615pub type SubGhzKeyArray_subtype_ct = SubGhzKey;
24616#[repr(C)]
24617#[derive(Debug, Copy, Clone)]
24618pub struct SubGhzKeystore {
24619 _unused: [u8; 0],
24620}
24621unsafe extern "C" {
24622 #[doc = "Allocate SubGhzKeystore.\n # Returns\n\nSubGhzKeystore* pointer to a SubGhzKeystore instance"]
24623 pub fn subghz_keystore_alloc() -> *mut SubGhzKeystore;
24624}
24625unsafe extern "C" {
24626 #[doc = "Free SubGhzKeystore.\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance"]
24627 pub fn subghz_keystore_free(instance: *mut SubGhzKeystore);
24628}
24629unsafe extern "C" {
24630 #[doc = "Loading manufacture key from file\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance\n * `filename` - Full path to the file"]
24631 pub fn subghz_keystore_load(
24632 instance: *mut SubGhzKeystore,
24633 filename: *const core::ffi::c_char,
24634 ) -> bool;
24635}
24636unsafe extern "C" {
24637 #[doc = "Save manufacture key to file\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance\n * `filename` - Full path to the file\n # Returns\n\ntrue On success"]
24638 pub fn subghz_keystore_save(
24639 instance: *mut SubGhzKeystore,
24640 filename: *const core::ffi::c_char,
24641 iv: *mut u8,
24642 ) -> bool;
24643}
24644unsafe extern "C" {
24645 #[doc = "Get array of keys and names manufacture\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance\n # Returns\n\nSubGhzKeyArray_t*"]
24646 pub fn subghz_keystore_get_data(instance: *mut SubGhzKeystore) -> *mut SubGhzKeyArray_t;
24647}
24648unsafe extern "C" {
24649 #[doc = "Save RAW encrypted to file\n # Arguments\n\n* `input_file_name` - Full path to the input file\n * `output_file_name` - Full path to the output file\n * `iv` - IV, 16 bytes in hex"]
24650 pub fn subghz_keystore_raw_encrypted_save(
24651 input_file_name: *const core::ffi::c_char,
24652 output_file_name: *const core::ffi::c_char,
24653 iv: *mut u8,
24654 ) -> bool;
24655}
24656unsafe extern "C" {
24657 #[doc = "Get decrypt RAW data to file\n # Arguments\n\n* `file_name` - Full path to the input file\n * `offset` - Offset from the start of the RAW data\n * `data` - Returned array\n * `len` - Required data length\n # Returns\n\ntrue On success"]
24658 pub fn subghz_keystore_raw_get_data(
24659 file_name: *const core::ffi::c_char,
24660 offset: usize,
24661 data: *mut u8,
24662 len: usize,
24663 ) -> bool;
24664}
24665unsafe extern "C" {
24666 #[doc = "Allocate SubGhzEnvironment.\n # Returns\n\nSubGhzEnvironment* pointer to a SubGhzEnvironment instance"]
24667 pub fn subghz_environment_alloc() -> *mut SubGhzEnvironment;
24668}
24669unsafe extern "C" {
24670 #[doc = "Free SubGhzEnvironment.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance"]
24671 pub fn subghz_environment_free(instance: *mut SubGhzEnvironment);
24672}
24673unsafe extern "C" {
24674 #[doc = "Downloading the manufacture key file.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n * `filename` - Full path to the file\n # Returns\n\ntrue On success"]
24675 pub fn subghz_environment_load_keystore(
24676 instance: *mut SubGhzEnvironment,
24677 filename: *const core::ffi::c_char,
24678 ) -> bool;
24679}
24680unsafe extern "C" {
24681 #[doc = "Get pointer to a SubGhzKeystore* instance.\n # Returns\n\nSubGhzEnvironment* pointer to a SubGhzEnvironment instance"]
24682 pub fn subghz_environment_get_keystore(instance: *mut SubGhzEnvironment)
24683 -> *mut SubGhzKeystore;
24684}
24685unsafe extern "C" {
24686 #[doc = "Set filename to work with Came Atomo.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n * `filename` - Full path to the file"]
24687 pub fn subghz_environment_set_came_atomo_rainbow_table_file_name(
24688 instance: *mut SubGhzEnvironment,
24689 filename: *const core::ffi::c_char,
24690 );
24691}
24692unsafe extern "C" {
24693 #[doc = "Get filename to work with Came Atomo.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nFull path to the file"]
24694 pub fn subghz_environment_get_came_atomo_rainbow_table_file_name(
24695 instance: *mut SubGhzEnvironment,
24696 ) -> *const core::ffi::c_char;
24697}
24698unsafe extern "C" {
24699 #[doc = "Set filename to work with Alutech at-4n.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n * `filename` - Full path to the file"]
24700 pub fn subghz_environment_set_alutech_at_4n_rainbow_table_file_name(
24701 instance: *mut SubGhzEnvironment,
24702 filename: *const core::ffi::c_char,
24703 );
24704}
24705unsafe extern "C" {
24706 #[doc = "Get filename to work with Alutech at-4n.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nFull path to the file"]
24707 pub fn subghz_environment_get_alutech_at_4n_rainbow_table_file_name(
24708 instance: *mut SubGhzEnvironment,
24709 ) -> *const core::ffi::c_char;
24710}
24711unsafe extern "C" {
24712 #[doc = "Set filename to work with Nice Flor-S.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n * `filename` - Full path to the file"]
24713 pub fn subghz_environment_set_nice_flor_s_rainbow_table_file_name(
24714 instance: *mut SubGhzEnvironment,
24715 filename: *const core::ffi::c_char,
24716 );
24717}
24718unsafe extern "C" {
24719 #[doc = "Get filename to work with Nice Flor-S.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nFull path to the file"]
24720 pub fn subghz_environment_get_nice_flor_s_rainbow_table_file_name(
24721 instance: *mut SubGhzEnvironment,
24722 ) -> *const core::ffi::c_char;
24723}
24724unsafe extern "C" {
24725 #[doc = "Set list of protocols to work.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n * `protocol_registry_items` - Pointer to a SubGhzProtocolRegistry"]
24726 pub fn subghz_environment_set_protocol_registry(
24727 instance: *mut SubGhzEnvironment,
24728 protocol_registry_items: *const SubGhzProtocolRegistry,
24729 );
24730}
24731unsafe extern "C" {
24732 #[doc = "Get list of protocols to work.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nPointer to a SubGhzProtocolRegistry"]
24733 pub fn subghz_environment_get_protocol_registry(
24734 instance: *mut SubGhzEnvironment,
24735 ) -> *const SubGhzProtocolRegistry;
24736}
24737unsafe extern "C" {
24738 #[doc = "Get list of protocols names.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n * `idx` - index protocols\n # Returns\n\nPointer to a SubGhzProtocolRegistry"]
24739 pub fn subghz_environment_get_protocol_name_registry(
24740 instance: *mut SubGhzEnvironment,
24741 idx: usize,
24742 ) -> *const core::ffi::c_char;
24743}
24744#[repr(C)]
24745#[derive(Debug, Copy, Clone)]
24746pub struct SubGhzRadioPreset {
24747 pub name: *mut FuriString,
24748 pub frequency: u32,
24749 pub data: *mut u8,
24750 pub data_size: usize,
24751}
24752#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24753const _: () = {
24754 ["Size of SubGhzRadioPreset"][::core::mem::size_of::<SubGhzRadioPreset>() - 16usize];
24755 ["Alignment of SubGhzRadioPreset"][::core::mem::align_of::<SubGhzRadioPreset>() - 4usize];
24756 ["Offset of field: SubGhzRadioPreset::name"]
24757 [::core::mem::offset_of!(SubGhzRadioPreset, name) - 0usize];
24758 ["Offset of field: SubGhzRadioPreset::frequency"]
24759 [::core::mem::offset_of!(SubGhzRadioPreset, frequency) - 4usize];
24760 ["Offset of field: SubGhzRadioPreset::data"]
24761 [::core::mem::offset_of!(SubGhzRadioPreset, data) - 8usize];
24762 ["Offset of field: SubGhzRadioPreset::data_size"]
24763 [::core::mem::offset_of!(SubGhzRadioPreset, data_size) - 12usize];
24764};
24765pub const SubGhzProtocolStatusOk: SubGhzProtocolStatus = SubGhzProtocolStatus(0);
24766#[doc = "< General unclassified error"]
24767pub const SubGhzProtocolStatusError: SubGhzProtocolStatus = SubGhzProtocolStatus(-1);
24768#[doc = "< Missing or invalid file header"]
24769pub const SubGhzProtocolStatusErrorParserHeader: SubGhzProtocolStatus = SubGhzProtocolStatus(-2);
24770#[doc = "< Missing `Frequency`"]
24771pub const SubGhzProtocolStatusErrorParserFrequency: SubGhzProtocolStatus = SubGhzProtocolStatus(-3);
24772#[doc = "< Missing `Preset`"]
24773pub const SubGhzProtocolStatusErrorParserPreset: SubGhzProtocolStatus = SubGhzProtocolStatus(-4);
24774#[doc = "< Missing `Custom_preset_module`"]
24775pub const SubGhzProtocolStatusErrorParserCustomPreset: SubGhzProtocolStatus =
24776 SubGhzProtocolStatus(-5);
24777#[doc = "< Missing `Protocol` name"]
24778pub const SubGhzProtocolStatusErrorParserProtocolName: SubGhzProtocolStatus =
24779 SubGhzProtocolStatus(-6);
24780#[doc = "< Missing `Bit`"]
24781pub const SubGhzProtocolStatusErrorParserBitCount: SubGhzProtocolStatus = SubGhzProtocolStatus(-7);
24782#[doc = "< Missing `Key`"]
24783pub const SubGhzProtocolStatusErrorParserKey: SubGhzProtocolStatus = SubGhzProtocolStatus(-8);
24784#[doc = "< Missing `Te`"]
24785pub const SubGhzProtocolStatusErrorParserTe: SubGhzProtocolStatus = SubGhzProtocolStatus(-9);
24786#[doc = "< Missing some other mandatory keys"]
24787pub const SubGhzProtocolStatusErrorParserOthers: SubGhzProtocolStatus = SubGhzProtocolStatus(-10);
24788#[doc = "< Invalid bit count value"]
24789pub const SubGhzProtocolStatusErrorValueBitCount: SubGhzProtocolStatus = SubGhzProtocolStatus(-11);
24790#[doc = "< Payload encoder failure"]
24791pub const SubGhzProtocolStatusErrorEncoderGetUpload: SubGhzProtocolStatus =
24792 SubGhzProtocolStatus(-12);
24793#[doc = "< Protocol not found"]
24794pub const SubGhzProtocolStatusErrorProtocolNotFound: SubGhzProtocolStatus =
24795 SubGhzProtocolStatus(-13);
24796#[doc = "< Prevents enum down-size compiler optimization."]
24797pub const SubGhzProtocolStatusReserved: SubGhzProtocolStatus = SubGhzProtocolStatus(2147483647);
24798#[repr(transparent)]
24799#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24800pub struct SubGhzProtocolStatus(pub core::ffi::c_int);
24801pub type SubGhzAlloc = ::core::option::Option<
24802 unsafe extern "C" fn(environment: *mut SubGhzEnvironment) -> *mut core::ffi::c_void,
24803>;
24804pub type SubGhzFree = ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
24805pub type SubGhzSerialize = ::core::option::Option<
24806 unsafe extern "C" fn(
24807 context: *mut core::ffi::c_void,
24808 flipper_format: *mut FlipperFormat,
24809 preset: *mut SubGhzRadioPreset,
24810 ) -> SubGhzProtocolStatus,
24811>;
24812pub type SubGhzDeserialize = ::core::option::Option<
24813 unsafe extern "C" fn(
24814 context: *mut core::ffi::c_void,
24815 flipper_format: *mut FlipperFormat,
24816 ) -> SubGhzProtocolStatus,
24817>;
24818pub type SubGhzDecoderFeed = ::core::option::Option<
24819 unsafe extern "C" fn(decoder: *mut core::ffi::c_void, level: bool, duration: u32),
24820>;
24821pub type SubGhzDecoderReset =
24822 ::core::option::Option<unsafe extern "C" fn(decoder: *mut core::ffi::c_void)>;
24823pub type SubGhzGetHashData =
24824 ::core::option::Option<unsafe extern "C" fn(decoder: *mut core::ffi::c_void) -> u8>;
24825pub type SubGhzGetString = ::core::option::Option<
24826 unsafe extern "C" fn(decoder: *mut core::ffi::c_void, output: *mut FuriString),
24827>;
24828pub type SubGhzEncoderStop =
24829 ::core::option::Option<unsafe extern "C" fn(encoder: *mut core::ffi::c_void)>;
24830pub type SubGhzEncoderYield =
24831 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> LevelDuration>;
24832#[repr(C)]
24833#[derive(Debug, Copy, Clone)]
24834pub struct SubGhzProtocolDecoder {
24835 pub alloc: SubGhzAlloc,
24836 pub free: SubGhzFree,
24837 pub feed: SubGhzDecoderFeed,
24838 pub reset: SubGhzDecoderReset,
24839 pub get_hash_data: SubGhzGetHashData,
24840 pub get_string: SubGhzGetString,
24841 pub serialize: SubGhzSerialize,
24842 pub deserialize: SubGhzDeserialize,
24843}
24844#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24845const _: () = {
24846 ["Size of SubGhzProtocolDecoder"][::core::mem::size_of::<SubGhzProtocolDecoder>() - 32usize];
24847 ["Alignment of SubGhzProtocolDecoder"]
24848 [::core::mem::align_of::<SubGhzProtocolDecoder>() - 4usize];
24849 ["Offset of field: SubGhzProtocolDecoder::alloc"]
24850 [::core::mem::offset_of!(SubGhzProtocolDecoder, alloc) - 0usize];
24851 ["Offset of field: SubGhzProtocolDecoder::free"]
24852 [::core::mem::offset_of!(SubGhzProtocolDecoder, free) - 4usize];
24853 ["Offset of field: SubGhzProtocolDecoder::feed"]
24854 [::core::mem::offset_of!(SubGhzProtocolDecoder, feed) - 8usize];
24855 ["Offset of field: SubGhzProtocolDecoder::reset"]
24856 [::core::mem::offset_of!(SubGhzProtocolDecoder, reset) - 12usize];
24857 ["Offset of field: SubGhzProtocolDecoder::get_hash_data"]
24858 [::core::mem::offset_of!(SubGhzProtocolDecoder, get_hash_data) - 16usize];
24859 ["Offset of field: SubGhzProtocolDecoder::get_string"]
24860 [::core::mem::offset_of!(SubGhzProtocolDecoder, get_string) - 20usize];
24861 ["Offset of field: SubGhzProtocolDecoder::serialize"]
24862 [::core::mem::offset_of!(SubGhzProtocolDecoder, serialize) - 24usize];
24863 ["Offset of field: SubGhzProtocolDecoder::deserialize"]
24864 [::core::mem::offset_of!(SubGhzProtocolDecoder, deserialize) - 28usize];
24865};
24866#[repr(C)]
24867#[derive(Debug, Copy, Clone)]
24868pub struct SubGhzProtocolEncoder {
24869 pub alloc: SubGhzAlloc,
24870 pub free: SubGhzFree,
24871 pub deserialize: SubGhzDeserialize,
24872 pub stop: SubGhzEncoderStop,
24873 pub yield_: SubGhzEncoderYield,
24874}
24875#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24876const _: () = {
24877 ["Size of SubGhzProtocolEncoder"][::core::mem::size_of::<SubGhzProtocolEncoder>() - 20usize];
24878 ["Alignment of SubGhzProtocolEncoder"]
24879 [::core::mem::align_of::<SubGhzProtocolEncoder>() - 4usize];
24880 ["Offset of field: SubGhzProtocolEncoder::alloc"]
24881 [::core::mem::offset_of!(SubGhzProtocolEncoder, alloc) - 0usize];
24882 ["Offset of field: SubGhzProtocolEncoder::free"]
24883 [::core::mem::offset_of!(SubGhzProtocolEncoder, free) - 4usize];
24884 ["Offset of field: SubGhzProtocolEncoder::deserialize"]
24885 [::core::mem::offset_of!(SubGhzProtocolEncoder, deserialize) - 8usize];
24886 ["Offset of field: SubGhzProtocolEncoder::stop"]
24887 [::core::mem::offset_of!(SubGhzProtocolEncoder, stop) - 12usize];
24888 ["Offset of field: SubGhzProtocolEncoder::yield_"]
24889 [::core::mem::offset_of!(SubGhzProtocolEncoder, yield_) - 16usize];
24890};
24891pub const SubGhzProtocolTypeUnknown: SubGhzProtocolType = SubGhzProtocolType(0);
24892pub const SubGhzProtocolTypeStatic: SubGhzProtocolType = SubGhzProtocolType(1);
24893pub const SubGhzProtocolTypeDynamic: SubGhzProtocolType = SubGhzProtocolType(2);
24894pub const SubGhzProtocolTypeRAW: SubGhzProtocolType = SubGhzProtocolType(3);
24895pub const SubGhzProtocolWeatherStation: SubGhzProtocolType = SubGhzProtocolType(4);
24896pub const SubGhzProtocolCustom: SubGhzProtocolType = SubGhzProtocolType(5);
24897#[repr(transparent)]
24898#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24899pub struct SubGhzProtocolType(pub core::ffi::c_uchar);
24900pub const SubGhzProtocolFlag_RAW: SubGhzProtocolFlag = SubGhzProtocolFlag(1);
24901pub const SubGhzProtocolFlag_Decodable: SubGhzProtocolFlag = SubGhzProtocolFlag(2);
24902pub const SubGhzProtocolFlag_315: SubGhzProtocolFlag = SubGhzProtocolFlag(4);
24903pub const SubGhzProtocolFlag_433: SubGhzProtocolFlag = SubGhzProtocolFlag(8);
24904pub const SubGhzProtocolFlag_868: SubGhzProtocolFlag = SubGhzProtocolFlag(16);
24905pub const SubGhzProtocolFlag_AM: SubGhzProtocolFlag = SubGhzProtocolFlag(32);
24906pub const SubGhzProtocolFlag_FM: SubGhzProtocolFlag = SubGhzProtocolFlag(64);
24907pub const SubGhzProtocolFlag_Save: SubGhzProtocolFlag = SubGhzProtocolFlag(128);
24908pub const SubGhzProtocolFlag_Load: SubGhzProtocolFlag = SubGhzProtocolFlag(256);
24909pub const SubGhzProtocolFlag_Send: SubGhzProtocolFlag = SubGhzProtocolFlag(512);
24910pub const SubGhzProtocolFlag_BinRAW: SubGhzProtocolFlag = SubGhzProtocolFlag(1024);
24911#[repr(transparent)]
24912#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24913pub struct SubGhzProtocolFlag(pub core::ffi::c_ushort);
24914#[repr(C)]
24915#[derive(Debug, Copy, Clone)]
24916pub struct SubGhzProtocol {
24917 pub name: *const core::ffi::c_char,
24918 pub type_: SubGhzProtocolType,
24919 pub flag: SubGhzProtocolFlag,
24920 pub encoder: *const SubGhzProtocolEncoder,
24921 pub decoder: *const SubGhzProtocolDecoder,
24922}
24923#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24924const _: () = {
24925 ["Size of SubGhzProtocol"][::core::mem::size_of::<SubGhzProtocol>() - 16usize];
24926 ["Alignment of SubGhzProtocol"][::core::mem::align_of::<SubGhzProtocol>() - 4usize];
24927 ["Offset of field: SubGhzProtocol::name"]
24928 [::core::mem::offset_of!(SubGhzProtocol, name) - 0usize];
24929 ["Offset of field: SubGhzProtocol::type_"]
24930 [::core::mem::offset_of!(SubGhzProtocol, type_) - 4usize];
24931 ["Offset of field: SubGhzProtocol::flag"]
24932 [::core::mem::offset_of!(SubGhzProtocol, flag) - 6usize];
24933 ["Offset of field: SubGhzProtocol::encoder"]
24934 [::core::mem::offset_of!(SubGhzProtocol, encoder) - 8usize];
24935 ["Offset of field: SubGhzProtocol::decoder"]
24936 [::core::mem::offset_of!(SubGhzProtocol, decoder) - 12usize];
24937};
24938#[repr(C)]
24939#[derive(Debug, Copy, Clone)]
24940pub struct SubGhzBlockGeneric {
24941 pub protocol_name: *const core::ffi::c_char,
24942 pub data: u64,
24943 pub serial: u32,
24944 pub data_count_bit: u16,
24945 pub btn: u8,
24946 pub cnt: u32,
24947}
24948#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24949const _: () = {
24950 ["Size of SubGhzBlockGeneric"][::core::mem::size_of::<SubGhzBlockGeneric>() - 32usize];
24951 ["Alignment of SubGhzBlockGeneric"][::core::mem::align_of::<SubGhzBlockGeneric>() - 8usize];
24952 ["Offset of field: SubGhzBlockGeneric::protocol_name"]
24953 [::core::mem::offset_of!(SubGhzBlockGeneric, protocol_name) - 0usize];
24954 ["Offset of field: SubGhzBlockGeneric::data"]
24955 [::core::mem::offset_of!(SubGhzBlockGeneric, data) - 8usize];
24956 ["Offset of field: SubGhzBlockGeneric::serial"]
24957 [::core::mem::offset_of!(SubGhzBlockGeneric, serial) - 16usize];
24958 ["Offset of field: SubGhzBlockGeneric::data_count_bit"]
24959 [::core::mem::offset_of!(SubGhzBlockGeneric, data_count_bit) - 20usize];
24960 ["Offset of field: SubGhzBlockGeneric::btn"]
24961 [::core::mem::offset_of!(SubGhzBlockGeneric, btn) - 22usize];
24962 ["Offset of field: SubGhzBlockGeneric::cnt"]
24963 [::core::mem::offset_of!(SubGhzBlockGeneric, cnt) - 24usize];
24964};
24965unsafe extern "C" {
24966 #[doc = "Get name preset.\n # Arguments\n\n* `preset_name` - name preset\n * `preset_str` - Output name preset"]
24967 pub fn subghz_block_generic_get_preset_name(
24968 preset_name: *const core::ffi::c_char,
24969 preset_str: *mut FuriString,
24970 );
24971}
24972unsafe extern "C" {
24973 #[doc = "Serialize data SubGhzBlockGeneric.\n # Arguments\n\n* `instance` - Pointer to a SubGhzBlockGeneric instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n * `preset` - The modulation on which the signal was received, SubGhzRadioPreset\n # Returns\n\nStatus Error"]
24974 pub fn subghz_block_generic_serialize(
24975 instance: *mut SubGhzBlockGeneric,
24976 flipper_format: *mut FlipperFormat,
24977 preset: *mut SubGhzRadioPreset,
24978 ) -> SubGhzProtocolStatus;
24979}
24980unsafe extern "C" {
24981 #[doc = "Deserialize data SubGhzBlockGeneric.\n # Arguments\n\n* `instance` - Pointer to a SubGhzBlockGeneric instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n # Returns\n\nStatus Error"]
24982 pub fn subghz_block_generic_deserialize(
24983 instance: *mut SubGhzBlockGeneric,
24984 flipper_format: *mut FlipperFormat,
24985 ) -> SubGhzProtocolStatus;
24986}
24987unsafe extern "C" {
24988 #[doc = "Deserialize data SubGhzBlockGeneric.\n # Arguments\n\n* `instance` - Pointer to a SubGhzBlockGeneric instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n * `count_bit` - Count bit protocol\n # Returns\n\nStatus Error"]
24989 pub fn subghz_block_generic_deserialize_check_count_bit(
24990 instance: *mut SubGhzBlockGeneric,
24991 flipper_format: *mut FlipperFormat,
24992 count_bit: u16,
24993 ) -> SubGhzProtocolStatus;
24994}
24995unsafe extern "C" {
24996 #[doc = "Flip the data bitwise\n\n # Arguments\n\n* `key` - In data\n * `bit_count` - number of data bits\n\n # Returns\n\nReverse data"]
24997 pub fn subghz_protocol_blocks_reverse_key(key: u64, bit_count: u8) -> u64;
24998}
24999unsafe extern "C" {
25000 #[doc = "Get parity the data bitwise\n\n # Arguments\n\n* `key` - In data\n * `bit_count` - number of data bits\n\n # Returns\n\nparity"]
25001 pub fn subghz_protocol_blocks_get_parity(key: u64, bit_count: u8) -> u8;
25002}
25003unsafe extern "C" {
25004 #[doc = "CRC-4\n\n # Arguments\n\n* `message` - array of bytes to check\n * `size` - number of bytes in message\n * `polynomial` - CRC polynomial\n * `init` - starting crc value\n\n # Returns\n\nCRC value"]
25005 pub fn subghz_protocol_blocks_crc4(
25006 message: *const u8,
25007 size: usize,
25008 polynomial: u8,
25009 init: u8,
25010 ) -> u8;
25011}
25012unsafe extern "C" {
25013 #[doc = "CRC-7\n\n # Arguments\n\n* `message` - array of bytes to check\n * `size` - number of bytes in message\n * `polynomial` - CRC polynomial\n * `init` - starting crc value\n\n # Returns\n\nCRC value"]
25014 pub fn subghz_protocol_blocks_crc7(
25015 message: *const u8,
25016 size: usize,
25017 polynomial: u8,
25018 init: u8,
25019 ) -> u8;
25020}
25021unsafe extern "C" {
25022 #[doc = "Generic Cyclic Redundancy Check CRC-8. Example polynomial: 0x31 = x8 + x5 +\n x4 + 1 (x8 is implicit) Example polynomial: 0x80 = x8 + x7 (a normal\n bit-by-bit parity XOR)\n\n # Arguments\n\n* `message` - array of bytes to check\n * `size` - number of bytes in message\n * `polynomial` - byte is from x^7 to x^0 (x^8 is implicitly one)\n * `init` - starting crc value\n\n # Returns\n\nCRC value"]
25023 pub fn subghz_protocol_blocks_crc8(
25024 message: *const u8,
25025 size: usize,
25026 polynomial: u8,
25027 init: u8,
25028 ) -> u8;
25029}
25030unsafe extern "C" {
25031 #[doc = "\"Little-endian\" Cyclic Redundancy Check CRC-8 LE Input and output are\n reflected, i.e. least significant bit is shifted in first\n\n # Arguments\n\n* `message` - array of bytes to check\n * `size` - number of bytes in message\n * `polynomial` - CRC polynomial\n * `init` - starting crc value\n\n # Returns\n\nCRC value"]
25032 pub fn subghz_protocol_blocks_crc8le(
25033 message: *const u8,
25034 size: usize,
25035 polynomial: u8,
25036 init: u8,
25037 ) -> u8;
25038}
25039unsafe extern "C" {
25040 #[doc = "CRC-16 LSB. Input and output are reflected, i.e. least significant bit is\n shifted in first. Note that poly and init already need to be reflected\n\n # Arguments\n\n* `message` - array of bytes to check\n * `size` - number of bytes in message\n * `polynomial` - CRC polynomial\n * `init` - starting crc value\n\n # Returns\n\nCRC value"]
25041 pub fn subghz_protocol_blocks_crc16lsb(
25042 message: *const u8,
25043 size: usize,
25044 polynomial: u16,
25045 init: u16,
25046 ) -> u16;
25047}
25048unsafe extern "C" {
25049 #[doc = "CRC-16\n\n # Arguments\n\n* `message` - array of bytes to check\n * `size` - number of bytes in message\n * `polynomial` - CRC polynomial\n * `init` - starting crc value\n\n # Returns\n\nCRC value"]
25050 pub fn subghz_protocol_blocks_crc16(
25051 message: *const u8,
25052 size: usize,
25053 polynomial: u16,
25054 init: u16,
25055 ) -> u16;
25056}
25057unsafe extern "C" {
25058 #[doc = "Digest-8 by \"LFSR-based Toeplitz hash\"\n\n # Arguments\n\n* `message` - bytes of message data\n * `size` - number of bytes to digest\n * `gen` - key stream generator, needs to includes the MSB if the\n LFSR is rolling\n * `key` - initial key\n\n # Returns\n\ndigest value"]
25059 pub fn subghz_protocol_blocks_lfsr_digest8(
25060 message: *const u8,
25061 size: usize,
25062 gen_: u8,
25063 key: u8,
25064 ) -> u8;
25065}
25066unsafe extern "C" {
25067 #[doc = "Digest-8 by \"LFSR-based Toeplitz hash\", byte reflect, bit reflect\n\n # Arguments\n\n* `message` - bytes of message data\n * `size` - number of bytes to digest\n * `gen` - key stream generator, needs to includes the MSB if the\n LFSR is rolling\n * `key` - initial key\n\n # Returns\n\ndigest value"]
25068 pub fn subghz_protocol_blocks_lfsr_digest8_reflect(
25069 message: *const u8,
25070 size: usize,
25071 gen_: u8,
25072 key: u8,
25073 ) -> u8;
25074}
25075unsafe extern "C" {
25076 #[doc = "Digest-16 by \"LFSR-based Toeplitz hash\"\n\n # Arguments\n\n* `message` - bytes of message data\n * `size` - number of bytes to digest\n * `gen` - key stream generator, needs to includes the MSB if the\n LFSR is rolling\n * `key` - initial key\n\n # Returns\n\ndigest value"]
25077 pub fn subghz_protocol_blocks_lfsr_digest16(
25078 message: *const u8,
25079 size: usize,
25080 gen_: u16,
25081 key: u16,
25082 ) -> u16;
25083}
25084unsafe extern "C" {
25085 #[doc = "Compute Addition of a number of bytes\n\n # Arguments\n\n* `message` - bytes of message data\n * `size` - number of bytes to sum\n\n # Returns\n\nsummation value"]
25086 pub fn subghz_protocol_blocks_add_bytes(message: *const u8, size: usize) -> u8;
25087}
25088unsafe extern "C" {
25089 #[doc = "Compute bit parity of a single byte (8 bits)\n\n # Arguments\n\n* `byte` - single byte to check\n\n # Returns\n\n1 odd parity, 0 even parity"]
25090 pub fn subghz_protocol_blocks_parity8(byte: u8) -> u8;
25091}
25092unsafe extern "C" {
25093 #[doc = "Compute bit parity of a number of bytes\n\n # Arguments\n\n* `message` - bytes of message data\n * `size` - number of bytes to sum\n\n # Returns\n\n1 odd parity, 0 even parity"]
25094 pub fn subghz_protocol_blocks_parity_bytes(message: *const u8, size: usize) -> u8;
25095}
25096unsafe extern "C" {
25097 #[doc = "Compute XOR (byte-wide parity) of a number of bytes\n\n # Arguments\n\n* `message` - bytes of message data\n * `size` - number of bytes to sum\n\n # Returns\n\nsummation value, per bit-position 1 odd parity, 0 even parity"]
25098 pub fn subghz_protocol_blocks_xor_bytes(message: *const u8, size: usize) -> u8;
25099}
25100unsafe extern "C" {
25101 pub static subghz_device_cc1101_preset_ook_270khz_async_regs: [u8; 0usize];
25102}
25103unsafe extern "C" {
25104 pub static subghz_device_cc1101_preset_ook_650khz_async_regs: [u8; 0usize];
25105}
25106unsafe extern "C" {
25107 pub static subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs: [u8; 0usize];
25108}
25109unsafe extern "C" {
25110 pub static subghz_device_cc1101_preset_2fsk_dev47_6khz_async_regs: [u8; 0usize];
25111}
25112unsafe extern "C" {
25113 pub static subghz_device_cc1101_preset_msk_99_97kb_async_regs: [u8; 0usize];
25114}
25115unsafe extern "C" {
25116 pub static subghz_device_cc1101_preset_gfsk_9_99kb_async_regs: [u8; 0usize];
25117}
25118#[repr(C)]
25119#[derive(Debug, Copy, Clone)]
25120pub struct SubGhzDeviceCC1101Int {
25121 _unused: [u8; 0],
25122}
25123unsafe extern "C" {
25124 #[doc = "Key generation from simple data.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderSecPlus_v2 instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n * `serial` - Serial number, 32 bit\n * `btn` - Button number, 8 bit\n * `cnt` - Container value, 28 bit\n * `manufacture_name` - Name of manufacturer's key\n * `preset` - Modulation, SubGhzRadioPreset\n # Returns\n\ntrue On success"]
25125 pub fn subghz_protocol_secplus_v2_create_data(
25126 context: *mut core::ffi::c_void,
25127 flipper_format: *mut FlipperFormat,
25128 serial: u32,
25129 btn: u8,
25130 cnt: u32,
25131 preset: *mut SubGhzRadioPreset,
25132 ) -> bool;
25133}
25134unsafe extern "C" {
25135 #[doc = "Key generation from simple data.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderKeeloq instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n * `serial` - Serial number, 28 bit\n * `btn` - Button number, 4 bit\n * `cnt` - Counter value, 16 bit\n * `manufacture_name` - Name of manufacturer's key\n * `preset` - Modulation, SubGhzRadioPreset\n # Returns\n\ntrue On success"]
25136 pub fn subghz_protocol_keeloq_create_data(
25137 context: *mut core::ffi::c_void,
25138 flipper_format: *mut FlipperFormat,
25139 serial: u32,
25140 btn: u8,
25141 cnt: u16,
25142 manufacture_name: *const core::ffi::c_char,
25143 preset: *mut SubGhzRadioPreset,
25144 ) -> bool;
25145}
25146#[repr(C)]
25147#[derive(Debug, Copy, Clone)]
25148pub struct SubGhzProtocolDecoderBinRAW {
25149 _unused: [u8; 0],
25150}
25151unsafe extern "C" {
25152 pub fn subghz_protocol_decoder_bin_raw_data_input_rssi(
25153 instance: *mut SubGhzProtocolDecoderBinRAW,
25154 rssi: f32,
25155 );
25156}
25157unsafe extern "C" {
25158 #[doc = "Validation of fixed parts SubGhzProtocolDecoderSecPlus_v1.\n # Arguments\n\n* `fixed` - fixed parts\n # Returns\n\ntrue On success"]
25159 pub fn subghz_protocol_secplus_v1_check_fixed(fixed: u32) -> bool;
25160}
25161pub type SubGhzProtocolDecoderBaseRxCallback = ::core::option::Option<
25162 unsafe extern "C" fn(instance: *mut SubGhzProtocolDecoderBase, context: *mut core::ffi::c_void),
25163>;
25164pub type SubGhzProtocolDecoderBaseSerialize = ::core::option::Option<
25165 unsafe extern "C" fn(decoder_base: *mut SubGhzProtocolDecoderBase, output: *mut FuriString),
25166>;
25167#[repr(C)]
25168#[derive(Debug, Copy, Clone)]
25169pub struct SubGhzProtocolDecoderBase {
25170 pub protocol: *const SubGhzProtocol,
25171 pub callback: SubGhzProtocolDecoderBaseRxCallback,
25172 pub context: *mut core::ffi::c_void,
25173}
25174#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25175const _: () = {
25176 ["Size of SubGhzProtocolDecoderBase"]
25177 [::core::mem::size_of::<SubGhzProtocolDecoderBase>() - 12usize];
25178 ["Alignment of SubGhzProtocolDecoderBase"]
25179 [::core::mem::align_of::<SubGhzProtocolDecoderBase>() - 4usize];
25180 ["Offset of field: SubGhzProtocolDecoderBase::protocol"]
25181 [::core::mem::offset_of!(SubGhzProtocolDecoderBase, protocol) - 0usize];
25182 ["Offset of field: SubGhzProtocolDecoderBase::callback"]
25183 [::core::mem::offset_of!(SubGhzProtocolDecoderBase, callback) - 4usize];
25184 ["Offset of field: SubGhzProtocolDecoderBase::context"]
25185 [::core::mem::offset_of!(SubGhzProtocolDecoderBase, context) - 8usize];
25186};
25187unsafe extern "C" {
25188 #[doc = "Getting a textual representation of the received data.\n # Arguments\n\n* `decoder_base` - Pointer to a SubGhzProtocolDecoderBase instance\n * `output` - Resulting text"]
25189 pub fn subghz_protocol_decoder_base_get_string(
25190 decoder_base: *mut SubGhzProtocolDecoderBase,
25191 output: *mut FuriString,
25192 ) -> bool;
25193}
25194unsafe extern "C" {
25195 #[doc = "Serialize data SubGhzProtocolDecoderBase.\n # Arguments\n\n* `decoder_base` - Pointer to a SubGhzProtocolDecoderBase instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n * `preset` - The modulation on which the signal was received, SubGhzRadioPreset\n # Returns\n\nStatus Error"]
25196 pub fn subghz_protocol_decoder_base_serialize(
25197 decoder_base: *mut SubGhzProtocolDecoderBase,
25198 flipper_format: *mut FlipperFormat,
25199 preset: *mut SubGhzRadioPreset,
25200 ) -> SubGhzProtocolStatus;
25201}
25202unsafe extern "C" {
25203 #[doc = "Deserialize data SubGhzProtocolDecoderBase.\n # Arguments\n\n* `decoder_base` - Pointer to a SubGhzProtocolDecoderBase instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n # Returns\n\nStatus Error"]
25204 pub fn subghz_protocol_decoder_base_deserialize(
25205 decoder_base: *mut SubGhzProtocolDecoderBase,
25206 flipper_format: *mut FlipperFormat,
25207 ) -> SubGhzProtocolStatus;
25208}
25209unsafe extern "C" {
25210 #[doc = "Getting the hash sum of the last randomly received parcel.\n # Arguments\n\n* `decoder_base` - Pointer to a SubGhzProtocolDecoderBase instance\n # Returns\n\nhash Hash sum"]
25211 pub fn subghz_protocol_decoder_base_get_hash_data(
25212 decoder_base: *mut SubGhzProtocolDecoderBase,
25213 ) -> u8;
25214}
25215#[repr(C)]
25216#[derive(Debug, Copy, Clone)]
25217pub struct SubGhzProtocolEncoderBase {
25218 pub protocol: *const SubGhzProtocol,
25219}
25220#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25221const _: () = {
25222 ["Size of SubGhzProtocolEncoderBase"]
25223 [::core::mem::size_of::<SubGhzProtocolEncoderBase>() - 4usize];
25224 ["Alignment of SubGhzProtocolEncoderBase"]
25225 [::core::mem::align_of::<SubGhzProtocolEncoderBase>() - 4usize];
25226 ["Offset of field: SubGhzProtocolEncoderBase::protocol"]
25227 [::core::mem::offset_of!(SubGhzProtocolEncoderBase, protocol) - 0usize];
25228};
25229pub type SubGhzProtocolEncoderRAWCallbackEnd =
25230 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25231#[repr(C)]
25232#[derive(Debug, Copy, Clone)]
25233pub struct SubGhzProtocolDecoderRAW {
25234 _unused: [u8; 0],
25235}
25236#[repr(C)]
25237#[derive(Debug, Copy, Clone)]
25238pub struct SubGhzProtocolEncoderRAW {
25239 _unused: [u8; 0],
25240}
25241unsafe extern "C" {
25242 pub static subghz_protocol_raw_decoder: SubGhzProtocolDecoder;
25243}
25244unsafe extern "C" {
25245 pub static subghz_protocol_raw_encoder: SubGhzProtocolEncoder;
25246}
25247unsafe extern "C" {
25248 pub static subghz_protocol_raw: SubGhzProtocol;
25249}
25250unsafe extern "C" {
25251 #[doc = "Open file for writing\n # Arguments\n\n* `instance` - Pointer to a SubGhzProtocolDecoderRAW instance\n * `dev_name` - File name\n * `preset` - The modulation on which the signal was received, SubGhzRadioPreset\n # Returns\n\ntrue On success"]
25252 pub fn subghz_protocol_raw_save_to_file_init(
25253 instance: *mut SubGhzProtocolDecoderRAW,
25254 dev_name: *const core::ffi::c_char,
25255 preset: *mut SubGhzRadioPreset,
25256 ) -> bool;
25257}
25258unsafe extern "C" {
25259 #[doc = "Stop writing file to flash\n # Arguments\n\n* `instance` - Pointer to a SubGhzProtocolDecoderRAW instance"]
25260 pub fn subghz_protocol_raw_save_to_file_stop(instance: *mut SubGhzProtocolDecoderRAW);
25261}
25262unsafe extern "C" {
25263 #[doc = "Get the number of samples received SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `instance` - Pointer to a SubGhzProtocolDecoderRAW instance\n # Returns\n\ncount of samples"]
25264 pub fn subghz_protocol_raw_get_sample_write(instance: *mut SubGhzProtocolDecoderRAW) -> usize;
25265}
25266unsafe extern "C" {
25267 #[doc = "Allocate SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzProtocolDecoderRAW* pointer to a SubGhzProtocolDecoderRAW instance"]
25268 pub fn subghz_protocol_decoder_raw_alloc(
25269 environment: *mut SubGhzEnvironment,
25270 ) -> *mut core::ffi::c_void;
25271}
25272unsafe extern "C" {
25273 #[doc = "Free SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance"]
25274 pub fn subghz_protocol_decoder_raw_free(context: *mut core::ffi::c_void);
25275}
25276unsafe extern "C" {
25277 #[doc = "Reset decoder SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance"]
25278 pub fn subghz_protocol_decoder_raw_reset(context: *mut core::ffi::c_void);
25279}
25280unsafe extern "C" {
25281 #[doc = "Parse a raw sequence of levels and durations received from the air.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance\n * `level` - Signal level true-high false-low\n * `duration` - Duration of this level in, us"]
25282 pub fn subghz_protocol_decoder_raw_feed(
25283 context: *mut core::ffi::c_void,
25284 level: bool,
25285 duration: u32,
25286 );
25287}
25288unsafe extern "C" {
25289 #[doc = "Deserialize data SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n # Returns\n\nstatus"]
25290 pub fn subghz_protocol_decoder_raw_deserialize(
25291 context: *mut core::ffi::c_void,
25292 flipper_format: *mut FlipperFormat,
25293 ) -> SubGhzProtocolStatus;
25294}
25295unsafe extern "C" {
25296 #[doc = "Getting a textual representation of the received data.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance\n * `output` - Resulting text"]
25297 pub fn subghz_protocol_decoder_raw_get_string(
25298 context: *mut core::ffi::c_void,
25299 output: *mut FuriString,
25300 );
25301}
25302unsafe extern "C" {
25303 #[doc = "Allocate SubGhzProtocolEncoderRAW.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzProtocolEncoderRAW* pointer to a SubGhzProtocolEncoderRAW instance"]
25304 pub fn subghz_protocol_encoder_raw_alloc(
25305 environment: *mut SubGhzEnvironment,
25306 ) -> *mut core::ffi::c_void;
25307}
25308unsafe extern "C" {
25309 #[doc = "Free SubGhzProtocolEncoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance"]
25310 pub fn subghz_protocol_encoder_raw_free(context: *mut core::ffi::c_void);
25311}
25312unsafe extern "C" {
25313 #[doc = "Forced transmission stop.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance"]
25314 pub fn subghz_protocol_encoder_raw_stop(context: *mut core::ffi::c_void);
25315}
25316unsafe extern "C" {
25317 #[doc = "pause writing to flash.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance\n * `pause` - pause writing"]
25318 pub fn subghz_protocol_raw_save_to_file_pause(
25319 instance: *mut SubGhzProtocolDecoderRAW,
25320 pause: bool,
25321 );
25322}
25323unsafe extern "C" {
25324 #[doc = "Set callback on completion of file transfer.\n # Arguments\n\n* `instance` - Pointer to a SubGhzProtocolEncoderRAW instance\n * `callback_end` - Callback, SubGhzProtocolEncoderRAWCallbackEnd\n * `context_end` - Context"]
25325 pub fn subghz_protocol_raw_file_encoder_worker_set_callback_end(
25326 instance: *mut SubGhzProtocolEncoderRAW,
25327 callback_end: SubGhzProtocolEncoderRAWCallbackEnd,
25328 context_end: *mut core::ffi::c_void,
25329 );
25330}
25331unsafe extern "C" {
25332 #[doc = "File generation for RAW work.\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n * `file_path` - File path\n * `radio_dev_name` - Radio device name"]
25333 pub fn subghz_protocol_raw_gen_fff_data(
25334 flipper_format: *mut FlipperFormat,
25335 file_path: *const core::ffi::c_char,
25336 radio_dev_name: *const core::ffi::c_char,
25337 );
25338}
25339unsafe extern "C" {
25340 #[doc = "Deserialize and generating an upload to send.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n # Returns\n\nstatus"]
25341 pub fn subghz_protocol_encoder_raw_deserialize(
25342 context: *mut core::ffi::c_void,
25343 flipper_format: *mut FlipperFormat,
25344 ) -> SubGhzProtocolStatus;
25345}
25346unsafe extern "C" {
25347 #[doc = "Getting the level and duration of the upload to be loaded into DMA.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance\n # Returns\n\nLevelDuration"]
25348 pub fn subghz_protocol_encoder_raw_yield(context: *mut core::ffi::c_void) -> LevelDuration;
25349}
25350#[repr(C)]
25351#[derive(Debug, Copy, Clone)]
25352pub struct SubGhzReceiver {
25353 _unused: [u8; 0],
25354}
25355pub type SubGhzReceiverCallback = ::core::option::Option<
25356 unsafe extern "C" fn(
25357 decoder: *mut SubGhzReceiver,
25358 decoder_base: *mut SubGhzProtocolDecoderBase,
25359 context: *mut core::ffi::c_void,
25360 ),
25361>;
25362unsafe extern "C" {
25363 #[doc = "Allocate and init SubGhzReceiver.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzReceiver* pointer to a SubGhzReceiver instance"]
25364 pub fn subghz_receiver_alloc_init(environment: *mut SubGhzEnvironment) -> *mut SubGhzReceiver;
25365}
25366unsafe extern "C" {
25367 #[doc = "Free SubGhzReceiver.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance"]
25368 pub fn subghz_receiver_free(instance: *mut SubGhzReceiver);
25369}
25370unsafe extern "C" {
25371 #[doc = "Parse a raw sequence of levels and durations received from the air.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance\n * `level` - Signal level true-high false-low\n * `duration` - Duration of this level in, us"]
25372 pub fn subghz_receiver_decode(instance: *mut SubGhzReceiver, level: bool, duration: u32);
25373}
25374unsafe extern "C" {
25375 #[doc = "Reset decoder SubGhzReceiver.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance"]
25376 pub fn subghz_receiver_reset(instance: *mut SubGhzReceiver);
25377}
25378unsafe extern "C" {
25379 #[doc = "Set a callback upon completion of successful decoding of one of the protocols.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance\n * `callback` - Callback, SubGhzReceiverCallback\n * `context` - Context"]
25380 pub fn subghz_receiver_set_rx_callback(
25381 instance: *mut SubGhzReceiver,
25382 callback: SubGhzReceiverCallback,
25383 context: *mut core::ffi::c_void,
25384 );
25385}
25386unsafe extern "C" {
25387 #[doc = "Set the filter of receivers that will work at the moment.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance\n * `filter` - Filter, SubGhzProtocolFlag"]
25388 pub fn subghz_receiver_set_filter(instance: *mut SubGhzReceiver, filter: SubGhzProtocolFlag);
25389}
25390unsafe extern "C" {
25391 #[doc = "Search for a cattery by his name.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance\n * `decoder_name` - Receiver name\n # Returns\n\nSubGhzProtocolDecoderBase* pointer to a SubGhzProtocolDecoderBase instance"]
25392 pub fn subghz_receiver_search_decoder_base_by_name(
25393 instance: *mut SubGhzReceiver,
25394 decoder_name: *const core::ffi::c_char,
25395 ) -> *mut SubGhzProtocolDecoderBase;
25396}
25397pub type SubGhzFileEncoderWorkerCallbackEnd =
25398 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25399#[repr(C)]
25400#[derive(Debug, Copy, Clone)]
25401pub struct SubGhzFileEncoderWorker {
25402 _unused: [u8; 0],
25403}
25404unsafe extern "C" {
25405 #[doc = "End callback SubGhzWorker.\n # Arguments\n\n* `instance` - SubGhzFileEncoderWorker instance\n * `callback` - SubGhzFileEncoderWorkerCallbackEnd callback"]
25406 pub fn subghz_file_encoder_worker_callback_end(
25407 instance: *mut SubGhzFileEncoderWorker,
25408 callback_end: SubGhzFileEncoderWorkerCallbackEnd,
25409 context_end: *mut core::ffi::c_void,
25410 );
25411}
25412unsafe extern "C" {
25413 #[doc = "Allocate SubGhzFileEncoderWorker.\n # Returns\n\nSubGhzFileEncoderWorker* pointer to a SubGhzFileEncoderWorker instance"]
25414 pub fn subghz_file_encoder_worker_alloc() -> *mut SubGhzFileEncoderWorker;
25415}
25416unsafe extern "C" {
25417 #[doc = "Free SubGhzFileEncoderWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance"]
25418 pub fn subghz_file_encoder_worker_free(instance: *mut SubGhzFileEncoderWorker);
25419}
25420unsafe extern "C" {
25421 #[doc = "Getting the level and duration of the upload to be loaded into DMA.\n # Arguments\n\n* `context` - Pointer to a SubGhzFileEncoderWorker instance\n # Returns\n\nLevelDuration"]
25422 pub fn subghz_file_encoder_worker_get_level_duration(
25423 context: *mut core::ffi::c_void,
25424 ) -> LevelDuration;
25425}
25426unsafe extern "C" {
25427 #[doc = "Start SubGhzFileEncoderWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance\n * `file_path` - File path\n * `radio_device_name` - Radio device name\n # Returns\n\nbool - true if ok"]
25428 pub fn subghz_file_encoder_worker_start(
25429 instance: *mut SubGhzFileEncoderWorker,
25430 file_path: *const core::ffi::c_char,
25431 radio_device_name: *const core::ffi::c_char,
25432 ) -> bool;
25433}
25434unsafe extern "C" {
25435 #[doc = "Stop SubGhzFileEncoderWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance"]
25436 pub fn subghz_file_encoder_worker_stop(instance: *mut SubGhzFileEncoderWorker);
25437}
25438unsafe extern "C" {
25439 #[doc = "Check if worker is running\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance\n # Returns\n\nbool - true if running"]
25440 pub fn subghz_file_encoder_worker_is_running(instance: *mut SubGhzFileEncoderWorker) -> bool;
25441}
25442unsafe extern "C" {
25443 pub static subghz_protocol_registry: SubGhzProtocolRegistry;
25444}
25445#[repr(C)]
25446#[derive(Debug, Copy, Clone)]
25447pub struct SubGhzSetting {
25448 _unused: [u8; 0],
25449}
25450unsafe extern "C" {
25451 pub fn subghz_setting_alloc() -> *mut SubGhzSetting;
25452}
25453unsafe extern "C" {
25454 pub fn subghz_setting_free(instance: *mut SubGhzSetting);
25455}
25456unsafe extern "C" {
25457 pub fn subghz_setting_load(instance: *mut SubGhzSetting, file_path: *const core::ffi::c_char);
25458}
25459unsafe extern "C" {
25460 pub fn subghz_setting_get_frequency_count(instance: *mut SubGhzSetting) -> usize;
25461}
25462unsafe extern "C" {
25463 pub fn subghz_setting_get_hopper_frequency_count(instance: *mut SubGhzSetting) -> usize;
25464}
25465unsafe extern "C" {
25466 pub fn subghz_setting_get_preset_count(instance: *mut SubGhzSetting) -> usize;
25467}
25468unsafe extern "C" {
25469 pub fn subghz_setting_get_preset_name(
25470 instance: *mut SubGhzSetting,
25471 idx: usize,
25472 ) -> *const core::ffi::c_char;
25473}
25474unsafe extern "C" {
25475 pub fn subghz_setting_get_inx_preset_by_name(
25476 instance: *mut SubGhzSetting,
25477 preset_name: *const core::ffi::c_char,
25478 ) -> core::ffi::c_int;
25479}
25480unsafe extern "C" {
25481 pub fn subghz_setting_get_preset_data(instance: *mut SubGhzSetting, idx: usize) -> *mut u8;
25482}
25483unsafe extern "C" {
25484 pub fn subghz_setting_get_preset_data_size(instance: *mut SubGhzSetting, idx: usize) -> usize;
25485}
25486unsafe extern "C" {
25487 pub fn subghz_setting_get_preset_data_by_name(
25488 instance: *mut SubGhzSetting,
25489 preset_name: *const core::ffi::c_char,
25490 ) -> *mut u8;
25491}
25492unsafe extern "C" {
25493 pub fn subghz_setting_load_custom_preset(
25494 instance: *mut SubGhzSetting,
25495 preset_name: *const core::ffi::c_char,
25496 fff_data_file: *mut FlipperFormat,
25497 ) -> bool;
25498}
25499unsafe extern "C" {
25500 pub fn subghz_setting_delete_custom_preset(
25501 instance: *mut SubGhzSetting,
25502 preset_name: *const core::ffi::c_char,
25503 ) -> bool;
25504}
25505unsafe extern "C" {
25506 pub fn subghz_setting_get_frequency(instance: *mut SubGhzSetting, idx: usize) -> u32;
25507}
25508unsafe extern "C" {
25509 pub fn subghz_setting_get_hopper_frequency(instance: *mut SubGhzSetting, idx: usize) -> u32;
25510}
25511unsafe extern "C" {
25512 pub fn subghz_setting_get_frequency_default_index(instance: *mut SubGhzSetting) -> u32;
25513}
25514unsafe extern "C" {
25515 pub fn subghz_setting_get_default_frequency(instance: *mut SubGhzSetting) -> u32;
25516}
25517unsafe extern "C" {
25518 pub fn subghz_devices_init();
25519}
25520unsafe extern "C" {
25521 pub fn subghz_devices_deinit();
25522}
25523unsafe extern "C" {
25524 pub fn subghz_devices_get_by_name(device_name: *const core::ffi::c_char)
25525 -> *const SubGhzDevice;
25526}
25527unsafe extern "C" {
25528 pub fn subghz_devices_get_name(device: *const SubGhzDevice) -> *const core::ffi::c_char;
25529}
25530unsafe extern "C" {
25531 pub fn subghz_devices_begin(device: *const SubGhzDevice) -> bool;
25532}
25533unsafe extern "C" {
25534 pub fn subghz_devices_end(device: *const SubGhzDevice);
25535}
25536unsafe extern "C" {
25537 pub fn subghz_devices_is_connect(device: *const SubGhzDevice) -> bool;
25538}
25539unsafe extern "C" {
25540 pub fn subghz_devices_reset(device: *const SubGhzDevice);
25541}
25542unsafe extern "C" {
25543 pub fn subghz_devices_sleep(device: *const SubGhzDevice);
25544}
25545unsafe extern "C" {
25546 pub fn subghz_devices_idle(device: *const SubGhzDevice);
25547}
25548unsafe extern "C" {
25549 pub fn subghz_devices_load_preset(
25550 device: *const SubGhzDevice,
25551 preset: FuriHalSubGhzPreset,
25552 preset_data: *mut u8,
25553 );
25554}
25555unsafe extern "C" {
25556 pub fn subghz_devices_set_frequency(device: *const SubGhzDevice, frequency: u32) -> u32;
25557}
25558unsafe extern "C" {
25559 pub fn subghz_devices_is_frequency_valid(device: *const SubGhzDevice, frequency: u32) -> bool;
25560}
25561unsafe extern "C" {
25562 pub fn subghz_devices_set_async_mirror_pin(device: *const SubGhzDevice, gpio: *const GpioPin);
25563}
25564unsafe extern "C" {
25565 pub fn subghz_devices_get_data_gpio(device: *const SubGhzDevice) -> *const GpioPin;
25566}
25567unsafe extern "C" {
25568 pub fn subghz_devices_set_tx(device: *const SubGhzDevice) -> bool;
25569}
25570unsafe extern "C" {
25571 pub fn subghz_devices_flush_tx(device: *const SubGhzDevice);
25572}
25573unsafe extern "C" {
25574 pub fn subghz_devices_start_async_tx(
25575 device: *const SubGhzDevice,
25576 callback: *mut core::ffi::c_void,
25577 context: *mut core::ffi::c_void,
25578 ) -> bool;
25579}
25580unsafe extern "C" {
25581 pub fn subghz_devices_is_async_complete_tx(device: *const SubGhzDevice) -> bool;
25582}
25583unsafe extern "C" {
25584 pub fn subghz_devices_stop_async_tx(device: *const SubGhzDevice);
25585}
25586unsafe extern "C" {
25587 pub fn subghz_devices_set_rx(device: *const SubGhzDevice);
25588}
25589unsafe extern "C" {
25590 pub fn subghz_devices_flush_rx(device: *const SubGhzDevice);
25591}
25592unsafe extern "C" {
25593 pub fn subghz_devices_start_async_rx(
25594 device: *const SubGhzDevice,
25595 callback: *mut core::ffi::c_void,
25596 context: *mut core::ffi::c_void,
25597 );
25598}
25599unsafe extern "C" {
25600 pub fn subghz_devices_stop_async_rx(device: *const SubGhzDevice);
25601}
25602unsafe extern "C" {
25603 pub fn subghz_devices_get_rssi(device: *const SubGhzDevice) -> f32;
25604}
25605unsafe extern "C" {
25606 pub fn subghz_devices_get_lqi(device: *const SubGhzDevice) -> u8;
25607}
25608unsafe extern "C" {
25609 pub fn subghz_devices_rx_pipe_not_empty(device: *const SubGhzDevice) -> bool;
25610}
25611unsafe extern "C" {
25612 pub fn subghz_devices_is_rx_data_crc_valid(device: *const SubGhzDevice) -> bool;
25613}
25614unsafe extern "C" {
25615 pub fn subghz_devices_read_packet(device: *const SubGhzDevice, data: *mut u8, size: *mut u8);
25616}
25617unsafe extern "C" {
25618 pub fn subghz_devices_write_packet(device: *const SubGhzDevice, data: *const u8, size: u8);
25619}
25620pub type SubGhzTxRxWorkerCallbackHaveRead =
25621 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25622#[repr(C)]
25623#[derive(Debug, Copy, Clone)]
25624pub struct SubGhzTxRxWorker {
25625 _unused: [u8; 0],
25626}
25627pub const SubGhzTxRxWorkerStatusIDLE: SubGhzTxRxWorkerStatus = SubGhzTxRxWorkerStatus(0);
25628pub const SubGhzTxRxWorkerStatusTx: SubGhzTxRxWorkerStatus = SubGhzTxRxWorkerStatus(1);
25629pub const SubGhzTxRxWorkerStatusRx: SubGhzTxRxWorkerStatus = SubGhzTxRxWorkerStatus(2);
25630#[repr(transparent)]
25631#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25632pub struct SubGhzTxRxWorkerStatus(pub core::ffi::c_uchar);
25633unsafe extern "C" {
25634 #[doc = "SubGhzTxRxWorker, add data to transfer\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n * `data` - *data\n * `size` - data size\n # Returns\n\nbool true if ok"]
25635 pub fn subghz_tx_rx_worker_write(
25636 instance: *mut SubGhzTxRxWorker,
25637 data: *mut u8,
25638 size: usize,
25639 ) -> bool;
25640}
25641unsafe extern "C" {
25642 #[doc = "SubGhzTxRxWorker, get available data\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n # Returns\n\nsize_t data size"]
25643 pub fn subghz_tx_rx_worker_available(instance: *mut SubGhzTxRxWorker) -> usize;
25644}
25645unsafe extern "C" {
25646 #[doc = "SubGhzTxRxWorker, read data\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n * `data` - *data\n * `size` - max data size, which can be read\n # Returns\n\nsize_t data size, how much is actually read"]
25647 pub fn subghz_tx_rx_worker_read(
25648 instance: *mut SubGhzTxRxWorker,
25649 data: *mut u8,
25650 size: usize,
25651 ) -> usize;
25652}
25653unsafe extern "C" {
25654 #[doc = "Сallback SubGhzTxRxWorker when there is data to read in an empty buffer\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n * `callback` - SubGhzTxRxWorkerCallbackHaveRead callback\n * `context` -"]
25655 pub fn subghz_tx_rx_worker_set_callback_have_read(
25656 instance: *mut SubGhzTxRxWorker,
25657 callback: SubGhzTxRxWorkerCallbackHaveRead,
25658 context: *mut core::ffi::c_void,
25659 );
25660}
25661unsafe extern "C" {
25662 #[doc = "Allocate SubGhzTxRxWorker\n # Returns\n\nSubGhzTxRxWorker* Pointer to a SubGhzTxRxWorker instance"]
25663 pub fn subghz_tx_rx_worker_alloc() -> *mut SubGhzTxRxWorker;
25664}
25665unsafe extern "C" {
25666 #[doc = "Free SubGhzTxRxWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance"]
25667 pub fn subghz_tx_rx_worker_free(instance: *mut SubGhzTxRxWorker);
25668}
25669unsafe extern "C" {
25670 #[doc = "Start SubGhzTxRxWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n * `device` - Pointer to a SubGhzDevice instance\n # Returns\n\nbool - true if ok"]
25671 pub fn subghz_tx_rx_worker_start(
25672 instance: *mut SubGhzTxRxWorker,
25673 device: *const SubGhzDevice,
25674 frequency: u32,
25675 ) -> bool;
25676}
25677unsafe extern "C" {
25678 #[doc = "Stop SubGhzTxRxWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance"]
25679 pub fn subghz_tx_rx_worker_stop(instance: *mut SubGhzTxRxWorker);
25680}
25681unsafe extern "C" {
25682 #[doc = "Check if worker is running\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n # Returns\n\nbool - true if running"]
25683 pub fn subghz_tx_rx_worker_is_running(instance: *mut SubGhzTxRxWorker) -> bool;
25684}
25685#[repr(C)]
25686#[derive(Debug, Copy, Clone)]
25687pub struct SubGhzWorker {
25688 _unused: [u8; 0],
25689}
25690pub type SubGhzWorkerOverrunCallback =
25691 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25692pub type SubGhzWorkerPairCallback = ::core::option::Option<
25693 unsafe extern "C" fn(context: *mut core::ffi::c_void, level: bool, duration: u32),
25694>;
25695unsafe extern "C" {
25696 pub fn subghz_worker_rx_callback(level: bool, duration: u32, context: *mut core::ffi::c_void);
25697}
25698unsafe extern "C" {
25699 #[doc = "Allocate SubGhzWorker.\n # Returns\n\nSubGhzWorker* Pointer to a SubGhzWorker instance"]
25700 pub fn subghz_worker_alloc() -> *mut SubGhzWorker;
25701}
25702unsafe extern "C" {
25703 #[doc = "Free SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance"]
25704 pub fn subghz_worker_free(instance: *mut SubGhzWorker);
25705}
25706unsafe extern "C" {
25707 #[doc = "Overrun callback SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `callback` - SubGhzWorkerOverrunCallback callback"]
25708 pub fn subghz_worker_set_overrun_callback(
25709 instance: *mut SubGhzWorker,
25710 callback: SubGhzWorkerOverrunCallback,
25711 );
25712}
25713unsafe extern "C" {
25714 #[doc = "Pair callback SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `callback` - SubGhzWorkerOverrunCallback callback"]
25715 pub fn subghz_worker_set_pair_callback(
25716 instance: *mut SubGhzWorker,
25717 callback: SubGhzWorkerPairCallback,
25718 );
25719}
25720unsafe extern "C" {
25721 #[doc = "Context callback SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `context` -"]
25722 pub fn subghz_worker_set_context(instance: *mut SubGhzWorker, context: *mut core::ffi::c_void);
25723}
25724unsafe extern "C" {
25725 #[doc = "Start SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance"]
25726 pub fn subghz_worker_start(instance: *mut SubGhzWorker);
25727}
25728unsafe extern "C" {
25729 #[doc = "Stop SubGhzWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance"]
25730 pub fn subghz_worker_stop(instance: *mut SubGhzWorker);
25731}
25732unsafe extern "C" {
25733 #[doc = "Check if worker is running.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n # Returns\n\nbool - true if running"]
25734 pub fn subghz_worker_is_running(instance: *mut SubGhzWorker) -> bool;
25735}
25736unsafe extern "C" {
25737 #[doc = "Short duration filter setting.\n glues short durations into 1. The default setting is 30 us, if set to 0 the filter will be disabled\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `timeout` - time in us"]
25738 pub fn subghz_worker_set_filter(instance: *mut SubGhzWorker, timeout: u16);
25739}
25740#[repr(C)]
25741#[derive(Debug, Copy, Clone)]
25742pub struct SubGhzTransmitter {
25743 _unused: [u8; 0],
25744}
25745unsafe extern "C" {
25746 #[doc = "Allocate and init SubGhzTransmitter.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzTransmitter* pointer to a SubGhzTransmitter instance"]
25747 pub fn subghz_transmitter_alloc_init(
25748 environment: *mut SubGhzEnvironment,
25749 protocol_name: *const core::ffi::c_char,
25750 ) -> *mut SubGhzTransmitter;
25751}
25752unsafe extern "C" {
25753 #[doc = "Free SubGhzTransmitter.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance"]
25754 pub fn subghz_transmitter_free(instance: *mut SubGhzTransmitter);
25755}
25756unsafe extern "C" {
25757 #[doc = "Get protocol instance.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance"]
25758 pub fn subghz_transmitter_get_protocol_instance(
25759 instance: *mut SubGhzTransmitter,
25760 ) -> *mut SubGhzProtocolEncoderBase;
25761}
25762unsafe extern "C" {
25763 #[doc = "Forced transmission stop.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance"]
25764 pub fn subghz_transmitter_stop(instance: *mut SubGhzTransmitter) -> bool;
25765}
25766unsafe extern "C" {
25767 #[doc = "Deserialize and generating an upload to send.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance\n * `flipper_format` - Pointer to a FlipperFormat instance\n # Returns\n\nstatus"]
25768 pub fn subghz_transmitter_deserialize(
25769 instance: *mut SubGhzTransmitter,
25770 flipper_format: *mut FlipperFormat,
25771 ) -> SubGhzProtocolStatus;
25772}
25773unsafe extern "C" {
25774 #[doc = "Getting the level and duration of the upload to be loaded into DMA.\n # Arguments\n\n* `context` - Pointer to a SubGhzTransmitter instance\n # Returns\n\nLevelDuration"]
25775 pub fn subghz_transmitter_yield(context: *mut core::ffi::c_void) -> LevelDuration;
25776}
25777pub type FuriApiLock = *mut FuriEventFlag;
25778unsafe extern "C" {
25779 #[doc = "Extract int value and trim arguments string\n\n # Arguments\n\n* `args` - - arguments string\n * `value` - first argument, output\n # Returns\n\ntrue - success\n false - arguments string does not contain int"]
25780 pub fn args_read_int_and_trim(args: *mut FuriString, value: *mut core::ffi::c_int) -> bool;
25781}
25782unsafe extern "C" {
25783 #[doc = "Extract float value and trim arguments string\n\n # Arguments\n\n* `[in,` - out] args arguments string\n * `[out]` - value first argument\n # Returns\n\ntrue - success\n false - arguments string does not contain float"]
25784 pub fn args_read_float_and_trim(args: *mut FuriString, value: *mut f32) -> bool;
25785}
25786unsafe extern "C" {
25787 #[doc = "Extract first argument from arguments string and trim arguments string\n\n # Arguments\n\n* `args` - arguments string\n * `word` - first argument, output\n # Returns\n\ntrue - success\n false - arguments string does not contain anything"]
25788 pub fn args_read_string_and_trim(args: *mut FuriString, word: *mut FuriString) -> bool;
25789}
25790unsafe extern "C" {
25791 #[doc = "Extract the first quoted argument from the argument string and trim the argument string. If the argument is not quoted, calls args_read_string_and_trim.\n\n # Arguments\n\n* `args` - arguments string\n * `word` - first argument, output, without quotes\n # Returns\n\ntrue - success\n false - arguments string does not contain anything"]
25792 pub fn args_read_probably_quoted_string_and_trim(
25793 args: *mut FuriString,
25794 word: *mut FuriString,
25795 ) -> bool;
25796}
25797unsafe extern "C" {
25798 #[doc = "Convert hex ASCII values to byte array\n\n # Arguments\n\n* `args` - arguments string\n * `bytes` - byte array pointer, output\n * `bytes_count` - needed bytes count\n # Returns\n\ntrue - success\n false - arguments string does not contain enough values, or contain non-hex ASCII values"]
25799 pub fn args_read_hex_bytes(args: *mut FuriString, bytes: *mut u8, bytes_count: usize) -> bool;
25800}
25801unsafe extern "C" {
25802 #[doc = "Parses a duration value from a given string and converts it to milliseconds\n\n # Arguments\n\n* `[in]` - args the input string containing the duration value. The string may include units (e.g., \"10s\", \"0.5m\").\n * `[out]` - value pointer to store the parsed value in milliseconds\n * `[in]` - default_unit A default unit to be used if the input string does not contain a valid suffix.\n Supported units: `\"ms\"`, `\"s\"`, `\"m\"`, `\"h\"`\n If NULL, the function will assume milliseconds by default.\n # Returns\n\n`true` if the parsing and conversion succeeded, `false` otherwise."]
25803 pub fn args_read_duration(
25804 args: *mut FuriString,
25805 value: *mut u32,
25806 default_unit: *const core::ffi::c_char,
25807 ) -> bool;
25808}
25809unsafe extern "C" {
25810 #[doc = "Get length of first word from arguments string\n\n # Arguments\n\n* `args` - arguments string\n # Returns\n\nsize_t length of first word"]
25811 pub fn args_get_first_word_length(args: *mut FuriString) -> usize;
25812}
25813unsafe extern "C" {
25814 #[doc = "Get length of arguments string\n\n # Arguments\n\n* `args` - arguments string\n # Returns\n\nsize_t length of arguments string"]
25815 pub fn args_length(args: *mut FuriString) -> usize;
25816}
25817unsafe extern "C" {
25818 #[doc = "Convert ASCII hex values to byte\n\n # Arguments\n\n* `hi_nibble` - ASCII hi nibble character\n * `low_nibble` - ASCII low nibble character\n * `byte` - byte pointer, output\n # Returns\n\nbool conversion status"]
25819 pub fn args_char_to_hex(
25820 hi_nibble: core::ffi::c_char,
25821 low_nibble: core::ffi::c_char,
25822 byte: *mut u8,
25823 ) -> bool;
25824}
25825pub const CliKeyUnrecognized: CliKey = CliKey(0);
25826pub const CliKeySOH: CliKey = CliKey(1);
25827pub const CliKeyETX: CliKey = CliKey(3);
25828pub const CliKeyEOT: CliKey = CliKey(4);
25829pub const CliKeyBell: CliKey = CliKey(7);
25830pub const CliKeyBackspace: CliKey = CliKey(8);
25831pub const CliKeyTab: CliKey = CliKey(9);
25832pub const CliKeyLF: CliKey = CliKey(10);
25833pub const CliKeyFF: CliKey = CliKey(12);
25834pub const CliKeyCR: CliKey = CliKey(13);
25835pub const CliKeyETB: CliKey = CliKey(23);
25836pub const CliKeyEsc: CliKey = CliKey(27);
25837pub const CliKeyUS: CliKey = CliKey(31);
25838pub const CliKeySpace: CliKey = CliKey(32);
25839pub const CliKeyDEL: CliKey = CliKey(127);
25840pub const CliKeySpecial: CliKey = CliKey(128);
25841pub const CliKeyLeft: CliKey = CliKey(129);
25842pub const CliKeyRight: CliKey = CliKey(130);
25843pub const CliKeyUp: CliKey = CliKey(131);
25844pub const CliKeyDown: CliKey = CliKey(132);
25845pub const CliKeyHome: CliKey = CliKey(133);
25846pub const CliKeyEnd: CliKey = CliKey(134);
25847#[repr(transparent)]
25848#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25849pub struct CliKey(pub core::ffi::c_uchar);
25850pub const CliModKeyNo: CliModKey = CliModKey(0);
25851pub const CliModKeyAlt: CliModKey = CliModKey(2);
25852pub const CliModKeyCtrl: CliModKey = CliModKey(4);
25853pub const CliModKeyMeta: CliModKey = CliModKey(8);
25854#[repr(transparent)]
25855#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25856pub struct CliModKey(pub core::ffi::c_uchar);
25857#[repr(C)]
25858#[derive(Debug, Copy, Clone)]
25859pub struct CliKeyCombo {
25860 pub modifiers: CliModKey,
25861 pub key: CliKey,
25862}
25863#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25864const _: () = {
25865 ["Size of CliKeyCombo"][::core::mem::size_of::<CliKeyCombo>() - 2usize];
25866 ["Alignment of CliKeyCombo"][::core::mem::align_of::<CliKeyCombo>() - 1usize];
25867 ["Offset of field: CliKeyCombo::modifiers"]
25868 [::core::mem::offset_of!(CliKeyCombo, modifiers) - 0usize];
25869 ["Offset of field: CliKeyCombo::key"][::core::mem::offset_of!(CliKeyCombo, key) - 1usize];
25870};
25871#[repr(C)]
25872#[derive(Debug, Copy, Clone)]
25873pub struct CliAnsiParser {
25874 _unused: [u8; 0],
25875}
25876#[repr(C)]
25877#[derive(Debug, Copy, Clone)]
25878pub struct CliAnsiParserResult {
25879 pub is_done: bool,
25880 pub result: CliKeyCombo,
25881}
25882#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25883const _: () = {
25884 ["Size of CliAnsiParserResult"][::core::mem::size_of::<CliAnsiParserResult>() - 3usize];
25885 ["Alignment of CliAnsiParserResult"][::core::mem::align_of::<CliAnsiParserResult>() - 1usize];
25886 ["Offset of field: CliAnsiParserResult::is_done"]
25887 [::core::mem::offset_of!(CliAnsiParserResult, is_done) - 0usize];
25888 ["Offset of field: CliAnsiParserResult::result"]
25889 [::core::mem::offset_of!(CliAnsiParserResult, result) - 1usize];
25890};
25891unsafe extern "C" {
25892 #[doc = "Allocates an ANSI parser"]
25893 pub fn cli_ansi_parser_alloc() -> *mut CliAnsiParser;
25894}
25895unsafe extern "C" {
25896 #[doc = "Frees an ANSI parser"]
25897 pub fn cli_ansi_parser_free(parser: *mut CliAnsiParser);
25898}
25899unsafe extern "C" {
25900 #[doc = "Feeds an ANSI parser a character"]
25901 pub fn cli_ansi_parser_feed(
25902 parser: *mut CliAnsiParser,
25903 c: core::ffi::c_char,
25904 ) -> CliAnsiParserResult;
25905}
25906unsafe extern "C" {
25907 #[doc = "Feeds an ANSI parser a timeout event\n\n As a user of the ANSI parser API, you are responsible for calling this\n function some time after the last character was fed into the parser. The\n recommended timeout is about 10 ms. The exact value does not matter as long\n as it is small enough for the user not notice a delay, but big enough that\n when a terminal is sending an escape sequence, this function does not get\n called in between the characters of the sequence."]
25908 pub fn cli_ansi_parser_feed_timeout(parser: *mut CliAnsiParser) -> CliAnsiParserResult;
25909}
25910#[repr(C)]
25911#[derive(Debug, Copy, Clone)]
25912pub struct CliShell {
25913 _unused: [u8; 0],
25914}
25915#[doc = "Called from the shell thread to print the Message of the Day when the shell\n is started."]
25916pub type CliShellMotd =
25917 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25918unsafe extern "C" {
25919 #[doc = "Allocates a shell\n\n # Arguments\n\n* `[in]` - motd Message of the Day callback\n * `[in]` - context Callback context\n * `[in]` - pipe Pipe side to be used by the shell\n * `[in]` - registry Command registry\n * `[in]` - ext_config External command configuration. See\n `CliCommandExternalConfig`. May be NULL if support for\n external commands is not required.\n\n # Returns\n\nShell instance"]
25920 pub fn cli_shell_alloc(
25921 motd: CliShellMotd,
25922 context: *mut core::ffi::c_void,
25923 pipe: *mut PipeSide,
25924 registry: *mut CliRegistry,
25925 ext_config: *const CliCommandExternalConfig,
25926 ) -> *mut CliShell;
25927}
25928unsafe extern "C" {
25929 #[doc = "Frees a shell\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25930 pub fn cli_shell_free(shell: *mut CliShell);
25931}
25932unsafe extern "C" {
25933 #[doc = "Starts a shell\n\n The shell runs in a separate thread. This call is non-blocking.\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25934 pub fn cli_shell_start(shell: *mut CliShell);
25935}
25936unsafe extern "C" {
25937 #[doc = "Joins the shell thread\n\n This call is blocking.\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25938 pub fn cli_shell_join(shell: *mut CliShell);
25939}
25940unsafe extern "C" {
25941 #[doc = "Sets optional text before prompt (`>:`)\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25942 pub fn cli_shell_set_prompt(shell: *mut CliShell, prompt: *const core::ffi::c_char);
25943}
25944#[repr(C)]
25945#[derive(Debug, Copy, Clone)]
25946pub struct CompressIcon {
25947 _unused: [u8; 0],
25948}
25949unsafe extern "C" {
25950 #[doc = "Initialize icon compressor\n\n # Arguments\n\n* `decode_buf_size` (direction in) - The icon buffer size for decoding. Ensure that\n it's big enough for any icons that you are\n planning to decode with it.\n\n # Returns\n\nCompress Icon instance"]
25951 pub fn compress_icon_alloc(decode_buf_size: usize) -> *mut CompressIcon;
25952}
25953unsafe extern "C" {
25954 #[doc = "Free icon compressor\n\n # Arguments\n\n* `instance` - The Compress Icon instance"]
25955 pub fn compress_icon_free(instance: *mut CompressIcon);
25956}
25957unsafe extern "C" {
25958 #[doc = "Decompress icon\n\n output pointer set by this function is valid till next\n `compress_icon_decode` or `compress_icon_free` call\n\n # Arguments\n\n* `instance` - The Compress Icon instance\n * `icon_data` - pointer to icon data.\n * `output` (direction in) - pointer to decoded buffer pointer. Data in buffer is\n valid till next call. If icon data was not compressed,\n pointer within icon_data is returned"]
25959 pub fn compress_icon_decode(
25960 instance: *mut CompressIcon,
25961 icon_data: *const u8,
25962 output: *mut *mut u8,
25963 );
25964}
25965#[repr(C)]
25966#[derive(Debug, Copy, Clone)]
25967pub struct Compress {
25968 _unused: [u8; 0],
25969}
25970pub const CompressTypeHeatshrink: CompressType = CompressType(0);
25971#[repr(transparent)]
25972#[doc = "Supported compression types"]
25973#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25974pub struct CompressType(pub core::ffi::c_uchar);
25975#[doc = "Configuration for heatshrink compression"]
25976#[repr(C)]
25977#[derive(Debug, Copy, Clone)]
25978pub struct CompressConfigHeatshrink {
25979 pub window_sz2: u16,
25980 pub lookahead_sz2: u16,
25981 pub input_buffer_sz: u16,
25982}
25983#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25984const _: () = {
25985 ["Size of CompressConfigHeatshrink"]
25986 [::core::mem::size_of::<CompressConfigHeatshrink>() - 6usize];
25987 ["Alignment of CompressConfigHeatshrink"]
25988 [::core::mem::align_of::<CompressConfigHeatshrink>() - 2usize];
25989 ["Offset of field: CompressConfigHeatshrink::window_sz2"]
25990 [::core::mem::offset_of!(CompressConfigHeatshrink, window_sz2) - 0usize];
25991 ["Offset of field: CompressConfigHeatshrink::lookahead_sz2"]
25992 [::core::mem::offset_of!(CompressConfigHeatshrink, lookahead_sz2) - 2usize];
25993 ["Offset of field: CompressConfigHeatshrink::input_buffer_sz"]
25994 [::core::mem::offset_of!(CompressConfigHeatshrink, input_buffer_sz) - 4usize];
25995};
25996unsafe extern "C" {
25997 #[doc = "Default configuration for heatshrink compression. Used for image assets."]
25998 pub static compress_config_heatshrink_default: CompressConfigHeatshrink;
25999}
26000unsafe extern "C" {
26001 #[doc = "Allocate encoder and decoder\n\n # Arguments\n\n* `type` - Compression type\n * `config` (direction in) - Configuration for compression, specific to type\n\n # Returns\n\nCompress instance"]
26002 pub fn compress_alloc(type_: CompressType, config: *const core::ffi::c_void) -> *mut Compress;
26003}
26004unsafe extern "C" {
26005 #[doc = "Free encoder and decoder\n\n # Arguments\n\n* `compress` - Compress instance"]
26006 pub fn compress_free(compress: *mut Compress);
26007}
26008unsafe extern "C" {
26009 #[doc = "Encode data\n\n # Arguments\n\n* `compress` - Compress instance\n * `data_in` - pointer to input data\n * `data_in_size` - size of input data\n * `data_out` - maximum size of output data\n * `data_out_size` (direction in) - The data out size\n * `data_res_size` - pointer to result output data size\n\n > **Note:** Prepends compressed stream with a header. If data is not compressible,\n it will be stored as is after the header.\n # Returns\n\ntrue on success"]
26010 pub fn compress_encode(
26011 compress: *mut Compress,
26012 data_in: *mut u8,
26013 data_in_size: usize,
26014 data_out: *mut u8,
26015 data_out_size: usize,
26016 data_res_size: *mut usize,
26017 ) -> bool;
26018}
26019unsafe extern "C" {
26020 #[doc = "Decode data\n\n # Arguments\n\n* `compress` - Compress instance\n * `data_in` - pointer to input data\n * `data_in_size` - size of input data\n * `data_out` - maximum size of output data\n * `data_out_size` (direction in) - The data out size\n * `data_res_size` - pointer to result output data size\n\n > **Note:** Expects compressed stream with a header, as produced by `compress_encode`.\n # Returns\n\ntrue on success"]
26021 pub fn compress_decode(
26022 compress: *mut Compress,
26023 data_in: *mut u8,
26024 data_in_size: usize,
26025 data_out: *mut u8,
26026 data_out_size: usize,
26027 data_res_size: *mut usize,
26028 ) -> bool;
26029}
26030#[doc = "I/O callback for streamed compression/decompression\n\n # Arguments\n\n* `context` - user context\n * `buffer` - buffer to read/write\n * `size` - size of buffer\n\n # Returns\n\nnumber of bytes read/written, 0 on end of stream, negative on error"]
26031pub type CompressIoCallback = ::core::option::Option<
26032 unsafe extern "C" fn(context: *mut core::ffi::c_void, buffer: *mut u8, size: usize) -> i32,
26033>;
26034unsafe extern "C" {
26035 #[doc = "Decompress streamed data\n\n # Arguments\n\n* `compress` - Compress instance\n * `read_cb` - read callback\n * `read_context` - read callback context\n * `write_cb` - write callback\n * `write_context` - write callback context\n\n > **Note:** Does not expect a header, just compressed data stream.\n # Returns\n\ntrue on success"]
26036 pub fn compress_decode_streamed(
26037 compress: *mut Compress,
26038 read_cb: CompressIoCallback,
26039 read_context: *mut core::ffi::c_void,
26040 write_cb: CompressIoCallback,
26041 write_context: *mut core::ffi::c_void,
26042 ) -> bool;
26043}
26044#[repr(C)]
26045#[derive(Debug, Copy, Clone)]
26046pub struct CompressStreamDecoder {
26047 _unused: [u8; 0],
26048}
26049unsafe extern "C" {
26050 #[doc = "Allocate stream decoder\n\n # Arguments\n\n* `type` - Compression type\n * `config` (direction in) - Configuration for compression, specific to type\n * `read_cb` - The read callback for input (compressed) data\n * `read_context` - The read context\n\n # Returns\n\nCompressStreamDecoder instance"]
26051 pub fn compress_stream_decoder_alloc(
26052 type_: CompressType,
26053 config: *const core::ffi::c_void,
26054 read_cb: CompressIoCallback,
26055 read_context: *mut core::ffi::c_void,
26056 ) -> *mut CompressStreamDecoder;
26057}
26058unsafe extern "C" {
26059 #[doc = "Free stream decoder\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance"]
26060 pub fn compress_stream_decoder_free(instance: *mut CompressStreamDecoder);
26061}
26062unsafe extern "C" {
26063 #[doc = "Read uncompressed data chunk from stream decoder\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance\n * `data_out` - The data out\n * `data_out_size` (direction in) - The data out size\n\n # Returns\n\ntrue on success"]
26064 pub fn compress_stream_decoder_read(
26065 instance: *mut CompressStreamDecoder,
26066 data_out: *mut u8,
26067 data_out_size: usize,
26068 ) -> bool;
26069}
26070unsafe extern "C" {
26071 #[doc = "Seek to position in uncompressed data stream\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance\n * `position` (direction in) - The position\n\n # Returns\n\ntrue on success\n Backward seeking is not supported"]
26072 pub fn compress_stream_decoder_seek(
26073 instance: *mut CompressStreamDecoder,
26074 position: usize,
26075 ) -> bool;
26076}
26077unsafe extern "C" {
26078 #[doc = "Get current position in uncompressed data stream\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance\n\n # Returns\n\ncurrent position"]
26079 pub fn compress_stream_decoder_tell(instance: *mut CompressStreamDecoder) -> usize;
26080}
26081unsafe extern "C" {
26082 #[doc = "Reset stream decoder to the beginning\n Read callback must be repositioned by caller separately\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance\n\n # Returns\n\ntrue on success"]
26083 pub fn compress_stream_decoder_rewind(instance: *mut CompressStreamDecoder) -> bool;
26084}
26085unsafe extern "C" {
26086 pub fn crc32_calc_buffer(crc: u32, buffer: *const core::ffi::c_void, size: usize) -> u32;
26087}
26088pub type FileCrcProgressCb =
26089 ::core::option::Option<unsafe extern "C" fn(progress: u8, context: *mut core::ffi::c_void)>;
26090unsafe extern "C" {
26091 pub fn crc32_calc_file(
26092 file: *mut File,
26093 progress_cb: FileCrcProgressCb,
26094 context: *mut core::ffi::c_void,
26095 ) -> u32;
26096}
26097#[repr(C)]
26098#[derive(Debug, Copy, Clone)]
26099pub struct DirWalk {
26100 _unused: [u8; 0],
26101}
26102#[doc = "< OK"]
26103pub const DirWalkOK: DirWalkResult = DirWalkResult(0);
26104#[doc = "< Error"]
26105pub const DirWalkError: DirWalkResult = DirWalkResult(1);
26106#[doc = "< Last element"]
26107pub const DirWalkLast: DirWalkResult = DirWalkResult(2);
26108#[repr(transparent)]
26109#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26110pub struct DirWalkResult(pub core::ffi::c_uchar);
26111pub type DirWalkFilterCb = ::core::option::Option<
26112 unsafe extern "C" fn(
26113 name: *const core::ffi::c_char,
26114 fileinfo: *mut FileInfo,
26115 ctx: *mut core::ffi::c_void,
26116 ) -> bool,
26117>;
26118unsafe extern "C" {
26119 #[doc = "Allocate DirWalk\n # Arguments\n\n* `storage` -\n # Returns\n\nDirWalk*"]
26120 pub fn dir_walk_alloc(storage: *mut Storage) -> *mut DirWalk;
26121}
26122unsafe extern "C" {
26123 #[doc = "Free DirWalk\n # Arguments\n\n* `dir_walk` -"]
26124 pub fn dir_walk_free(dir_walk: *mut DirWalk);
26125}
26126unsafe extern "C" {
26127 #[doc = "Set recursive mode (true by default)\n # Arguments\n\n* `dir_walk` -\n * `recursive` -"]
26128 pub fn dir_walk_set_recursive(dir_walk: *mut DirWalk, recursive: bool);
26129}
26130unsafe extern "C" {
26131 #[doc = "Set filter callback (Should return true if the data is valid)\n # Arguments\n\n* `dir_walk` -\n * `cb` -\n * `context` -"]
26132 pub fn dir_walk_set_filter_cb(
26133 dir_walk: *mut DirWalk,
26134 cb: DirWalkFilterCb,
26135 context: *mut core::ffi::c_void,
26136 );
26137}
26138unsafe extern "C" {
26139 #[doc = "Open directory\n # Arguments\n\n* `dir_walk` -\n * `path` -\n # Returns\n\ntrue\n false"]
26140 pub fn dir_walk_open(dir_walk: *mut DirWalk, path: *const core::ffi::c_char) -> bool;
26141}
26142unsafe extern "C" {
26143 #[doc = "Get error id\n # Arguments\n\n* `dir_walk` -\n # Returns\n\nFS_Error"]
26144 pub fn dir_walk_get_error(dir_walk: *mut DirWalk) -> FS_Error;
26145}
26146unsafe extern "C" {
26147 #[doc = "Read next element from directory\n # Arguments\n\n* `dir_walk` -\n * `return_path` -\n * `fileinfo` -\n # Returns\n\nDirWalkResult"]
26148 pub fn dir_walk_read(
26149 dir_walk: *mut DirWalk,
26150 return_path: *mut FuriString,
26151 fileinfo: *mut FileInfo,
26152 ) -> DirWalkResult;
26153}
26154unsafe extern "C" {
26155 #[doc = "Close directory\n # Arguments\n\n* `dir_walk` -"]
26156 pub fn dir_walk_close(dir_walk: *mut DirWalk);
26157}
26158unsafe extern "C" {
26159 #[doc = "Compare two floating point numbers\n # Arguments\n\n* `a` - First number to compare\n * `b` - Second number to compare\n\n # Returns\n\nbool true if a equals b, false otherwise"]
26160 pub fn float_is_equal(a: f32, b: f32) -> bool;
26161}
26162unsafe extern "C" {
26163 #[doc = "Convert ASCII hex value to nibble\n # Arguments\n\n* `c` - ASCII character\n * `nibble` - nibble pointer, output\n\n # Returns\n\nbool conversion status"]
26164 pub fn hex_char_to_hex_nibble(c: core::ffi::c_char, nibble: *mut u8) -> bool;
26165}
26166unsafe extern "C" {
26167 #[doc = "Convert ASCII hex value to byte\n # Arguments\n\n* `hi` - hi nibble text\n * `low` - low nibble text\n * `value` - output value\n\n # Returns\n\nbool conversion status"]
26168 pub fn hex_char_to_uint8(hi: core::ffi::c_char, low: core::ffi::c_char, value: *mut u8)
26169 -> bool;
26170}
26171unsafe extern "C" {
26172 #[doc = "Convert ASCII hex values to uint8_t\n # Arguments\n\n* `value_str` - ASCII data\n * `value` - output value\n\n # Returns\n\nbool conversion status"]
26173 pub fn hex_chars_to_uint8(value_str: *const core::ffi::c_char, value: *mut u8) -> bool;
26174}
26175unsafe extern "C" {
26176 #[doc = "Convert ASCII hex values to uint64_t\n # Arguments\n\n* `value_str` - ASCII 64 bi data\n * `value` - output value\n\n # Returns\n\nbool conversion status"]
26177 pub fn hex_chars_to_uint64(value_str: *const core::ffi::c_char, value: *mut u64) -> bool;
26178}
26179unsafe extern "C" {
26180 #[doc = "Convert uint8_t to ASCII hex values\n # Arguments\n\n* `src` - source data\n * `target` - output value\n * `length` - data length\n"]
26181 pub fn uint8_to_hex_chars(src: *const u8, target: *mut u8, length: core::ffi::c_int);
26182}
26183pub const KeysDictModeOpenExisting: KeysDictMode = KeysDictMode(0);
26184pub const KeysDictModeOpenAlways: KeysDictMode = KeysDictMode(1);
26185#[repr(transparent)]
26186#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26187pub struct KeysDictMode(pub core::ffi::c_uchar);
26188#[repr(C)]
26189#[derive(Debug, Copy, Clone)]
26190pub struct KeysDict {
26191 _unused: [u8; 0],
26192}
26193unsafe extern "C" {
26194 #[doc = "Check if the file list exists\n\n # Arguments\n\n* `path` - - list path\n\n # Returns\n\ntrue if list exists, false otherwise"]
26195 pub fn keys_dict_check_presence(path: *const core::ffi::c_char) -> bool;
26196}
26197unsafe extern "C" {
26198 #[doc = "Open or create list\n Depending on mode, list will be opened or created.\n\n # Arguments\n\n* `path` - - Path of the file that contain the list\n * `mode` - - ListKeysMode value\n * `key_size` - - Size of each key in bytes\n\n # Returns\n\nReturns KeysDict list instance"]
26199 pub fn keys_dict_alloc(
26200 path: *const core::ffi::c_char,
26201 mode: KeysDictMode,
26202 key_size: usize,
26203 ) -> *mut KeysDict;
26204}
26205unsafe extern "C" {
26206 #[doc = "Close list\n\n # Arguments\n\n* `instance` - - KeysDict list instance"]
26207 pub fn keys_dict_free(instance: *mut KeysDict);
26208}
26209unsafe extern "C" {
26210 #[doc = "Get total number of keys in list\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n\n # Returns\n\nReturns total number of keys in list"]
26211 pub fn keys_dict_get_total_keys(instance: *mut KeysDict) -> usize;
26212}
26213unsafe extern "C" {
26214 #[doc = "Rewind list\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n\n # Returns\n\nReturns true if rewind was successful, false otherwise"]
26215 pub fn keys_dict_rewind(instance: *mut KeysDict) -> bool;
26216}
26217unsafe extern "C" {
26218 #[doc = "Check if key is present in list\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n * `key` - - key to check\n * `key_size` - - Size of the key in bytes\n\n # Returns\n\nReturns true if key is present, false otherwise"]
26219 pub fn keys_dict_is_key_present(
26220 instance: *mut KeysDict,
26221 key: *const u8,
26222 key_size: usize,
26223 ) -> bool;
26224}
26225unsafe extern "C" {
26226 #[doc = "Get next key from the list\n This function will return next key from list. If there are no more\n keys, it will return false, and keys_dict_rewind() should be called.\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n * `key` - - Array where to store key\n * `key_size` - - Size of key in bytes\n\n # Returns\n\nReturns true if key was successfully retrieved, false otherwise"]
26227 pub fn keys_dict_get_next_key(instance: *mut KeysDict, key: *mut u8, key_size: usize) -> bool;
26228}
26229unsafe extern "C" {
26230 #[doc = "Add key to list\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n * `key` - - Key to add\n * `key_size` - - Size of the key in bytes\n\n # Returns\n\nReturns true if key was successfully added, false otherwise"]
26231 pub fn keys_dict_add_key(instance: *mut KeysDict, key: *const u8, key_size: usize) -> bool;
26232}
26233unsafe extern "C" {
26234 #[doc = "Delete key from list\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n * `key` - - Key to delete\n * `key_size` - - Size of the key in bytes\n\n # Returns\n\nReturns true if key was successfully deleted, false otherwise"]
26235 pub fn keys_dict_delete_key(instance: *mut KeysDict, key: *const u8, key_size: usize) -> bool;
26236}
26237pub const ManchesterEventShortLow: ManchesterEvent = ManchesterEvent(0);
26238pub const ManchesterEventShortHigh: ManchesterEvent = ManchesterEvent(2);
26239pub const ManchesterEventLongLow: ManchesterEvent = ManchesterEvent(4);
26240pub const ManchesterEventLongHigh: ManchesterEvent = ManchesterEvent(6);
26241pub const ManchesterEventReset: ManchesterEvent = ManchesterEvent(8);
26242#[repr(transparent)]
26243#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26244pub struct ManchesterEvent(pub core::ffi::c_uchar);
26245pub const ManchesterStateStart1: ManchesterState = ManchesterState(0);
26246pub const ManchesterStateMid1: ManchesterState = ManchesterState(1);
26247pub const ManchesterStateMid0: ManchesterState = ManchesterState(2);
26248pub const ManchesterStateStart0: ManchesterState = ManchesterState(3);
26249#[repr(transparent)]
26250#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26251pub struct ManchesterState(pub core::ffi::c_uchar);
26252unsafe extern "C" {
26253 pub fn manchester_advance(
26254 state: ManchesterState,
26255 event: ManchesterEvent,
26256 next_state: *mut ManchesterState,
26257 data: *mut bool,
26258 ) -> bool;
26259}
26260#[repr(C)]
26261#[derive(Debug, Copy, Clone)]
26262pub struct ManchesterEncoderState {
26263 pub prev_bit: bool,
26264 pub step: u8,
26265}
26266#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26267const _: () = {
26268 ["Size of ManchesterEncoderState"][::core::mem::size_of::<ManchesterEncoderState>() - 2usize];
26269 ["Alignment of ManchesterEncoderState"]
26270 [::core::mem::align_of::<ManchesterEncoderState>() - 1usize];
26271 ["Offset of field: ManchesterEncoderState::prev_bit"]
26272 [::core::mem::offset_of!(ManchesterEncoderState, prev_bit) - 0usize];
26273 ["Offset of field: ManchesterEncoderState::step"]
26274 [::core::mem::offset_of!(ManchesterEncoderState, step) - 1usize];
26275};
26276pub const ManchesterEncoderResultShortLow: ManchesterEncoderResult = ManchesterEncoderResult(0);
26277pub const ManchesterEncoderResultLongLow: ManchesterEncoderResult = ManchesterEncoderResult(1);
26278pub const ManchesterEncoderResultLongHigh: ManchesterEncoderResult = ManchesterEncoderResult(2);
26279pub const ManchesterEncoderResultShortHigh: ManchesterEncoderResult = ManchesterEncoderResult(3);
26280#[repr(transparent)]
26281#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26282pub struct ManchesterEncoderResult(pub core::ffi::c_uchar);
26283unsafe extern "C" {
26284 pub fn manchester_encoder_reset(state: *mut ManchesterEncoderState);
26285}
26286unsafe extern "C" {
26287 pub fn manchester_encoder_advance(
26288 state: *mut ManchesterEncoderState,
26289 curr_bit: bool,
26290 result: *mut ManchesterEncoderResult,
26291 ) -> bool;
26292}
26293unsafe extern "C" {
26294 pub fn manchester_encoder_finish(state: *mut ManchesterEncoderState)
26295 -> ManchesterEncoderResult;
26296}
26297unsafe extern "C" {
26298 pub fn md5_calc_file(
26299 file: *mut File,
26300 path: *const core::ffi::c_char,
26301 output: *mut core::ffi::c_uchar,
26302 file_error: *mut FS_Error,
26303 ) -> bool;
26304}
26305unsafe extern "C" {
26306 pub fn md5_string_calc_file(
26307 file: *mut File,
26308 path: *const core::ffi::c_char,
26309 output: *mut FuriString,
26310 file_error: *mut FS_Error,
26311 ) -> bool;
26312}
26313unsafe extern "C" {
26314 #[doc = "Generates detailed/random name based on furi_hal flags\n\n # Arguments\n\n* `name` - buffer to write random name\n * `max_name_size` - length of given buffer\n * `prefix` (direction in) - The prefix of the name"]
26315 pub fn name_generator_make_auto(
26316 name: *mut core::ffi::c_char,
26317 max_name_size: usize,
26318 prefix: *const core::ffi::c_char,
26319 );
26320}
26321unsafe extern "C" {
26322 #[doc = "Generates random name\n\n # Arguments\n\n* `name` - buffer to write random name\n * `max_name_size` - length of given buffer"]
26323 pub fn name_generator_make_random(name: *mut core::ffi::c_char, max_name_size: usize);
26324}
26325unsafe extern "C" {
26326 #[doc = "Generates detailed name\n\n # Arguments\n\n* `name` - buffer to write random name\n * `max_name_size` - length of given buffer\n * `prefix` (direction in) - The prefix of the name"]
26327 pub fn name_generator_make_detailed(
26328 name: *mut core::ffi::c_char,
26329 max_name_size: usize,
26330 prefix: *const core::ffi::c_char,
26331 );
26332}
26333unsafe extern "C" {
26334 #[doc = "Extract filename without extension from path.\n\n # Arguments\n\n* `path` - path string\n * `filename` - output filename string. Must be initialized before."]
26335 pub fn path_extract_filename_no_ext(path: *const core::ffi::c_char, filename: *mut FuriString);
26336}
26337unsafe extern "C" {
26338 #[doc = "Extract filename string from path.\n\n # Arguments\n\n* `path` - path string\n * `filename` - output filename string. Must be initialized before.\n * `trim_ext` - true - get filename without extension"]
26339 pub fn path_extract_filename(path: *mut FuriString, filename: *mut FuriString, trim_ext: bool);
26340}
26341unsafe extern "C" {
26342 #[doc = "Extract file extension from path.\n\n # Arguments\n\n* `path` - path string\n * `ext` - output extension string\n * `ext_len_max` - maximum extension string length"]
26343 pub fn path_extract_extension(
26344 path: *mut FuriString,
26345 ext: *mut core::ffi::c_char,
26346 ext_len_max: usize,
26347 );
26348}
26349unsafe extern "C" {
26350 #[doc = "Extract last path component\n\n # Arguments\n\n* `path` - path string\n * `filename` - output string. Must be initialized before."]
26351 pub fn path_extract_basename(path: *const core::ffi::c_char, basename: *mut FuriString);
26352}
26353unsafe extern "C" {
26354 #[doc = "Extract path, except for last component\n\n # Arguments\n\n* `path` - path string\n * `filename` - output string. Must be initialized before."]
26355 pub fn path_extract_dirname(path: *const core::ffi::c_char, dirname: *mut FuriString);
26356}
26357unsafe extern "C" {
26358 #[doc = "Appends new component to path, adding path delimiter\n\n # Arguments\n\n* `path` - path string\n * `suffix` - path part to apply"]
26359 pub fn path_append(path: *mut FuriString, suffix: *const core::ffi::c_char);
26360}
26361unsafe extern "C" {
26362 #[doc = "Appends new component to path, adding path delimiter\n\n # Arguments\n\n* `path` - first path part\n * `suffix` - second path part\n * `out_path` - output string to combine parts into. Must be initialized"]
26363 pub fn path_concat(
26364 path: *const core::ffi::c_char,
26365 suffix: *const core::ffi::c_char,
26366 out_path: *mut FuriString,
26367 );
26368}
26369unsafe extern "C" {
26370 #[doc = "Check that path contains only ascii characters\n\n # Arguments\n\n* `path` -\n # Returns\n\ntrue\n false"]
26371 pub fn path_contains_only_ascii(path: *const core::ffi::c_char) -> bool;
26372}
26373unsafe extern "C" {
26374 #[doc = "Format a data buffer as a canonical HEX dump\n # Arguments\n\n* `[out]` - result pointer to the output string (must be initialised)\n * `[in]` - num_places the number of bytes on one line (both as HEX and ASCII)\n * `[in]` - line_prefix if not NULL, prepend this string to each line\n * `[in]` - data pointer to the input data buffer\n * `[in]` - data_size input data size"]
26375 pub fn pretty_format_bytes_hex_canonical(
26376 result: *mut FuriString,
26377 num_places: usize,
26378 line_prefix: *const core::ffi::c_char,
26379 data: *const u8,
26380 data_size: usize,
26381 );
26382}
26383#[repr(C)]
26384#[derive(Debug, Copy, Clone)]
26385pub struct PulseGlue {
26386 _unused: [u8; 0],
26387}
26388unsafe extern "C" {
26389 pub fn pulse_glue_alloc() -> *mut PulseGlue;
26390}
26391unsafe extern "C" {
26392 pub fn pulse_glue_free(pulse_glue: *mut PulseGlue);
26393}
26394unsafe extern "C" {
26395 pub fn pulse_glue_reset(pulse_glue: *mut PulseGlue);
26396}
26397unsafe extern "C" {
26398 pub fn pulse_glue_push(pulse_glue: *mut PulseGlue, polarity: bool, length: u32) -> bool;
26399}
26400unsafe extern "C" {
26401 pub fn pulse_glue_pop(pulse_glue: *mut PulseGlue, length: *mut u32, period: *mut u32);
26402}
26403unsafe extern "C" {
26404 #[doc = "Load data from the file in saved structure format\n\n # Arguments\n\n* `path` (direction in) - The path to the file\n * `data` (direction out) - Pointer to the memory where to load data\n * `size` (direction in) - The size of the data\n * `magic` (direction in) - The magic to embed into metadata\n * `version` (direction in) - The version to embed into metadata\n\n # Returns\n\ntrue on success, false otherwise"]
26405 pub fn saved_struct_load(
26406 path: *const core::ffi::c_char,
26407 data: *mut core::ffi::c_void,
26408 size: usize,
26409 magic: u8,
26410 version: u8,
26411 ) -> bool;
26412}
26413unsafe extern "C" {
26414 #[doc = "Save data in saved structure format\n\n # Arguments\n\n* `path` (direction in) - The path to the file\n * `data` (direction in) - Pointer to the memory where data\n * `size` (direction in) - The size of the data\n * `magic` (direction in) - The magic to embed into metadata\n * `version` (direction in) - The version to embed into metadata\n\n # Returns\n\ntrue on success, false otherwise"]
26415 pub fn saved_struct_save(
26416 path: *const core::ffi::c_char,
26417 data: *const core::ffi::c_void,
26418 size: usize,
26419 magic: u8,
26420 version: u8,
26421 ) -> bool;
26422}
26423unsafe extern "C" {
26424 #[doc = "Get SavedStructure file metadata\n\n # Arguments\n\n* `path` (direction in) - The path to the file\n * `magic` (direction out) - Pointer to store magic or NULL if you don't need it\n * `version` (direction out) - Pointer to store version or NULL if you don't need\n it\n * `payload_size` (direction out) - Pointer to store payload size or NULL if you don't\n need it\n\n # Returns\n\ntrue on success, false otherwise"]
26425 pub fn saved_struct_get_metadata(
26426 path: *const core::ffi::c_char,
26427 magic: *mut u8,
26428 version: *mut u8,
26429 payload_size: *mut usize,
26430 ) -> bool;
26431}
26432#[doc = "StrBuffer instance\n\n Place this struct directly wherever you want, it doesn't have to be `alloc`ed\n and `free`d."]
26433#[repr(C)]
26434#[derive(Debug, Copy, Clone)]
26435pub struct StrBuffer {
26436 pub owned_strings: *mut *mut core::ffi::c_char,
26437 pub n_owned_strings: usize,
26438}
26439#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26440const _: () = {
26441 ["Size of StrBuffer"][::core::mem::size_of::<StrBuffer>() - 8usize];
26442 ["Alignment of StrBuffer"][::core::mem::align_of::<StrBuffer>() - 4usize];
26443 ["Offset of field: StrBuffer::owned_strings"]
26444 [::core::mem::offset_of!(StrBuffer, owned_strings) - 0usize];
26445 ["Offset of field: StrBuffer::n_owned_strings"]
26446 [::core::mem::offset_of!(StrBuffer, n_owned_strings) - 4usize];
26447};
26448unsafe extern "C" {
26449 #[doc = "Makes a owned duplicate of the provided string\n\n # Arguments\n\n* `buffer` (direction in) - StrBuffer instance\n * `str` (direction in) - Input C-style string\n\n # Returns\n\nC-style string that contains to be valid event after `str` becomes\n invalid"]
26450 pub fn str_buffer_make_owned_clone(
26451 buffer: *mut StrBuffer,
26452 str_: *const core::ffi::c_char,
26453 ) -> *const core::ffi::c_char;
26454}
26455unsafe extern "C" {
26456 #[doc = "Clears all owned duplicates\n\n # Arguments\n\n* `buffer` (direction in) - StrBuffer instance"]
26457 pub fn str_buffer_clear_all_clones(buffer: *mut StrBuffer);
26458}
26459unsafe extern "C" {
26460 #[doc = "Allocate a file stream with buffered read operations\n # Returns\n\nStream*"]
26461 pub fn buffered_file_stream_alloc(storage: *mut Storage) -> *mut Stream;
26462}
26463unsafe extern "C" {
26464 #[doc = "Opens an existing file or creates a new one.\n # Arguments\n\n* `stream` - pointer to file stream object.\n * `path` - path to file\n * `access_mode` - access mode from FS_AccessMode\n * `open_mode` - open mode from FS_OpenMode\n # Returns\n\nTrue on success, False on failure. You need to close the file even if the open operation failed."]
26465 pub fn buffered_file_stream_open(
26466 stream: *mut Stream,
26467 path: *const core::ffi::c_char,
26468 access_mode: FS_AccessMode,
26469 open_mode: FS_OpenMode,
26470 ) -> bool;
26471}
26472unsafe extern "C" {
26473 #[doc = "Closes the file.\n # Arguments\n\n* `stream` - pointer to file stream object.\n # Returns\n\nTrue on success, False on failure."]
26474 pub fn buffered_file_stream_close(stream: *mut Stream) -> bool;
26475}
26476unsafe extern "C" {
26477 #[doc = "Forces write from cache to the underlying file.\n # Arguments\n\n* `stream` - pointer to file stream object.\n # Returns\n\nTrue on success, False on failure."]
26478 pub fn buffered_file_stream_sync(stream: *mut Stream) -> bool;
26479}
26480unsafe extern "C" {
26481 #[doc = "Retrieves the error id from the file object\n # Arguments\n\n* `stream` - pointer to stream object.\n # Returns\n\nFS_Error error id"]
26482 pub fn buffered_file_stream_get_error(stream: *mut Stream) -> FS_Error;
26483}
26484unsafe extern "C" {
26485 #[doc = "Allocate file stream\n # Returns\n\nStream*"]
26486 pub fn file_stream_alloc(storage: *mut Storage) -> *mut Stream;
26487}
26488unsafe extern "C" {
26489 #[doc = "Opens an existing file or create a new one.\n # Arguments\n\n* `stream` - pointer to file stream object.\n * `path` - path to file\n * `access_mode` - access mode from FS_AccessMode\n * `open_mode` - open mode from FS_OpenMode\n # Returns\n\nsuccess flag. You need to close the file even if the open operation failed."]
26490 pub fn file_stream_open(
26491 stream: *mut Stream,
26492 path: *const core::ffi::c_char,
26493 access_mode: FS_AccessMode,
26494 open_mode: FS_OpenMode,
26495 ) -> bool;
26496}
26497unsafe extern "C" {
26498 #[doc = "Closes the file.\n # Arguments\n\n* `stream` -\n # Returns\n\ntrue\n false"]
26499 pub fn file_stream_close(stream: *mut Stream) -> bool;
26500}
26501unsafe extern "C" {
26502 #[doc = "Retrieves the error id from the file object\n # Arguments\n\n* `stream` - pointer to stream object.\n # Returns\n\nFS_Error error id"]
26503 pub fn file_stream_get_error(stream: *mut Stream) -> FS_Error;
26504}
26505unsafe extern "C" {
26506 #[doc = "Allocate string stream\n # Returns\n\nStream*"]
26507 pub fn string_stream_alloc() -> *mut Stream;
26508}
26509#[doc = "!< Conversion performed successfully"]
26510pub const StrintParseNoError: StrintParseError = StrintParseError(0);
26511#[doc = "!< Multiple leading `+` or `-` characters, or leading `-` character if the type is unsigned"]
26512pub const StrintParseSignError: StrintParseError = StrintParseError(1);
26513#[doc = "!< No valid digits after the leading whitespace, sign and prefix"]
26514pub const StrintParseAbsentError: StrintParseError = StrintParseError(2);
26515#[doc = "!< Result does not fit in the requested type"]
26516pub const StrintParseOverflowError: StrintParseError = StrintParseError(3);
26517#[repr(transparent)]
26518#[doc = "String to integer conversion error"]
26519#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26520pub struct StrintParseError(pub core::ffi::c_uchar);
26521unsafe extern "C" {
26522 #[doc = "See `strint_to_uint32`"]
26523 pub fn strint_to_uint64(
26524 str_: *const core::ffi::c_char,
26525 end: *mut *mut core::ffi::c_char,
26526 out: *mut u64,
26527 base: u8,
26528 ) -> StrintParseError;
26529}
26530unsafe extern "C" {
26531 #[doc = "See `strint_to_uint32`"]
26532 pub fn strint_to_int64(
26533 str_: *const core::ffi::c_char,
26534 end: *mut *mut core::ffi::c_char,
26535 out: *mut i64,
26536 base: u8,
26537 ) -> StrintParseError;
26538}
26539unsafe extern "C" {
26540 #[doc = "Converts a string to a `uint32_t`\n\n # Arguments\n\n* `str` (direction in) - Input string\n * `end` (direction out) - Pointer to first character after the number in input string\n * `out` (direction out) - Parse result\n * `base` (direction in) - Integer base\n\n # Returns\n\nParse error\n\n Parses the number in the input string. The number may be surrounded by\n whitespace characters to the left and any non-digit characters to the right.\n What's considered a digit is determined by the input base in the following\n order: `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`. The number may be prefixed\n with either a `+` or a `-` to indicate its sign. The pointer to the first\n character after the leading whitespace, allowed prefixes and digits is\n assigned to `end`.\n\n If the input base is 0, the base is inferred from the leading characters of\n the number:\n - If it starts with `0x`, it's read in base 16;\n - If it starts with a `0`, it's read in base 8;\n - If it starts with `0b`, it's read in base 2.\n - Otherwise, it's read in base 10.\n\n For a description of the return codes, see `StrintParseError`. If the return\n code is something other than `StrintParseNoError`, the values at `end` and\n `out` are unaltered."]
26541 pub fn strint_to_uint32(
26542 str_: *const core::ffi::c_char,
26543 end: *mut *mut core::ffi::c_char,
26544 out: *mut u32,
26545 base: u8,
26546 ) -> StrintParseError;
26547}
26548unsafe extern "C" {
26549 #[doc = "See `strint_to_uint32`"]
26550 pub fn strint_to_int32(
26551 str_: *const core::ffi::c_char,
26552 end: *mut *mut core::ffi::c_char,
26553 out: *mut i32,
26554 base: u8,
26555 ) -> StrintParseError;
26556}
26557unsafe extern "C" {
26558 #[doc = "See `strint_to_uint32`"]
26559 pub fn strint_to_uint16(
26560 str_: *const core::ffi::c_char,
26561 end: *mut *mut core::ffi::c_char,
26562 out: *mut u16,
26563 base: u8,
26564 ) -> StrintParseError;
26565}
26566unsafe extern "C" {
26567 #[doc = "See `strint_to_uint32`"]
26568 pub fn strint_to_int16(
26569 str_: *const core::ffi::c_char,
26570 end: *mut *mut core::ffi::c_char,
26571 out: *mut i16,
26572 base: u8,
26573 ) -> StrintParseError;
26574}
26575#[repr(C)]
26576#[derive(Debug, Copy, Clone)]
26577pub struct TarArchive {
26578 _unused: [u8; 0],
26579}
26580pub const TarOpenModeRead: TarOpenMode = TarOpenMode(114);
26581pub const TarOpenModeWrite: TarOpenMode = TarOpenMode(119);
26582pub const TarOpenModeReadHeatshrink: TarOpenMode = TarOpenMode(104);
26583#[repr(transparent)]
26584#[doc = "Tar archive open mode"]
26585#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26586pub struct TarOpenMode(pub core::ffi::c_uchar);
26587unsafe extern "C" {
26588 #[doc = "Get expected open mode for archive at the path.\n Used for automatic mode detection based on the file extension.\n\n # Arguments\n\n* `path` (direction in) - Path to the archive\n\n # Returns\n\nopen mode from TarOpenMode enum"]
26589 pub fn tar_archive_get_mode_for_path(path: *const core::ffi::c_char) -> TarOpenMode;
26590}
26591unsafe extern "C" {
26592 #[doc = "Tar archive constructor\n\n # Arguments\n\n* `storage` - Storage API pointer\n\n # Returns\n\nallocated object"]
26593 pub fn tar_archive_alloc(storage: *mut Storage) -> *mut TarArchive;
26594}
26595unsafe extern "C" {
26596 #[doc = "Open tar archive\n\n # Arguments\n\n* `archive` - Tar archive object\n * `path` (direction in) - Path to the tar archive\n * `mode` - Open mode\n\n # Returns\n\ntrue if successful"]
26597 pub fn tar_archive_open(
26598 archive: *mut TarArchive,
26599 path: *const core::ffi::c_char,
26600 mode: TarOpenMode,
26601 ) -> bool;
26602}
26603unsafe extern "C" {
26604 #[doc = "Tar archive destructor\n\n # Arguments\n\n* `archive` - Tar archive object"]
26605 pub fn tar_archive_free(archive: *mut TarArchive);
26606}
26607pub type TarArchiveNameConverter =
26608 ::core::option::Option<unsafe extern "C" fn(arg1: *mut FuriString)>;
26609unsafe extern "C" {
26610 #[doc = "Unpack tar archive to destination\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in read mode\n * `destination` (direction in) - Destination path\n * `converter` - Storage name converter\n\n # Returns\n\ntrue if successful"]
26611 pub fn tar_archive_unpack_to(
26612 archive: *mut TarArchive,
26613 destination: *const core::ffi::c_char,
26614 converter: TarArchiveNameConverter,
26615 ) -> bool;
26616}
26617unsafe extern "C" {
26618 #[doc = "Add file to tar archive\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n * `fs_file_path` (direction in) - Path to the file on the filesystem\n * `archive_fname` (direction in) - Name of the file in the archive\n * `file_size` - Size of the file\n\n # Returns\n\ntrue if successful"]
26619 pub fn tar_archive_add_file(
26620 archive: *mut TarArchive,
26621 fs_file_path: *const core::ffi::c_char,
26622 archive_fname: *const core::ffi::c_char,
26623 file_size: i32,
26624 ) -> bool;
26625}
26626unsafe extern "C" {
26627 #[doc = "Add directory to tar archive\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n * `fs_full_path` - Path to the directory on the filesystem\n * `path_prefix` - Prefix to add to the directory name in the archive\n\n # Returns\n\ntrue if successful"]
26628 pub fn tar_archive_add_dir(
26629 archive: *mut TarArchive,
26630 fs_full_path: *const core::ffi::c_char,
26631 path_prefix: *const core::ffi::c_char,
26632 ) -> bool;
26633}
26634unsafe extern "C" {
26635 #[doc = "Get number of entries in the archive\n\n # Arguments\n\n* `archive` - Tar archive object\n\n # Returns\n\nnumber of entries. -1 on error"]
26636 pub fn tar_archive_get_entries_count(archive: *mut TarArchive) -> i32;
26637}
26638unsafe extern "C" {
26639 #[doc = "Get read progress\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in read mode\n * `processed` (direction in) - Number of processed entries\n * `total` (direction in) - Total number of entries\n\n # Returns\n\ntrue if successful"]
26640 pub fn tar_archive_get_read_progress(
26641 archive: *mut TarArchive,
26642 processed: *mut i32,
26643 total: *mut i32,
26644 ) -> bool;
26645}
26646unsafe extern "C" {
26647 #[doc = "Unpack single file from tar archive\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in read mode\n * `archive_fname` (direction in) - Name of the file in the archive\n * `destination` (direction in) - Destination path\n\n # Returns\n\ntrue if successful"]
26648 pub fn tar_archive_unpack_file(
26649 archive: *mut TarArchive,
26650 archive_fname: *const core::ffi::c_char,
26651 destination: *const core::ffi::c_char,
26652 ) -> bool;
26653}
26654#[doc = "Optional per-entry callback on unpacking\n # Arguments\n\n* `name` - Name of the file or directory\n * `is_directory` - True if the entry is a directory\n * `context` (direction in) - User context\n # Returns\n\ntrue to process the entry, false to skip"]
26655pub type tar_unpack_file_cb = ::core::option::Option<
26656 unsafe extern "C" fn(
26657 name: *const core::ffi::c_char,
26658 is_directory: bool,
26659 context: *mut core::ffi::c_void,
26660 ) -> bool,
26661>;
26662unsafe extern "C" {
26663 #[doc = "Set per-entry callback on unpacking\n # Arguments\n\n* `archive` - Tar archive object\n * `callback` - Callback function\n * `context` (direction in) - User context"]
26664 pub fn tar_archive_set_file_callback(
26665 archive: *mut TarArchive,
26666 callback: tar_unpack_file_cb,
26667 context: *mut core::ffi::c_void,
26668 );
26669}
26670unsafe extern "C" {
26671 #[doc = "Add tar archive directory header\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n * `dirpath` (direction in) - Path to the directory\n\n # Returns\n\ntrue if successful"]
26672 pub fn tar_archive_dir_add_element(
26673 archive: *mut TarArchive,
26674 dirpath: *const core::ffi::c_char,
26675 ) -> bool;
26676}
26677unsafe extern "C" {
26678 #[doc = "Add tar archive file header\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n * `path` (direction in) - Path to the file\n * `data_len` - Size of the file\n\n # Returns\n\ntrue if successful"]
26679 pub fn tar_archive_file_add_header(
26680 archive: *mut TarArchive,
26681 path: *const core::ffi::c_char,
26682 data_len: i32,
26683 ) -> bool;
26684}
26685unsafe extern "C" {
26686 #[doc = "Add tar archive file data block\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n * `data_block` (direction in) - Data block\n * `block_len` - Size of the data block\n\n # Returns\n\ntrue if successful"]
26687 pub fn tar_archive_file_add_data_block(
26688 archive: *mut TarArchive,
26689 data_block: *const u8,
26690 block_len: i32,
26691 ) -> bool;
26692}
26693unsafe extern "C" {
26694 #[doc = "Finalize tar archive file\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n\n # Returns\n\ntrue if successful"]
26695 pub fn tar_archive_file_finalize(archive: *mut TarArchive) -> bool;
26696}
26697unsafe extern "C" {
26698 #[doc = "Store data in tar archive\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n * `path` (direction in) - Path to the file\n * `data` (direction in) - Data to store\n * `data_len` - Size of the data\n\n # Returns\n\ntrue if successful"]
26699 pub fn tar_archive_store_data(
26700 archive: *mut TarArchive,
26701 path: *const core::ffi::c_char,
26702 data: *const u8,
26703 data_len: i32,
26704 ) -> bool;
26705}
26706unsafe extern "C" {
26707 #[doc = "Finalize tar archive\n\n # Arguments\n\n* `archive` - Tar archive object. Must be opened in write mode\n\n # Returns\n\ntrue if successful"]
26708 pub fn tar_archive_finalize(archive: *mut TarArchive) -> bool;
26709}
26710unsafe extern "C" {
26711 #[doc = "Get the index of a int32_t array element which is closest to the given value.\n\n Returned index corresponds to the first element found.\n If no suitable elements were found, the function returns 0.\n\n # Arguments\n\n* `value` - value to be searched.\n * `values` - pointer to the array to perform the search in.\n * `values_count` - array size.\n\n # Returns\n\nvalue's index."]
26712 pub fn value_index_int32(value: i32, values: *const i32, values_count: usize) -> usize;
26713}
26714unsafe extern "C" {
26715 #[doc = "Get the index of a uint32_t array element which is closest to the given value.\n\n Returned index corresponds to the first element found.\n If no suitable elements were found, the function returns 0.\n\n # Arguments\n\n* `value` - value to be searched.\n * `values` - pointer to the array to perform the search in.\n * `values_count` - array size.\n\n # Returns\n\nvalue's index."]
26716 pub fn value_index_uint32(value: u32, values: *const u32, values_count: usize) -> usize;
26717}
26718unsafe extern "C" {
26719 #[doc = "Get the index of a float array element which is closest to the given value.\n\n Returned index corresponds to the first element found.\n If no suitable elements were found, the function returns 0.\n\n # Arguments\n\n* `value` - value to be searched.\n * `values` - pointer to the array to perform the search in.\n * `values_count` - array size.\n\n # Returns\n\nvalue's index."]
26720 pub fn value_index_float(value: f32, values: *const f32, values_count: usize) -> usize;
26721}
26722unsafe extern "C" {
26723 #[doc = "Get the index of a bool array element which is equal to the given value.\n\n Returned index corresponds to the first element found.\n If no suitable elements were found, the function returns 0.\n\n # Arguments\n\n* `value` - value to be searched.\n * `values` - pointer to the array to perform the search in.\n * `values_count` - array size.\n\n # Returns\n\nvalue's index."]
26724 pub fn value_index_bool(value: bool, values: *const bool, values_count: usize) -> usize;
26725}
26726unsafe extern "C" {
26727 #[doc = "Pack uint32 to varint\n # Arguments\n\n* `value` - value from UINT32_MIN to UINT32_MAX\n * `output` - output array, need to be at least 5 bytes long\n # Returns\n\nsize_t"]
26728 pub fn varint_uint32_pack(value: u32, output: *mut u8) -> usize;
26729}
26730unsafe extern "C" {
26731 pub fn varint_uint32_unpack(value: *mut u32, input: *const u8, input_size: usize) -> usize;
26732}
26733unsafe extern "C" {
26734 pub fn varint_uint32_length(value: u32) -> usize;
26735}
26736unsafe extern "C" {
26737 #[doc = "Pack int32 to varint\n # Arguments\n\n* `value` - value from (INT32_MIN / 2 + 1) to INT32_MAX\n * `output` - output array, need to be at least 5 bytes long\n # Returns\n\nsize_t"]
26738 pub fn varint_int32_pack(value: i32, output: *mut u8) -> usize;
26739}
26740unsafe extern "C" {
26741 pub fn varint_int32_unpack(value: *mut i32, input: *const u8, input_size: usize) -> usize;
26742}
26743unsafe extern "C" {
26744 pub fn varint_int32_length(value: i32) -> usize;
26745}
26746pub const BleEventNotAck: BleEventAckStatus = BleEventAckStatus(0);
26747pub const BleEventAckFlowEnable: BleEventAckStatus = BleEventAckStatus(1);
26748pub const BleEventAckFlowDisable: BleEventAckStatus = BleEventAckStatus(2);
26749#[repr(transparent)]
26750#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26751pub struct BleEventAckStatus(pub core::ffi::c_uchar);
26752pub const BleEventFlowDisable: BleEventFlowStatus = BleEventFlowStatus(0);
26753pub const BleEventFlowEnable: BleEventFlowStatus = BleEventFlowStatus(1);
26754#[repr(transparent)]
26755#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26756pub struct BleEventFlowStatus(pub core::ffi::c_uchar);
26757pub type BleSvcEventHandlerCb = ::core::option::Option<
26758 unsafe extern "C" fn(
26759 event: *mut core::ffi::c_void,
26760 context: *mut core::ffi::c_void,
26761 ) -> BleEventAckStatus,
26762>;
26763#[repr(C)]
26764#[derive(Debug, Copy, Clone)]
26765pub struct GapEventHandler {
26766 _unused: [u8; 0],
26767}
26768pub type GapSvcEventHandler = GapEventHandler;
26769unsafe extern "C" {
26770 pub fn ble_event_dispatcher_register_svc_handler(
26771 handler: BleSvcEventHandlerCb,
26772 context: *mut core::ffi::c_void,
26773 ) -> *mut GapSvcEventHandler;
26774}
26775unsafe extern "C" {
26776 pub fn ble_event_dispatcher_unregister_svc_handler(handler: *mut GapSvcEventHandler);
26777}
26778#[repr(C, packed)]
26779#[derive(Copy, Clone)]
26780pub union Service_UUID_t {
26781 #[doc = "16-bit UUID"]
26782 pub Service_UUID_16: u16,
26783 #[doc = "128-bit UUID"]
26784 pub Service_UUID_128: [u8; 16usize],
26785}
26786#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26787const _: () = {
26788 ["Size of Service_UUID_t"][::core::mem::size_of::<Service_UUID_t>() - 16usize];
26789 ["Alignment of Service_UUID_t"][::core::mem::align_of::<Service_UUID_t>() - 1usize];
26790 ["Offset of field: Service_UUID_t::Service_UUID_16"]
26791 [::core::mem::offset_of!(Service_UUID_t, Service_UUID_16) - 0usize];
26792 ["Offset of field: Service_UUID_t::Service_UUID_128"]
26793 [::core::mem::offset_of!(Service_UUID_t, Service_UUID_128) - 0usize];
26794};
26795#[repr(C, packed)]
26796#[derive(Copy, Clone)]
26797pub union Char_UUID_t {
26798 #[doc = "16-bit UUID"]
26799 pub Char_UUID_16: u16,
26800 #[doc = "128-bit UUID"]
26801 pub Char_UUID_128: [u8; 16usize],
26802}
26803#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26804const _: () = {
26805 ["Size of Char_UUID_t"][::core::mem::size_of::<Char_UUID_t>() - 16usize];
26806 ["Alignment of Char_UUID_t"][::core::mem::align_of::<Char_UUID_t>() - 1usize];
26807 ["Offset of field: Char_UUID_t::Char_UUID_16"]
26808 [::core::mem::offset_of!(Char_UUID_t, Char_UUID_16) - 0usize];
26809 ["Offset of field: Char_UUID_t::Char_UUID_128"]
26810 [::core::mem::offset_of!(Char_UUID_t, Char_UUID_128) - 0usize];
26811};
26812#[repr(C, packed)]
26813#[derive(Copy, Clone)]
26814pub union Char_Desc_Uuid_t {
26815 #[doc = "16-bit UUID"]
26816 pub Char_UUID_16: u16,
26817 #[doc = "128-bit UUID"]
26818 pub Char_UUID_128: [u8; 16usize],
26819}
26820#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26821const _: () = {
26822 ["Size of Char_Desc_Uuid_t"][::core::mem::size_of::<Char_Desc_Uuid_t>() - 16usize];
26823 ["Alignment of Char_Desc_Uuid_t"][::core::mem::align_of::<Char_Desc_Uuid_t>() - 1usize];
26824 ["Offset of field: Char_Desc_Uuid_t::Char_UUID_16"]
26825 [::core::mem::offset_of!(Char_Desc_Uuid_t, Char_UUID_16) - 0usize];
26826 ["Offset of field: Char_Desc_Uuid_t::Char_UUID_128"]
26827 [::core::mem::offset_of!(Char_Desc_Uuid_t, Char_UUID_128) - 0usize];
26828};
26829pub type cbBleGattCharacteristicData = ::core::option::Option<
26830 unsafe extern "C" fn(
26831 context: *const core::ffi::c_void,
26832 data: *mut *const u8,
26833 data_len: *mut u16,
26834 ) -> bool,
26835>;
26836pub const FlipperGattCharacteristicDataFixed: BleGattCharacteristicDataType =
26837 BleGattCharacteristicDataType(0);
26838pub const FlipperGattCharacteristicDataCallback: BleGattCharacteristicDataType =
26839 BleGattCharacteristicDataType(1);
26840#[repr(transparent)]
26841#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26842pub struct BleGattCharacteristicDataType(pub core::ffi::c_uchar);
26843#[repr(C)]
26844#[derive(Copy, Clone)]
26845pub struct BleGattCharacteristicDescriptorParams {
26846 pub uuid: Char_Desc_Uuid_t,
26847 pub data_callback: BleGattCharacteristicDescriptorParams__bindgen_ty_1,
26848 pub uuid_type: u8,
26849 pub max_length: u8,
26850 pub security_permissions: u8,
26851 pub access_permissions: u8,
26852 pub gatt_evt_mask: u8,
26853 pub is_variable: u8,
26854}
26855#[repr(C)]
26856#[derive(Debug, Copy, Clone)]
26857pub struct BleGattCharacteristicDescriptorParams__bindgen_ty_1 {
26858 pub fn_: cbBleGattCharacteristicData,
26859 pub context: *const core::ffi::c_void,
26860}
26861#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26862const _: () = {
26863 ["Size of BleGattCharacteristicDescriptorParams__bindgen_ty_1"]
26864 [::core::mem::size_of::<BleGattCharacteristicDescriptorParams__bindgen_ty_1>() - 8usize];
26865 ["Alignment of BleGattCharacteristicDescriptorParams__bindgen_ty_1"]
26866 [::core::mem::align_of::<BleGattCharacteristicDescriptorParams__bindgen_ty_1>() - 4usize];
26867 ["Offset of field: BleGattCharacteristicDescriptorParams__bindgen_ty_1::fn_"][::core::mem::offset_of!(
26868 BleGattCharacteristicDescriptorParams__bindgen_ty_1,
26869 fn_
26870 ) - 0usize];
26871 ["Offset of field: BleGattCharacteristicDescriptorParams__bindgen_ty_1::context"][::core::mem::offset_of!(
26872 BleGattCharacteristicDescriptorParams__bindgen_ty_1,
26873 context
26874 ) - 4usize];
26875};
26876#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26877const _: () = {
26878 ["Size of BleGattCharacteristicDescriptorParams"]
26879 [::core::mem::size_of::<BleGattCharacteristicDescriptorParams>() - 32usize];
26880 ["Alignment of BleGattCharacteristicDescriptorParams"]
26881 [::core::mem::align_of::<BleGattCharacteristicDescriptorParams>() - 4usize];
26882 ["Offset of field: BleGattCharacteristicDescriptorParams::uuid"]
26883 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, uuid) - 0usize];
26884 ["Offset of field: BleGattCharacteristicDescriptorParams::data_callback"]
26885 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, data_callback) - 16usize];
26886 ["Offset of field: BleGattCharacteristicDescriptorParams::uuid_type"]
26887 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, uuid_type) - 24usize];
26888 ["Offset of field: BleGattCharacteristicDescriptorParams::max_length"]
26889 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, max_length) - 25usize];
26890 ["Offset of field: BleGattCharacteristicDescriptorParams::security_permissions"][::core::mem::offset_of!(
26891 BleGattCharacteristicDescriptorParams,
26892 security_permissions
26893 ) - 26usize];
26894 ["Offset of field: BleGattCharacteristicDescriptorParams::access_permissions"][::core::mem::offset_of!(
26895 BleGattCharacteristicDescriptorParams,
26896 access_permissions
26897 ) - 27usize];
26898 ["Offset of field: BleGattCharacteristicDescriptorParams::gatt_evt_mask"]
26899 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, gatt_evt_mask) - 28usize];
26900 ["Offset of field: BleGattCharacteristicDescriptorParams::is_variable"]
26901 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, is_variable) - 29usize];
26902};
26903#[repr(C)]
26904#[derive(Copy, Clone)]
26905pub struct BleGattCharacteristicParams {
26906 pub name: *const core::ffi::c_char,
26907 pub descriptor_params: *mut BleGattCharacteristicDescriptorParams,
26908 pub data: BleGattCharacteristicParams__bindgen_ty_1,
26909 pub uuid: Char_UUID_t,
26910 pub _bitfield_align_1: [u8; 0],
26911 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
26912 pub char_properties: u8,
26913 pub security_permissions: u8,
26914 pub gatt_evt_mask: u8,
26915}
26916#[repr(C)]
26917#[derive(Copy, Clone)]
26918pub union BleGattCharacteristicParams__bindgen_ty_1 {
26919 pub fixed: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26920 pub callback: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26921}
26922#[repr(C)]
26923#[derive(Debug, Copy, Clone)]
26924pub struct BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1 {
26925 pub ptr: *const u8,
26926 pub length: u16,
26927}
26928#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26929const _: () = {
26930 ["Size of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1"][::core::mem::size_of::<
26931 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26932 >() - 8usize];
26933 ["Alignment of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1"][::core::mem::align_of::<
26934 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26935 >() - 4usize];
26936 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1::ptr"][::core::mem::offset_of!(
26937 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26938 ptr
26939 ) - 0usize];
26940 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1::length"][::core::mem::offset_of!(
26941 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26942 length
26943 )
26944 - 4usize];
26945};
26946#[repr(C)]
26947#[derive(Debug, Copy, Clone)]
26948pub struct BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2 {
26949 pub fn_: cbBleGattCharacteristicData,
26950 pub context: *const core::ffi::c_void,
26951}
26952#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26953const _: () = {
26954 ["Size of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2"][::core::mem::size_of::<
26955 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26956 >() - 8usize];
26957 ["Alignment of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2"][::core::mem::align_of::<
26958 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26959 >() - 4usize];
26960 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2::fn_"][::core::mem::offset_of!(
26961 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26962 fn_
26963 ) - 0usize];
26964 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2::context"][::core::mem::offset_of!(
26965 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26966 context
26967 )
26968 - 4usize];
26969};
26970#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26971const _: () = {
26972 ["Size of BleGattCharacteristicParams__bindgen_ty_1"]
26973 [::core::mem::size_of::<BleGattCharacteristicParams__bindgen_ty_1>() - 8usize];
26974 ["Alignment of BleGattCharacteristicParams__bindgen_ty_1"]
26975 [::core::mem::align_of::<BleGattCharacteristicParams__bindgen_ty_1>() - 4usize];
26976 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1::fixed"]
26977 [::core::mem::offset_of!(BleGattCharacteristicParams__bindgen_ty_1, fixed) - 0usize];
26978 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1::callback"]
26979 [::core::mem::offset_of!(BleGattCharacteristicParams__bindgen_ty_1, callback) - 0usize];
26980};
26981#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26982const _: () = {
26983 ["Size of BleGattCharacteristicParams"]
26984 [::core::mem::size_of::<BleGattCharacteristicParams>() - 36usize];
26985 ["Alignment of BleGattCharacteristicParams"]
26986 [::core::mem::align_of::<BleGattCharacteristicParams>() - 4usize];
26987 ["Offset of field: BleGattCharacteristicParams::name"]
26988 [::core::mem::offset_of!(BleGattCharacteristicParams, name) - 0usize];
26989 ["Offset of field: BleGattCharacteristicParams::descriptor_params"]
26990 [::core::mem::offset_of!(BleGattCharacteristicParams, descriptor_params) - 4usize];
26991 ["Offset of field: BleGattCharacteristicParams::data"]
26992 [::core::mem::offset_of!(BleGattCharacteristicParams, data) - 8usize];
26993 ["Offset of field: BleGattCharacteristicParams::uuid"]
26994 [::core::mem::offset_of!(BleGattCharacteristicParams, uuid) - 16usize];
26995 ["Offset of field: BleGattCharacteristicParams::char_properties"]
26996 [::core::mem::offset_of!(BleGattCharacteristicParams, char_properties) - 33usize];
26997 ["Offset of field: BleGattCharacteristicParams::security_permissions"]
26998 [::core::mem::offset_of!(BleGattCharacteristicParams, security_permissions) - 34usize];
26999 ["Offset of field: BleGattCharacteristicParams::gatt_evt_mask"]
27000 [::core::mem::offset_of!(BleGattCharacteristicParams, gatt_evt_mask) - 35usize];
27001};
27002impl BleGattCharacteristicParams {
27003 #[inline]
27004 pub fn data_prop_type(&self) -> BleGattCharacteristicDataType {
27005 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
27006 }
27007 #[inline]
27008 pub fn set_data_prop_type(&mut self, val: BleGattCharacteristicDataType) {
27009 unsafe {
27010 let val: u8 = ::core::mem::transmute(val);
27011 self._bitfield_1.set(0usize, 2u8, val as u64)
27012 }
27013 }
27014 #[inline]
27015 pub unsafe fn data_prop_type_raw(this: *const Self) -> BleGattCharacteristicDataType {
27016 unsafe {
27017 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
27018 ::core::ptr::addr_of!((*this)._bitfield_1),
27019 0usize,
27020 2u8,
27021 ) as u8)
27022 }
27023 }
27024 #[inline]
27025 pub unsafe fn set_data_prop_type_raw(this: *mut Self, val: BleGattCharacteristicDataType) {
27026 unsafe {
27027 let val: u8 = ::core::mem::transmute(val);
27028 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
27029 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
27030 0usize,
27031 2u8,
27032 val as u64,
27033 )
27034 }
27035 }
27036 #[inline]
27037 pub fn is_variable(&self) -> u8 {
27038 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u8) }
27039 }
27040 #[inline]
27041 pub fn set_is_variable(&mut self, val: u8) {
27042 unsafe {
27043 let val: u8 = ::core::mem::transmute(val);
27044 self._bitfield_1.set(2usize, 2u8, val as u64)
27045 }
27046 }
27047 #[inline]
27048 pub unsafe fn is_variable_raw(this: *const Self) -> u8 {
27049 unsafe {
27050 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
27051 ::core::ptr::addr_of!((*this)._bitfield_1),
27052 2usize,
27053 2u8,
27054 ) as u8)
27055 }
27056 }
27057 #[inline]
27058 pub unsafe fn set_is_variable_raw(this: *mut Self, val: u8) {
27059 unsafe {
27060 let val: u8 = ::core::mem::transmute(val);
27061 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
27062 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
27063 2usize,
27064 2u8,
27065 val as u64,
27066 )
27067 }
27068 }
27069 #[inline]
27070 pub fn uuid_type(&self) -> u8 {
27071 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) }
27072 }
27073 #[inline]
27074 pub fn set_uuid_type(&mut self, val: u8) {
27075 unsafe {
27076 let val: u8 = ::core::mem::transmute(val);
27077 self._bitfield_1.set(4usize, 2u8, val as u64)
27078 }
27079 }
27080 #[inline]
27081 pub unsafe fn uuid_type_raw(this: *const Self) -> u8 {
27082 unsafe {
27083 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
27084 ::core::ptr::addr_of!((*this)._bitfield_1),
27085 4usize,
27086 2u8,
27087 ) as u8)
27088 }
27089 }
27090 #[inline]
27091 pub unsafe fn set_uuid_type_raw(this: *mut Self, val: u8) {
27092 unsafe {
27093 let val: u8 = ::core::mem::transmute(val);
27094 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
27095 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
27096 4usize,
27097 2u8,
27098 val as u64,
27099 )
27100 }
27101 }
27102 #[inline]
27103 pub fn new_bitfield_1(
27104 data_prop_type: BleGattCharacteristicDataType,
27105 is_variable: u8,
27106 uuid_type: u8,
27107 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
27108 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
27109 __bindgen_bitfield_unit.set(0usize, 2u8, {
27110 let data_prop_type: u8 = unsafe { ::core::mem::transmute(data_prop_type) };
27111 data_prop_type as u64
27112 });
27113 __bindgen_bitfield_unit.set(2usize, 2u8, {
27114 let is_variable: u8 = unsafe { ::core::mem::transmute(is_variable) };
27115 is_variable as u64
27116 });
27117 __bindgen_bitfield_unit.set(4usize, 2u8, {
27118 let uuid_type: u8 = unsafe { ::core::mem::transmute(uuid_type) };
27119 uuid_type as u64
27120 });
27121 __bindgen_bitfield_unit
27122 }
27123}
27124#[repr(C)]
27125#[derive(Debug, Copy, Clone)]
27126pub struct BleGattCharacteristicInstance {
27127 pub characteristic: *const BleGattCharacteristicParams,
27128 pub handle: u16,
27129 pub descriptor_handle: u16,
27130}
27131#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27132const _: () = {
27133 ["Size of BleGattCharacteristicInstance"]
27134 [::core::mem::size_of::<BleGattCharacteristicInstance>() - 8usize];
27135 ["Alignment of BleGattCharacteristicInstance"]
27136 [::core::mem::align_of::<BleGattCharacteristicInstance>() - 4usize];
27137 ["Offset of field: BleGattCharacteristicInstance::characteristic"]
27138 [::core::mem::offset_of!(BleGattCharacteristicInstance, characteristic) - 0usize];
27139 ["Offset of field: BleGattCharacteristicInstance::handle"]
27140 [::core::mem::offset_of!(BleGattCharacteristicInstance, handle) - 4usize];
27141 ["Offset of field: BleGattCharacteristicInstance::descriptor_handle"]
27142 [::core::mem::offset_of!(BleGattCharacteristicInstance, descriptor_handle) - 6usize];
27143};
27144unsafe extern "C" {
27145 pub fn ble_gatt_characteristic_init(
27146 svc_handle: u16,
27147 char_descriptor: *const BleGattCharacteristicParams,
27148 char_instance: *mut BleGattCharacteristicInstance,
27149 );
27150}
27151unsafe extern "C" {
27152 pub fn ble_gatt_characteristic_delete(
27153 svc_handle: u16,
27154 char_instance: *mut BleGattCharacteristicInstance,
27155 );
27156}
27157unsafe extern "C" {
27158 pub fn ble_gatt_characteristic_update(
27159 svc_handle: u16,
27160 char_instance: *mut BleGattCharacteristicInstance,
27161 source: *const core::ffi::c_void,
27162 ) -> bool;
27163}
27164unsafe extern "C" {
27165 pub fn ble_gatt_service_add(
27166 Service_UUID_Type: u8,
27167 Service_UUID: *const Service_UUID_t,
27168 Service_Type: u8,
27169 Max_Attribute_Records: u8,
27170 Service_Handle: *mut u16,
27171 ) -> bool;
27172}
27173unsafe extern "C" {
27174 pub fn ble_gatt_service_delete(svc_handle: u16) -> bool;
27175}
27176pub const SerialServiceEventTypeDataReceived: SerialServiceEventType = SerialServiceEventType(0);
27177pub const SerialServiceEventTypeDataSent: SerialServiceEventType = SerialServiceEventType(1);
27178pub const SerialServiceEventTypesBleResetRequest: SerialServiceEventType =
27179 SerialServiceEventType(2);
27180#[repr(transparent)]
27181#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27182pub struct SerialServiceEventType(pub core::ffi::c_uchar);
27183#[repr(C)]
27184#[derive(Debug, Copy, Clone)]
27185pub struct SerialServiceData {
27186 pub buffer: *mut u8,
27187 pub size: u16,
27188}
27189#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27190const _: () = {
27191 ["Size of SerialServiceData"][::core::mem::size_of::<SerialServiceData>() - 8usize];
27192 ["Alignment of SerialServiceData"][::core::mem::align_of::<SerialServiceData>() - 4usize];
27193 ["Offset of field: SerialServiceData::buffer"]
27194 [::core::mem::offset_of!(SerialServiceData, buffer) - 0usize];
27195 ["Offset of field: SerialServiceData::size"]
27196 [::core::mem::offset_of!(SerialServiceData, size) - 4usize];
27197};
27198#[repr(C)]
27199#[derive(Debug, Copy, Clone)]
27200pub struct SerialServiceEvent {
27201 pub event: SerialServiceEventType,
27202 pub data: SerialServiceData,
27203}
27204#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27205const _: () = {
27206 ["Size of SerialServiceEvent"][::core::mem::size_of::<SerialServiceEvent>() - 12usize];
27207 ["Alignment of SerialServiceEvent"][::core::mem::align_of::<SerialServiceEvent>() - 4usize];
27208 ["Offset of field: SerialServiceEvent::event"]
27209 [::core::mem::offset_of!(SerialServiceEvent, event) - 0usize];
27210 ["Offset of field: SerialServiceEvent::data"]
27211 [::core::mem::offset_of!(SerialServiceEvent, data) - 4usize];
27212};
27213pub type SerialServiceEventCallback = ::core::option::Option<
27214 unsafe extern "C" fn(event: SerialServiceEvent, context: *mut core::ffi::c_void) -> u16,
27215>;
27216#[repr(C)]
27217#[derive(Debug, Copy, Clone)]
27218pub struct BleServiceSerial {
27219 _unused: [u8; 0],
27220}
27221unsafe extern "C" {
27222 pub fn ble_svc_serial_start() -> *mut BleServiceSerial;
27223}
27224unsafe extern "C" {
27225 pub fn ble_svc_serial_stop(service: *mut BleServiceSerial);
27226}
27227unsafe extern "C" {
27228 pub fn ble_svc_serial_set_callbacks(
27229 service: *mut BleServiceSerial,
27230 buff_size: u16,
27231 callback: SerialServiceEventCallback,
27232 context: *mut core::ffi::c_void,
27233 );
27234}
27235unsafe extern "C" {
27236 pub fn ble_svc_serial_set_rpc_active(service: *mut BleServiceSerial, active: bool);
27237}
27238unsafe extern "C" {
27239 pub fn ble_svc_serial_notify_buffer_is_empty(service: *mut BleServiceSerial);
27240}
27241unsafe extern "C" {
27242 pub fn ble_svc_serial_update_tx(
27243 service: *mut BleServiceSerial,
27244 data: *mut u8,
27245 data_len: u16,
27246 ) -> bool;
27247}
27248pub const FuriHalBtSerialRpcStatusNotActive: FuriHalBtSerialRpcStatus = FuriHalBtSerialRpcStatus(0);
27249pub const FuriHalBtSerialRpcStatusActive: FuriHalBtSerialRpcStatus = FuriHalBtSerialRpcStatus(1);
27250#[repr(transparent)]
27251#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27252pub struct FuriHalBtSerialRpcStatus(pub core::ffi::c_uchar);
27253#[doc = "Serial service callback type"]
27254pub type FuriHalBtSerialCallback = SerialServiceEventCallback;
27255unsafe extern "C" {
27256 #[doc = "Serial profile descriptor"]
27257 pub static ble_profile_serial: *const FuriHalBleProfileTemplate;
27258}
27259unsafe extern "C" {
27260 #[doc = "Send data through BLE\n\n # Arguments\n\n* `profile` - Profile instance\n * `data` - data buffer\n * `size` - data buffer size\n\n # Returns\n\ntrue on success"]
27261 pub fn ble_profile_serial_tx(
27262 profile: *mut FuriHalBleProfileBase,
27263 data: *mut u8,
27264 size: u16,
27265 ) -> bool;
27266}
27267unsafe extern "C" {
27268 #[doc = "Set BLE RPC status\n\n # Arguments\n\n* `profile` - Profile instance\n * `active` - true if RPC is active"]
27269 pub fn ble_profile_serial_set_rpc_active(profile: *mut FuriHalBleProfileBase, active: bool);
27270}
27271unsafe extern "C" {
27272 #[doc = "Notify that application buffer is empty\n # Arguments\n\n* `profile` - Profile instance"]
27273 pub fn ble_profile_serial_notify_buffer_is_empty(profile: *mut FuriHalBleProfileBase);
27274}
27275unsafe extern "C" {
27276 #[doc = "Set Serial service events callback\n\n # Arguments\n\n* `profile` - Profile instance\n * `buffer_size` - Applicaition buffer size\n * `calback` - FuriHalBtSerialCallback instance\n * `context` - pointer to context"]
27277 pub fn ble_profile_serial_set_event_callback(
27278 profile: *mut FuriHalBleProfileBase,
27279 buff_size: u16,
27280 callback: FuriHalBtSerialCallback,
27281 context: *mut core::ffi::c_void,
27282 );
27283}
27284#[repr(C)]
27285#[derive(Debug, Copy, Clone)]
27286pub struct BleServiceBattery {
27287 _unused: [u8; 0],
27288}
27289unsafe extern "C" {
27290 pub fn ble_svc_battery_start(auto_update: bool) -> *mut BleServiceBattery;
27291}
27292unsafe extern "C" {
27293 pub fn ble_svc_battery_stop(service: *mut BleServiceBattery);
27294}
27295unsafe extern "C" {
27296 pub fn ble_svc_battery_update_level(service: *mut BleServiceBattery, battery_level: u8)
27297 -> bool;
27298}
27299unsafe extern "C" {
27300 pub fn ble_svc_battery_update_power_state(
27301 service: *mut BleServiceBattery,
27302 charging: bool,
27303 ) -> bool;
27304}
27305unsafe extern "C" {
27306 pub fn ble_svc_battery_state_update(battery_level: *mut u8, charging: *mut bool);
27307}
27308#[repr(C)]
27309#[derive(Debug, Copy, Clone)]
27310pub struct BleServiceDevInfo {
27311 _unused: [u8; 0],
27312}
27313unsafe extern "C" {
27314 pub fn ble_svc_dev_info_start() -> *mut BleServiceDevInfo;
27315}
27316unsafe extern "C" {
27317 pub fn ble_svc_dev_info_stop(service: *mut BleServiceDevInfo);
27318}
27319pub const CdcStateDisconnected: CdcState = CdcState(0);
27320pub const CdcStateConnected: CdcState = CdcState(1);
27321#[repr(transparent)]
27322#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27323pub struct CdcState(pub core::ffi::c_uchar);
27324pub const CdcCtrlLineDTR: CdcCtrlLine = CdcCtrlLine(1);
27325pub const CdcCtrlLineRTS: CdcCtrlLine = CdcCtrlLine(2);
27326#[repr(transparent)]
27327#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27328pub struct CdcCtrlLine(pub core::ffi::c_uchar);
27329#[repr(C)]
27330#[derive(Debug, Copy, Clone)]
27331pub struct CdcCallbacks {
27332 pub tx_ep_callback:
27333 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>,
27334 pub rx_ep_callback:
27335 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>,
27336 pub state_callback: ::core::option::Option<
27337 unsafe extern "C" fn(context: *mut core::ffi::c_void, state: CdcState),
27338 >,
27339 pub ctrl_line_callback: ::core::option::Option<
27340 unsafe extern "C" fn(context: *mut core::ffi::c_void, ctrl_lines: CdcCtrlLine),
27341 >,
27342 pub config_callback: ::core::option::Option<
27343 unsafe extern "C" fn(context: *mut core::ffi::c_void, config: *mut usb_cdc_line_coding),
27344 >,
27345}
27346#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27347const _: () = {
27348 ["Size of CdcCallbacks"][::core::mem::size_of::<CdcCallbacks>() - 20usize];
27349 ["Alignment of CdcCallbacks"][::core::mem::align_of::<CdcCallbacks>() - 4usize];
27350 ["Offset of field: CdcCallbacks::tx_ep_callback"]
27351 [::core::mem::offset_of!(CdcCallbacks, tx_ep_callback) - 0usize];
27352 ["Offset of field: CdcCallbacks::rx_ep_callback"]
27353 [::core::mem::offset_of!(CdcCallbacks, rx_ep_callback) - 4usize];
27354 ["Offset of field: CdcCallbacks::state_callback"]
27355 [::core::mem::offset_of!(CdcCallbacks, state_callback) - 8usize];
27356 ["Offset of field: CdcCallbacks::ctrl_line_callback"]
27357 [::core::mem::offset_of!(CdcCallbacks, ctrl_line_callback) - 12usize];
27358 ["Offset of field: CdcCallbacks::config_callback"]
27359 [::core::mem::offset_of!(CdcCallbacks, config_callback) - 16usize];
27360};
27361unsafe extern "C" {
27362 pub fn furi_hal_cdc_set_callbacks(
27363 if_num: u8,
27364 cb: *mut CdcCallbacks,
27365 context: *mut core::ffi::c_void,
27366 );
27367}
27368unsafe extern "C" {
27369 pub fn furi_hal_cdc_get_port_settings(if_num: u8) -> *mut usb_cdc_line_coding;
27370}
27371unsafe extern "C" {
27372 pub fn furi_hal_cdc_get_ctrl_line_state(if_num: u8) -> u8;
27373}
27374unsafe extern "C" {
27375 pub fn furi_hal_cdc_send(if_num: u8, buf: *mut u8, len: u16);
27376}
27377unsafe extern "C" {
27378 pub fn furi_hal_cdc_receive(if_num: u8, buf: *mut u8, max_len: u16) -> i32;
27379}
27380unsafe extern "C" {
27381 pub fn __errno() -> *mut core::ffi::c_int;
27382}
27383unsafe extern "C" {
27384 pub fn __cxa_pure_virtual();
27385}
27386unsafe extern "C" {
27387 pub fn __clear_cache(arg1: *mut core::ffi::c_void, arg2: *mut core::ffi::c_void);
27388}
27389unsafe extern "C" {
27390 pub fn __aeabi_uldivmod(arg1: u64, arg2: u64) -> *mut core::ffi::c_void;
27391}
27392unsafe extern "C" {
27393 pub fn __aeabi_f2d(arg1: f32) -> f64;
27394}
27395unsafe extern "C" {
27396 #[doc = "Init memory pool manager"]
27397 pub fn furi_hal_memory_init();
27398}
27399unsafe extern "C" {
27400 #[doc = "Allocate memory from separate memory pool. That memory can't be freed.\n\n # Arguments\n\n* `size` -\n # Returns\n\nvoid*"]
27401 pub fn furi_hal_memory_alloc(size: usize) -> *mut core::ffi::c_void;
27402}
27403unsafe extern "C" {
27404 #[doc = "Get free memory pool size\n\n # Returns\n\nsize_t"]
27405 pub fn furi_hal_memory_get_free() -> usize;
27406}
27407unsafe extern "C" {
27408 #[doc = "Get max free block size from memory pool\n\n # Returns\n\nsize_t"]
27409 pub fn furi_hal_memory_max_pool_block() -> usize;
27410}
27411pub const FuriHalMpuRegionNULL: FuriHalMpuRegion = FuriHalMpuRegion(0);
27412pub const FuriHalMpuRegionMainStack: FuriHalMpuRegion = FuriHalMpuRegion(1);
27413pub const FuriHalMpuRegionThreadStack: FuriHalMpuRegion = FuriHalMpuRegion(2);
27414pub const FuriHalMpuRegion3: FuriHalMpuRegion = FuriHalMpuRegion(3);
27415pub const FuriHalMpuRegion4: FuriHalMpuRegion = FuriHalMpuRegion(4);
27416pub const FuriHalMpuRegion5: FuriHalMpuRegion = FuriHalMpuRegion(5);
27417pub const FuriHalMpuRegion6: FuriHalMpuRegion = FuriHalMpuRegion(6);
27418pub const FuriHalMpuRegion7: FuriHalMpuRegion = FuriHalMpuRegion(7);
27419#[repr(transparent)]
27420#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27421pub struct FuriHalMpuRegion(pub core::ffi::c_uchar);
27422pub const FuriHalMPURegionSize32B: FuriHalMPURegionSize = FuriHalMPURegionSize(4);
27423pub const FuriHalMPURegionSize64B: FuriHalMPURegionSize = FuriHalMPURegionSize(5);
27424pub const FuriHalMPURegionSize128B: FuriHalMPURegionSize = FuriHalMPURegionSize(6);
27425pub const FuriHalMPURegionSize256B: FuriHalMPURegionSize = FuriHalMPURegionSize(7);
27426pub const FuriHalMPURegionSize512B: FuriHalMPURegionSize = FuriHalMPURegionSize(8);
27427pub const FuriHalMPURegionSize1KB: FuriHalMPURegionSize = FuriHalMPURegionSize(9);
27428pub const FuriHalMPURegionSize2KB: FuriHalMPURegionSize = FuriHalMPURegionSize(10);
27429pub const FuriHalMPURegionSize4KB: FuriHalMPURegionSize = FuriHalMPURegionSize(11);
27430pub const FuriHalMPURegionSize8KB: FuriHalMPURegionSize = FuriHalMPURegionSize(12);
27431pub const FuriHalMPURegionSize16KB: FuriHalMPURegionSize = FuriHalMPURegionSize(13);
27432pub const FuriHalMPURegionSize32KB: FuriHalMPURegionSize = FuriHalMPURegionSize(14);
27433pub const FuriHalMPURegionSize64KB: FuriHalMPURegionSize = FuriHalMPURegionSize(15);
27434pub const FuriHalMPURegionSize128KB: FuriHalMPURegionSize = FuriHalMPURegionSize(16);
27435pub const FuriHalMPURegionSize256KB: FuriHalMPURegionSize = FuriHalMPURegionSize(17);
27436pub const FuriHalMPURegionSize512KB: FuriHalMPURegionSize = FuriHalMPURegionSize(18);
27437pub const FuriHalMPURegionSize1MB: FuriHalMPURegionSize = FuriHalMPURegionSize(19);
27438pub const FuriHalMPURegionSize2MB: FuriHalMPURegionSize = FuriHalMPURegionSize(20);
27439pub const FuriHalMPURegionSize4MB: FuriHalMPURegionSize = FuriHalMPURegionSize(21);
27440pub const FuriHalMPURegionSize8MB: FuriHalMPURegionSize = FuriHalMPURegionSize(22);
27441pub const FuriHalMPURegionSize16MB: FuriHalMPURegionSize = FuriHalMPURegionSize(23);
27442pub const FuriHalMPURegionSize32MB: FuriHalMPURegionSize = FuriHalMPURegionSize(24);
27443pub const FuriHalMPURegionSize64MB: FuriHalMPURegionSize = FuriHalMPURegionSize(25);
27444pub const FuriHalMPURegionSize128MB: FuriHalMPURegionSize = FuriHalMPURegionSize(26);
27445pub const FuriHalMPURegionSize256MB: FuriHalMPURegionSize = FuriHalMPURegionSize(27);
27446pub const FuriHalMPURegionSize512MB: FuriHalMPURegionSize = FuriHalMPURegionSize(28);
27447pub const FuriHalMPURegionSize1GB: FuriHalMPURegionSize = FuriHalMPURegionSize(29);
27448pub const FuriHalMPURegionSize2GB: FuriHalMPURegionSize = FuriHalMPURegionSize(30);
27449pub const FuriHalMPURegionSize4GB: FuriHalMPURegionSize = FuriHalMPURegionSize(31);
27450#[repr(transparent)]
27451#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27452pub struct FuriHalMPURegionSize(pub core::ffi::c_uchar);
27453unsafe extern "C" {
27454 #[doc = "Enable memory protection unit"]
27455 pub fn furi_hal_mpu_enable();
27456}
27457unsafe extern "C" {
27458 #[doc = "Disable memory protection unit"]
27459 pub fn furi_hal_mpu_disable();
27460}
27461unsafe extern "C" {
27462 pub fn furi_hal_mpu_protect_no_access(
27463 region: FuriHalMpuRegion,
27464 address: u32,
27465 size: FuriHalMPURegionSize,
27466 );
27467}
27468unsafe extern "C" {
27469 pub fn furi_hal_mpu_protect_read_only(
27470 region: FuriHalMpuRegion,
27471 address: u32,
27472 size: FuriHalMPURegionSize,
27473 );
27474}
27475unsafe extern "C" {
27476 pub fn furi_hal_mpu_protect_disable(region: FuriHalMpuRegion);
27477}
27478pub const HidU2fDisconnected: HidU2fEvent = HidU2fEvent(0);
27479pub const HidU2fConnected: HidU2fEvent = HidU2fEvent(1);
27480pub const HidU2fRequest: HidU2fEvent = HidU2fEvent(2);
27481#[repr(transparent)]
27482#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27483pub struct HidU2fEvent(pub core::ffi::c_uchar);
27484pub type HidU2fCallback =
27485 ::core::option::Option<unsafe extern "C" fn(ev: HidU2fEvent, context: *mut core::ffi::c_void)>;
27486unsafe extern "C" {
27487 #[doc = "Get HID U2F connection state\n\n # Returns\n\ntrue / false"]
27488 pub fn furi_hal_hid_u2f_is_connected() -> bool;
27489}
27490unsafe extern "C" {
27491 #[doc = "Set HID U2F event callback\n\n # Arguments\n\n* `cb` - callback\n * `ctx` - callback context"]
27492 pub fn furi_hal_hid_u2f_set_callback(cb: HidU2fCallback, ctx: *mut core::ffi::c_void);
27493}
27494unsafe extern "C" {
27495 #[doc = "Get received U2F HID packet\n"]
27496 pub fn furi_hal_hid_u2f_get_request(data: *mut u8) -> u32;
27497}
27498unsafe extern "C" {
27499 #[doc = "Send U2F HID response packet\n\n # Arguments\n\n* `data` - response data\n * `len` - packet length"]
27500 pub fn furi_hal_hid_u2f_send_response(data: *mut u8, len: u8);
27501}