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 = 5767170;
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}
6369pub const FuriHalUsbStateEventReset: FuriHalUsbStateEvent = FuriHalUsbStateEvent(0);
6370pub const FuriHalUsbStateEventWakeup: FuriHalUsbStateEvent = FuriHalUsbStateEvent(1);
6371pub const FuriHalUsbStateEventSuspend: FuriHalUsbStateEvent = FuriHalUsbStateEvent(2);
6372pub const FuriHalUsbStateEventDescriptorRequest: FuriHalUsbStateEvent = FuriHalUsbStateEvent(3);
6373#[repr(transparent)]
6374#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6375pub struct FuriHalUsbStateEvent(pub core::ffi::c_uchar);
6376pub type FuriHalUsbStateCallback = ::core::option::Option<
6377 unsafe extern "C" fn(state: FuriHalUsbStateEvent, context: *mut core::ffi::c_void),
6378>;
6379unsafe extern "C" {
6380 #[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"]
6381 pub fn furi_hal_usb_set_config(
6382 new_if: *mut FuriHalUsbInterface,
6383 ctx: *mut core::ffi::c_void,
6384 ) -> bool;
6385}
6386unsafe extern "C" {
6387 #[doc = "Get USB device configuration\n\n # Returns\n\ncurrent USB device mode"]
6388 pub fn furi_hal_usb_get_config() -> *mut FuriHalUsbInterface;
6389}
6390unsafe extern "C" {
6391 #[doc = "Lock USB device mode switch"]
6392 pub fn furi_hal_usb_lock();
6393}
6394unsafe extern "C" {
6395 #[doc = "Unlock USB device mode switch"]
6396 pub fn furi_hal_usb_unlock();
6397}
6398unsafe extern "C" {
6399 #[doc = "Check if USB device mode switch locked\n\n # Returns\n\nlock state"]
6400 pub fn furi_hal_usb_is_locked() -> bool;
6401}
6402unsafe extern "C" {
6403 #[doc = "Disable USB device"]
6404 pub fn furi_hal_usb_disable();
6405}
6406unsafe extern "C" {
6407 #[doc = "Enable USB device"]
6408 pub fn furi_hal_usb_enable();
6409}
6410unsafe extern "C" {
6411 #[doc = "Set USB state callback"]
6412 pub fn furi_hal_usb_set_state_callback(
6413 cb: FuriHalUsbStateCallback,
6414 ctx: *mut core::ffi::c_void,
6415 );
6416}
6417unsafe extern "C" {
6418 #[doc = "Restart USB device"]
6419 pub fn furi_hal_usb_reinit();
6420}
6421#[repr(C)]
6422#[derive(Debug, Copy, Clone)]
6423pub struct FuriHalUsbHidConfig {
6424 pub vid: u32,
6425 pub pid: u32,
6426 pub manuf: [core::ffi::c_char; 32usize],
6427 pub product: [core::ffi::c_char; 32usize],
6428}
6429#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6430const _: () = {
6431 ["Size of FuriHalUsbHidConfig"][::core::mem::size_of::<FuriHalUsbHidConfig>() - 72usize];
6432 ["Alignment of FuriHalUsbHidConfig"][::core::mem::align_of::<FuriHalUsbHidConfig>() - 4usize];
6433 ["Offset of field: FuriHalUsbHidConfig::vid"]
6434 [::core::mem::offset_of!(FuriHalUsbHidConfig, vid) - 0usize];
6435 ["Offset of field: FuriHalUsbHidConfig::pid"]
6436 [::core::mem::offset_of!(FuriHalUsbHidConfig, pid) - 4usize];
6437 ["Offset of field: FuriHalUsbHidConfig::manuf"]
6438 [::core::mem::offset_of!(FuriHalUsbHidConfig, manuf) - 8usize];
6439 ["Offset of field: FuriHalUsbHidConfig::product"]
6440 [::core::mem::offset_of!(FuriHalUsbHidConfig, product) - 40usize];
6441};
6442pub type HidStateCallback =
6443 ::core::option::Option<unsafe extern "C" fn(state: bool, context: *mut core::ffi::c_void)>;
6444unsafe extern "C" {
6445 #[doc = "Get USB HID connection state\n\n # Returns\n\ntrue / false"]
6446 pub fn furi_hal_hid_is_connected() -> bool;
6447}
6448unsafe extern "C" {
6449 #[doc = "Get USB HID keyboard leds state\n\n # Returns\n\nleds state"]
6450 pub fn furi_hal_hid_get_led_state() -> u8;
6451}
6452unsafe extern "C" {
6453 #[doc = "Set USB HID connect/disconnect callback\n\n # Arguments\n\n* `cb` - callback\n * `ctx` - callback context"]
6454 pub fn furi_hal_hid_set_state_callback(cb: HidStateCallback, ctx: *mut core::ffi::c_void);
6455}
6456unsafe extern "C" {
6457 #[doc = "Set the following key to pressed state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6458 pub fn furi_hal_hid_kb_press(button: u16) -> bool;
6459}
6460unsafe extern "C" {
6461 #[doc = "Set the following key to released state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6462 pub fn furi_hal_hid_kb_release(button: u16) -> bool;
6463}
6464unsafe extern "C" {
6465 #[doc = "Clear all pressed keys and send HID report\n"]
6466 pub fn furi_hal_hid_kb_release_all() -> bool;
6467}
6468unsafe extern "C" {
6469 #[doc = "Set mouse movement and send HID report\n\n # Arguments\n\n* `dx` - x coordinate delta\n * `dy` - y coordinate delta"]
6470 pub fn furi_hal_hid_mouse_move(dx: i8, dy: i8) -> bool;
6471}
6472unsafe extern "C" {
6473 #[doc = "Set mouse button to pressed state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6474 pub fn furi_hal_hid_mouse_press(button: u8) -> bool;
6475}
6476unsafe extern "C" {
6477 #[doc = "Set mouse button to released state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6478 pub fn furi_hal_hid_mouse_release(button: u8) -> bool;
6479}
6480unsafe extern "C" {
6481 #[doc = "Set mouse wheel position and send HID report\n\n # Arguments\n\n* `delta` - number of scroll steps"]
6482 pub fn furi_hal_hid_mouse_scroll(delta: i8) -> bool;
6483}
6484unsafe extern "C" {
6485 #[doc = "Set the following consumer key to pressed state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6486 pub fn furi_hal_hid_consumer_key_press(button: u16) -> bool;
6487}
6488unsafe extern "C" {
6489 #[doc = "Set the following consumer key to released state and send HID report\n\n # Arguments\n\n* `button` - key code"]
6490 pub fn furi_hal_hid_consumer_key_release(button: u16) -> bool;
6491}
6492unsafe extern "C" {
6493 #[doc = "Clear all pressed consumer keys and send HID report\n"]
6494 pub fn furi_hal_hid_consumer_key_release_all() -> bool;
6495}
6496pub const FuriHalSerialIdUsart: FuriHalSerialId = FuriHalSerialId(0);
6497pub const FuriHalSerialIdLpuart: FuriHalSerialId = FuriHalSerialId(1);
6498pub const FuriHalSerialIdMax: FuriHalSerialId = FuriHalSerialId(2);
6499#[repr(transparent)]
6500#[doc = "UART channels"]
6501#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6502pub struct FuriHalSerialId(pub core::ffi::c_uchar);
6503pub const FuriHalSerialDirectionTx: FuriHalSerialDirection = FuriHalSerialDirection(0);
6504pub const FuriHalSerialDirectionRx: FuriHalSerialDirection = FuriHalSerialDirection(1);
6505pub const FuriHalSerialDirectionMax: FuriHalSerialDirection = FuriHalSerialDirection(2);
6506#[repr(transparent)]
6507#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6508pub struct FuriHalSerialDirection(pub core::ffi::c_uchar);
6509pub const FuriHalSerialDataBits6: FuriHalSerialDataBits = FuriHalSerialDataBits(0);
6510pub const FuriHalSerialDataBits7: FuriHalSerialDataBits = FuriHalSerialDataBits(1);
6511pub const FuriHalSerialDataBits8: FuriHalSerialDataBits = FuriHalSerialDataBits(2);
6512pub const FuriHalSerialDataBits9: FuriHalSerialDataBits = FuriHalSerialDataBits(3);
6513pub const FuriHalSerialDataBitsMax: FuriHalSerialDataBits = FuriHalSerialDataBits(4);
6514#[repr(transparent)]
6515#[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"]
6516#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6517pub struct FuriHalSerialDataBits(pub core::ffi::c_uchar);
6518pub const FuriHalSerialParityNone: FuriHalSerialParity = FuriHalSerialParity(0);
6519pub const FuriHalSerialParityEven: FuriHalSerialParity = FuriHalSerialParity(1);
6520pub const FuriHalSerialParityOdd: FuriHalSerialParity = FuriHalSerialParity(2);
6521pub const FuriHalSerialParityMax: FuriHalSerialParity = FuriHalSerialParity(3);
6522#[repr(transparent)]
6523#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6524pub struct FuriHalSerialParity(pub core::ffi::c_uchar);
6525pub const FuriHalSerialStopBits0_5: FuriHalSerialStopBits = FuriHalSerialStopBits(0);
6526pub const FuriHalSerialStopBits1: FuriHalSerialStopBits = FuriHalSerialStopBits(1);
6527pub const FuriHalSerialStopBits1_5: FuriHalSerialStopBits = FuriHalSerialStopBits(2);
6528pub const FuriHalSerialStopBits2: FuriHalSerialStopBits = FuriHalSerialStopBits(3);
6529pub const FuriHalSerialStopBits2Max: FuriHalSerialStopBits = FuriHalSerialStopBits(4);
6530#[repr(transparent)]
6531#[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)"]
6532#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6533pub struct FuriHalSerialStopBits(pub core::ffi::c_uchar);
6534#[repr(C)]
6535#[derive(Debug, Copy, Clone)]
6536pub struct FuriHalSerialHandle {
6537 _unused: [u8; 0],
6538}
6539unsafe extern "C" {
6540 #[doc = "Initialize Serial Control"]
6541 pub fn furi_hal_serial_control_init();
6542}
6543unsafe extern "C" {
6544 #[doc = "De-Initialize Serial Control"]
6545 pub fn furi_hal_serial_control_deinit();
6546}
6547unsafe extern "C" {
6548 #[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"]
6549 pub fn furi_hal_serial_control_acquire(serial_id: FuriHalSerialId) -> *mut FuriHalSerialHandle;
6550}
6551unsafe extern "C" {
6552 #[doc = "Release Serial Interface Handler\n\n # Arguments\n\n* `handle` - The handle"]
6553 pub fn furi_hal_serial_control_release(handle: *mut FuriHalSerialHandle);
6554}
6555unsafe extern "C" {
6556 #[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"]
6557 pub fn furi_hal_serial_control_is_busy(serial_id: FuriHalSerialId) -> bool;
6558}
6559unsafe extern "C" {
6560 #[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"]
6561 pub fn furi_hal_serial_control_set_logging_config(serial_id: FuriHalSerialId, baud_rate: u32);
6562}
6563#[doc = "Expansion module detection callback type.\n\n # Arguments\n\n* `context` (direction in, out) - Pointer to the user-defined context object."]
6564pub type FuriHalSerialControlExpansionCallback =
6565 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
6566unsafe extern "C" {
6567 #[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."]
6568 pub fn furi_hal_serial_control_set_expansion_callback(
6569 serial_id: FuriHalSerialId,
6570 callback: FuriHalSerialControlExpansionCallback,
6571 context: *mut core::ffi::c_void,
6572 );
6573}
6574unsafe extern "C" {
6575 #[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"]
6576 pub fn furi_hal_serial_init(handle: *mut FuriHalSerialHandle, baud: u32);
6577}
6578unsafe extern "C" {
6579 #[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"]
6580 pub fn furi_hal_serial_deinit(handle: *mut FuriHalSerialHandle);
6581}
6582unsafe extern "C" {
6583 #[doc = "Suspend operation\n\n Suspend hardware, settings and callbacks are preserved\n\n # Arguments\n\n* `handle` - Serial handle"]
6584 pub fn furi_hal_serial_suspend(handle: *mut FuriHalSerialHandle);
6585}
6586unsafe extern "C" {
6587 #[doc = "Resume operation\n\n Resumes hardware from suspended state\n\n # Arguments\n\n* `handle` - Serial handle"]
6588 pub fn furi_hal_serial_resume(handle: *mut FuriHalSerialHandle);
6589}
6590unsafe extern "C" {
6591 #[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."]
6592 pub fn furi_hal_serial_is_baud_rate_supported(
6593 handle: *mut FuriHalSerialHandle,
6594 baud: u32,
6595 ) -> bool;
6596}
6597unsafe extern "C" {
6598 #[doc = "Changes baud rate\n\n # Arguments\n\n* `handle` - Serial handle\n * `baud` - baud rate"]
6599 pub fn furi_hal_serial_set_br(handle: *mut FuriHalSerialHandle, baud: u32);
6600}
6601unsafe extern "C" {
6602 #[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"]
6603 pub fn furi_hal_serial_configure_framing(
6604 handle: *mut FuriHalSerialHandle,
6605 data_bits: FuriHalSerialDataBits,
6606 parity: FuriHalSerialParity,
6607 stop_bits: FuriHalSerialStopBits,
6608 );
6609}
6610unsafe extern "C" {
6611 #[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)"]
6612 pub fn furi_hal_serial_tx(
6613 handle: *mut FuriHalSerialHandle,
6614 buffer: *const u8,
6615 buffer_size: usize,
6616 );
6617}
6618unsafe extern "C" {
6619 #[doc = "Wait until transmission is completed\n\n Ensures that all data has been sent.\n\n # Arguments\n\n* `handle` - Serial handle"]
6620 pub fn furi_hal_serial_tx_wait_complete(handle: *mut FuriHalSerialHandle);
6621}
6622#[doc = "< Data: new data available"]
6623pub const FuriHalSerialRxEventData: FuriHalSerialRxEvent = FuriHalSerialRxEvent(1);
6624#[doc = "< Idle: bus idle detected"]
6625pub const FuriHalSerialRxEventIdle: FuriHalSerialRxEvent = FuriHalSerialRxEvent(2);
6626#[doc = "< Framing Error: incorrect frame detected"]
6627pub const FuriHalSerialRxEventFrameError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(4);
6628#[doc = "< Noise Error: noise on the line detected"]
6629pub const FuriHalSerialRxEventNoiseError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(8);
6630#[doc = "< Overrun Error: no space for received data"]
6631pub const FuriHalSerialRxEventOverrunError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(16);
6632#[doc = "< Parity Error: incorrect parity bit received"]
6633pub const FuriHalSerialRxEventParityError: FuriHalSerialRxEvent = FuriHalSerialRxEvent(32);
6634#[repr(transparent)]
6635#[doc = "Serial RX events"]
6636#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6637pub struct FuriHalSerialRxEvent(pub core::ffi::c_uchar);
6638#[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"]
6639pub type FuriHalSerialAsyncRxCallback = ::core::option::Option<
6640 unsafe extern "C" fn(
6641 handle: *mut FuriHalSerialHandle,
6642 event: FuriHalSerialRxEvent,
6643 context: *mut core::ffi::c_void,
6644 ),
6645>;
6646unsafe extern "C" {
6647 #[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"]
6648 pub fn furi_hal_serial_async_rx_start(
6649 handle: *mut FuriHalSerialHandle,
6650 callback: FuriHalSerialAsyncRxCallback,
6651 context: *mut core::ffi::c_void,
6652 report_errors: bool,
6653 );
6654}
6655unsafe extern "C" {
6656 #[doc = "Stop Serial Receive\n\n # Arguments\n\n* `handle` - Serial handle"]
6657 pub fn furi_hal_serial_async_rx_stop(handle: *mut FuriHalSerialHandle);
6658}
6659unsafe extern "C" {
6660 #[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"]
6661 pub fn furi_hal_serial_async_rx_available(handle: *mut FuriHalSerialHandle) -> bool;
6662}
6663unsafe extern "C" {
6664 #[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"]
6665 pub fn furi_hal_serial_async_rx(handle: *mut FuriHalSerialHandle) -> u8;
6666}
6667#[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"]
6668pub type FuriHalSerialDmaRxCallback = ::core::option::Option<
6669 unsafe extern "C" fn(
6670 handle: *mut FuriHalSerialHandle,
6671 event: FuriHalSerialRxEvent,
6672 data_len: usize,
6673 context: *mut core::ffi::c_void,
6674 ),
6675>;
6676unsafe extern "C" {
6677 #[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"]
6678 pub fn furi_hal_serial_enable_direction(
6679 handle: *mut FuriHalSerialHandle,
6680 direction: FuriHalSerialDirection,
6681 );
6682}
6683unsafe extern "C" {
6684 #[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"]
6685 pub fn furi_hal_serial_disable_direction(
6686 handle: *mut FuriHalSerialHandle,
6687 direction: FuriHalSerialDirection,
6688 );
6689}
6690unsafe extern "C" {
6691 #[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"]
6692 pub fn furi_hal_serial_get_gpio_pin(
6693 handle: *mut FuriHalSerialHandle,
6694 direction: FuriHalSerialDirection,
6695 ) -> *const GpioPin;
6696}
6697unsafe extern "C" {
6698 #[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"]
6699 pub fn furi_hal_serial_dma_rx_start(
6700 handle: *mut FuriHalSerialHandle,
6701 callback: FuriHalSerialDmaRxCallback,
6702 context: *mut core::ffi::c_void,
6703 report_errors: bool,
6704 );
6705}
6706unsafe extern "C" {
6707 #[doc = "Stop Serial receive DMA\n\n # Arguments\n\n* `handle` - Serial handle"]
6708 pub fn furi_hal_serial_dma_rx_stop(handle: *mut FuriHalSerialHandle);
6709}
6710unsafe extern "C" {
6711 #[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)"]
6712 pub fn furi_hal_serial_dma_rx(
6713 handle: *mut FuriHalSerialHandle,
6714 data: *mut u8,
6715 len: usize,
6716 ) -> usize;
6717}
6718unsafe extern "C" {
6719 pub fn furi_hal_info_get_api_version(major: *mut u16, minor: *mut u16);
6720}
6721unsafe extern "C" {
6722 #[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"]
6723 pub fn furi_hal_info_get(
6724 callback: PropertyValueCallback,
6725 sep: core::ffi::c_char,
6726 context: *mut core::ffi::c_void,
6727 );
6728}
6729unsafe extern "C" {
6730 #[doc = "Initialize random subsystem"]
6731 pub fn furi_hal_random_init();
6732}
6733unsafe extern "C" {
6734 #[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)"]
6735 pub fn furi_hal_random_get() -> u32;
6736}
6737unsafe extern "C" {
6738 #[doc = "Fill buffer with random data\n\n # Arguments\n\n* `buf` - buffer pointer\n * `data` - buffer len"]
6739 pub fn furi_hal_random_fill_buf(buf: *mut u8, len: u32);
6740}
6741#[doc = "< default configuration"]
6742pub const FuriHalSubGhzPresetIDLE: FuriHalSubGhzPreset = FuriHalSubGhzPreset(0);
6743#[doc = "< OOK, bandwidth 270kHz, asynchronous"]
6744pub const FuriHalSubGhzPresetOok270Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(1);
6745#[doc = "< OOK, bandwidth 650kHz, asynchronous"]
6746pub const FuriHalSubGhzPresetOok650Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(2);
6747#[doc = "< FM, deviation 2.380371 kHz, asynchronous"]
6748pub const FuriHalSubGhzPreset2FSKDev238Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(3);
6749#[doc = "< FM, deviation ~12 kHz, asynchronous"]
6750pub const FuriHalSubGhzPreset2FSKDev12KAsync: FuriHalSubGhzPreset = FuriHalSubGhzPreset(4);
6751#[doc = "< FM, deviation 47.60742 kHz, asynchronous"]
6752pub const FuriHalSubGhzPreset2FSKDev476Async: FuriHalSubGhzPreset = FuriHalSubGhzPreset(5);
6753#[doc = "< MSK, deviation 47.60742 kHz, 99.97Kb/s, asynchronous"]
6754pub const FuriHalSubGhzPresetMSK99_97KbAsync: FuriHalSubGhzPreset = FuriHalSubGhzPreset(6);
6755#[doc = "< GFSK, deviation 19.042969 kHz, 9.996Kb/s, asynchronous"]
6756pub const FuriHalSubGhzPresetGFSK9_99KbAsync: FuriHalSubGhzPreset = FuriHalSubGhzPreset(7);
6757pub const FuriHalSubGhzPresetCustom: FuriHalSubGhzPreset = FuriHalSubGhzPreset(8);
6758#[repr(transparent)]
6759#[doc = "Radio Presets"]
6760#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6761pub struct FuriHalSubGhzPreset(pub core::ffi::c_uchar);
6762#[repr(C)]
6763#[derive(Debug, Copy, Clone)]
6764pub struct LevelDuration {
6765 pub _bitfield_align_1: [u32; 0],
6766 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
6767}
6768#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6769const _: () = {
6770 ["Size of LevelDuration"][::core::mem::size_of::<LevelDuration>() - 4usize];
6771 ["Alignment of LevelDuration"][::core::mem::align_of::<LevelDuration>() - 4usize];
6772};
6773impl LevelDuration {
6774 #[inline]
6775 pub fn duration(&self) -> u32 {
6776 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 30u8) as u32) }
6777 }
6778 #[inline]
6779 pub fn set_duration(&mut self, val: u32) {
6780 unsafe {
6781 let val: u32 = ::core::mem::transmute(val);
6782 self._bitfield_1.set(0usize, 30u8, val as u64)
6783 }
6784 }
6785 #[inline]
6786 pub unsafe fn duration_raw(this: *const Self) -> u32 {
6787 unsafe {
6788 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
6789 ::core::ptr::addr_of!((*this)._bitfield_1),
6790 0usize,
6791 30u8,
6792 ) as u32)
6793 }
6794 }
6795 #[inline]
6796 pub unsafe fn set_duration_raw(this: *mut Self, val: u32) {
6797 unsafe {
6798 let val: u32 = ::core::mem::transmute(val);
6799 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
6800 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6801 0usize,
6802 30u8,
6803 val as u64,
6804 )
6805 }
6806 }
6807 #[inline]
6808 pub fn level(&self) -> u8 {
6809 unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u8) }
6810 }
6811 #[inline]
6812 pub fn set_level(&mut self, val: u8) {
6813 unsafe {
6814 let val: u8 = ::core::mem::transmute(val);
6815 self._bitfield_1.set(30usize, 2u8, val as u64)
6816 }
6817 }
6818 #[inline]
6819 pub unsafe fn level_raw(this: *const Self) -> u8 {
6820 unsafe {
6821 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
6822 ::core::ptr::addr_of!((*this)._bitfield_1),
6823 30usize,
6824 2u8,
6825 ) as u8)
6826 }
6827 }
6828 #[inline]
6829 pub unsafe fn set_level_raw(this: *mut Self, val: u8) {
6830 unsafe {
6831 let val: u8 = ::core::mem::transmute(val);
6832 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
6833 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6834 30usize,
6835 2u8,
6836 val as u64,
6837 )
6838 }
6839 }
6840 #[inline]
6841 pub fn new_bitfield_1(duration: u32, level: u8) -> __BindgenBitfieldUnit<[u8; 4usize]> {
6842 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
6843 __bindgen_bitfield_unit.set(0usize, 30u8, {
6844 let duration: u32 = unsafe { ::core::mem::transmute(duration) };
6845 duration as u64
6846 });
6847 __bindgen_bitfield_unit.set(30usize, 2u8, {
6848 let level: u8 = unsafe { ::core::mem::transmute(level) };
6849 level as u64
6850 });
6851 __bindgen_bitfield_unit
6852 }
6853}
6854#[doc = "< Isolate Radio from antenna"]
6855pub const FuriHalSubGhzPathIsolate: FuriHalSubGhzPath = FuriHalSubGhzPath(0);
6856#[doc = "< Center Frequency: 433MHz. Path 1: SW1RF1-SW2RF2, LCLCL"]
6857pub const FuriHalSubGhzPath433: FuriHalSubGhzPath = FuriHalSubGhzPath(1);
6858#[doc = "< Center Frequency: 315MHz. Path 2: SW1RF2-SW2RF1, LCLCLCL"]
6859pub const FuriHalSubGhzPath315: FuriHalSubGhzPath = FuriHalSubGhzPath(2);
6860#[doc = "< Center Frequency: 868MHz. Path 3: SW1RF3-SW2RF3, LCLC"]
6861pub const FuriHalSubGhzPath868: FuriHalSubGhzPath = FuriHalSubGhzPath(3);
6862#[repr(transparent)]
6863#[doc = "Switchable Radio Paths"]
6864#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6865pub struct FuriHalSubGhzPath(pub core::ffi::c_uchar);
6866unsafe extern "C" {
6867 pub fn furi_hal_subghz_set_async_mirror_pin(pin: *const GpioPin);
6868}
6869unsafe extern "C" {
6870 #[doc = "Get data GPIO\n\n # Returns\n\npointer to the gpio pin structure"]
6871 pub fn furi_hal_subghz_get_data_gpio() -> *const GpioPin;
6872}
6873unsafe extern "C" {
6874 #[doc = "Send device to sleep mode"]
6875 pub fn furi_hal_subghz_sleep();
6876}
6877unsafe extern "C" {
6878 #[doc = "Load custom registers from preset\n\n # Arguments\n\n* `preset_data` - registers to load"]
6879 pub fn furi_hal_subghz_load_custom_preset(preset_data: *const u8);
6880}
6881unsafe extern "C" {
6882 #[doc = "Load registers\n\n # Arguments\n\n* `data` - Registers data"]
6883 pub fn furi_hal_subghz_load_registers(data: *const u8);
6884}
6885unsafe extern "C" {
6886 #[doc = "Load PATABLE\n\n # Arguments\n\n* `data` - 8 uint8_t values"]
6887 pub fn furi_hal_subghz_load_patable(data: *const u8);
6888}
6889unsafe extern "C" {
6890 #[doc = "Write packet to FIFO\n\n # Arguments\n\n* `data` - bytes array\n * `size` - size"]
6891 pub fn furi_hal_subghz_write_packet(data: *const u8, size: u8);
6892}
6893unsafe extern "C" {
6894 #[doc = "Check if receive pipe is not empty\n\n # Returns\n\ntrue if not empty"]
6895 pub fn furi_hal_subghz_rx_pipe_not_empty() -> bool;
6896}
6897unsafe extern "C" {
6898 #[doc = "Check if received data crc is valid\n\n # Returns\n\ntrue if valid"]
6899 pub fn furi_hal_subghz_is_rx_data_crc_valid() -> bool;
6900}
6901unsafe extern "C" {
6902 #[doc = "Read packet from FIFO\n\n # Arguments\n\n* `data` - pointer\n * `size` - size"]
6903 pub fn furi_hal_subghz_read_packet(data: *mut u8, size: *mut u8);
6904}
6905unsafe extern "C" {
6906 #[doc = "Flush rx FIFO buffer"]
6907 pub fn furi_hal_subghz_flush_rx();
6908}
6909unsafe extern "C" {
6910 #[doc = "Flush tx FIFO buffer"]
6911 pub fn furi_hal_subghz_flush_tx();
6912}
6913unsafe extern "C" {
6914 #[doc = "Shutdown Issue SPWD command\n registers content will be lost"]
6915 pub fn furi_hal_subghz_shutdown();
6916}
6917unsafe extern "C" {
6918 #[doc = "Reset Issue reset command\n registers content will be lost"]
6919 pub fn furi_hal_subghz_reset();
6920}
6921unsafe extern "C" {
6922 #[doc = "Switch to Idle"]
6923 pub fn furi_hal_subghz_idle();
6924}
6925unsafe extern "C" {
6926 #[doc = "Switch to Receive"]
6927 pub fn furi_hal_subghz_rx();
6928}
6929unsafe extern "C" {
6930 #[doc = "Switch to Transmit\n\n # Returns\n\ntrue if the transfer is allowed by belonging to the region"]
6931 pub fn furi_hal_subghz_tx() -> bool;
6932}
6933unsafe extern "C" {
6934 #[doc = "Get RSSI value in dBm\n\n # Returns\n\nRSSI value"]
6935 pub fn furi_hal_subghz_get_rssi() -> f32;
6936}
6937unsafe extern "C" {
6938 #[doc = "Get LQI\n\n # Returns\n\nLQI value"]
6939 pub fn furi_hal_subghz_get_lqi() -> u8;
6940}
6941unsafe extern "C" {
6942 #[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"]
6943 pub fn furi_hal_subghz_is_frequency_valid(value: u32) -> bool;
6944}
6945unsafe extern "C" {
6946 #[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"]
6947 pub fn furi_hal_subghz_set_frequency_and_path(value: u32) -> u32;
6948}
6949unsafe extern "C" {
6950 #[doc = "Set frequency\n\n # Arguments\n\n* `value` - frequency in Hz\n\n # Returns\n\nreal frequency in Hz"]
6951 pub fn furi_hal_subghz_set_frequency(value: u32) -> u32;
6952}
6953unsafe extern "C" {
6954 #[doc = "Set path\n\n # Arguments\n\n* `path` - path to use"]
6955 pub fn furi_hal_subghz_set_path(path: FuriHalSubGhzPath);
6956}
6957#[doc = "Signal Timings Capture callback"]
6958pub type FuriHalSubGhzCaptureCallback = ::core::option::Option<
6959 unsafe extern "C" fn(level: bool, duration: u32, context: *mut core::ffi::c_void),
6960>;
6961unsafe extern "C" {
6962 #[doc = "Enable signal timings capture Initializes GPIO and TIM2 for timings capture\n\n # Arguments\n\n* `callback` - FuriHalSubGhzCaptureCallback\n * `context` - callback context"]
6963 pub fn furi_hal_subghz_start_async_rx(
6964 callback: FuriHalSubGhzCaptureCallback,
6965 context: *mut core::ffi::c_void,
6966 );
6967}
6968unsafe extern "C" {
6969 #[doc = "Disable signal timings capture Resets GPIO and TIM2"]
6970 pub fn furi_hal_subghz_stop_async_rx();
6971}
6972#[doc = "Async TX callback type\n # Arguments\n\n* `context` - callback context\n # Returns\n\nLevelDuration"]
6973pub type FuriHalSubGhzAsyncTxCallback =
6974 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> LevelDuration>;
6975unsafe extern "C" {
6976 #[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"]
6977 pub fn furi_hal_subghz_start_async_tx(
6978 callback: FuriHalSubGhzAsyncTxCallback,
6979 context: *mut core::ffi::c_void,
6980 ) -> bool;
6981}
6982unsafe extern "C" {
6983 #[doc = "Wait for async transmission to complete\n\n # Returns\n\ntrue if TX complete"]
6984 pub fn furi_hal_subghz_is_async_tx_complete() -> bool;
6985}
6986unsafe extern "C" {
6987 #[doc = "Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1"]
6988 pub fn furi_hal_subghz_stop_async_tx();
6989}
6990pub type FuriHalIbuttonEmulateCallback =
6991 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
6992unsafe extern "C" {
6993 #[doc = "Start emulation timer\n # Arguments\n\n* `period` - timer period\n * `callback` - timer callback\n * `context` - callback context"]
6994 pub fn furi_hal_ibutton_emulate_start(
6995 period: u32,
6996 callback: FuriHalIbuttonEmulateCallback,
6997 context: *mut core::ffi::c_void,
6998 );
6999}
7000unsafe extern "C" {
7001 #[doc = "Update emulation timer period\n # Arguments\n\n* `period` - new timer period"]
7002 pub fn furi_hal_ibutton_emulate_set_next(period: u32);
7003}
7004unsafe extern "C" {
7005 #[doc = "Stop emulation timer"]
7006 pub fn furi_hal_ibutton_emulate_stop();
7007}
7008unsafe extern "C" {
7009 #[doc = "Set the pin to normal mode (open collector), and sets it to float"]
7010 pub fn furi_hal_ibutton_pin_configure();
7011}
7012unsafe extern "C" {
7013 #[doc = "Sets the pin to analog mode, and sets it to float"]
7014 pub fn furi_hal_ibutton_pin_reset();
7015}
7016unsafe extern "C" {
7017 #[doc = "iButton write pin\n # Arguments\n\n* `state` - true / false"]
7018 pub fn furi_hal_ibutton_pin_write(state: bool);
7019}
7020unsafe extern "C" {
7021 #[doc = "Config rfid pins to reset state"]
7022 pub fn furi_hal_rfid_pins_reset();
7023}
7024unsafe extern "C" {
7025 #[doc = "Release rfid pull pin"]
7026 pub fn furi_hal_rfid_pin_pull_release();
7027}
7028unsafe extern "C" {
7029 #[doc = "Pulldown rfid pull pin"]
7030 pub fn furi_hal_rfid_pin_pull_pulldown();
7031}
7032unsafe extern "C" {
7033 #[doc = "Start read timer\n # Arguments\n\n* `freq` - timer frequency\n * `duty_cycle` - timer duty cycle, 0.0-1.0"]
7034 pub fn furi_hal_rfid_tim_read_start(freq: f32, duty_cycle: f32);
7035}
7036unsafe extern "C" {
7037 #[doc = "Pause read timer, to be able to continue later"]
7038 pub fn furi_hal_rfid_tim_read_pause();
7039}
7040unsafe extern "C" {
7041 #[doc = "Continue read timer"]
7042 pub fn furi_hal_rfid_tim_read_continue();
7043}
7044unsafe extern "C" {
7045 #[doc = "Stop read timer"]
7046 pub fn furi_hal_rfid_tim_read_stop();
7047}
7048pub type FuriHalRfidReadCaptureCallback = ::core::option::Option<
7049 unsafe extern "C" fn(level: bool, duration: u32, context: *mut core::ffi::c_void),
7050>;
7051unsafe extern "C" {
7052 pub fn furi_hal_rfid_tim_read_capture_start(
7053 callback: FuriHalRfidReadCaptureCallback,
7054 context: *mut core::ffi::c_void,
7055 );
7056}
7057unsafe extern "C" {
7058 pub fn furi_hal_rfid_tim_read_capture_stop();
7059}
7060pub type FuriHalRfidDMACallback =
7061 ::core::option::Option<unsafe extern "C" fn(half: bool, context: *mut core::ffi::c_void)>;
7062unsafe extern "C" {
7063 pub fn furi_hal_rfid_tim_emulate_dma_start(
7064 duration: *mut u32,
7065 pulse: *mut u32,
7066 length: usize,
7067 callback: FuriHalRfidDMACallback,
7068 context: *mut core::ffi::c_void,
7069 );
7070}
7071unsafe extern "C" {
7072 pub fn furi_hal_rfid_tim_emulate_dma_stop();
7073}
7074unsafe extern "C" {
7075 #[doc = "Set read timer period\n\n # Arguments\n\n* `period` - overall duration"]
7076 pub fn furi_hal_rfid_set_read_period(period: u32);
7077}
7078unsafe extern "C" {
7079 #[doc = "Set read timer pulse\n\n # Arguments\n\n* `pulse` - duration of high level"]
7080 pub fn furi_hal_rfid_set_read_pulse(pulse: u32);
7081}
7082unsafe extern "C" {
7083 #[doc = "Start/Enable comparator"]
7084 pub fn furi_hal_rfid_comp_start();
7085}
7086unsafe extern "C" {
7087 #[doc = "Stop/Disable comparator"]
7088 pub fn furi_hal_rfid_comp_stop();
7089}
7090pub type FuriHalRfidCompCallback =
7091 ::core::option::Option<unsafe extern "C" fn(level: bool, context: *mut core::ffi::c_void)>;
7092unsafe extern "C" {
7093 #[doc = "Set comparator callback"]
7094 pub fn furi_hal_rfid_comp_set_callback(
7095 callback: FuriHalRfidCompCallback,
7096 context: *mut core::ffi::c_void,
7097 );
7098}
7099unsafe extern "C" {
7100 #[doc = "Start/Enable Field Presence detect"]
7101 pub fn furi_hal_rfid_field_detect_start();
7102}
7103unsafe extern "C" {
7104 #[doc = "Stop/Disable Field Presence detect"]
7105 pub fn furi_hal_rfid_field_detect_stop();
7106}
7107unsafe extern "C" {
7108 #[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"]
7109 pub fn furi_hal_rfid_field_is_present(frequency: *mut u32) -> bool;
7110}
7111#[doc = "< Oscillator has been started."]
7112pub const FuriHalNfcEventOscOn: FuriHalNfcEvent = FuriHalNfcEvent(1);
7113#[doc = "< External field (carrier) has been detected."]
7114pub const FuriHalNfcEventFieldOn: FuriHalNfcEvent = FuriHalNfcEvent(2);
7115#[doc = "< External field (carrier) has been lost."]
7116pub const FuriHalNfcEventFieldOff: FuriHalNfcEvent = FuriHalNfcEvent(4);
7117#[doc = "< Reader has issued a wake-up command."]
7118pub const FuriHalNfcEventListenerActive: FuriHalNfcEvent = FuriHalNfcEvent(8);
7119#[doc = "< Transmission has started."]
7120pub const FuriHalNfcEventTxStart: FuriHalNfcEvent = FuriHalNfcEvent(16);
7121#[doc = "< Transmission has ended."]
7122pub const FuriHalNfcEventTxEnd: FuriHalNfcEvent = FuriHalNfcEvent(32);
7123#[doc = "< Reception has started."]
7124pub const FuriHalNfcEventRxStart: FuriHalNfcEvent = FuriHalNfcEvent(64);
7125#[doc = "< Reception has ended."]
7126pub const FuriHalNfcEventRxEnd: FuriHalNfcEvent = FuriHalNfcEvent(128);
7127#[doc = "< A collision has occurred."]
7128pub const FuriHalNfcEventCollision: FuriHalNfcEvent = FuriHalNfcEvent(256);
7129#[doc = "< Frame wait timer has expired."]
7130pub const FuriHalNfcEventTimerFwtExpired: FuriHalNfcEvent = FuriHalNfcEvent(512);
7131#[doc = "< Transmission block timer has expired."]
7132pub const FuriHalNfcEventTimerBlockTxExpired: FuriHalNfcEvent = FuriHalNfcEvent(1024);
7133pub const FuriHalNfcEventTimeout: FuriHalNfcEvent = FuriHalNfcEvent(2048);
7134pub const FuriHalNfcEventAbortRequest: FuriHalNfcEvent = FuriHalNfcEvent(4096);
7135#[repr(transparent)]
7136#[doc = "Enumeration of possible NFC HAL events."]
7137#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7138pub struct FuriHalNfcEvent(pub core::ffi::c_ushort);
7139#[doc = "< No error has occurred."]
7140pub const FuriHalNfcErrorNone: FuriHalNfcError = FuriHalNfcError(0);
7141#[doc = "< The communication bus is busy."]
7142pub const FuriHalNfcErrorBusy: FuriHalNfcError = FuriHalNfcError(1);
7143#[doc = "< NFC hardware did not respond or responded unexpectedly."]
7144pub const FuriHalNfcErrorCommunication: FuriHalNfcError = FuriHalNfcError(2);
7145#[doc = "< Oscillator failed to start."]
7146pub const FuriHalNfcErrorOscillator: FuriHalNfcError = FuriHalNfcError(3);
7147#[doc = "< NFC hardware did not respond in time."]
7148pub const FuriHalNfcErrorCommunicationTimeout: FuriHalNfcError = FuriHalNfcError(4);
7149#[doc = "< Receive buffer was too small for the received data."]
7150pub const FuriHalNfcErrorBufferOverflow: FuriHalNfcError = FuriHalNfcError(5);
7151#[doc = "< Not enough data was received to parse a valid frame."]
7152pub const FuriHalNfcErrorIncompleteFrame: FuriHalNfcError = FuriHalNfcError(6);
7153#[doc = "< Cannot parse a frame due to unexpected/invalid data."]
7154pub const FuriHalNfcErrorDataFormat: FuriHalNfcError = FuriHalNfcError(7);
7155#[repr(transparent)]
7156#[doc = "Enumeration of possible NFC HAL errors."]
7157#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7158pub struct FuriHalNfcError(pub core::ffi::c_uchar);
7159#[doc = "< Configure NFC HAL to operate as a poller."]
7160pub const FuriHalNfcModePoller: FuriHalNfcMode = FuriHalNfcMode(0);
7161#[doc = "< Configure NFC HAL to operate as a listener."]
7162pub const FuriHalNfcModeListener: FuriHalNfcMode = FuriHalNfcMode(1);
7163#[doc = "< Special value equal to the operating modes count. Internal use."]
7164pub const FuriHalNfcModeNum: FuriHalNfcMode = FuriHalNfcMode(2);
7165#[repr(transparent)]
7166#[doc = "Enumeration of possible NFC HAL operating modes."]
7167#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7168pub struct FuriHalNfcMode(pub core::ffi::c_uchar);
7169#[doc = "< Configure NFC HAL to use the ISO14443 (type A) technology."]
7170pub const FuriHalNfcTechIso14443a: FuriHalNfcTech = FuriHalNfcTech(0);
7171#[doc = "< Configure NFC HAL to use the ISO14443 (type B) technology."]
7172pub const FuriHalNfcTechIso14443b: FuriHalNfcTech = FuriHalNfcTech(1);
7173#[doc = "< Configure NFC HAL to use the ISO15693 technology."]
7174pub const FuriHalNfcTechIso15693: FuriHalNfcTech = FuriHalNfcTech(2);
7175#[doc = "< Configure NFC HAL to use the FeliCa technology."]
7176pub const FuriHalNfcTechFelica: FuriHalNfcTech = FuriHalNfcTech(3);
7177#[doc = "< Special value equal to the supported technologies count. Internal use."]
7178pub const FuriHalNfcTechNum: FuriHalNfcTech = FuriHalNfcTech(4);
7179#[doc = "< Special value indicating the unconfigured state. Internal use."]
7180pub const FuriHalNfcTechInvalid: FuriHalNfcTech = FuriHalNfcTech(5);
7181#[repr(transparent)]
7182#[doc = "Enumeration of supported NFC technologies."]
7183#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7184pub struct FuriHalNfcTech(pub core::ffi::c_uchar);
7185unsafe extern "C" {
7186 #[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."]
7187 pub fn furi_hal_nfc_init() -> FuriHalNfcError;
7188}
7189unsafe extern "C" {
7190 #[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."]
7191 pub fn furi_hal_nfc_is_hal_ready() -> FuriHalNfcError;
7192}
7193unsafe extern "C" {
7194 #[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."]
7195 pub fn furi_hal_nfc_acquire() -> FuriHalNfcError;
7196}
7197unsafe extern "C" {
7198 #[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."]
7199 pub fn furi_hal_nfc_release() -> FuriHalNfcError;
7200}
7201unsafe extern "C" {
7202 #[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."]
7203 pub fn furi_hal_nfc_low_power_mode_start() -> FuriHalNfcError;
7204}
7205unsafe extern "C" {
7206 #[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."]
7207 pub fn furi_hal_nfc_low_power_mode_stop() -> FuriHalNfcError;
7208}
7209unsafe extern "C" {
7210 #[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."]
7211 pub fn furi_hal_nfc_set_mode(mode: FuriHalNfcMode, tech: FuriHalNfcTech) -> FuriHalNfcError;
7212}
7213unsafe extern "C" {
7214 #[doc = "Reset the NFC HAL to its default (unconfigured) state.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7215 pub fn furi_hal_nfc_reset_mode() -> FuriHalNfcError;
7216}
7217unsafe extern "C" {
7218 #[doc = "Enable field (carrier) detection by the NFC hardware.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7219 pub fn furi_hal_nfc_field_detect_start() -> FuriHalNfcError;
7220}
7221unsafe extern "C" {
7222 #[doc = "Disable field (carrier) detection by the NFC hardware.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7223 pub fn furi_hal_nfc_field_detect_stop() -> FuriHalNfcError;
7224}
7225unsafe extern "C" {
7226 #[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."]
7227 pub fn furi_hal_nfc_field_is_present() -> bool;
7228}
7229unsafe extern "C" {
7230 #[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."]
7231 pub fn furi_hal_nfc_poller_field_on() -> FuriHalNfcError;
7232}
7233unsafe extern "C" {
7234 #[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."]
7235 pub fn furi_hal_nfc_poller_wait_event(timeout_ms: u32) -> FuriHalNfcEvent;
7236}
7237unsafe extern "C" {
7238 #[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."]
7239 pub fn furi_hal_nfc_listener_wait_event(timeout_ms: u32) -> FuriHalNfcEvent;
7240}
7241unsafe extern "C" {
7242 #[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."]
7243 pub fn furi_hal_nfc_poller_tx(tx_data: *const u8, tx_bits: usize) -> FuriHalNfcError;
7244}
7245unsafe extern "C" {
7246 #[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."]
7247 pub fn furi_hal_nfc_poller_rx(
7248 rx_data: *mut u8,
7249 rx_data_size: usize,
7250 rx_bits: *mut usize,
7251 ) -> FuriHalNfcError;
7252}
7253unsafe extern "C" {
7254 #[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."]
7255 pub fn furi_hal_nfc_listener_tx(tx_data: *const u8, tx_bits: usize) -> FuriHalNfcError;
7256}
7257unsafe extern "C" {
7258 #[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."]
7259 pub fn furi_hal_nfc_listener_rx(
7260 rx_data: *mut u8,
7261 rx_data_size: usize,
7262 rx_bits: *mut usize,
7263 ) -> FuriHalNfcError;
7264}
7265unsafe extern "C" {
7266 #[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."]
7267 pub fn furi_hal_nfc_listener_sleep() -> FuriHalNfcError;
7268}
7269unsafe extern "C" {
7270 #[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."]
7271 pub fn furi_hal_nfc_listener_idle() -> FuriHalNfcError;
7272}
7273unsafe extern "C" {
7274 #[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."]
7275 pub fn furi_hal_nfc_listener_enable_rx() -> FuriHalNfcError;
7276}
7277unsafe extern "C" {
7278 #[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."]
7279 pub fn furi_hal_nfc_trx_reset() -> FuriHalNfcError;
7280}
7281unsafe extern "C" {
7282 #[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."]
7283 pub fn furi_hal_nfc_event_start() -> FuriHalNfcError;
7284}
7285unsafe extern "C" {
7286 #[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."]
7287 pub fn furi_hal_nfc_event_stop() -> FuriHalNfcError;
7288}
7289unsafe extern "C" {
7290 #[doc = "Manually emit the FuriHalNfcEventAbortRequest event.\n\n # Returns\n\nFuriHalNfcErrorNone on success, any other error code on failure."]
7291 pub fn furi_hal_nfc_abort() -> FuriHalNfcError;
7292}
7293unsafe extern "C" {
7294 #[doc = "Start frame wait timeout timer.\n\n # Arguments\n\n* `time_fc` (direction in) - time to wait, in carrier cycles."]
7295 pub fn furi_hal_nfc_timer_fwt_start(time_fc: u32);
7296}
7297unsafe extern "C" {
7298 #[doc = "Stop frame wait timeout timer."]
7299 pub fn furi_hal_nfc_timer_fwt_stop();
7300}
7301unsafe extern "C" {
7302 #[doc = "Start block transmit (frame delay) timer.\n\n # Arguments\n\n* `time_fc` (direction in) - time to wait, in carrier cycles."]
7303 pub fn furi_hal_nfc_timer_block_tx_start(time_fc: u32);
7304}
7305unsafe extern "C" {
7306 #[doc = "Start block transmit (frame delay) timer.\n\n # Arguments\n\n* `time_us` (direction in) - time to wait, in microseconds."]
7307 pub fn furi_hal_nfc_timer_block_tx_start_us(time_us: u32);
7308}
7309unsafe extern "C" {
7310 #[doc = "Stop block transmit (frame delay) timer."]
7311 pub fn furi_hal_nfc_timer_block_tx_stop();
7312}
7313unsafe extern "C" {
7314 #[doc = "Check whether block transmit (frame delay) timer is running.\n\n # Returns\n\ntrue if timer is running, false otherwise."]
7315 pub fn furi_hal_nfc_timer_block_tx_is_running() -> bool;
7316}
7317pub const FuriHalNfcaShortFrameAllReq: FuriHalNfcaShortFrame = FuriHalNfcaShortFrame(0);
7318pub const FuriHalNfcaShortFrameSensReq: FuriHalNfcaShortFrame = FuriHalNfcaShortFrame(1);
7319#[repr(transparent)]
7320#[doc = "Enumeration of ISO14443 (Type A) short frame types."]
7321#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7322pub struct FuriHalNfcaShortFrame(pub core::ffi::c_uchar);
7323unsafe extern "C" {
7324 #[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."]
7325 pub fn furi_hal_nfc_iso14443a_poller_trx_short_frame(
7326 frame: FuriHalNfcaShortFrame,
7327 ) -> FuriHalNfcError;
7328}
7329unsafe extern "C" {
7330 #[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."]
7331 pub fn furi_hal_nfc_iso14443a_tx_sdd_frame(
7332 tx_data: *const u8,
7333 tx_bits: usize,
7334 ) -> FuriHalNfcError;
7335}
7336unsafe extern "C" {
7337 #[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."]
7338 pub fn furi_hal_nfc_iso14443a_rx_sdd_frame(
7339 rx_data: *mut u8,
7340 rx_data_size: usize,
7341 rx_bits: *mut usize,
7342 ) -> FuriHalNfcError;
7343}
7344unsafe extern "C" {
7345 #[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."]
7346 pub fn furi_hal_nfc_iso14443a_poller_tx_custom_parity(
7347 tx_data: *const u8,
7348 tx_bits: usize,
7349 ) -> FuriHalNfcError;
7350}
7351unsafe extern "C" {
7352 #[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."]
7353 pub fn furi_hal_nfc_iso14443a_listener_set_col_res_data(
7354 uid: *mut u8,
7355 uid_len: u8,
7356 atqa: *mut u8,
7357 sak: u8,
7358 ) -> FuriHalNfcError;
7359}
7360unsafe extern "C" {
7361 #[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."]
7362 pub fn furi_hal_nfc_iso14443a_listener_tx_custom_parity(
7363 tx_data: *const u8,
7364 tx_parity: *const u8,
7365 tx_bits: usize,
7366 ) -> FuriHalNfcError;
7367}
7368unsafe extern "C" {
7369 #[doc = "Send ISO15693 SOF in listener mode\n\n # Returns\n\nFuriHalNfcError"]
7370 pub fn furi_hal_nfc_iso15693_listener_tx_sof() -> FuriHalNfcError;
7371}
7372unsafe extern "C" {
7373 #[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."]
7374 pub fn furi_hal_nfc_felica_listener_set_sensf_res_data(
7375 idm: *const u8,
7376 idm_len: u8,
7377 pmm: *const u8,
7378 pmm_len: u8,
7379 sys_code: u16,
7380 ) -> FuriHalNfcError;
7381}
7382unsafe extern "C" {
7383 #[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)"]
7384 pub fn furi_hal_switch(address: *mut core::ffi::c_void);
7385}
7386pub type Elf32_Half = u16;
7387pub type Elf64_Half = u16;
7388pub type Elf32_Word = u32;
7389pub type Elf32_Sword = i32;
7390pub type Elf64_Word = u32;
7391pub type Elf64_Sword = i32;
7392pub type Elf32_Xword = u64;
7393pub type Elf32_Sxword = i64;
7394pub type Elf64_Xword = u64;
7395pub type Elf64_Sxword = i64;
7396pub type Elf32_Addr = u32;
7397pub type Elf64_Addr = u64;
7398pub type Elf32_Off = u32;
7399pub type Elf64_Off = u64;
7400pub type Elf32_Section = u16;
7401pub type Elf64_Section = u16;
7402pub type Elf32_Versym = Elf32_Half;
7403pub type Elf64_Versym = Elf64_Half;
7404#[repr(C)]
7405#[derive(Debug, Copy, Clone)]
7406pub struct Elf32_Ehdr {
7407 pub e_ident: [core::ffi::c_uchar; 16usize],
7408 pub e_type: Elf32_Half,
7409 pub e_machine: Elf32_Half,
7410 pub e_version: Elf32_Word,
7411 pub e_entry: Elf32_Addr,
7412 pub e_phoff: Elf32_Off,
7413 pub e_shoff: Elf32_Off,
7414 pub e_flags: Elf32_Word,
7415 pub e_ehsize: Elf32_Half,
7416 pub e_phentsize: Elf32_Half,
7417 pub e_phnum: Elf32_Half,
7418 pub e_shentsize: Elf32_Half,
7419 pub e_shnum: Elf32_Half,
7420 pub e_shstrndx: Elf32_Half,
7421}
7422#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7423const _: () = {
7424 ["Size of Elf32_Ehdr"][::core::mem::size_of::<Elf32_Ehdr>() - 52usize];
7425 ["Alignment of Elf32_Ehdr"][::core::mem::align_of::<Elf32_Ehdr>() - 4usize];
7426 ["Offset of field: Elf32_Ehdr::e_ident"][::core::mem::offset_of!(Elf32_Ehdr, e_ident) - 0usize];
7427 ["Offset of field: Elf32_Ehdr::e_type"][::core::mem::offset_of!(Elf32_Ehdr, e_type) - 16usize];
7428 ["Offset of field: Elf32_Ehdr::e_machine"]
7429 [::core::mem::offset_of!(Elf32_Ehdr, e_machine) - 18usize];
7430 ["Offset of field: Elf32_Ehdr::e_version"]
7431 [::core::mem::offset_of!(Elf32_Ehdr, e_version) - 20usize];
7432 ["Offset of field: Elf32_Ehdr::e_entry"]
7433 [::core::mem::offset_of!(Elf32_Ehdr, e_entry) - 24usize];
7434 ["Offset of field: Elf32_Ehdr::e_phoff"]
7435 [::core::mem::offset_of!(Elf32_Ehdr, e_phoff) - 28usize];
7436 ["Offset of field: Elf32_Ehdr::e_shoff"]
7437 [::core::mem::offset_of!(Elf32_Ehdr, e_shoff) - 32usize];
7438 ["Offset of field: Elf32_Ehdr::e_flags"]
7439 [::core::mem::offset_of!(Elf32_Ehdr, e_flags) - 36usize];
7440 ["Offset of field: Elf32_Ehdr::e_ehsize"]
7441 [::core::mem::offset_of!(Elf32_Ehdr, e_ehsize) - 40usize];
7442 ["Offset of field: Elf32_Ehdr::e_phentsize"]
7443 [::core::mem::offset_of!(Elf32_Ehdr, e_phentsize) - 42usize];
7444 ["Offset of field: Elf32_Ehdr::e_phnum"]
7445 [::core::mem::offset_of!(Elf32_Ehdr, e_phnum) - 44usize];
7446 ["Offset of field: Elf32_Ehdr::e_shentsize"]
7447 [::core::mem::offset_of!(Elf32_Ehdr, e_shentsize) - 46usize];
7448 ["Offset of field: Elf32_Ehdr::e_shnum"]
7449 [::core::mem::offset_of!(Elf32_Ehdr, e_shnum) - 48usize];
7450 ["Offset of field: Elf32_Ehdr::e_shstrndx"]
7451 [::core::mem::offset_of!(Elf32_Ehdr, e_shstrndx) - 50usize];
7452};
7453#[repr(C)]
7454#[derive(Debug, Copy, Clone)]
7455pub struct Elf64_Ehdr {
7456 pub e_ident: [core::ffi::c_uchar; 16usize],
7457 pub e_type: Elf64_Half,
7458 pub e_machine: Elf64_Half,
7459 pub e_version: Elf64_Word,
7460 pub e_entry: Elf64_Addr,
7461 pub e_phoff: Elf64_Off,
7462 pub e_shoff: Elf64_Off,
7463 pub e_flags: Elf64_Word,
7464 pub e_ehsize: Elf64_Half,
7465 pub e_phentsize: Elf64_Half,
7466 pub e_phnum: Elf64_Half,
7467 pub e_shentsize: Elf64_Half,
7468 pub e_shnum: Elf64_Half,
7469 pub e_shstrndx: Elf64_Half,
7470}
7471#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7472const _: () = {
7473 ["Size of Elf64_Ehdr"][::core::mem::size_of::<Elf64_Ehdr>() - 64usize];
7474 ["Alignment of Elf64_Ehdr"][::core::mem::align_of::<Elf64_Ehdr>() - 8usize];
7475 ["Offset of field: Elf64_Ehdr::e_ident"][::core::mem::offset_of!(Elf64_Ehdr, e_ident) - 0usize];
7476 ["Offset of field: Elf64_Ehdr::e_type"][::core::mem::offset_of!(Elf64_Ehdr, e_type) - 16usize];
7477 ["Offset of field: Elf64_Ehdr::e_machine"]
7478 [::core::mem::offset_of!(Elf64_Ehdr, e_machine) - 18usize];
7479 ["Offset of field: Elf64_Ehdr::e_version"]
7480 [::core::mem::offset_of!(Elf64_Ehdr, e_version) - 20usize];
7481 ["Offset of field: Elf64_Ehdr::e_entry"]
7482 [::core::mem::offset_of!(Elf64_Ehdr, e_entry) - 24usize];
7483 ["Offset of field: Elf64_Ehdr::e_phoff"]
7484 [::core::mem::offset_of!(Elf64_Ehdr, e_phoff) - 32usize];
7485 ["Offset of field: Elf64_Ehdr::e_shoff"]
7486 [::core::mem::offset_of!(Elf64_Ehdr, e_shoff) - 40usize];
7487 ["Offset of field: Elf64_Ehdr::e_flags"]
7488 [::core::mem::offset_of!(Elf64_Ehdr, e_flags) - 48usize];
7489 ["Offset of field: Elf64_Ehdr::e_ehsize"]
7490 [::core::mem::offset_of!(Elf64_Ehdr, e_ehsize) - 52usize];
7491 ["Offset of field: Elf64_Ehdr::e_phentsize"]
7492 [::core::mem::offset_of!(Elf64_Ehdr, e_phentsize) - 54usize];
7493 ["Offset of field: Elf64_Ehdr::e_phnum"]
7494 [::core::mem::offset_of!(Elf64_Ehdr, e_phnum) - 56usize];
7495 ["Offset of field: Elf64_Ehdr::e_shentsize"]
7496 [::core::mem::offset_of!(Elf64_Ehdr, e_shentsize) - 58usize];
7497 ["Offset of field: Elf64_Ehdr::e_shnum"]
7498 [::core::mem::offset_of!(Elf64_Ehdr, e_shnum) - 60usize];
7499 ["Offset of field: Elf64_Ehdr::e_shstrndx"]
7500 [::core::mem::offset_of!(Elf64_Ehdr, e_shstrndx) - 62usize];
7501};
7502#[repr(C)]
7503#[derive(Debug, Copy, Clone)]
7504pub struct Elf32_Shdr {
7505 pub sh_name: Elf32_Word,
7506 pub sh_type: Elf32_Word,
7507 pub sh_flags: Elf32_Word,
7508 pub sh_addr: Elf32_Addr,
7509 pub sh_offset: Elf32_Off,
7510 pub sh_size: Elf32_Word,
7511 pub sh_link: Elf32_Word,
7512 pub sh_info: Elf32_Word,
7513 pub sh_addralign: Elf32_Word,
7514 pub sh_entsize: Elf32_Word,
7515}
7516#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7517const _: () = {
7518 ["Size of Elf32_Shdr"][::core::mem::size_of::<Elf32_Shdr>() - 40usize];
7519 ["Alignment of Elf32_Shdr"][::core::mem::align_of::<Elf32_Shdr>() - 4usize];
7520 ["Offset of field: Elf32_Shdr::sh_name"][::core::mem::offset_of!(Elf32_Shdr, sh_name) - 0usize];
7521 ["Offset of field: Elf32_Shdr::sh_type"][::core::mem::offset_of!(Elf32_Shdr, sh_type) - 4usize];
7522 ["Offset of field: Elf32_Shdr::sh_flags"]
7523 [::core::mem::offset_of!(Elf32_Shdr, sh_flags) - 8usize];
7524 ["Offset of field: Elf32_Shdr::sh_addr"]
7525 [::core::mem::offset_of!(Elf32_Shdr, sh_addr) - 12usize];
7526 ["Offset of field: Elf32_Shdr::sh_offset"]
7527 [::core::mem::offset_of!(Elf32_Shdr, sh_offset) - 16usize];
7528 ["Offset of field: Elf32_Shdr::sh_size"]
7529 [::core::mem::offset_of!(Elf32_Shdr, sh_size) - 20usize];
7530 ["Offset of field: Elf32_Shdr::sh_link"]
7531 [::core::mem::offset_of!(Elf32_Shdr, sh_link) - 24usize];
7532 ["Offset of field: Elf32_Shdr::sh_info"]
7533 [::core::mem::offset_of!(Elf32_Shdr, sh_info) - 28usize];
7534 ["Offset of field: Elf32_Shdr::sh_addralign"]
7535 [::core::mem::offset_of!(Elf32_Shdr, sh_addralign) - 32usize];
7536 ["Offset of field: Elf32_Shdr::sh_entsize"]
7537 [::core::mem::offset_of!(Elf32_Shdr, sh_entsize) - 36usize];
7538};
7539#[repr(C)]
7540#[derive(Debug, Copy, Clone)]
7541pub struct Elf64_Shdr {
7542 pub sh_name: Elf64_Word,
7543 pub sh_type: Elf64_Word,
7544 pub sh_flags: Elf64_Xword,
7545 pub sh_addr: Elf64_Addr,
7546 pub sh_offset: Elf64_Off,
7547 pub sh_size: Elf64_Xword,
7548 pub sh_link: Elf64_Word,
7549 pub sh_info: Elf64_Word,
7550 pub sh_addralign: Elf64_Xword,
7551 pub sh_entsize: Elf64_Xword,
7552}
7553#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7554const _: () = {
7555 ["Size of Elf64_Shdr"][::core::mem::size_of::<Elf64_Shdr>() - 64usize];
7556 ["Alignment of Elf64_Shdr"][::core::mem::align_of::<Elf64_Shdr>() - 8usize];
7557 ["Offset of field: Elf64_Shdr::sh_name"][::core::mem::offset_of!(Elf64_Shdr, sh_name) - 0usize];
7558 ["Offset of field: Elf64_Shdr::sh_type"][::core::mem::offset_of!(Elf64_Shdr, sh_type) - 4usize];
7559 ["Offset of field: Elf64_Shdr::sh_flags"]
7560 [::core::mem::offset_of!(Elf64_Shdr, sh_flags) - 8usize];
7561 ["Offset of field: Elf64_Shdr::sh_addr"]
7562 [::core::mem::offset_of!(Elf64_Shdr, sh_addr) - 16usize];
7563 ["Offset of field: Elf64_Shdr::sh_offset"]
7564 [::core::mem::offset_of!(Elf64_Shdr, sh_offset) - 24usize];
7565 ["Offset of field: Elf64_Shdr::sh_size"]
7566 [::core::mem::offset_of!(Elf64_Shdr, sh_size) - 32usize];
7567 ["Offset of field: Elf64_Shdr::sh_link"]
7568 [::core::mem::offset_of!(Elf64_Shdr, sh_link) - 40usize];
7569 ["Offset of field: Elf64_Shdr::sh_info"]
7570 [::core::mem::offset_of!(Elf64_Shdr, sh_info) - 44usize];
7571 ["Offset of field: Elf64_Shdr::sh_addralign"]
7572 [::core::mem::offset_of!(Elf64_Shdr, sh_addralign) - 48usize];
7573 ["Offset of field: Elf64_Shdr::sh_entsize"]
7574 [::core::mem::offset_of!(Elf64_Shdr, sh_entsize) - 56usize];
7575};
7576#[repr(C)]
7577#[derive(Debug, Copy, Clone)]
7578pub struct Elf32_Chdr {
7579 pub ch_type: Elf32_Word,
7580 pub ch_size: Elf32_Word,
7581 pub ch_addralign: Elf32_Word,
7582}
7583#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7584const _: () = {
7585 ["Size of Elf32_Chdr"][::core::mem::size_of::<Elf32_Chdr>() - 12usize];
7586 ["Alignment of Elf32_Chdr"][::core::mem::align_of::<Elf32_Chdr>() - 4usize];
7587 ["Offset of field: Elf32_Chdr::ch_type"][::core::mem::offset_of!(Elf32_Chdr, ch_type) - 0usize];
7588 ["Offset of field: Elf32_Chdr::ch_size"][::core::mem::offset_of!(Elf32_Chdr, ch_size) - 4usize];
7589 ["Offset of field: Elf32_Chdr::ch_addralign"]
7590 [::core::mem::offset_of!(Elf32_Chdr, ch_addralign) - 8usize];
7591};
7592#[repr(C)]
7593#[derive(Debug, Copy, Clone)]
7594pub struct Elf64_Chdr {
7595 pub ch_type: Elf64_Word,
7596 pub ch_reserved: Elf64_Word,
7597 pub ch_size: Elf64_Xword,
7598 pub ch_addralign: Elf64_Xword,
7599}
7600#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7601const _: () = {
7602 ["Size of Elf64_Chdr"][::core::mem::size_of::<Elf64_Chdr>() - 24usize];
7603 ["Alignment of Elf64_Chdr"][::core::mem::align_of::<Elf64_Chdr>() - 8usize];
7604 ["Offset of field: Elf64_Chdr::ch_type"][::core::mem::offset_of!(Elf64_Chdr, ch_type) - 0usize];
7605 ["Offset of field: Elf64_Chdr::ch_reserved"]
7606 [::core::mem::offset_of!(Elf64_Chdr, ch_reserved) - 4usize];
7607 ["Offset of field: Elf64_Chdr::ch_size"][::core::mem::offset_of!(Elf64_Chdr, ch_size) - 8usize];
7608 ["Offset of field: Elf64_Chdr::ch_addralign"]
7609 [::core::mem::offset_of!(Elf64_Chdr, ch_addralign) - 16usize];
7610};
7611#[repr(C)]
7612#[derive(Debug, Copy, Clone)]
7613pub struct Elf32_Sym {
7614 pub st_name: Elf32_Word,
7615 pub st_value: Elf32_Addr,
7616 pub st_size: Elf32_Word,
7617 pub st_info: core::ffi::c_uchar,
7618 pub st_other: core::ffi::c_uchar,
7619 pub st_shndx: Elf32_Section,
7620}
7621#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7622const _: () = {
7623 ["Size of Elf32_Sym"][::core::mem::size_of::<Elf32_Sym>() - 16usize];
7624 ["Alignment of Elf32_Sym"][::core::mem::align_of::<Elf32_Sym>() - 4usize];
7625 ["Offset of field: Elf32_Sym::st_name"][::core::mem::offset_of!(Elf32_Sym, st_name) - 0usize];
7626 ["Offset of field: Elf32_Sym::st_value"][::core::mem::offset_of!(Elf32_Sym, st_value) - 4usize];
7627 ["Offset of field: Elf32_Sym::st_size"][::core::mem::offset_of!(Elf32_Sym, st_size) - 8usize];
7628 ["Offset of field: Elf32_Sym::st_info"][::core::mem::offset_of!(Elf32_Sym, st_info) - 12usize];
7629 ["Offset of field: Elf32_Sym::st_other"]
7630 [::core::mem::offset_of!(Elf32_Sym, st_other) - 13usize];
7631 ["Offset of field: Elf32_Sym::st_shndx"]
7632 [::core::mem::offset_of!(Elf32_Sym, st_shndx) - 14usize];
7633};
7634#[repr(C)]
7635#[derive(Debug, Copy, Clone)]
7636pub struct Elf64_Sym {
7637 pub st_name: Elf64_Word,
7638 pub st_info: core::ffi::c_uchar,
7639 pub st_other: core::ffi::c_uchar,
7640 pub st_shndx: Elf64_Section,
7641 pub st_value: Elf64_Addr,
7642 pub st_size: Elf64_Xword,
7643}
7644#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7645const _: () = {
7646 ["Size of Elf64_Sym"][::core::mem::size_of::<Elf64_Sym>() - 24usize];
7647 ["Alignment of Elf64_Sym"][::core::mem::align_of::<Elf64_Sym>() - 8usize];
7648 ["Offset of field: Elf64_Sym::st_name"][::core::mem::offset_of!(Elf64_Sym, st_name) - 0usize];
7649 ["Offset of field: Elf64_Sym::st_info"][::core::mem::offset_of!(Elf64_Sym, st_info) - 4usize];
7650 ["Offset of field: Elf64_Sym::st_other"][::core::mem::offset_of!(Elf64_Sym, st_other) - 5usize];
7651 ["Offset of field: Elf64_Sym::st_shndx"][::core::mem::offset_of!(Elf64_Sym, st_shndx) - 6usize];
7652 ["Offset of field: Elf64_Sym::st_value"][::core::mem::offset_of!(Elf64_Sym, st_value) - 8usize];
7653 ["Offset of field: Elf64_Sym::st_size"][::core::mem::offset_of!(Elf64_Sym, st_size) - 16usize];
7654};
7655#[repr(C)]
7656#[derive(Debug, Copy, Clone)]
7657pub struct Elf32_Syminfo {
7658 pub si_boundto: Elf32_Half,
7659 pub si_flags: Elf32_Half,
7660}
7661#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7662const _: () = {
7663 ["Size of Elf32_Syminfo"][::core::mem::size_of::<Elf32_Syminfo>() - 4usize];
7664 ["Alignment of Elf32_Syminfo"][::core::mem::align_of::<Elf32_Syminfo>() - 2usize];
7665 ["Offset of field: Elf32_Syminfo::si_boundto"]
7666 [::core::mem::offset_of!(Elf32_Syminfo, si_boundto) - 0usize];
7667 ["Offset of field: Elf32_Syminfo::si_flags"]
7668 [::core::mem::offset_of!(Elf32_Syminfo, si_flags) - 2usize];
7669};
7670#[repr(C)]
7671#[derive(Debug, Copy, Clone)]
7672pub struct Elf64_Syminfo {
7673 pub si_boundto: Elf64_Half,
7674 pub si_flags: Elf64_Half,
7675}
7676#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7677const _: () = {
7678 ["Size of Elf64_Syminfo"][::core::mem::size_of::<Elf64_Syminfo>() - 4usize];
7679 ["Alignment of Elf64_Syminfo"][::core::mem::align_of::<Elf64_Syminfo>() - 2usize];
7680 ["Offset of field: Elf64_Syminfo::si_boundto"]
7681 [::core::mem::offset_of!(Elf64_Syminfo, si_boundto) - 0usize];
7682 ["Offset of field: Elf64_Syminfo::si_flags"]
7683 [::core::mem::offset_of!(Elf64_Syminfo, si_flags) - 2usize];
7684};
7685#[repr(C)]
7686#[derive(Debug, Copy, Clone)]
7687pub struct Elf32_Rel {
7688 pub r_offset: Elf32_Addr,
7689 pub r_info: Elf32_Word,
7690}
7691#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7692const _: () = {
7693 ["Size of Elf32_Rel"][::core::mem::size_of::<Elf32_Rel>() - 8usize];
7694 ["Alignment of Elf32_Rel"][::core::mem::align_of::<Elf32_Rel>() - 4usize];
7695 ["Offset of field: Elf32_Rel::r_offset"][::core::mem::offset_of!(Elf32_Rel, r_offset) - 0usize];
7696 ["Offset of field: Elf32_Rel::r_info"][::core::mem::offset_of!(Elf32_Rel, r_info) - 4usize];
7697};
7698#[repr(C)]
7699#[derive(Debug, Copy, Clone)]
7700pub struct Elf64_Rel {
7701 pub r_offset: Elf64_Addr,
7702 pub r_info: Elf64_Xword,
7703}
7704#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7705const _: () = {
7706 ["Size of Elf64_Rel"][::core::mem::size_of::<Elf64_Rel>() - 16usize];
7707 ["Alignment of Elf64_Rel"][::core::mem::align_of::<Elf64_Rel>() - 8usize];
7708 ["Offset of field: Elf64_Rel::r_offset"][::core::mem::offset_of!(Elf64_Rel, r_offset) - 0usize];
7709 ["Offset of field: Elf64_Rel::r_info"][::core::mem::offset_of!(Elf64_Rel, r_info) - 8usize];
7710};
7711#[repr(C)]
7712#[derive(Debug, Copy, Clone)]
7713pub struct Elf32_Rela {
7714 pub r_offset: Elf32_Addr,
7715 pub r_info: Elf32_Word,
7716 pub r_addend: Elf32_Sword,
7717}
7718#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7719const _: () = {
7720 ["Size of Elf32_Rela"][::core::mem::size_of::<Elf32_Rela>() - 12usize];
7721 ["Alignment of Elf32_Rela"][::core::mem::align_of::<Elf32_Rela>() - 4usize];
7722 ["Offset of field: Elf32_Rela::r_offset"]
7723 [::core::mem::offset_of!(Elf32_Rela, r_offset) - 0usize];
7724 ["Offset of field: Elf32_Rela::r_info"][::core::mem::offset_of!(Elf32_Rela, r_info) - 4usize];
7725 ["Offset of field: Elf32_Rela::r_addend"]
7726 [::core::mem::offset_of!(Elf32_Rela, r_addend) - 8usize];
7727};
7728#[repr(C)]
7729#[derive(Debug, Copy, Clone)]
7730pub struct Elf64_Rela {
7731 pub r_offset: Elf64_Addr,
7732 pub r_info: Elf64_Xword,
7733 pub r_addend: Elf64_Sxword,
7734}
7735#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7736const _: () = {
7737 ["Size of Elf64_Rela"][::core::mem::size_of::<Elf64_Rela>() - 24usize];
7738 ["Alignment of Elf64_Rela"][::core::mem::align_of::<Elf64_Rela>() - 8usize];
7739 ["Offset of field: Elf64_Rela::r_offset"]
7740 [::core::mem::offset_of!(Elf64_Rela, r_offset) - 0usize];
7741 ["Offset of field: Elf64_Rela::r_info"][::core::mem::offset_of!(Elf64_Rela, r_info) - 8usize];
7742 ["Offset of field: Elf64_Rela::r_addend"]
7743 [::core::mem::offset_of!(Elf64_Rela, r_addend) - 16usize];
7744};
7745#[repr(C)]
7746#[derive(Debug, Copy, Clone)]
7747pub struct Elf32_Phdr {
7748 pub p_type: Elf32_Word,
7749 pub p_offset: Elf32_Off,
7750 pub p_vaddr: Elf32_Addr,
7751 pub p_paddr: Elf32_Addr,
7752 pub p_filesz: Elf32_Word,
7753 pub p_memsz: Elf32_Word,
7754 pub p_flags: Elf32_Word,
7755 pub p_align: Elf32_Word,
7756}
7757#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7758const _: () = {
7759 ["Size of Elf32_Phdr"][::core::mem::size_of::<Elf32_Phdr>() - 32usize];
7760 ["Alignment of Elf32_Phdr"][::core::mem::align_of::<Elf32_Phdr>() - 4usize];
7761 ["Offset of field: Elf32_Phdr::p_type"][::core::mem::offset_of!(Elf32_Phdr, p_type) - 0usize];
7762 ["Offset of field: Elf32_Phdr::p_offset"]
7763 [::core::mem::offset_of!(Elf32_Phdr, p_offset) - 4usize];
7764 ["Offset of field: Elf32_Phdr::p_vaddr"][::core::mem::offset_of!(Elf32_Phdr, p_vaddr) - 8usize];
7765 ["Offset of field: Elf32_Phdr::p_paddr"]
7766 [::core::mem::offset_of!(Elf32_Phdr, p_paddr) - 12usize];
7767 ["Offset of field: Elf32_Phdr::p_filesz"]
7768 [::core::mem::offset_of!(Elf32_Phdr, p_filesz) - 16usize];
7769 ["Offset of field: Elf32_Phdr::p_memsz"]
7770 [::core::mem::offset_of!(Elf32_Phdr, p_memsz) - 20usize];
7771 ["Offset of field: Elf32_Phdr::p_flags"]
7772 [::core::mem::offset_of!(Elf32_Phdr, p_flags) - 24usize];
7773 ["Offset of field: Elf32_Phdr::p_align"]
7774 [::core::mem::offset_of!(Elf32_Phdr, p_align) - 28usize];
7775};
7776#[repr(C)]
7777#[derive(Debug, Copy, Clone)]
7778pub struct Elf64_Phdr {
7779 pub p_type: Elf64_Word,
7780 pub p_flags: Elf64_Word,
7781 pub p_offset: Elf64_Off,
7782 pub p_vaddr: Elf64_Addr,
7783 pub p_paddr: Elf64_Addr,
7784 pub p_filesz: Elf64_Xword,
7785 pub p_memsz: Elf64_Xword,
7786 pub p_align: Elf64_Xword,
7787}
7788#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7789const _: () = {
7790 ["Size of Elf64_Phdr"][::core::mem::size_of::<Elf64_Phdr>() - 56usize];
7791 ["Alignment of Elf64_Phdr"][::core::mem::align_of::<Elf64_Phdr>() - 8usize];
7792 ["Offset of field: Elf64_Phdr::p_type"][::core::mem::offset_of!(Elf64_Phdr, p_type) - 0usize];
7793 ["Offset of field: Elf64_Phdr::p_flags"][::core::mem::offset_of!(Elf64_Phdr, p_flags) - 4usize];
7794 ["Offset of field: Elf64_Phdr::p_offset"]
7795 [::core::mem::offset_of!(Elf64_Phdr, p_offset) - 8usize];
7796 ["Offset of field: Elf64_Phdr::p_vaddr"]
7797 [::core::mem::offset_of!(Elf64_Phdr, p_vaddr) - 16usize];
7798 ["Offset of field: Elf64_Phdr::p_paddr"]
7799 [::core::mem::offset_of!(Elf64_Phdr, p_paddr) - 24usize];
7800 ["Offset of field: Elf64_Phdr::p_filesz"]
7801 [::core::mem::offset_of!(Elf64_Phdr, p_filesz) - 32usize];
7802 ["Offset of field: Elf64_Phdr::p_memsz"]
7803 [::core::mem::offset_of!(Elf64_Phdr, p_memsz) - 40usize];
7804 ["Offset of field: Elf64_Phdr::p_align"]
7805 [::core::mem::offset_of!(Elf64_Phdr, p_align) - 48usize];
7806};
7807#[repr(C)]
7808#[derive(Copy, Clone)]
7809pub struct Elf32_Dyn {
7810 pub d_tag: Elf32_Sword,
7811 pub d_un: Elf32_Dyn__bindgen_ty_1,
7812}
7813#[repr(C)]
7814#[derive(Copy, Clone)]
7815pub union Elf32_Dyn__bindgen_ty_1 {
7816 pub d_val: Elf32_Word,
7817 pub d_ptr: Elf32_Addr,
7818}
7819#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7820const _: () = {
7821 ["Size of Elf32_Dyn__bindgen_ty_1"][::core::mem::size_of::<Elf32_Dyn__bindgen_ty_1>() - 4usize];
7822 ["Alignment of Elf32_Dyn__bindgen_ty_1"]
7823 [::core::mem::align_of::<Elf32_Dyn__bindgen_ty_1>() - 4usize];
7824 ["Offset of field: Elf32_Dyn__bindgen_ty_1::d_val"]
7825 [::core::mem::offset_of!(Elf32_Dyn__bindgen_ty_1, d_val) - 0usize];
7826 ["Offset of field: Elf32_Dyn__bindgen_ty_1::d_ptr"]
7827 [::core::mem::offset_of!(Elf32_Dyn__bindgen_ty_1, d_ptr) - 0usize];
7828};
7829#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7830const _: () = {
7831 ["Size of Elf32_Dyn"][::core::mem::size_of::<Elf32_Dyn>() - 8usize];
7832 ["Alignment of Elf32_Dyn"][::core::mem::align_of::<Elf32_Dyn>() - 4usize];
7833 ["Offset of field: Elf32_Dyn::d_tag"][::core::mem::offset_of!(Elf32_Dyn, d_tag) - 0usize];
7834 ["Offset of field: Elf32_Dyn::d_un"][::core::mem::offset_of!(Elf32_Dyn, d_un) - 4usize];
7835};
7836#[repr(C)]
7837#[derive(Copy, Clone)]
7838pub struct Elf64_Dyn {
7839 pub d_tag: Elf64_Sxword,
7840 pub d_un: Elf64_Dyn__bindgen_ty_1,
7841}
7842#[repr(C)]
7843#[derive(Copy, Clone)]
7844pub union Elf64_Dyn__bindgen_ty_1 {
7845 pub d_val: Elf64_Xword,
7846 pub d_ptr: Elf64_Addr,
7847}
7848#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7849const _: () = {
7850 ["Size of Elf64_Dyn__bindgen_ty_1"][::core::mem::size_of::<Elf64_Dyn__bindgen_ty_1>() - 8usize];
7851 ["Alignment of Elf64_Dyn__bindgen_ty_1"]
7852 [::core::mem::align_of::<Elf64_Dyn__bindgen_ty_1>() - 8usize];
7853 ["Offset of field: Elf64_Dyn__bindgen_ty_1::d_val"]
7854 [::core::mem::offset_of!(Elf64_Dyn__bindgen_ty_1, d_val) - 0usize];
7855 ["Offset of field: Elf64_Dyn__bindgen_ty_1::d_ptr"]
7856 [::core::mem::offset_of!(Elf64_Dyn__bindgen_ty_1, d_ptr) - 0usize];
7857};
7858#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7859const _: () = {
7860 ["Size of Elf64_Dyn"][::core::mem::size_of::<Elf64_Dyn>() - 16usize];
7861 ["Alignment of Elf64_Dyn"][::core::mem::align_of::<Elf64_Dyn>() - 8usize];
7862 ["Offset of field: Elf64_Dyn::d_tag"][::core::mem::offset_of!(Elf64_Dyn, d_tag) - 0usize];
7863 ["Offset of field: Elf64_Dyn::d_un"][::core::mem::offset_of!(Elf64_Dyn, d_un) - 8usize];
7864};
7865#[repr(C)]
7866#[derive(Debug, Copy, Clone)]
7867pub struct Elf32_Verdef {
7868 pub vd_version: Elf32_Half,
7869 pub vd_flags: Elf32_Half,
7870 pub vd_ndx: Elf32_Half,
7871 pub vd_cnt: Elf32_Half,
7872 pub vd_hash: Elf32_Word,
7873 pub vd_aux: Elf32_Word,
7874 pub vd_next: Elf32_Word,
7875}
7876#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7877const _: () = {
7878 ["Size of Elf32_Verdef"][::core::mem::size_of::<Elf32_Verdef>() - 20usize];
7879 ["Alignment of Elf32_Verdef"][::core::mem::align_of::<Elf32_Verdef>() - 4usize];
7880 ["Offset of field: Elf32_Verdef::vd_version"]
7881 [::core::mem::offset_of!(Elf32_Verdef, vd_version) - 0usize];
7882 ["Offset of field: Elf32_Verdef::vd_flags"]
7883 [::core::mem::offset_of!(Elf32_Verdef, vd_flags) - 2usize];
7884 ["Offset of field: Elf32_Verdef::vd_ndx"]
7885 [::core::mem::offset_of!(Elf32_Verdef, vd_ndx) - 4usize];
7886 ["Offset of field: Elf32_Verdef::vd_cnt"]
7887 [::core::mem::offset_of!(Elf32_Verdef, vd_cnt) - 6usize];
7888 ["Offset of field: Elf32_Verdef::vd_hash"]
7889 [::core::mem::offset_of!(Elf32_Verdef, vd_hash) - 8usize];
7890 ["Offset of field: Elf32_Verdef::vd_aux"]
7891 [::core::mem::offset_of!(Elf32_Verdef, vd_aux) - 12usize];
7892 ["Offset of field: Elf32_Verdef::vd_next"]
7893 [::core::mem::offset_of!(Elf32_Verdef, vd_next) - 16usize];
7894};
7895#[repr(C)]
7896#[derive(Debug, Copy, Clone)]
7897pub struct Elf64_Verdef {
7898 pub vd_version: Elf64_Half,
7899 pub vd_flags: Elf64_Half,
7900 pub vd_ndx: Elf64_Half,
7901 pub vd_cnt: Elf64_Half,
7902 pub vd_hash: Elf64_Word,
7903 pub vd_aux: Elf64_Word,
7904 pub vd_next: Elf64_Word,
7905}
7906#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7907const _: () = {
7908 ["Size of Elf64_Verdef"][::core::mem::size_of::<Elf64_Verdef>() - 20usize];
7909 ["Alignment of Elf64_Verdef"][::core::mem::align_of::<Elf64_Verdef>() - 4usize];
7910 ["Offset of field: Elf64_Verdef::vd_version"]
7911 [::core::mem::offset_of!(Elf64_Verdef, vd_version) - 0usize];
7912 ["Offset of field: Elf64_Verdef::vd_flags"]
7913 [::core::mem::offset_of!(Elf64_Verdef, vd_flags) - 2usize];
7914 ["Offset of field: Elf64_Verdef::vd_ndx"]
7915 [::core::mem::offset_of!(Elf64_Verdef, vd_ndx) - 4usize];
7916 ["Offset of field: Elf64_Verdef::vd_cnt"]
7917 [::core::mem::offset_of!(Elf64_Verdef, vd_cnt) - 6usize];
7918 ["Offset of field: Elf64_Verdef::vd_hash"]
7919 [::core::mem::offset_of!(Elf64_Verdef, vd_hash) - 8usize];
7920 ["Offset of field: Elf64_Verdef::vd_aux"]
7921 [::core::mem::offset_of!(Elf64_Verdef, vd_aux) - 12usize];
7922 ["Offset of field: Elf64_Verdef::vd_next"]
7923 [::core::mem::offset_of!(Elf64_Verdef, vd_next) - 16usize];
7924};
7925#[repr(C)]
7926#[derive(Debug, Copy, Clone)]
7927pub struct Elf32_Verdaux {
7928 pub vda_name: Elf32_Word,
7929 pub vda_next: Elf32_Word,
7930}
7931#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7932const _: () = {
7933 ["Size of Elf32_Verdaux"][::core::mem::size_of::<Elf32_Verdaux>() - 8usize];
7934 ["Alignment of Elf32_Verdaux"][::core::mem::align_of::<Elf32_Verdaux>() - 4usize];
7935 ["Offset of field: Elf32_Verdaux::vda_name"]
7936 [::core::mem::offset_of!(Elf32_Verdaux, vda_name) - 0usize];
7937 ["Offset of field: Elf32_Verdaux::vda_next"]
7938 [::core::mem::offset_of!(Elf32_Verdaux, vda_next) - 4usize];
7939};
7940#[repr(C)]
7941#[derive(Debug, Copy, Clone)]
7942pub struct Elf64_Verdaux {
7943 pub vda_name: Elf64_Word,
7944 pub vda_next: Elf64_Word,
7945}
7946#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7947const _: () = {
7948 ["Size of Elf64_Verdaux"][::core::mem::size_of::<Elf64_Verdaux>() - 8usize];
7949 ["Alignment of Elf64_Verdaux"][::core::mem::align_of::<Elf64_Verdaux>() - 4usize];
7950 ["Offset of field: Elf64_Verdaux::vda_name"]
7951 [::core::mem::offset_of!(Elf64_Verdaux, vda_name) - 0usize];
7952 ["Offset of field: Elf64_Verdaux::vda_next"]
7953 [::core::mem::offset_of!(Elf64_Verdaux, vda_next) - 4usize];
7954};
7955#[repr(C)]
7956#[derive(Debug, Copy, Clone)]
7957pub struct Elf32_Verneed {
7958 pub vn_version: Elf32_Half,
7959 pub vn_cnt: Elf32_Half,
7960 pub vn_file: Elf32_Word,
7961 pub vn_aux: Elf32_Word,
7962 pub vn_next: Elf32_Word,
7963}
7964#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7965const _: () = {
7966 ["Size of Elf32_Verneed"][::core::mem::size_of::<Elf32_Verneed>() - 16usize];
7967 ["Alignment of Elf32_Verneed"][::core::mem::align_of::<Elf32_Verneed>() - 4usize];
7968 ["Offset of field: Elf32_Verneed::vn_version"]
7969 [::core::mem::offset_of!(Elf32_Verneed, vn_version) - 0usize];
7970 ["Offset of field: Elf32_Verneed::vn_cnt"]
7971 [::core::mem::offset_of!(Elf32_Verneed, vn_cnt) - 2usize];
7972 ["Offset of field: Elf32_Verneed::vn_file"]
7973 [::core::mem::offset_of!(Elf32_Verneed, vn_file) - 4usize];
7974 ["Offset of field: Elf32_Verneed::vn_aux"]
7975 [::core::mem::offset_of!(Elf32_Verneed, vn_aux) - 8usize];
7976 ["Offset of field: Elf32_Verneed::vn_next"]
7977 [::core::mem::offset_of!(Elf32_Verneed, vn_next) - 12usize];
7978};
7979#[repr(C)]
7980#[derive(Debug, Copy, Clone)]
7981pub struct Elf64_Verneed {
7982 pub vn_version: Elf64_Half,
7983 pub vn_cnt: Elf64_Half,
7984 pub vn_file: Elf64_Word,
7985 pub vn_aux: Elf64_Word,
7986 pub vn_next: Elf64_Word,
7987}
7988#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7989const _: () = {
7990 ["Size of Elf64_Verneed"][::core::mem::size_of::<Elf64_Verneed>() - 16usize];
7991 ["Alignment of Elf64_Verneed"][::core::mem::align_of::<Elf64_Verneed>() - 4usize];
7992 ["Offset of field: Elf64_Verneed::vn_version"]
7993 [::core::mem::offset_of!(Elf64_Verneed, vn_version) - 0usize];
7994 ["Offset of field: Elf64_Verneed::vn_cnt"]
7995 [::core::mem::offset_of!(Elf64_Verneed, vn_cnt) - 2usize];
7996 ["Offset of field: Elf64_Verneed::vn_file"]
7997 [::core::mem::offset_of!(Elf64_Verneed, vn_file) - 4usize];
7998 ["Offset of field: Elf64_Verneed::vn_aux"]
7999 [::core::mem::offset_of!(Elf64_Verneed, vn_aux) - 8usize];
8000 ["Offset of field: Elf64_Verneed::vn_next"]
8001 [::core::mem::offset_of!(Elf64_Verneed, vn_next) - 12usize];
8002};
8003#[repr(C)]
8004#[derive(Debug, Copy, Clone)]
8005pub struct Elf32_Vernaux {
8006 pub vna_hash: Elf32_Word,
8007 pub vna_flags: Elf32_Half,
8008 pub vna_other: Elf32_Half,
8009 pub vna_name: Elf32_Word,
8010 pub vna_next: Elf32_Word,
8011}
8012#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8013const _: () = {
8014 ["Size of Elf32_Vernaux"][::core::mem::size_of::<Elf32_Vernaux>() - 16usize];
8015 ["Alignment of Elf32_Vernaux"][::core::mem::align_of::<Elf32_Vernaux>() - 4usize];
8016 ["Offset of field: Elf32_Vernaux::vna_hash"]
8017 [::core::mem::offset_of!(Elf32_Vernaux, vna_hash) - 0usize];
8018 ["Offset of field: Elf32_Vernaux::vna_flags"]
8019 [::core::mem::offset_of!(Elf32_Vernaux, vna_flags) - 4usize];
8020 ["Offset of field: Elf32_Vernaux::vna_other"]
8021 [::core::mem::offset_of!(Elf32_Vernaux, vna_other) - 6usize];
8022 ["Offset of field: Elf32_Vernaux::vna_name"]
8023 [::core::mem::offset_of!(Elf32_Vernaux, vna_name) - 8usize];
8024 ["Offset of field: Elf32_Vernaux::vna_next"]
8025 [::core::mem::offset_of!(Elf32_Vernaux, vna_next) - 12usize];
8026};
8027#[repr(C)]
8028#[derive(Debug, Copy, Clone)]
8029pub struct Elf64_Vernaux {
8030 pub vna_hash: Elf64_Word,
8031 pub vna_flags: Elf64_Half,
8032 pub vna_other: Elf64_Half,
8033 pub vna_name: Elf64_Word,
8034 pub vna_next: Elf64_Word,
8035}
8036#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8037const _: () = {
8038 ["Size of Elf64_Vernaux"][::core::mem::size_of::<Elf64_Vernaux>() - 16usize];
8039 ["Alignment of Elf64_Vernaux"][::core::mem::align_of::<Elf64_Vernaux>() - 4usize];
8040 ["Offset of field: Elf64_Vernaux::vna_hash"]
8041 [::core::mem::offset_of!(Elf64_Vernaux, vna_hash) - 0usize];
8042 ["Offset of field: Elf64_Vernaux::vna_flags"]
8043 [::core::mem::offset_of!(Elf64_Vernaux, vna_flags) - 4usize];
8044 ["Offset of field: Elf64_Vernaux::vna_other"]
8045 [::core::mem::offset_of!(Elf64_Vernaux, vna_other) - 6usize];
8046 ["Offset of field: Elf64_Vernaux::vna_name"]
8047 [::core::mem::offset_of!(Elf64_Vernaux, vna_name) - 8usize];
8048 ["Offset of field: Elf64_Vernaux::vna_next"]
8049 [::core::mem::offset_of!(Elf64_Vernaux, vna_next) - 12usize];
8050};
8051#[repr(C)]
8052#[derive(Copy, Clone)]
8053pub struct Elf32_auxv_t {
8054 pub a_type: u32,
8055 pub a_un: Elf32_auxv_t__bindgen_ty_1,
8056}
8057#[repr(C)]
8058#[derive(Copy, Clone)]
8059pub union Elf32_auxv_t__bindgen_ty_1 {
8060 pub a_val: u32,
8061}
8062#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8063const _: () = {
8064 ["Size of Elf32_auxv_t__bindgen_ty_1"]
8065 [::core::mem::size_of::<Elf32_auxv_t__bindgen_ty_1>() - 4usize];
8066 ["Alignment of Elf32_auxv_t__bindgen_ty_1"]
8067 [::core::mem::align_of::<Elf32_auxv_t__bindgen_ty_1>() - 4usize];
8068 ["Offset of field: Elf32_auxv_t__bindgen_ty_1::a_val"]
8069 [::core::mem::offset_of!(Elf32_auxv_t__bindgen_ty_1, a_val) - 0usize];
8070};
8071#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8072const _: () = {
8073 ["Size of Elf32_auxv_t"][::core::mem::size_of::<Elf32_auxv_t>() - 8usize];
8074 ["Alignment of Elf32_auxv_t"][::core::mem::align_of::<Elf32_auxv_t>() - 4usize];
8075 ["Offset of field: Elf32_auxv_t::a_type"]
8076 [::core::mem::offset_of!(Elf32_auxv_t, a_type) - 0usize];
8077 ["Offset of field: Elf32_auxv_t::a_un"][::core::mem::offset_of!(Elf32_auxv_t, a_un) - 4usize];
8078};
8079#[repr(C)]
8080#[derive(Copy, Clone)]
8081pub struct Elf64_auxv_t {
8082 pub a_type: u64,
8083 pub a_un: Elf64_auxv_t__bindgen_ty_1,
8084}
8085#[repr(C)]
8086#[derive(Copy, Clone)]
8087pub union Elf64_auxv_t__bindgen_ty_1 {
8088 pub a_val: u64,
8089}
8090#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8091const _: () = {
8092 ["Size of Elf64_auxv_t__bindgen_ty_1"]
8093 [::core::mem::size_of::<Elf64_auxv_t__bindgen_ty_1>() - 8usize];
8094 ["Alignment of Elf64_auxv_t__bindgen_ty_1"]
8095 [::core::mem::align_of::<Elf64_auxv_t__bindgen_ty_1>() - 8usize];
8096 ["Offset of field: Elf64_auxv_t__bindgen_ty_1::a_val"]
8097 [::core::mem::offset_of!(Elf64_auxv_t__bindgen_ty_1, a_val) - 0usize];
8098};
8099#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8100const _: () = {
8101 ["Size of Elf64_auxv_t"][::core::mem::size_of::<Elf64_auxv_t>() - 16usize];
8102 ["Alignment of Elf64_auxv_t"][::core::mem::align_of::<Elf64_auxv_t>() - 8usize];
8103 ["Offset of field: Elf64_auxv_t::a_type"]
8104 [::core::mem::offset_of!(Elf64_auxv_t, a_type) - 0usize];
8105 ["Offset of field: Elf64_auxv_t::a_un"][::core::mem::offset_of!(Elf64_auxv_t, a_un) - 8usize];
8106};
8107#[repr(C)]
8108#[derive(Debug, Copy, Clone)]
8109pub struct Elf32_Nhdr {
8110 pub n_namesz: Elf32_Word,
8111 pub n_descsz: Elf32_Word,
8112 pub n_type: Elf32_Word,
8113}
8114#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8115const _: () = {
8116 ["Size of Elf32_Nhdr"][::core::mem::size_of::<Elf32_Nhdr>() - 12usize];
8117 ["Alignment of Elf32_Nhdr"][::core::mem::align_of::<Elf32_Nhdr>() - 4usize];
8118 ["Offset of field: Elf32_Nhdr::n_namesz"]
8119 [::core::mem::offset_of!(Elf32_Nhdr, n_namesz) - 0usize];
8120 ["Offset of field: Elf32_Nhdr::n_descsz"]
8121 [::core::mem::offset_of!(Elf32_Nhdr, n_descsz) - 4usize];
8122 ["Offset of field: Elf32_Nhdr::n_type"][::core::mem::offset_of!(Elf32_Nhdr, n_type) - 8usize];
8123};
8124#[repr(C)]
8125#[derive(Debug, Copy, Clone)]
8126pub struct Elf64_Nhdr {
8127 pub n_namesz: Elf64_Word,
8128 pub n_descsz: Elf64_Word,
8129 pub n_type: Elf64_Word,
8130}
8131#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8132const _: () = {
8133 ["Size of Elf64_Nhdr"][::core::mem::size_of::<Elf64_Nhdr>() - 12usize];
8134 ["Alignment of Elf64_Nhdr"][::core::mem::align_of::<Elf64_Nhdr>() - 4usize];
8135 ["Offset of field: Elf64_Nhdr::n_namesz"]
8136 [::core::mem::offset_of!(Elf64_Nhdr, n_namesz) - 0usize];
8137 ["Offset of field: Elf64_Nhdr::n_descsz"]
8138 [::core::mem::offset_of!(Elf64_Nhdr, n_descsz) - 4usize];
8139 ["Offset of field: Elf64_Nhdr::n_type"][::core::mem::offset_of!(Elf64_Nhdr, n_type) - 8usize];
8140};
8141#[repr(C)]
8142#[derive(Debug, Copy, Clone)]
8143pub struct Elf32_Move {
8144 pub m_value: Elf32_Xword,
8145 pub m_info: Elf32_Word,
8146 pub m_poffset: Elf32_Word,
8147 pub m_repeat: Elf32_Half,
8148 pub m_stride: Elf32_Half,
8149}
8150#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8151const _: () = {
8152 ["Size of Elf32_Move"][::core::mem::size_of::<Elf32_Move>() - 24usize];
8153 ["Alignment of Elf32_Move"][::core::mem::align_of::<Elf32_Move>() - 8usize];
8154 ["Offset of field: Elf32_Move::m_value"][::core::mem::offset_of!(Elf32_Move, m_value) - 0usize];
8155 ["Offset of field: Elf32_Move::m_info"][::core::mem::offset_of!(Elf32_Move, m_info) - 8usize];
8156 ["Offset of field: Elf32_Move::m_poffset"]
8157 [::core::mem::offset_of!(Elf32_Move, m_poffset) - 12usize];
8158 ["Offset of field: Elf32_Move::m_repeat"]
8159 [::core::mem::offset_of!(Elf32_Move, m_repeat) - 16usize];
8160 ["Offset of field: Elf32_Move::m_stride"]
8161 [::core::mem::offset_of!(Elf32_Move, m_stride) - 18usize];
8162};
8163#[repr(C)]
8164#[derive(Debug, Copy, Clone)]
8165pub struct Elf64_Move {
8166 pub m_value: Elf64_Xword,
8167 pub m_info: Elf64_Xword,
8168 pub m_poffset: Elf64_Xword,
8169 pub m_repeat: Elf64_Half,
8170 pub m_stride: Elf64_Half,
8171}
8172#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8173const _: () = {
8174 ["Size of Elf64_Move"][::core::mem::size_of::<Elf64_Move>() - 32usize];
8175 ["Alignment of Elf64_Move"][::core::mem::align_of::<Elf64_Move>() - 8usize];
8176 ["Offset of field: Elf64_Move::m_value"][::core::mem::offset_of!(Elf64_Move, m_value) - 0usize];
8177 ["Offset of field: Elf64_Move::m_info"][::core::mem::offset_of!(Elf64_Move, m_info) - 8usize];
8178 ["Offset of field: Elf64_Move::m_poffset"]
8179 [::core::mem::offset_of!(Elf64_Move, m_poffset) - 16usize];
8180 ["Offset of field: Elf64_Move::m_repeat"]
8181 [::core::mem::offset_of!(Elf64_Move, m_repeat) - 24usize];
8182 ["Offset of field: Elf64_Move::m_stride"]
8183 [::core::mem::offset_of!(Elf64_Move, m_stride) - 26usize];
8184};
8185#[repr(C)]
8186#[derive(Copy, Clone)]
8187pub union Elf32_gptab {
8188 pub gt_header: Elf32_gptab__bindgen_ty_1,
8189 pub gt_entry: Elf32_gptab__bindgen_ty_2,
8190}
8191#[repr(C)]
8192#[derive(Debug, Copy, Clone)]
8193pub struct Elf32_gptab__bindgen_ty_1 {
8194 pub gt_current_g_value: Elf32_Word,
8195 pub gt_unused: Elf32_Word,
8196}
8197#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8198const _: () = {
8199 ["Size of Elf32_gptab__bindgen_ty_1"]
8200 [::core::mem::size_of::<Elf32_gptab__bindgen_ty_1>() - 8usize];
8201 ["Alignment of Elf32_gptab__bindgen_ty_1"]
8202 [::core::mem::align_of::<Elf32_gptab__bindgen_ty_1>() - 4usize];
8203 ["Offset of field: Elf32_gptab__bindgen_ty_1::gt_current_g_value"]
8204 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_1, gt_current_g_value) - 0usize];
8205 ["Offset of field: Elf32_gptab__bindgen_ty_1::gt_unused"]
8206 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_1, gt_unused) - 4usize];
8207};
8208#[repr(C)]
8209#[derive(Debug, Copy, Clone)]
8210pub struct Elf32_gptab__bindgen_ty_2 {
8211 pub gt_g_value: Elf32_Word,
8212 pub gt_bytes: Elf32_Word,
8213}
8214#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8215const _: () = {
8216 ["Size of Elf32_gptab__bindgen_ty_2"]
8217 [::core::mem::size_of::<Elf32_gptab__bindgen_ty_2>() - 8usize];
8218 ["Alignment of Elf32_gptab__bindgen_ty_2"]
8219 [::core::mem::align_of::<Elf32_gptab__bindgen_ty_2>() - 4usize];
8220 ["Offset of field: Elf32_gptab__bindgen_ty_2::gt_g_value"]
8221 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_2, gt_g_value) - 0usize];
8222 ["Offset of field: Elf32_gptab__bindgen_ty_2::gt_bytes"]
8223 [::core::mem::offset_of!(Elf32_gptab__bindgen_ty_2, gt_bytes) - 4usize];
8224};
8225#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8226const _: () = {
8227 ["Size of Elf32_gptab"][::core::mem::size_of::<Elf32_gptab>() - 8usize];
8228 ["Alignment of Elf32_gptab"][::core::mem::align_of::<Elf32_gptab>() - 4usize];
8229 ["Offset of field: Elf32_gptab::gt_header"]
8230 [::core::mem::offset_of!(Elf32_gptab, gt_header) - 0usize];
8231 ["Offset of field: Elf32_gptab::gt_entry"]
8232 [::core::mem::offset_of!(Elf32_gptab, gt_entry) - 0usize];
8233};
8234#[repr(C)]
8235#[derive(Debug, Copy, Clone)]
8236pub struct Elf32_RegInfo {
8237 pub ri_gprmask: Elf32_Word,
8238 pub ri_cprmask: [Elf32_Word; 4usize],
8239 pub ri_gp_value: Elf32_Sword,
8240}
8241#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8242const _: () = {
8243 ["Size of Elf32_RegInfo"][::core::mem::size_of::<Elf32_RegInfo>() - 24usize];
8244 ["Alignment of Elf32_RegInfo"][::core::mem::align_of::<Elf32_RegInfo>() - 4usize];
8245 ["Offset of field: Elf32_RegInfo::ri_gprmask"]
8246 [::core::mem::offset_of!(Elf32_RegInfo, ri_gprmask) - 0usize];
8247 ["Offset of field: Elf32_RegInfo::ri_cprmask"]
8248 [::core::mem::offset_of!(Elf32_RegInfo, ri_cprmask) - 4usize];
8249 ["Offset of field: Elf32_RegInfo::ri_gp_value"]
8250 [::core::mem::offset_of!(Elf32_RegInfo, ri_gp_value) - 20usize];
8251};
8252#[repr(C)]
8253#[derive(Debug, Copy, Clone)]
8254pub struct Elf_Options {
8255 pub kind: core::ffi::c_uchar,
8256 pub size: core::ffi::c_uchar,
8257 pub section: Elf32_Section,
8258 pub info: Elf32_Word,
8259}
8260#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8261const _: () = {
8262 ["Size of Elf_Options"][::core::mem::size_of::<Elf_Options>() - 8usize];
8263 ["Alignment of Elf_Options"][::core::mem::align_of::<Elf_Options>() - 4usize];
8264 ["Offset of field: Elf_Options::kind"][::core::mem::offset_of!(Elf_Options, kind) - 0usize];
8265 ["Offset of field: Elf_Options::size"][::core::mem::offset_of!(Elf_Options, size) - 1usize];
8266 ["Offset of field: Elf_Options::section"]
8267 [::core::mem::offset_of!(Elf_Options, section) - 2usize];
8268 ["Offset of field: Elf_Options::info"][::core::mem::offset_of!(Elf_Options, info) - 4usize];
8269};
8270#[repr(C)]
8271#[derive(Debug, Copy, Clone)]
8272pub struct Elf_Options_Hw {
8273 pub hwp_flags1: Elf32_Word,
8274 pub hwp_flags2: Elf32_Word,
8275}
8276#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8277const _: () = {
8278 ["Size of Elf_Options_Hw"][::core::mem::size_of::<Elf_Options_Hw>() - 8usize];
8279 ["Alignment of Elf_Options_Hw"][::core::mem::align_of::<Elf_Options_Hw>() - 4usize];
8280 ["Offset of field: Elf_Options_Hw::hwp_flags1"]
8281 [::core::mem::offset_of!(Elf_Options_Hw, hwp_flags1) - 0usize];
8282 ["Offset of field: Elf_Options_Hw::hwp_flags2"]
8283 [::core::mem::offset_of!(Elf_Options_Hw, hwp_flags2) - 4usize];
8284};
8285#[repr(C)]
8286#[derive(Debug, Copy, Clone)]
8287pub struct Elf32_Lib {
8288 pub l_name: Elf32_Word,
8289 pub l_time_stamp: Elf32_Word,
8290 pub l_checksum: Elf32_Word,
8291 pub l_version: Elf32_Word,
8292 pub l_flags: Elf32_Word,
8293}
8294#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8295const _: () = {
8296 ["Size of Elf32_Lib"][::core::mem::size_of::<Elf32_Lib>() - 20usize];
8297 ["Alignment of Elf32_Lib"][::core::mem::align_of::<Elf32_Lib>() - 4usize];
8298 ["Offset of field: Elf32_Lib::l_name"][::core::mem::offset_of!(Elf32_Lib, l_name) - 0usize];
8299 ["Offset of field: Elf32_Lib::l_time_stamp"]
8300 [::core::mem::offset_of!(Elf32_Lib, l_time_stamp) - 4usize];
8301 ["Offset of field: Elf32_Lib::l_checksum"]
8302 [::core::mem::offset_of!(Elf32_Lib, l_checksum) - 8usize];
8303 ["Offset of field: Elf32_Lib::l_version"]
8304 [::core::mem::offset_of!(Elf32_Lib, l_version) - 12usize];
8305 ["Offset of field: Elf32_Lib::l_flags"][::core::mem::offset_of!(Elf32_Lib, l_flags) - 16usize];
8306};
8307#[repr(C)]
8308#[derive(Debug, Copy, Clone)]
8309pub struct Elf64_Lib {
8310 pub l_name: Elf64_Word,
8311 pub l_time_stamp: Elf64_Word,
8312 pub l_checksum: Elf64_Word,
8313 pub l_version: Elf64_Word,
8314 pub l_flags: Elf64_Word,
8315}
8316#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8317const _: () = {
8318 ["Size of Elf64_Lib"][::core::mem::size_of::<Elf64_Lib>() - 20usize];
8319 ["Alignment of Elf64_Lib"][::core::mem::align_of::<Elf64_Lib>() - 4usize];
8320 ["Offset of field: Elf64_Lib::l_name"][::core::mem::offset_of!(Elf64_Lib, l_name) - 0usize];
8321 ["Offset of field: Elf64_Lib::l_time_stamp"]
8322 [::core::mem::offset_of!(Elf64_Lib, l_time_stamp) - 4usize];
8323 ["Offset of field: Elf64_Lib::l_checksum"]
8324 [::core::mem::offset_of!(Elf64_Lib, l_checksum) - 8usize];
8325 ["Offset of field: Elf64_Lib::l_version"]
8326 [::core::mem::offset_of!(Elf64_Lib, l_version) - 12usize];
8327 ["Offset of field: Elf64_Lib::l_flags"][::core::mem::offset_of!(Elf64_Lib, l_flags) - 16usize];
8328};
8329pub type Elf32_Conflict = Elf32_Addr;
8330#[repr(C)]
8331#[derive(Debug, Copy, Clone)]
8332pub struct Elf_MIPS_ABIFlags_v0 {
8333 pub version: Elf32_Half,
8334 pub isa_level: core::ffi::c_uchar,
8335 pub isa_rev: core::ffi::c_uchar,
8336 pub gpr_size: core::ffi::c_uchar,
8337 pub cpr1_size: core::ffi::c_uchar,
8338 pub cpr2_size: core::ffi::c_uchar,
8339 pub fp_abi: core::ffi::c_uchar,
8340 pub isa_ext: Elf32_Word,
8341 pub ases: Elf32_Word,
8342 pub flags1: Elf32_Word,
8343 pub flags2: Elf32_Word,
8344}
8345#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8346const _: () = {
8347 ["Size of Elf_MIPS_ABIFlags_v0"][::core::mem::size_of::<Elf_MIPS_ABIFlags_v0>() - 24usize];
8348 ["Alignment of Elf_MIPS_ABIFlags_v0"][::core::mem::align_of::<Elf_MIPS_ABIFlags_v0>() - 4usize];
8349 ["Offset of field: Elf_MIPS_ABIFlags_v0::version"]
8350 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, version) - 0usize];
8351 ["Offset of field: Elf_MIPS_ABIFlags_v0::isa_level"]
8352 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, isa_level) - 2usize];
8353 ["Offset of field: Elf_MIPS_ABIFlags_v0::isa_rev"]
8354 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, isa_rev) - 3usize];
8355 ["Offset of field: Elf_MIPS_ABIFlags_v0::gpr_size"]
8356 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, gpr_size) - 4usize];
8357 ["Offset of field: Elf_MIPS_ABIFlags_v0::cpr1_size"]
8358 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, cpr1_size) - 5usize];
8359 ["Offset of field: Elf_MIPS_ABIFlags_v0::cpr2_size"]
8360 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, cpr2_size) - 6usize];
8361 ["Offset of field: Elf_MIPS_ABIFlags_v0::fp_abi"]
8362 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, fp_abi) - 7usize];
8363 ["Offset of field: Elf_MIPS_ABIFlags_v0::isa_ext"]
8364 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, isa_ext) - 8usize];
8365 ["Offset of field: Elf_MIPS_ABIFlags_v0::ases"]
8366 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, ases) - 12usize];
8367 ["Offset of field: Elf_MIPS_ABIFlags_v0::flags1"]
8368 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, flags1) - 16usize];
8369 ["Offset of field: Elf_MIPS_ABIFlags_v0::flags2"]
8370 [::core::mem::offset_of!(Elf_MIPS_ABIFlags_v0, flags2) - 20usize];
8371};
8372#[doc = "Interface for ELF loader to resolve symbols"]
8373#[repr(C)]
8374#[derive(Debug, Copy, Clone)]
8375pub struct ElfApiInterface {
8376 pub api_version_major: u16,
8377 pub api_version_minor: u16,
8378 pub resolver_callback: ::core::option::Option<
8379 unsafe extern "C" fn(
8380 interface: *const ElfApiInterface,
8381 hash: u32,
8382 address: *mut Elf32_Addr,
8383 ) -> bool,
8384 >,
8385}
8386#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8387const _: () = {
8388 ["Size of ElfApiInterface"][::core::mem::size_of::<ElfApiInterface>() - 8usize];
8389 ["Alignment of ElfApiInterface"][::core::mem::align_of::<ElfApiInterface>() - 4usize];
8390 ["Offset of field: ElfApiInterface::api_version_major"]
8391 [::core::mem::offset_of!(ElfApiInterface, api_version_major) - 0usize];
8392 ["Offset of field: ElfApiInterface::api_version_minor"]
8393 [::core::mem::offset_of!(ElfApiInterface, api_version_minor) - 2usize];
8394 ["Offset of field: ElfApiInterface::resolver_callback"]
8395 [::core::mem::offset_of!(ElfApiInterface, resolver_callback) - 4usize];
8396};
8397#[repr(C, packed)]
8398#[derive(Copy, Clone)]
8399pub struct FlipperApplicationManifestBase {
8400 pub manifest_magic: u32,
8401 pub manifest_version: u32,
8402 pub api_version: FlipperApplicationManifestBase__bindgen_ty_1,
8403 pub hardware_target_id: u16,
8404}
8405#[repr(C, packed)]
8406#[derive(Copy, Clone)]
8407pub union FlipperApplicationManifestBase__bindgen_ty_1 {
8408 pub __bindgen_anon_1: FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8409 pub version: u32,
8410}
8411#[repr(C, packed)]
8412#[derive(Debug, Copy, Clone)]
8413pub struct FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1 {
8414 pub minor: u16,
8415 pub major: u16,
8416}
8417#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8418const _: () = {
8419 ["Size of FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1"][::core::mem::size_of::<
8420 FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8421 >() - 4usize];
8422 ["Alignment of FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1"]
8423 [::core::mem::align_of::<FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1>()
8424 - 1usize];
8425 ["Offset of field: FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1::minor"][::core::mem::offset_of!(
8426 FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8427 minor
8428 )
8429 - 0usize];
8430 ["Offset of field: FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1::major"][::core::mem::offset_of!(
8431 FlipperApplicationManifestBase__bindgen_ty_1__bindgen_ty_1,
8432 major
8433 )
8434 - 2usize];
8435};
8436#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8437const _: () = {
8438 ["Size of FlipperApplicationManifestBase__bindgen_ty_1"]
8439 [::core::mem::size_of::<FlipperApplicationManifestBase__bindgen_ty_1>() - 4usize];
8440 ["Alignment of FlipperApplicationManifestBase__bindgen_ty_1"]
8441 [::core::mem::align_of::<FlipperApplicationManifestBase__bindgen_ty_1>() - 1usize];
8442 ["Offset of field: FlipperApplicationManifestBase__bindgen_ty_1::version"]
8443 [::core::mem::offset_of!(FlipperApplicationManifestBase__bindgen_ty_1, version) - 0usize];
8444};
8445#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8446const _: () = {
8447 ["Size of FlipperApplicationManifestBase"]
8448 [::core::mem::size_of::<FlipperApplicationManifestBase>() - 14usize];
8449 ["Alignment of FlipperApplicationManifestBase"]
8450 [::core::mem::align_of::<FlipperApplicationManifestBase>() - 1usize];
8451 ["Offset of field: FlipperApplicationManifestBase::manifest_magic"]
8452 [::core::mem::offset_of!(FlipperApplicationManifestBase, manifest_magic) - 0usize];
8453 ["Offset of field: FlipperApplicationManifestBase::manifest_version"]
8454 [::core::mem::offset_of!(FlipperApplicationManifestBase, manifest_version) - 4usize];
8455 ["Offset of field: FlipperApplicationManifestBase::api_version"]
8456 [::core::mem::offset_of!(FlipperApplicationManifestBase, api_version) - 8usize];
8457 ["Offset of field: FlipperApplicationManifestBase::hardware_target_id"]
8458 [::core::mem::offset_of!(FlipperApplicationManifestBase, hardware_target_id) - 12usize];
8459};
8460#[repr(C, packed)]
8461#[derive(Copy, Clone)]
8462pub struct FlipperApplicationManifestV1 {
8463 pub base: FlipperApplicationManifestBase,
8464 pub stack_size: u16,
8465 pub app_version: u32,
8466 pub name: [core::ffi::c_char; 32usize],
8467 pub has_icon: core::ffi::c_char,
8468 pub icon: [core::ffi::c_char; 32usize],
8469}
8470#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8471const _: () = {
8472 ["Size of FlipperApplicationManifestV1"]
8473 [::core::mem::size_of::<FlipperApplicationManifestV1>() - 85usize];
8474 ["Alignment of FlipperApplicationManifestV1"]
8475 [::core::mem::align_of::<FlipperApplicationManifestV1>() - 1usize];
8476 ["Offset of field: FlipperApplicationManifestV1::base"]
8477 [::core::mem::offset_of!(FlipperApplicationManifestV1, base) - 0usize];
8478 ["Offset of field: FlipperApplicationManifestV1::stack_size"]
8479 [::core::mem::offset_of!(FlipperApplicationManifestV1, stack_size) - 14usize];
8480 ["Offset of field: FlipperApplicationManifestV1::app_version"]
8481 [::core::mem::offset_of!(FlipperApplicationManifestV1, app_version) - 16usize];
8482 ["Offset of field: FlipperApplicationManifestV1::name"]
8483 [::core::mem::offset_of!(FlipperApplicationManifestV1, name) - 20usize];
8484 ["Offset of field: FlipperApplicationManifestV1::has_icon"]
8485 [::core::mem::offset_of!(FlipperApplicationManifestV1, has_icon) - 52usize];
8486 ["Offset of field: FlipperApplicationManifestV1::icon"]
8487 [::core::mem::offset_of!(FlipperApplicationManifestV1, icon) - 53usize];
8488};
8489pub type FlipperApplicationManifest = FlipperApplicationManifestV1;
8490unsafe extern "C" {
8491 #[doc = "Check if manifest is valid\n\n # Arguments\n\n* `manifest` -\n # Returns\n\nbool"]
8492 pub fn flipper_application_manifest_is_valid(
8493 manifest: *const FlipperApplicationManifest,
8494 ) -> bool;
8495}
8496unsafe extern "C" {
8497 #[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"]
8498 pub fn flipper_application_manifest_is_too_old(
8499 manifest: *const FlipperApplicationManifest,
8500 api_interface: *const ElfApiInterface,
8501 ) -> bool;
8502}
8503unsafe extern "C" {
8504 #[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"]
8505 pub fn flipper_application_manifest_is_too_new(
8506 manifest: *const FlipperApplicationManifest,
8507 api_interface: *const ElfApiInterface,
8508 ) -> bool;
8509}
8510unsafe extern "C" {
8511 #[doc = "Check if application is compatible with current hardware\n\n # Arguments\n\n* `manifest` -\n # Returns\n\nbool"]
8512 pub fn flipper_application_manifest_is_target_compatible(
8513 manifest: *const FlipperApplicationManifest,
8514 ) -> bool;
8515}
8516#[doc = "< Read access"]
8517pub const FSAM_READ: FS_AccessMode = FS_AccessMode(1);
8518#[doc = "< Write access"]
8519pub const FSAM_WRITE: FS_AccessMode = FS_AccessMode(2);
8520#[doc = "< Read and write access"]
8521pub const FSAM_READ_WRITE: FS_AccessMode = FS_AccessMode(3);
8522#[repr(transparent)]
8523#[doc = "Access mode flags"]
8524#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8525pub struct FS_AccessMode(pub core::ffi::c_uchar);
8526#[doc = "< Open file, fail if file doesn't exist"]
8527pub const FSOM_OPEN_EXISTING: FS_OpenMode = FS_OpenMode(1);
8528#[doc = "< Open file. Create new file if not exist"]
8529pub const FSOM_OPEN_ALWAYS: FS_OpenMode = FS_OpenMode(2);
8530#[doc = "< Open file. Create new file if not exist. Set R/W pointer to EOF"]
8531pub const FSOM_OPEN_APPEND: FS_OpenMode = FS_OpenMode(4);
8532#[doc = "< Creates a new file. Fails if the file is exist"]
8533pub const FSOM_CREATE_NEW: FS_OpenMode = FS_OpenMode(8);
8534#[doc = "< Creates a new file. If file exist, truncate to zero size"]
8535pub const FSOM_CREATE_ALWAYS: FS_OpenMode = FS_OpenMode(16);
8536#[repr(transparent)]
8537#[doc = "Open mode flags"]
8538#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8539pub struct FS_OpenMode(pub core::ffi::c_uchar);
8540#[doc = "< No error"]
8541pub const FSE_OK: FS_Error = FS_Error(0);
8542#[doc = "< FS not ready"]
8543pub const FSE_NOT_READY: FS_Error = FS_Error(1);
8544#[doc = "< File/Dir already exist"]
8545pub const FSE_EXIST: FS_Error = FS_Error(2);
8546#[doc = "< File/Dir does not exist"]
8547pub const FSE_NOT_EXIST: FS_Error = FS_Error(3);
8548#[doc = "< Invalid API parameter"]
8549pub const FSE_INVALID_PARAMETER: FS_Error = FS_Error(4);
8550#[doc = "< Access denied"]
8551pub const FSE_DENIED: FS_Error = FS_Error(5);
8552#[doc = "< Invalid name/path"]
8553pub const FSE_INVALID_NAME: FS_Error = FS_Error(6);
8554#[doc = "< Internal error"]
8555pub const FSE_INTERNAL: FS_Error = FS_Error(7);
8556#[doc = "< Function not implemented"]
8557pub const FSE_NOT_IMPLEMENTED: FS_Error = FS_Error(8);
8558#[doc = "< File/Dir already opened"]
8559pub const FSE_ALREADY_OPEN: FS_Error = FS_Error(9);
8560#[repr(transparent)]
8561#[doc = "API errors enumeration"]
8562#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8563pub struct FS_Error(pub core::ffi::c_uchar);
8564#[doc = "< Directory"]
8565pub const FSF_DIRECTORY: FS_Flags = FS_Flags(1);
8566#[repr(transparent)]
8567#[doc = "FileInfo flags"]
8568#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8569pub struct FS_Flags(pub core::ffi::c_uchar);
8570#[repr(C)]
8571#[derive(Debug, Copy, Clone)]
8572pub struct File {
8573 _unused: [u8; 0],
8574}
8575#[doc = "Structure that hold file info"]
8576#[repr(C)]
8577#[derive(Debug, Copy, Clone)]
8578pub struct FileInfo {
8579 #[doc = "< flags from FS_Flags enum"]
8580 pub flags: u8,
8581 #[doc = "< file size"]
8582 pub size: u64,
8583}
8584#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8585const _: () = {
8586 ["Size of FileInfo"][::core::mem::size_of::<FileInfo>() - 16usize];
8587 ["Alignment of FileInfo"][::core::mem::align_of::<FileInfo>() - 8usize];
8588 ["Offset of field: FileInfo::flags"][::core::mem::offset_of!(FileInfo, flags) - 0usize];
8589 ["Offset of field: FileInfo::size"][::core::mem::offset_of!(FileInfo, size) - 8usize];
8590};
8591unsafe extern "C" {
8592 #[doc = "Gets the error text from FS_Error\n # Arguments\n\n* `error_id` - error id\n # Returns\n\nconst char* error text"]
8593 pub fn filesystem_api_error_get_desc(error_id: FS_Error) -> *const core::ffi::c_char;
8594}
8595unsafe extern "C" {
8596 #[doc = "Checks if file info is directory\n # Arguments\n\n* `file_info` - file info pointer\n # Returns\n\nbool is directory"]
8597 pub fn file_info_is_dir(file_info: *const FileInfo) -> bool;
8598}
8599pub const FST_UNKNOWN: SDFsType = SDFsType(0);
8600pub const FST_FAT12: SDFsType = SDFsType(1);
8601pub const FST_FAT16: SDFsType = SDFsType(2);
8602pub const FST_FAT32: SDFsType = SDFsType(3);
8603pub const FST_EXFAT: SDFsType = SDFsType(4);
8604#[repr(transparent)]
8605#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8606pub struct SDFsType(pub core::ffi::c_uchar);
8607#[repr(C)]
8608#[derive(Debug, Copy, Clone)]
8609pub struct SDInfo {
8610 pub fs_type: SDFsType,
8611 pub kb_total: u32,
8612 pub kb_free: u32,
8613 pub cluster_size: u16,
8614 pub sector_size: u16,
8615 pub label: [core::ffi::c_char; 34usize],
8616 pub manufacturer_id: u8,
8617 pub oem_id: [core::ffi::c_char; 3usize],
8618 pub product_name: [core::ffi::c_char; 6usize],
8619 pub product_revision_major: u8,
8620 pub product_revision_minor: u8,
8621 pub product_serial_number: u32,
8622 pub manufacturing_month: u8,
8623 pub manufacturing_year: u16,
8624}
8625#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8626const _: () = {
8627 ["Size of SDInfo"][::core::mem::size_of::<SDInfo>() - 72usize];
8628 ["Alignment of SDInfo"][::core::mem::align_of::<SDInfo>() - 4usize];
8629 ["Offset of field: SDInfo::fs_type"][::core::mem::offset_of!(SDInfo, fs_type) - 0usize];
8630 ["Offset of field: SDInfo::kb_total"][::core::mem::offset_of!(SDInfo, kb_total) - 4usize];
8631 ["Offset of field: SDInfo::kb_free"][::core::mem::offset_of!(SDInfo, kb_free) - 8usize];
8632 ["Offset of field: SDInfo::cluster_size"]
8633 [::core::mem::offset_of!(SDInfo, cluster_size) - 12usize];
8634 ["Offset of field: SDInfo::sector_size"]
8635 [::core::mem::offset_of!(SDInfo, sector_size) - 14usize];
8636 ["Offset of field: SDInfo::label"][::core::mem::offset_of!(SDInfo, label) - 16usize];
8637 ["Offset of field: SDInfo::manufacturer_id"]
8638 [::core::mem::offset_of!(SDInfo, manufacturer_id) - 50usize];
8639 ["Offset of field: SDInfo::oem_id"][::core::mem::offset_of!(SDInfo, oem_id) - 51usize];
8640 ["Offset of field: SDInfo::product_name"]
8641 [::core::mem::offset_of!(SDInfo, product_name) - 54usize];
8642 ["Offset of field: SDInfo::product_revision_major"]
8643 [::core::mem::offset_of!(SDInfo, product_revision_major) - 60usize];
8644 ["Offset of field: SDInfo::product_revision_minor"]
8645 [::core::mem::offset_of!(SDInfo, product_revision_minor) - 61usize];
8646 ["Offset of field: SDInfo::product_serial_number"]
8647 [::core::mem::offset_of!(SDInfo, product_serial_number) - 64usize];
8648 ["Offset of field: SDInfo::manufacturing_month"]
8649 [::core::mem::offset_of!(SDInfo, manufacturing_month) - 68usize];
8650 ["Offset of field: SDInfo::manufacturing_year"]
8651 [::core::mem::offset_of!(SDInfo, manufacturing_year) - 70usize];
8652};
8653unsafe extern "C" {
8654 pub fn sd_api_get_fs_type_text(fs_type: SDFsType) -> *const core::ffi::c_char;
8655}
8656#[repr(C)]
8657#[derive(Debug, Copy, Clone)]
8658pub struct Storage {
8659 _unused: [u8; 0],
8660}
8661unsafe extern "C" {
8662 #[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."]
8663 pub fn storage_file_alloc(storage: *mut Storage) -> *mut File;
8664}
8665unsafe extern "C" {
8666 #[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."]
8667 pub fn storage_file_free(file: *mut File);
8668}
8669#[doc = "< SD card was mounted."]
8670pub const StorageEventTypeCardMount: StorageEventType = StorageEventType(0);
8671#[doc = "< SD card was unmounted."]
8672pub const StorageEventTypeCardUnmount: StorageEventType = StorageEventType(1);
8673#[doc = "< An error occurred during mounting of an SD card."]
8674pub const StorageEventTypeCardMountError: StorageEventType = StorageEventType(2);
8675#[doc = "< A file was closed."]
8676pub const StorageEventTypeFileClose: StorageEventType = StorageEventType(3);
8677#[doc = "< A directory was closed."]
8678pub const StorageEventTypeDirClose: StorageEventType = StorageEventType(4);
8679#[repr(transparent)]
8680#[doc = "Enumeration of events emitted by the storage through the PubSub system."]
8681#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8682pub struct StorageEventType(pub core::ffi::c_uchar);
8683#[doc = "Storage event (passed to the PubSub callback)."]
8684#[repr(C)]
8685#[derive(Debug, Copy, Clone)]
8686pub struct StorageEvent {
8687 #[doc = "< Type of the event."]
8688 pub type_: StorageEventType,
8689}
8690#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8691const _: () = {
8692 ["Size of StorageEvent"][::core::mem::size_of::<StorageEvent>() - 1usize];
8693 ["Alignment of StorageEvent"][::core::mem::align_of::<StorageEvent>() - 1usize];
8694 ["Offset of field: StorageEvent::type_"][::core::mem::offset_of!(StorageEvent, type_) - 0usize];
8695};
8696unsafe extern "C" {
8697 #[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."]
8698 pub fn storage_get_pubsub(storage: *mut Storage) -> *mut FuriPubSub;
8699}
8700unsafe extern "C" {
8701 #[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."]
8702 pub fn storage_file_open(
8703 file: *mut File,
8704 path: *const core::ffi::c_char,
8705 access_mode: FS_AccessMode,
8706 open_mode: FS_OpenMode,
8707 ) -> bool;
8708}
8709unsafe extern "C" {
8710 #[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."]
8711 pub fn storage_file_close(file: *mut File) -> bool;
8712}
8713unsafe extern "C" {
8714 #[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."]
8715 pub fn storage_file_is_open(file: *mut File) -> bool;
8716}
8717unsafe extern "C" {
8718 #[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."]
8719 pub fn storage_file_is_dir(file: *mut File) -> bool;
8720}
8721unsafe extern "C" {
8722 #[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)."]
8723 pub fn storage_file_read(
8724 file: *mut File,
8725 buff: *mut core::ffi::c_void,
8726 bytes_to_read: usize,
8727 ) -> usize;
8728}
8729unsafe extern "C" {
8730 #[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)."]
8731 pub fn storage_file_write(
8732 file: *mut File,
8733 buff: *const core::ffi::c_void,
8734 bytes_to_write: usize,
8735 ) -> usize;
8736}
8737unsafe extern "C" {
8738 #[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"]
8739 pub fn storage_file_seek(file: *mut File, offset: u32, from_start: bool) -> bool;
8740}
8741unsafe extern "C" {
8742 #[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."]
8743 pub fn storage_file_tell(file: *mut File) -> u64;
8744}
8745unsafe extern "C" {
8746 #[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."]
8747 pub fn storage_file_truncate(file: *mut File) -> bool;
8748}
8749unsafe extern "C" {
8750 #[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."]
8751 pub fn storage_file_size(file: *mut File) -> u64;
8752}
8753unsafe extern "C" {
8754 #[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."]
8755 pub fn storage_file_sync(file: *mut File) -> bool;
8756}
8757unsafe extern "C" {
8758 #[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."]
8759 pub fn storage_file_eof(file: *mut File) -> bool;
8760}
8761unsafe extern "C" {
8762 #[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."]
8763 pub fn storage_file_exists(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8764}
8765unsafe extern "C" {
8766 #[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."]
8767 pub fn storage_file_copy_to_file(
8768 source: *mut File,
8769 destination: *mut File,
8770 size: usize,
8771 ) -> bool;
8772}
8773unsafe extern "C" {
8774 #[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."]
8775 pub fn storage_dir_open(file: *mut File, path: *const core::ffi::c_char) -> bool;
8776}
8777unsafe extern "C" {
8778 #[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."]
8779 pub fn storage_dir_close(file: *mut File) -> bool;
8780}
8781unsafe extern "C" {
8782 #[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."]
8783 pub fn storage_dir_read(
8784 file: *mut File,
8785 fileinfo: *mut FileInfo,
8786 name: *mut core::ffi::c_char,
8787 name_length: u16,
8788 ) -> bool;
8789}
8790unsafe extern "C" {
8791 #[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."]
8792 pub fn storage_dir_exists(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8793}
8794unsafe extern "C" {
8795 #[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."]
8796 pub fn storage_common_timestamp(
8797 storage: *mut Storage,
8798 path: *const core::ffi::c_char,
8799 timestamp: *mut u32,
8800 ) -> FS_Error;
8801}
8802unsafe extern "C" {
8803 #[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."]
8804 pub fn storage_common_stat(
8805 storage: *mut Storage,
8806 path: *const core::ffi::c_char,
8807 fileinfo: *mut FileInfo,
8808 ) -> FS_Error;
8809}
8810unsafe extern "C" {
8811 #[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."]
8812 pub fn storage_common_remove(storage: *mut Storage, path: *const core::ffi::c_char)
8813 -> FS_Error;
8814}
8815unsafe extern "C" {
8816 #[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."]
8817 pub fn storage_common_rename(
8818 storage: *mut Storage,
8819 old_path: *const core::ffi::c_char,
8820 new_path: *const core::ffi::c_char,
8821 ) -> FS_Error;
8822}
8823unsafe extern "C" {
8824 #[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."]
8825 pub fn storage_common_copy(
8826 storage: *mut Storage,
8827 old_path: *const core::ffi::c_char,
8828 new_path: *const core::ffi::c_char,
8829 ) -> FS_Error;
8830}
8831unsafe extern "C" {
8832 #[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."]
8833 pub fn storage_common_merge(
8834 storage: *mut Storage,
8835 old_path: *const core::ffi::c_char,
8836 new_path: *const core::ffi::c_char,
8837 ) -> FS_Error;
8838}
8839unsafe extern "C" {
8840 #[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."]
8841 pub fn storage_common_mkdir(storage: *mut Storage, path: *const core::ffi::c_char) -> FS_Error;
8842}
8843unsafe extern "C" {
8844 #[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."]
8845 pub fn storage_common_fs_info(
8846 storage: *mut Storage,
8847 fs_path: *const core::ffi::c_char,
8848 total_space: *mut u64,
8849 free_space: *mut u64,
8850 ) -> FS_Error;
8851}
8852unsafe extern "C" {
8853 #[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."]
8854 pub fn storage_common_resolve_path_and_ensure_app_directory(
8855 storage: *mut Storage,
8856 path: *mut FuriString,
8857 );
8858}
8859unsafe extern "C" {
8860 #[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."]
8861 pub fn storage_common_migrate(
8862 storage: *mut Storage,
8863 source: *const core::ffi::c_char,
8864 dest: *const core::ffi::c_char,
8865 ) -> FS_Error;
8866}
8867unsafe extern "C" {
8868 #[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."]
8869 pub fn storage_common_exists(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8870}
8871unsafe extern "C" {
8872 #[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."]
8873 pub fn storage_common_equivalent_path(
8874 storage: *mut Storage,
8875 path1: *const core::ffi::c_char,
8876 path2: *const core::ffi::c_char,
8877 ) -> bool;
8878}
8879unsafe extern "C" {
8880 #[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."]
8881 pub fn storage_common_is_subdir(
8882 storage: *mut Storage,
8883 parent: *const core::ffi::c_char,
8884 child: *const core::ffi::c_char,
8885 ) -> bool;
8886}
8887unsafe extern "C" {
8888 #[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."]
8889 pub fn storage_error_get_desc(error_id: FS_Error) -> *const core::ffi::c_char;
8890}
8891unsafe extern "C" {
8892 #[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."]
8893 pub fn storage_file_get_error(file: *mut File) -> FS_Error;
8894}
8895unsafe extern "C" {
8896 #[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."]
8897 pub fn storage_file_get_error_desc(file: *mut File) -> *const core::ffi::c_char;
8898}
8899unsafe extern "C" {
8900 #[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."]
8901 pub fn storage_sd_format(storage: *mut Storage) -> FS_Error;
8902}
8903unsafe extern "C" {
8904 #[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."]
8905 pub fn storage_sd_unmount(storage: *mut Storage) -> FS_Error;
8906}
8907unsafe extern "C" {
8908 #[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."]
8909 pub fn storage_sd_mount(storage: *mut Storage) -> FS_Error;
8910}
8911unsafe extern "C" {
8912 #[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."]
8913 pub fn storage_sd_info(storage: *mut Storage, info: *mut SDInfo) -> FS_Error;
8914}
8915unsafe extern "C" {
8916 #[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."]
8917 pub fn storage_sd_status(storage: *mut Storage) -> FS_Error;
8918}
8919#[doc = "Internal Storage Backup/Restore"]
8920pub type StorageNameConverter = ::core::option::Option<unsafe extern "C" fn(arg1: *mut FuriString)>;
8921unsafe extern "C" {
8922 #[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."]
8923 pub fn storage_int_backup(storage: *mut Storage, dstname: *const core::ffi::c_char)
8924 -> FS_Error;
8925}
8926unsafe extern "C" {
8927 #[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."]
8928 pub fn storage_int_restore(
8929 storage: *mut Storage,
8930 dstname: *const core::ffi::c_char,
8931 converter: StorageNameConverter,
8932 ) -> FS_Error;
8933}
8934unsafe extern "C" {
8935 #[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."]
8936 pub fn storage_simply_remove(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8937}
8938unsafe extern "C" {
8939 #[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."]
8940 pub fn storage_simply_remove_recursive(
8941 storage: *mut Storage,
8942 path: *const core::ffi::c_char,
8943 ) -> bool;
8944}
8945unsafe extern "C" {
8946 #[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."]
8947 pub fn storage_simply_mkdir(storage: *mut Storage, path: *const core::ffi::c_char) -> bool;
8948}
8949unsafe extern "C" {
8950 #[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."]
8951 pub fn storage_get_next_filename(
8952 storage: *mut Storage,
8953 dirname: *const core::ffi::c_char,
8954 filename: *const core::ffi::c_char,
8955 fileextension: *const core::ffi::c_char,
8956 nextfilename: *mut FuriString,
8957 max_len: u8,
8958 );
8959}
8960pub const FlipperApplicationPreloadStatusSuccess: FlipperApplicationPreloadStatus =
8961 FlipperApplicationPreloadStatus(0);
8962pub const FlipperApplicationPreloadStatusInvalidFile: FlipperApplicationPreloadStatus =
8963 FlipperApplicationPreloadStatus(1);
8964pub const FlipperApplicationPreloadStatusNotEnoughMemory: FlipperApplicationPreloadStatus =
8965 FlipperApplicationPreloadStatus(2);
8966pub const FlipperApplicationPreloadStatusInvalidManifest: FlipperApplicationPreloadStatus =
8967 FlipperApplicationPreloadStatus(3);
8968pub const FlipperApplicationPreloadStatusApiTooOld: FlipperApplicationPreloadStatus =
8969 FlipperApplicationPreloadStatus(4);
8970pub const FlipperApplicationPreloadStatusApiTooNew: FlipperApplicationPreloadStatus =
8971 FlipperApplicationPreloadStatus(5);
8972pub const FlipperApplicationPreloadStatusTargetMismatch: FlipperApplicationPreloadStatus =
8973 FlipperApplicationPreloadStatus(6);
8974#[repr(transparent)]
8975#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8976pub struct FlipperApplicationPreloadStatus(pub core::ffi::c_uchar);
8977pub const FlipperApplicationLoadStatusSuccess: FlipperApplicationLoadStatus =
8978 FlipperApplicationLoadStatus(0);
8979pub const FlipperApplicationLoadStatusUnspecifiedError: FlipperApplicationLoadStatus =
8980 FlipperApplicationLoadStatus(1);
8981pub const FlipperApplicationLoadStatusMissingImports: FlipperApplicationLoadStatus =
8982 FlipperApplicationLoadStatus(2);
8983#[repr(transparent)]
8984#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
8985pub struct FlipperApplicationLoadStatus(pub core::ffi::c_uchar);
8986unsafe extern "C" {
8987 #[doc = "Get text description of preload status\n # Arguments\n\n* `status` - Status code\n # Returns\n\nString pointer to description"]
8988 pub fn flipper_application_preload_status_to_string(
8989 status: FlipperApplicationPreloadStatus,
8990 ) -> *const core::ffi::c_char;
8991}
8992unsafe extern "C" {
8993 #[doc = "Get text description of load status\n # Arguments\n\n* `status` - Status code\n # Returns\n\nString pointer to description"]
8994 pub fn flipper_application_load_status_to_string(
8995 status: FlipperApplicationLoadStatus,
8996 ) -> *const core::ffi::c_char;
8997}
8998#[repr(C)]
8999#[derive(Debug, Copy, Clone)]
9000pub struct FlipperApplication {
9001 _unused: [u8; 0],
9002}
9003#[repr(C)]
9004#[derive(Debug, Copy, Clone)]
9005pub struct FlipperApplicationMemoryMapEntry {
9006 pub name: *const core::ffi::c_char,
9007 pub address: u32,
9008}
9009#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9010const _: () = {
9011 ["Size of FlipperApplicationMemoryMapEntry"]
9012 [::core::mem::size_of::<FlipperApplicationMemoryMapEntry>() - 8usize];
9013 ["Alignment of FlipperApplicationMemoryMapEntry"]
9014 [::core::mem::align_of::<FlipperApplicationMemoryMapEntry>() - 4usize];
9015 ["Offset of field: FlipperApplicationMemoryMapEntry::name"]
9016 [::core::mem::offset_of!(FlipperApplicationMemoryMapEntry, name) - 0usize];
9017 ["Offset of field: FlipperApplicationMemoryMapEntry::address"]
9018 [::core::mem::offset_of!(FlipperApplicationMemoryMapEntry, address) - 4usize];
9019};
9020#[repr(C)]
9021#[derive(Debug, Copy, Clone)]
9022pub struct FlipperApplicationState {
9023 pub mmap_entry_count: u32,
9024 pub mmap_entries: *mut FlipperApplicationMemoryMapEntry,
9025 pub debug_link_size: u32,
9026 pub debug_link: *mut u8,
9027}
9028#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9029const _: () = {
9030 ["Size of FlipperApplicationState"]
9031 [::core::mem::size_of::<FlipperApplicationState>() - 16usize];
9032 ["Alignment of FlipperApplicationState"]
9033 [::core::mem::align_of::<FlipperApplicationState>() - 4usize];
9034 ["Offset of field: FlipperApplicationState::mmap_entry_count"]
9035 [::core::mem::offset_of!(FlipperApplicationState, mmap_entry_count) - 0usize];
9036 ["Offset of field: FlipperApplicationState::mmap_entries"]
9037 [::core::mem::offset_of!(FlipperApplicationState, mmap_entries) - 4usize];
9038 ["Offset of field: FlipperApplicationState::debug_link_size"]
9039 [::core::mem::offset_of!(FlipperApplicationState, debug_link_size) - 8usize];
9040 ["Offset of field: FlipperApplicationState::debug_link"]
9041 [::core::mem::offset_of!(FlipperApplicationState, debug_link) - 12usize];
9042};
9043unsafe extern "C" {
9044 #[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"]
9045 pub fn flipper_application_alloc(
9046 storage: *mut Storage,
9047 api_interface: *const ElfApiInterface,
9048 ) -> *mut FlipperApplication;
9049}
9050unsafe extern "C" {
9051 #[doc = "Destroy FlipperApplication object\n # Arguments\n\n* `app` - Application pointer"]
9052 pub fn flipper_application_free(app: *mut FlipperApplication);
9053}
9054unsafe extern "C" {
9055 #[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"]
9056 pub fn flipper_application_preload(
9057 app: *mut FlipperApplication,
9058 path: *const core::ffi::c_char,
9059 ) -> FlipperApplicationPreloadStatus;
9060}
9061unsafe extern "C" {
9062 #[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"]
9063 pub fn flipper_application_preload_manifest(
9064 app: *mut FlipperApplication,
9065 path: *const core::ffi::c_char,
9066 ) -> FlipperApplicationPreloadStatus;
9067}
9068unsafe extern "C" {
9069 #[doc = "Get pointer to application manifest for preloaded application\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\nPointer to application manifest"]
9070 pub fn flipper_application_get_manifest(
9071 app: *mut FlipperApplication,
9072 ) -> *const FlipperApplicationManifest;
9073}
9074unsafe extern "C" {
9075 #[doc = "Load sections and process relocations for already pre-loaded application\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\nLoad result code"]
9076 pub fn flipper_application_map_to_memory(
9077 app: *mut FlipperApplication,
9078 ) -> FlipperApplicationLoadStatus;
9079}
9080unsafe extern "C" {
9081 #[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"]
9082 pub fn flipper_application_alloc_thread(
9083 app: *mut FlipperApplication,
9084 args: *const core::ffi::c_char,
9085 ) -> *mut FuriThread;
9086}
9087unsafe extern "C" {
9088 #[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"]
9089 pub fn flipper_application_is_plugin(app: *mut FlipperApplication) -> bool;
9090}
9091#[doc = "Entry point prototype for standalone applications"]
9092pub type FlipperApplicationEntryPoint =
9093 ::core::option::Option<unsafe extern "C" fn(arg1: *mut core::ffi::c_void) -> i32>;
9094#[doc = "An object that describes a plugin - must be returned by plugin's entry point"]
9095#[repr(C)]
9096#[derive(Debug, Copy, Clone)]
9097pub struct FlipperAppPluginDescriptor {
9098 pub appid: *const core::ffi::c_char,
9099 pub ep_api_version: u32,
9100 pub entry_point: *const core::ffi::c_void,
9101}
9102#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9103const _: () = {
9104 ["Size of FlipperAppPluginDescriptor"]
9105 [::core::mem::size_of::<FlipperAppPluginDescriptor>() - 12usize];
9106 ["Alignment of FlipperAppPluginDescriptor"]
9107 [::core::mem::align_of::<FlipperAppPluginDescriptor>() - 4usize];
9108 ["Offset of field: FlipperAppPluginDescriptor::appid"]
9109 [::core::mem::offset_of!(FlipperAppPluginDescriptor, appid) - 0usize];
9110 ["Offset of field: FlipperAppPluginDescriptor::ep_api_version"]
9111 [::core::mem::offset_of!(FlipperAppPluginDescriptor, ep_api_version) - 4usize];
9112 ["Offset of field: FlipperAppPluginDescriptor::entry_point"]
9113 [::core::mem::offset_of!(FlipperAppPluginDescriptor, entry_point) - 8usize];
9114};
9115#[doc = "Entry point prototype for plugins"]
9116pub type FlipperApplicationPluginEntryPoint =
9117 ::core::option::Option<unsafe extern "C" fn() -> *const FlipperAppPluginDescriptor>;
9118unsafe extern "C" {
9119 #[doc = "Get plugin descriptor for preloaded plugin\n # Arguments\n\n* `app` - Application pointer\n # Returns\n\nPointer to plugin descriptor"]
9120 pub fn flipper_application_plugin_get_descriptor(
9121 app: *mut FlipperApplication,
9122 ) -> *const FlipperAppPluginDescriptor;
9123}
9124unsafe extern "C" {
9125 #[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."]
9126 pub fn flipper_application_load_name_and_icon(
9127 path: *mut FuriString,
9128 storage: *mut Storage,
9129 icon_ptr: *mut *mut u8,
9130 item_name: *mut FuriString,
9131 ) -> bool;
9132}
9133#[repr(C)]
9134#[derive(Debug, Copy, Clone)]
9135pub struct SubGhzDeviceRegistry {
9136 _unused: [u8; 0],
9137}
9138pub type SubGhzBegin = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9139pub type SubGhzEnd = ::core::option::Option<unsafe extern "C" fn()>;
9140pub type SubGhzIsConnect = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9141pub type SubGhzReset = ::core::option::Option<unsafe extern "C" fn()>;
9142pub type SubGhzSleep = ::core::option::Option<unsafe extern "C" fn()>;
9143pub type SubGhzIdle = ::core::option::Option<unsafe extern "C" fn()>;
9144pub type SubGhzLoadPreset =
9145 ::core::option::Option<unsafe extern "C" fn(preset: FuriHalSubGhzPreset, preset_data: *mut u8)>;
9146pub type SubGhzSetFrequency = ::core::option::Option<unsafe extern "C" fn(frequency: u32) -> u32>;
9147pub type SubGhzIsFrequencyValid =
9148 ::core::option::Option<unsafe extern "C" fn(frequency: u32) -> bool>;
9149pub type SubGhzSetAsyncMirrorPin =
9150 ::core::option::Option<unsafe extern "C" fn(gpio: *const GpioPin)>;
9151pub type SubGhzGetDataGpio = ::core::option::Option<unsafe extern "C" fn() -> *const GpioPin>;
9152pub type SubGhzSetTx = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9153pub type SubGhzFlushTx = ::core::option::Option<unsafe extern "C" fn()>;
9154pub type SubGhzStartAsyncTx = ::core::option::Option<
9155 unsafe extern "C" fn(callback: *mut core::ffi::c_void, context: *mut core::ffi::c_void) -> bool,
9156>;
9157pub type SubGhzIsAsyncCompleteTx = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9158pub type SubGhzStopAsyncTx = ::core::option::Option<unsafe extern "C" fn()>;
9159pub type SubGhzSetRx = ::core::option::Option<unsafe extern "C" fn()>;
9160pub type SubGhzFlushRx = ::core::option::Option<unsafe extern "C" fn()>;
9161pub type SubGhzStartAsyncRx = ::core::option::Option<
9162 unsafe extern "C" fn(callback: *mut core::ffi::c_void, context: *mut core::ffi::c_void),
9163>;
9164pub type SubGhzStopAsyncRx = ::core::option::Option<unsafe extern "C" fn()>;
9165pub type SubGhzGetRSSI = ::core::option::Option<unsafe extern "C" fn() -> f32>;
9166pub type SubGhzGetLQI = ::core::option::Option<unsafe extern "C" fn() -> u8>;
9167pub type SubGhzRxPipeNotEmpty = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9168pub type SubGhzRxIsDataCrcValid = ::core::option::Option<unsafe extern "C" fn() -> bool>;
9169pub type SubGhzReadPacket =
9170 ::core::option::Option<unsafe extern "C" fn(data: *mut u8, size: *mut u8)>;
9171pub type SubGhzWritePacket =
9172 ::core::option::Option<unsafe extern "C" fn(data: *const u8, size: u8)>;
9173#[repr(C)]
9174#[derive(Debug, Copy, Clone)]
9175pub struct SubGhzDeviceInterconnect {
9176 pub begin: SubGhzBegin,
9177 pub end: SubGhzEnd,
9178 pub is_connect: SubGhzIsConnect,
9179 pub reset: SubGhzReset,
9180 pub sleep: SubGhzSleep,
9181 pub idle: SubGhzIdle,
9182 pub load_preset: SubGhzLoadPreset,
9183 pub set_frequency: SubGhzSetFrequency,
9184 pub is_frequency_valid: SubGhzIsFrequencyValid,
9185 pub set_async_mirror_pin: SubGhzSetAsyncMirrorPin,
9186 pub get_data_gpio: SubGhzGetDataGpio,
9187 pub set_tx: SubGhzSetTx,
9188 pub flush_tx: SubGhzFlushTx,
9189 pub start_async_tx: SubGhzStartAsyncTx,
9190 pub is_async_complete_tx: SubGhzIsAsyncCompleteTx,
9191 pub stop_async_tx: SubGhzStopAsyncTx,
9192 pub set_rx: SubGhzSetRx,
9193 pub flush_rx: SubGhzFlushRx,
9194 pub start_async_rx: SubGhzStartAsyncRx,
9195 pub stop_async_rx: SubGhzStopAsyncRx,
9196 pub get_rssi: SubGhzGetRSSI,
9197 pub get_lqi: SubGhzGetLQI,
9198 pub rx_pipe_not_empty: SubGhzRxPipeNotEmpty,
9199 pub is_rx_data_crc_valid: SubGhzRxIsDataCrcValid,
9200 pub read_packet: SubGhzReadPacket,
9201 pub write_packet: SubGhzWritePacket,
9202}
9203#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9204const _: () = {
9205 ["Size of SubGhzDeviceInterconnect"]
9206 [::core::mem::size_of::<SubGhzDeviceInterconnect>() - 104usize];
9207 ["Alignment of SubGhzDeviceInterconnect"]
9208 [::core::mem::align_of::<SubGhzDeviceInterconnect>() - 4usize];
9209 ["Offset of field: SubGhzDeviceInterconnect::begin"]
9210 [::core::mem::offset_of!(SubGhzDeviceInterconnect, begin) - 0usize];
9211 ["Offset of field: SubGhzDeviceInterconnect::end"]
9212 [::core::mem::offset_of!(SubGhzDeviceInterconnect, end) - 4usize];
9213 ["Offset of field: SubGhzDeviceInterconnect::is_connect"]
9214 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_connect) - 8usize];
9215 ["Offset of field: SubGhzDeviceInterconnect::reset"]
9216 [::core::mem::offset_of!(SubGhzDeviceInterconnect, reset) - 12usize];
9217 ["Offset of field: SubGhzDeviceInterconnect::sleep"]
9218 [::core::mem::offset_of!(SubGhzDeviceInterconnect, sleep) - 16usize];
9219 ["Offset of field: SubGhzDeviceInterconnect::idle"]
9220 [::core::mem::offset_of!(SubGhzDeviceInterconnect, idle) - 20usize];
9221 ["Offset of field: SubGhzDeviceInterconnect::load_preset"]
9222 [::core::mem::offset_of!(SubGhzDeviceInterconnect, load_preset) - 24usize];
9223 ["Offset of field: SubGhzDeviceInterconnect::set_frequency"]
9224 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_frequency) - 28usize];
9225 ["Offset of field: SubGhzDeviceInterconnect::is_frequency_valid"]
9226 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_frequency_valid) - 32usize];
9227 ["Offset of field: SubGhzDeviceInterconnect::set_async_mirror_pin"]
9228 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_async_mirror_pin) - 36usize];
9229 ["Offset of field: SubGhzDeviceInterconnect::get_data_gpio"]
9230 [::core::mem::offset_of!(SubGhzDeviceInterconnect, get_data_gpio) - 40usize];
9231 ["Offset of field: SubGhzDeviceInterconnect::set_tx"]
9232 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_tx) - 44usize];
9233 ["Offset of field: SubGhzDeviceInterconnect::flush_tx"]
9234 [::core::mem::offset_of!(SubGhzDeviceInterconnect, flush_tx) - 48usize];
9235 ["Offset of field: SubGhzDeviceInterconnect::start_async_tx"]
9236 [::core::mem::offset_of!(SubGhzDeviceInterconnect, start_async_tx) - 52usize];
9237 ["Offset of field: SubGhzDeviceInterconnect::is_async_complete_tx"]
9238 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_async_complete_tx) - 56usize];
9239 ["Offset of field: SubGhzDeviceInterconnect::stop_async_tx"]
9240 [::core::mem::offset_of!(SubGhzDeviceInterconnect, stop_async_tx) - 60usize];
9241 ["Offset of field: SubGhzDeviceInterconnect::set_rx"]
9242 [::core::mem::offset_of!(SubGhzDeviceInterconnect, set_rx) - 64usize];
9243 ["Offset of field: SubGhzDeviceInterconnect::flush_rx"]
9244 [::core::mem::offset_of!(SubGhzDeviceInterconnect, flush_rx) - 68usize];
9245 ["Offset of field: SubGhzDeviceInterconnect::start_async_rx"]
9246 [::core::mem::offset_of!(SubGhzDeviceInterconnect, start_async_rx) - 72usize];
9247 ["Offset of field: SubGhzDeviceInterconnect::stop_async_rx"]
9248 [::core::mem::offset_of!(SubGhzDeviceInterconnect, stop_async_rx) - 76usize];
9249 ["Offset of field: SubGhzDeviceInterconnect::get_rssi"]
9250 [::core::mem::offset_of!(SubGhzDeviceInterconnect, get_rssi) - 80usize];
9251 ["Offset of field: SubGhzDeviceInterconnect::get_lqi"]
9252 [::core::mem::offset_of!(SubGhzDeviceInterconnect, get_lqi) - 84usize];
9253 ["Offset of field: SubGhzDeviceInterconnect::rx_pipe_not_empty"]
9254 [::core::mem::offset_of!(SubGhzDeviceInterconnect, rx_pipe_not_empty) - 88usize];
9255 ["Offset of field: SubGhzDeviceInterconnect::is_rx_data_crc_valid"]
9256 [::core::mem::offset_of!(SubGhzDeviceInterconnect, is_rx_data_crc_valid) - 92usize];
9257 ["Offset of field: SubGhzDeviceInterconnect::read_packet"]
9258 [::core::mem::offset_of!(SubGhzDeviceInterconnect, read_packet) - 96usize];
9259 ["Offset of field: SubGhzDeviceInterconnect::write_packet"]
9260 [::core::mem::offset_of!(SubGhzDeviceInterconnect, write_packet) - 100usize];
9261};
9262#[repr(C)]
9263#[derive(Debug, Copy, Clone)]
9264pub struct SubGhzDevice {
9265 pub name: *const core::ffi::c_char,
9266 pub interconnect: *const SubGhzDeviceInterconnect,
9267}
9268#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9269const _: () = {
9270 ["Size of SubGhzDevice"][::core::mem::size_of::<SubGhzDevice>() - 8usize];
9271 ["Alignment of SubGhzDevice"][::core::mem::align_of::<SubGhzDevice>() - 4usize];
9272 ["Offset of field: SubGhzDevice::name"][::core::mem::offset_of!(SubGhzDevice, name) - 0usize];
9273 ["Offset of field: SubGhzDevice::interconnect"]
9274 [::core::mem::offset_of!(SubGhzDevice, interconnect) - 4usize];
9275};
9276#[repr(C)]
9277#[derive(Debug, Copy, Clone)]
9278pub struct SubGhzDeviceCC1101Ext {
9279 _unused: [u8; 0],
9280}
9281#[repr(C)]
9282#[derive(Debug, Copy, Clone)]
9283pub struct Bt {
9284 _unused: [u8; 0],
9285}
9286pub const BtStatusUnavailable: BtStatus = BtStatus(0);
9287pub const BtStatusOff: BtStatus = BtStatus(1);
9288pub const BtStatusAdvertising: BtStatus = BtStatus(2);
9289pub const BtStatusConnected: BtStatus = BtStatus(3);
9290#[repr(transparent)]
9291#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9292pub struct BtStatus(pub core::ffi::c_uchar);
9293pub type BtStatusChangedCallback =
9294 ::core::option::Option<unsafe extern "C" fn(status: BtStatus, context: *mut core::ffi::c_void)>;
9295unsafe extern "C" {
9296 #[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"]
9297 pub fn bt_profile_start(
9298 bt: *mut Bt,
9299 profile_template: *const FuriHalBleProfileTemplate,
9300 params: FuriHalBleProfileParams,
9301 ) -> *mut FuriHalBleProfileBase;
9302}
9303unsafe extern "C" {
9304 #[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"]
9305 pub fn bt_profile_restore_default(bt: *mut Bt) -> bool;
9306}
9307unsafe extern "C" {
9308 #[doc = "Disconnect from Central\n\n # Arguments\n\n* `bt` - Bt instance"]
9309 pub fn bt_disconnect(bt: *mut Bt);
9310}
9311unsafe extern "C" {
9312 #[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"]
9313 pub fn bt_set_status_changed_callback(
9314 bt: *mut Bt,
9315 callback: BtStatusChangedCallback,
9316 context: *mut core::ffi::c_void,
9317 );
9318}
9319unsafe extern "C" {
9320 #[doc = "Forget bonded devices\n > **Note:** Leads to wipe ble key storage and deleting bt.keys\n\n # Arguments\n\n* `bt` - Bt instance"]
9321 pub fn bt_forget_bonded_devices(bt: *mut Bt);
9322}
9323unsafe extern "C" {
9324 #[doc = "Set keys storage file path\n\n # Arguments\n\n* `bt` - Bt instance\n * `keys_storage_path` - Path to file with saved keys"]
9325 pub fn bt_keys_storage_set_storage_path(
9326 bt: *mut Bt,
9327 keys_storage_path: *const core::ffi::c_char,
9328 );
9329}
9330unsafe extern "C" {
9331 #[doc = "Set default keys storage file path\n\n # Arguments\n\n* `bt` - Bt instance"]
9332 pub fn bt_keys_storage_set_default_path(bt: *mut Bt);
9333}
9334#[repr(C)]
9335#[derive(Debug, Copy, Clone)]
9336pub struct BtKeysStorage {
9337 _unused: [u8; 0],
9338}
9339unsafe extern "C" {
9340 pub fn bt_keys_storage_alloc(keys_storage_path: *const core::ffi::c_char)
9341 -> *mut BtKeysStorage;
9342}
9343unsafe extern "C" {
9344 pub fn bt_keys_storage_free(instance: *mut BtKeysStorage);
9345}
9346unsafe extern "C" {
9347 pub fn bt_keys_storage_set_file_path(
9348 instance: *mut BtKeysStorage,
9349 path: *const core::ffi::c_char,
9350 );
9351}
9352unsafe extern "C" {
9353 pub fn bt_keys_storage_set_ram_params(instance: *mut BtKeysStorage, buff: *mut u8, size: u16);
9354}
9355unsafe extern "C" {
9356 pub fn bt_keys_storage_is_changed(instance: *mut BtKeysStorage) -> bool;
9357}
9358unsafe extern "C" {
9359 pub fn bt_keys_storage_get_root_keys(
9360 instance: *mut BtKeysStorage,
9361 ) -> *const GapRootSecurityKeys;
9362}
9363unsafe extern "C" {
9364 pub fn bt_keys_storage_load(instance: *mut BtKeysStorage) -> bool;
9365}
9366unsafe extern "C" {
9367 pub fn bt_keys_storage_update(
9368 instance: *mut BtKeysStorage,
9369 start_addr: *mut u8,
9370 size: u32,
9371 ) -> bool;
9372}
9373unsafe extern "C" {
9374 pub fn bt_keys_storage_delete(instance: *mut BtKeysStorage) -> bool;
9375}
9376pub const PipeRoleAlice: PipeRole = PipeRole(0);
9377pub const PipeRoleBob: PipeRole = PipeRole(1);
9378#[repr(transparent)]
9379#[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."]
9380#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9381pub struct PipeRole(pub core::ffi::c_uchar);
9382pub const PipeStateOpen: PipeState = PipeState(0);
9383pub const PipeStateBroken: PipeState = PipeState(1);
9384#[repr(transparent)]
9385#[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."]
9386#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9387pub struct PipeState(pub core::ffi::c_uchar);
9388#[repr(C)]
9389#[derive(Debug, Copy, Clone)]
9390pub struct PipeSide {
9391 _unused: [u8; 0],
9392}
9393#[repr(C)]
9394#[derive(Debug, Copy, Clone)]
9395pub struct PipeSideBundle {
9396 pub alices_side: *mut PipeSide,
9397 pub bobs_side: *mut PipeSide,
9398}
9399#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9400const _: () = {
9401 ["Size of PipeSideBundle"][::core::mem::size_of::<PipeSideBundle>() - 8usize];
9402 ["Alignment of PipeSideBundle"][::core::mem::align_of::<PipeSideBundle>() - 4usize];
9403 ["Offset of field: PipeSideBundle::alices_side"]
9404 [::core::mem::offset_of!(PipeSideBundle, alices_side) - 0usize];
9405 ["Offset of field: PipeSideBundle::bobs_side"]
9406 [::core::mem::offset_of!(PipeSideBundle, bobs_side) - 4usize];
9407};
9408#[repr(C)]
9409#[derive(Debug, Copy, Clone)]
9410pub struct PipeSideReceiveSettings {
9411 pub capacity: usize,
9412 pub trigger_level: usize,
9413}
9414#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9415const _: () = {
9416 ["Size of PipeSideReceiveSettings"][::core::mem::size_of::<PipeSideReceiveSettings>() - 8usize];
9417 ["Alignment of PipeSideReceiveSettings"]
9418 [::core::mem::align_of::<PipeSideReceiveSettings>() - 4usize];
9419 ["Offset of field: PipeSideReceiveSettings::capacity"]
9420 [::core::mem::offset_of!(PipeSideReceiveSettings, capacity) - 0usize];
9421 ["Offset of field: PipeSideReceiveSettings::trigger_level"]
9422 [::core::mem::offset_of!(PipeSideReceiveSettings, trigger_level) - 4usize];
9423};
9424unsafe extern "C" {
9425 #[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"]
9426 pub fn pipe_alloc(capacity: usize, trigger_level: usize) -> PipeSideBundle;
9427}
9428unsafe extern "C" {
9429 #[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"]
9430 pub fn pipe_alloc_ex(
9431 alice: PipeSideReceiveSettings,
9432 bob: PipeSideReceiveSettings,
9433 ) -> PipeSideBundle;
9434}
9435unsafe extern "C" {
9436 #[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"]
9437 pub fn pipe_role(pipe: *mut PipeSide) -> PipeRole;
9438}
9439unsafe extern "C" {
9440 #[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"]
9441 pub fn pipe_state(pipe: *mut PipeSide) -> PipeState;
9442}
9443unsafe extern "C" {
9444 #[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"]
9445 pub fn pipe_free(pipe: *mut PipeSide);
9446}
9447unsafe extern "C" {
9448 #[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"]
9449 pub fn pipe_install_as_stdio(pipe: *mut PipeSide);
9450}
9451unsafe extern "C" {
9452 #[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"]
9453 pub fn pipe_set_state_check_period(pipe: *mut PipeSide, check_period: FuriWait);
9454}
9455unsafe extern "C" {
9456 #[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"]
9457 pub fn pipe_receive(pipe: *mut PipeSide, data: *mut core::ffi::c_void, length: usize) -> usize;
9458}
9459unsafe extern "C" {
9460 #[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"]
9461 pub fn pipe_send(pipe: *mut PipeSide, data: *const core::ffi::c_void, length: usize) -> usize;
9462}
9463unsafe extern "C" {
9464 #[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"]
9465 pub fn pipe_bytes_available(pipe: *mut PipeSide) -> usize;
9466}
9467unsafe extern "C" {
9468 #[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"]
9469 pub fn pipe_spaces_available(pipe: *mut PipeSide) -> usize;
9470}
9471unsafe extern "C" {
9472 #[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"]
9473 pub fn pipe_attach_to_event_loop(pipe: *mut PipeSide, event_loop: *mut FuriEventLoop);
9474}
9475unsafe extern "C" {
9476 #[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"]
9477 pub fn pipe_detach_from_event_loop(pipe: *mut PipeSide);
9478}
9479#[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"]
9480pub type PipeSideDataArrivedCallback = ::core::option::Option<
9481 unsafe extern "C" fn(pipe: *mut PipeSide, context: *mut core::ffi::c_void),
9482>;
9483#[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"]
9484pub type PipeSideSpaceFreedCallback = ::core::option::Option<
9485 unsafe extern "C" fn(pipe: *mut PipeSide, context: *mut core::ffi::c_void),
9486>;
9487#[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"]
9488pub type PipeSideBrokenCallback = ::core::option::Option<
9489 unsafe extern "C" fn(pipe: *mut PipeSide, context: *mut core::ffi::c_void),
9490>;
9491unsafe extern "C" {
9492 #[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"]
9493 pub fn pipe_set_callback_context(pipe: *mut PipeSide, context: *mut core::ffi::c_void);
9494}
9495unsafe extern "C" {
9496 #[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`."]
9497 pub fn pipe_set_data_arrived_callback(
9498 pipe: *mut PipeSide,
9499 callback: PipeSideDataArrivedCallback,
9500 event: FuriEventLoopEvent,
9501 );
9502}
9503unsafe extern "C" {
9504 #[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`."]
9505 pub fn pipe_set_space_freed_callback(
9506 pipe: *mut PipeSide,
9507 callback: PipeSideSpaceFreedCallback,
9508 event: FuriEventLoopEvent,
9509 );
9510}
9511unsafe extern "C" {
9512 #[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`."]
9513 pub fn pipe_set_broken_callback(
9514 pipe: *mut PipeSide,
9515 callback: PipeSideBrokenCallback,
9516 event: FuriEventLoopEvent,
9517 );
9518}
9519#[doc = "< Default"]
9520pub const CliCommandFlagDefault: CliCommandFlag = CliCommandFlag(0);
9521#[doc = "< Safe to run in parallel with other apps"]
9522pub const CliCommandFlagParallelSafe: CliCommandFlag = CliCommandFlag(1);
9523#[doc = "< Safe to run with insomnia mode on"]
9524pub const CliCommandFlagInsomniaSafe: CliCommandFlag = CliCommandFlag(2);
9525#[doc = "< Do no attach I/O pipe to thread stdio"]
9526pub const CliCommandFlagDontAttachStdio: CliCommandFlag = CliCommandFlag(4);
9527pub const CliCommandFlagUseShellThread: CliCommandFlag = CliCommandFlag(8);
9528#[doc = "< The command comes from a .fal file"]
9529pub const CliCommandFlagExternal: CliCommandFlag = CliCommandFlag(16);
9530#[repr(transparent)]
9531#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9532pub struct CliCommandFlag(pub core::ffi::c_uchar);
9533#[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`"]
9534pub type CliCommandExecuteCallback = ::core::option::Option<
9535 unsafe extern "C" fn(
9536 pipe: *mut PipeSide,
9537 args: *mut FuriString,
9538 context: *mut core::ffi::c_void,
9539 ),
9540>;
9541#[repr(C)]
9542#[derive(Debug, Copy, Clone)]
9543pub struct CliCommandDescriptor {
9544 pub name: *mut core::ffi::c_char,
9545 pub execute_callback: CliCommandExecuteCallback,
9546 pub flags: CliCommandFlag,
9547 pub stack_depth: usize,
9548}
9549#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9550const _: () = {
9551 ["Size of CliCommandDescriptor"][::core::mem::size_of::<CliCommandDescriptor>() - 16usize];
9552 ["Alignment of CliCommandDescriptor"][::core::mem::align_of::<CliCommandDescriptor>() - 4usize];
9553 ["Offset of field: CliCommandDescriptor::name"]
9554 [::core::mem::offset_of!(CliCommandDescriptor, name) - 0usize];
9555 ["Offset of field: CliCommandDescriptor::execute_callback"]
9556 [::core::mem::offset_of!(CliCommandDescriptor, execute_callback) - 4usize];
9557 ["Offset of field: CliCommandDescriptor::flags"]
9558 [::core::mem::offset_of!(CliCommandDescriptor, flags) - 8usize];
9559 ["Offset of field: CliCommandDescriptor::stack_depth"]
9560 [::core::mem::offset_of!(CliCommandDescriptor, stack_depth) - 12usize];
9561};
9562#[doc = "Configuration for locating external commands"]
9563#[repr(C)]
9564#[derive(Debug, Copy, Clone)]
9565pub struct CliCommandExternalConfig {
9566 pub search_directory: *const core::ffi::c_char,
9567 pub fal_prefix: *const core::ffi::c_char,
9568 pub appid: *const core::ffi::c_char,
9569}
9570#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9571const _: () = {
9572 ["Size of CliCommandExternalConfig"]
9573 [::core::mem::size_of::<CliCommandExternalConfig>() - 12usize];
9574 ["Alignment of CliCommandExternalConfig"]
9575 [::core::mem::align_of::<CliCommandExternalConfig>() - 4usize];
9576 ["Offset of field: CliCommandExternalConfig::search_directory"]
9577 [::core::mem::offset_of!(CliCommandExternalConfig, search_directory) - 0usize];
9578 ["Offset of field: CliCommandExternalConfig::fal_prefix"]
9579 [::core::mem::offset_of!(CliCommandExternalConfig, fal_prefix) - 4usize];
9580 ["Offset of field: CliCommandExternalConfig::appid"]
9581 [::core::mem::offset_of!(CliCommandExternalConfig, appid) - 8usize];
9582};
9583unsafe extern "C" {
9584 #[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"]
9585 pub fn cli_is_pipe_broken_or_is_etx_next_char(side: *mut PipeSide) -> bool;
9586}
9587unsafe extern "C" {
9588 #[doc = "Print unified cmd usage tip\n\n # Arguments\n\n* `cmd` - cmd name\n * `usage` - usage tip\n * `arg` - arg passed by user"]
9589 pub fn cli_print_usage(
9590 cmd: *const core::ffi::c_char,
9591 usage: *const core::ffi::c_char,
9592 arg: *const core::ffi::c_char,
9593 );
9594}
9595unsafe extern "C" {
9596 #[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."]
9597 pub fn cli_sleep(side: *mut PipeSide, duration_in_ms: u32) -> bool;
9598}
9599#[repr(C)]
9600#[derive(Debug, Copy, Clone)]
9601pub struct CliRegistry {
9602 _unused: [u8; 0],
9603}
9604unsafe extern "C" {
9605 #[doc = "Allocates a `CliRegistry`."]
9606 pub fn cli_registry_alloc() -> *mut CliRegistry;
9607}
9608unsafe extern "C" {
9609 #[doc = "Frees a `CliRegistry`."]
9610 pub fn cli_registry_free(registry: *mut CliRegistry);
9611}
9612unsafe extern "C" {
9613 #[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"]
9614 pub fn cli_registry_add_command(
9615 registry: *mut CliRegistry,
9616 name: *const core::ffi::c_char,
9617 flags: CliCommandFlag,
9618 callback: CliCommandExecuteCallback,
9619 context: *mut core::ffi::c_void,
9620 );
9621}
9622unsafe extern "C" {
9623 #[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"]
9624 pub fn cli_registry_add_command_ex(
9625 registry: *mut CliRegistry,
9626 name: *const core::ffi::c_char,
9627 flags: CliCommandFlag,
9628 callback: CliCommandExecuteCallback,
9629 context: *mut core::ffi::c_void,
9630 stack_size: usize,
9631 );
9632}
9633unsafe extern "C" {
9634 #[doc = "Deletes a cli command\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance\n * `[in]` - name Command name"]
9635 pub fn cli_registry_delete_command(registry: *mut CliRegistry, name: *const core::ffi::c_char);
9636}
9637unsafe extern "C" {
9638 #[doc = "Unregisters all external commands\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance"]
9639 pub fn cli_registry_remove_external_commands(registry: *mut CliRegistry);
9640}
9641unsafe extern "C" {
9642 #[doc = "Reloads the list of externally available commands\n\n # Arguments\n\n* `[in]` - registry Pointer to registry instance\n * `[in]` - config See `CliCommandExternalConfig`"]
9643 pub fn cli_registry_reload_external_commands(
9644 registry: *mut CliRegistry,
9645 config: *const CliCommandExternalConfig,
9646 );
9647}
9648#[repr(C)]
9649#[derive(Debug, Copy, Clone)]
9650pub struct CliVcp {
9651 _unused: [u8; 0],
9652}
9653unsafe extern "C" {
9654 pub fn cli_vcp_enable(cli_vcp: *mut CliVcp);
9655}
9656unsafe extern "C" {
9657 pub fn cli_vcp_disable(cli_vcp: *mut CliVcp);
9658}
9659unsafe extern "C" {
9660 #[doc = "Get icon width\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\nwidth in pixels"]
9661 pub fn icon_get_width(instance: *const Icon) -> u16;
9662}
9663unsafe extern "C" {
9664 #[doc = "Get icon height\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\nheight in pixels"]
9665 pub fn icon_get_height(instance: *const Icon) -> u16;
9666}
9667unsafe extern "C" {
9668 #[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"]
9669 pub fn icon_get_data(instance: *const Icon) -> *const u8;
9670}
9671unsafe extern "C" {
9672 #[doc = "Get Icon frame count\n\n # Arguments\n\n* `instance` (direction in) - pointer to Icon data\n\n # Returns\n\nframe count"]
9673 pub fn icon_get_frame_count(instance: *const Icon) -> u32;
9674}
9675unsafe extern "C" {
9676 #[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"]
9677 pub fn icon_get_frame_data(instance: *const Icon, frame: u32) -> *const u8;
9678}
9679#[repr(C)]
9680#[derive(Debug, Copy, Clone)]
9681pub struct IconAnimation {
9682 _unused: [u8; 0],
9683}
9684#[doc = "Icon Animation Callback. Used for update notification"]
9685pub type IconAnimationCallback = ::core::option::Option<
9686 unsafe extern "C" fn(instance: *mut IconAnimation, context: *mut core::ffi::c_void),
9687>;
9688unsafe extern "C" {
9689 #[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"]
9690 pub fn icon_animation_alloc(icon: *const Icon) -> *mut IconAnimation;
9691}
9692unsafe extern "C" {
9693 #[doc = "Release icon animation instance\n\n # Arguments\n\n* `instance` - IconAnimation instance"]
9694 pub fn icon_animation_free(instance: *mut IconAnimation);
9695}
9696unsafe extern "C" {
9697 #[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"]
9698 pub fn icon_animation_set_update_callback(
9699 instance: *mut IconAnimation,
9700 callback: IconAnimationCallback,
9701 context: *mut core::ffi::c_void,
9702 );
9703}
9704unsafe extern "C" {
9705 #[doc = "Get icon animation width\n\n # Arguments\n\n* `instance` - IconAnimation instance\n\n # Returns\n\nwidth in pixels"]
9706 pub fn icon_animation_get_width(instance: *const IconAnimation) -> u8;
9707}
9708unsafe extern "C" {
9709 #[doc = "Get icon animation height\n\n # Arguments\n\n* `instance` - IconAnimation instance\n\n # Returns\n\nheight in pixels"]
9710 pub fn icon_animation_get_height(instance: *const IconAnimation) -> u8;
9711}
9712unsafe extern "C" {
9713 #[doc = "Start icon animation\n\n # Arguments\n\n* `instance` - IconAnimation instance"]
9714 pub fn icon_animation_start(instance: *mut IconAnimation);
9715}
9716unsafe extern "C" {
9717 #[doc = "Stop icon animation\n\n # Arguments\n\n* `instance` - IconAnimation instance"]
9718 pub fn icon_animation_stop(instance: *mut IconAnimation);
9719}
9720unsafe extern "C" {
9721 #[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"]
9722 pub fn icon_animation_is_last_frame(instance: *const IconAnimation) -> bool;
9723}
9724pub const ColorWhite: Color = Color(0);
9725pub const ColorBlack: Color = Color(1);
9726pub const ColorXOR: Color = Color(2);
9727#[repr(transparent)]
9728#[doc = "Color enumeration"]
9729#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9730pub struct Color(pub core::ffi::c_uchar);
9731pub const FontPrimary: Font = Font(0);
9732pub const FontSecondary: Font = Font(1);
9733pub const FontKeyboard: Font = Font(2);
9734pub const FontBigNumbers: Font = Font(3);
9735pub const FontTotalNumber: Font = Font(4);
9736#[repr(transparent)]
9737#[doc = "Fonts enumeration"]
9738#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9739pub struct Font(pub core::ffi::c_uchar);
9740pub const AlignLeft: Align = Align(0);
9741pub const AlignRight: Align = Align(1);
9742pub const AlignTop: Align = Align(2);
9743pub const AlignBottom: Align = Align(3);
9744pub const AlignCenter: Align = Align(4);
9745#[repr(transparent)]
9746#[doc = "Alignment enumeration"]
9747#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9748pub struct Align(pub core::ffi::c_uchar);
9749pub const CanvasOrientationHorizontal: CanvasOrientation = CanvasOrientation(0);
9750pub const CanvasOrientationHorizontalFlip: CanvasOrientation = CanvasOrientation(1);
9751pub const CanvasOrientationVertical: CanvasOrientation = CanvasOrientation(2);
9752pub const CanvasOrientationVerticalFlip: CanvasOrientation = CanvasOrientation(3);
9753#[repr(transparent)]
9754#[doc = "Canvas Orientation"]
9755#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9756pub struct CanvasOrientation(pub core::ffi::c_uchar);
9757pub const CanvasDirectionLeftToRight: CanvasDirection = CanvasDirection(0);
9758pub const CanvasDirectionTopToBottom: CanvasDirection = CanvasDirection(1);
9759pub const CanvasDirectionRightToLeft: CanvasDirection = CanvasDirection(2);
9760pub const CanvasDirectionBottomToTop: CanvasDirection = CanvasDirection(3);
9761#[repr(transparent)]
9762#[doc = "Font Direction"]
9763#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9764pub struct CanvasDirection(pub core::ffi::c_uchar);
9765#[doc = "Font parameters"]
9766#[repr(C)]
9767#[derive(Debug, Copy, Clone)]
9768pub struct CanvasFontParameters {
9769 pub leading_default: u8,
9770 pub leading_min: u8,
9771 pub height: u8,
9772 pub descender: u8,
9773}
9774#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9775const _: () = {
9776 ["Size of CanvasFontParameters"][::core::mem::size_of::<CanvasFontParameters>() - 4usize];
9777 ["Alignment of CanvasFontParameters"][::core::mem::align_of::<CanvasFontParameters>() - 1usize];
9778 ["Offset of field: CanvasFontParameters::leading_default"]
9779 [::core::mem::offset_of!(CanvasFontParameters, leading_default) - 0usize];
9780 ["Offset of field: CanvasFontParameters::leading_min"]
9781 [::core::mem::offset_of!(CanvasFontParameters, leading_min) - 1usize];
9782 ["Offset of field: CanvasFontParameters::height"]
9783 [::core::mem::offset_of!(CanvasFontParameters, height) - 2usize];
9784 ["Offset of field: CanvasFontParameters::descender"]
9785 [::core::mem::offset_of!(CanvasFontParameters, descender) - 3usize];
9786};
9787pub const IconFlipNone: IconFlip = IconFlip(0);
9788pub const IconFlipHorizontal: IconFlip = IconFlip(1);
9789pub const IconFlipVertical: IconFlip = IconFlip(2);
9790pub const IconFlipBoth: IconFlip = IconFlip(3);
9791#[repr(transparent)]
9792#[doc = "Icon flip"]
9793#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9794pub struct IconFlip(pub core::ffi::c_uchar);
9795pub const IconRotation0: IconRotation = IconRotation(0);
9796pub const IconRotation90: IconRotation = IconRotation(1);
9797pub const IconRotation180: IconRotation = IconRotation(2);
9798pub const IconRotation270: IconRotation = IconRotation(3);
9799#[repr(transparent)]
9800#[doc = "Icon rotation"]
9801#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9802pub struct IconRotation(pub core::ffi::c_uchar);
9803#[repr(C)]
9804#[derive(Debug, Copy, Clone)]
9805pub struct Canvas {
9806 _unused: [u8; 0],
9807}
9808unsafe extern "C" {
9809 #[doc = "Get canvas buffer.\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\npointer to buffer"]
9810 pub fn canvas_get_buffer(canvas: *mut Canvas) -> *mut u8;
9811}
9812unsafe extern "C" {
9813 #[doc = "Get canvas buffer size.\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nsize of canvas in bytes"]
9814 pub fn canvas_get_buffer_size(canvas: *const Canvas) -> usize;
9815}
9816unsafe extern "C" {
9817 #[doc = "Reset canvas drawing tools configuration\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9818 pub fn canvas_reset(canvas: *mut Canvas);
9819}
9820unsafe extern "C" {
9821 #[doc = "Commit canvas. Send buffer to display\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9822 pub fn canvas_commit(canvas: *mut Canvas);
9823}
9824unsafe extern "C" {
9825 #[doc = "Get Canvas width\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nwidth in pixels."]
9826 pub fn canvas_width(canvas: *const Canvas) -> usize;
9827}
9828unsafe extern "C" {
9829 #[doc = "Get Canvas height\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nheight in pixels."]
9830 pub fn canvas_height(canvas: *const Canvas) -> usize;
9831}
9832unsafe extern "C" {
9833 #[doc = "Get current font height\n\n # Arguments\n\n* `canvas` - Canvas instance\n\n # Returns\n\nheight in pixels."]
9834 pub fn canvas_current_font_height(canvas: *const Canvas) -> usize;
9835}
9836unsafe extern "C" {
9837 #[doc = "Get font parameters\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `font` - Font\n\n # Returns\n\npointer to CanvasFontParameters structure"]
9838 pub fn canvas_get_font_params(canvas: *const Canvas, font: Font)
9839 -> *const CanvasFontParameters;
9840}
9841unsafe extern "C" {
9842 #[doc = "Clear canvas\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9843 pub fn canvas_clear(canvas: *mut Canvas);
9844}
9845unsafe extern "C" {
9846 #[doc = "Set drawing color\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `color` - Color"]
9847 pub fn canvas_set_color(canvas: *mut Canvas, color: Color);
9848}
9849unsafe extern "C" {
9850 #[doc = "Set font swap Argument String Rotation Description\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `dir` - Direction font"]
9851 pub fn canvas_set_font_direction(canvas: *mut Canvas, dir: CanvasDirection);
9852}
9853unsafe extern "C" {
9854 #[doc = "Invert drawing color\n\n # Arguments\n\n* `canvas` - Canvas instance"]
9855 pub fn canvas_invert_color(canvas: *mut Canvas);
9856}
9857unsafe extern "C" {
9858 #[doc = "Set drawing font\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `font` - Font"]
9859 pub fn canvas_set_font(canvas: *mut Canvas, font: Font);
9860}
9861unsafe extern "C" {
9862 #[doc = "Set custom drawing font\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `font` - Pointer to u8g2 const uint8_t* font array"]
9863 pub fn canvas_set_custom_u8g2_font(canvas: *mut Canvas, font: *const u8);
9864}
9865unsafe extern "C" {
9866 #[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"]
9867 pub fn canvas_draw_str(canvas: *mut Canvas, x: i32, y: i32, str_: *const core::ffi::c_char);
9868}
9869unsafe extern "C" {
9870 #[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"]
9871 pub fn canvas_draw_str_aligned(
9872 canvas: *mut Canvas,
9873 x: i32,
9874 y: i32,
9875 horizontal: Align,
9876 vertical: Align,
9877 str_: *const core::ffi::c_char,
9878 );
9879}
9880unsafe extern "C" {
9881 #[doc = "Get string width\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - C-string\n\n # Returns\n\nwidth in pixels."]
9882 pub fn canvas_string_width(canvas: *mut Canvas, str_: *const core::ffi::c_char) -> u16;
9883}
9884unsafe extern "C" {
9885 #[doc = "Get glyph width\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `symbol` (direction in) - character\n\n # Returns\n\nwidth in pixels"]
9886 pub fn canvas_glyph_width(canvas: *mut Canvas, symbol: u16) -> usize;
9887}
9888unsafe extern "C" {
9889 #[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"]
9890 pub fn canvas_draw_bitmap(
9891 canvas: *mut Canvas,
9892 x: i32,
9893 y: i32,
9894 width: usize,
9895 height: usize,
9896 compressed_bitmap_data: *const u8,
9897 );
9898}
9899unsafe extern "C" {
9900 #[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"]
9901 pub fn canvas_draw_icon_ex(
9902 canvas: *mut Canvas,
9903 x: i32,
9904 y: i32,
9905 icon: *const Icon,
9906 rotation: IconRotation,
9907 );
9908}
9909unsafe extern "C" {
9910 #[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"]
9911 pub fn canvas_draw_icon_animation(
9912 canvas: *mut Canvas,
9913 x: i32,
9914 y: i32,
9915 icon_animation: *mut IconAnimation,
9916 );
9917}
9918unsafe extern "C" {
9919 #[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"]
9920 pub fn canvas_draw_icon(canvas: *mut Canvas, x: i32, y: i32, icon: *const Icon);
9921}
9922unsafe extern "C" {
9923 #[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"]
9924 pub fn canvas_draw_xbm(
9925 canvas: *mut Canvas,
9926 x: i32,
9927 y: i32,
9928 width: usize,
9929 height: usize,
9930 bitmap: *const u8,
9931 );
9932}
9933unsafe extern "C" {
9934 #[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"]
9935 pub fn canvas_draw_xbm_ex(
9936 canvas: *mut Canvas,
9937 x: i32,
9938 y: i32,
9939 width: usize,
9940 height: usize,
9941 rotation: IconRotation,
9942 bitmap_data: *const u8,
9943 );
9944}
9945unsafe extern "C" {
9946 #[doc = "Draw dot at x,y\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate"]
9947 pub fn canvas_draw_dot(canvas: *mut Canvas, x: i32, y: i32);
9948}
9949unsafe extern "C" {
9950 #[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"]
9951 pub fn canvas_draw_box(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
9952}
9953unsafe extern "C" {
9954 #[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"]
9955 pub fn canvas_draw_frame(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
9956}
9957unsafe extern "C" {
9958 #[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"]
9959 pub fn canvas_draw_line(canvas: *mut Canvas, x1: i32, y1: i32, x2: i32, y2: i32);
9960}
9961unsafe extern "C" {
9962 #[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"]
9963 pub fn canvas_draw_circle(canvas: *mut Canvas, x: i32, y: i32, radius: usize);
9964}
9965unsafe extern "C" {
9966 #[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"]
9967 pub fn canvas_draw_disc(canvas: *mut Canvas, x: i32, y: i32, radius: usize);
9968}
9969unsafe extern "C" {
9970 #[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"]
9971 pub fn canvas_draw_triangle(
9972 canvas: *mut Canvas,
9973 x: i32,
9974 y: i32,
9975 base: usize,
9976 height: usize,
9977 dir: CanvasDirection,
9978 );
9979}
9980unsafe extern "C" {
9981 #[doc = "Draw glyph\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `x` - x coordinate\n * `y` - y coordinate\n * `ch` - character"]
9982 pub fn canvas_draw_glyph(canvas: *mut Canvas, x: i32, y: i32, ch: u16);
9983}
9984unsafe extern "C" {
9985 #[doc = "Set transparency mode\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `alpha` - transparency mode"]
9986 pub fn canvas_set_bitmap_mode(canvas: *mut Canvas, alpha: bool);
9987}
9988unsafe extern "C" {
9989 #[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"]
9990 pub fn canvas_draw_rframe(
9991 canvas: *mut Canvas,
9992 x: i32,
9993 y: i32,
9994 width: usize,
9995 height: usize,
9996 radius: usize,
9997 );
9998}
9999unsafe extern "C" {
10000 #[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"]
10001 pub fn canvas_draw_rbox(
10002 canvas: *mut Canvas,
10003 x: i32,
10004 y: i32,
10005 width: usize,
10006 height: usize,
10007 radius: usize,
10008 );
10009}
10010#[doc = "< Press event, emitted after debounce"]
10011pub const InputTypePress: InputType = InputType(0);
10012#[doc = "< Release event, emitted after debounce"]
10013pub const InputTypeRelease: InputType = InputType(1);
10014#[doc = "< Short event, emitted after InputTypeRelease done within INPUT_LONG_PRESS interval"]
10015pub const InputTypeShort: InputType = InputType(2);
10016#[doc = "< Long event, emitted after INPUT_LONG_PRESS_COUNTS interval, asynchronous to InputTypeRelease"]
10017pub const InputTypeLong: InputType = InputType(3);
10018#[doc = "< Repeat event, emitted with INPUT_LONG_PRESS_COUNTS period after InputTypeLong event"]
10019pub const InputTypeRepeat: InputType = InputType(4);
10020#[doc = "< Special value for exceptional"]
10021pub const InputTypeMAX: InputType = InputType(5);
10022#[repr(transparent)]
10023#[doc = "Input Types\n Some of them are physical events and some logical"]
10024#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10025pub struct InputType(pub core::ffi::c_uchar);
10026#[doc = "Input Event, dispatches with FuriPubSub"]
10027#[repr(C)]
10028#[derive(Copy, Clone)]
10029pub struct InputEvent {
10030 pub __bindgen_anon_1: InputEvent__bindgen_ty_1,
10031 pub key: InputKey,
10032 pub type_: InputType,
10033}
10034#[repr(C)]
10035#[derive(Copy, Clone)]
10036pub union InputEvent__bindgen_ty_1 {
10037 pub sequence: u32,
10038 pub __bindgen_anon_1: InputEvent__bindgen_ty_1__bindgen_ty_1,
10039}
10040#[repr(C)]
10041#[derive(Debug, Copy, Clone)]
10042pub struct InputEvent__bindgen_ty_1__bindgen_ty_1 {
10043 pub _bitfield_align_1: [u32; 0],
10044 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
10045}
10046#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10047const _: () = {
10048 ["Size of InputEvent__bindgen_ty_1__bindgen_ty_1"]
10049 [::core::mem::size_of::<InputEvent__bindgen_ty_1__bindgen_ty_1>() - 4usize];
10050 ["Alignment of InputEvent__bindgen_ty_1__bindgen_ty_1"]
10051 [::core::mem::align_of::<InputEvent__bindgen_ty_1__bindgen_ty_1>() - 4usize];
10052};
10053impl InputEvent__bindgen_ty_1__bindgen_ty_1 {
10054 #[inline]
10055 pub fn sequence_source(&self) -> u8 {
10056 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
10057 }
10058 #[inline]
10059 pub fn set_sequence_source(&mut self, val: u8) {
10060 unsafe {
10061 let val: u8 = ::core::mem::transmute(val);
10062 self._bitfield_1.set(0usize, 2u8, val as u64)
10063 }
10064 }
10065 #[inline]
10066 pub unsafe fn sequence_source_raw(this: *const Self) -> u8 {
10067 unsafe {
10068 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
10069 ::core::ptr::addr_of!((*this)._bitfield_1),
10070 0usize,
10071 2u8,
10072 ) as u8)
10073 }
10074 }
10075 #[inline]
10076 pub unsafe fn set_sequence_source_raw(this: *mut Self, val: u8) {
10077 unsafe {
10078 let val: u8 = ::core::mem::transmute(val);
10079 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
10080 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
10081 0usize,
10082 2u8,
10083 val as u64,
10084 )
10085 }
10086 }
10087 #[inline]
10088 pub fn sequence_counter(&self) -> u32 {
10089 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) }
10090 }
10091 #[inline]
10092 pub fn set_sequence_counter(&mut self, val: u32) {
10093 unsafe {
10094 let val: u32 = ::core::mem::transmute(val);
10095 self._bitfield_1.set(2usize, 30u8, val as u64)
10096 }
10097 }
10098 #[inline]
10099 pub unsafe fn sequence_counter_raw(this: *const Self) -> u32 {
10100 unsafe {
10101 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
10102 ::core::ptr::addr_of!((*this)._bitfield_1),
10103 2usize,
10104 30u8,
10105 ) as u32)
10106 }
10107 }
10108 #[inline]
10109 pub unsafe fn set_sequence_counter_raw(this: *mut Self, val: u32) {
10110 unsafe {
10111 let val: u32 = ::core::mem::transmute(val);
10112 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
10113 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
10114 2usize,
10115 30u8,
10116 val as u64,
10117 )
10118 }
10119 }
10120 #[inline]
10121 pub fn new_bitfield_1(
10122 sequence_source: u8,
10123 sequence_counter: u32,
10124 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
10125 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
10126 __bindgen_bitfield_unit.set(0usize, 2u8, {
10127 let sequence_source: u8 = unsafe { ::core::mem::transmute(sequence_source) };
10128 sequence_source as u64
10129 });
10130 __bindgen_bitfield_unit.set(2usize, 30u8, {
10131 let sequence_counter: u32 = unsafe { ::core::mem::transmute(sequence_counter) };
10132 sequence_counter as u64
10133 });
10134 __bindgen_bitfield_unit
10135 }
10136}
10137#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10138const _: () = {
10139 ["Size of InputEvent__bindgen_ty_1"]
10140 [::core::mem::size_of::<InputEvent__bindgen_ty_1>() - 4usize];
10141 ["Alignment of InputEvent__bindgen_ty_1"]
10142 [::core::mem::align_of::<InputEvent__bindgen_ty_1>() - 4usize];
10143 ["Offset of field: InputEvent__bindgen_ty_1::sequence"]
10144 [::core::mem::offset_of!(InputEvent__bindgen_ty_1, sequence) - 0usize];
10145};
10146#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10147const _: () = {
10148 ["Size of InputEvent"][::core::mem::size_of::<InputEvent>() - 8usize];
10149 ["Alignment of InputEvent"][::core::mem::align_of::<InputEvent>() - 4usize];
10150 ["Offset of field: InputEvent::key"][::core::mem::offset_of!(InputEvent, key) - 4usize];
10151 ["Offset of field: InputEvent::type_"][::core::mem::offset_of!(InputEvent, type_) - 5usize];
10152};
10153unsafe extern "C" {
10154 #[doc = "Get human readable input key name\n # Arguments\n\n* `key` - - InputKey\n # Returns\n\nstring"]
10155 pub fn input_get_key_name(key: InputKey) -> *const core::ffi::c_char;
10156}
10157unsafe extern "C" {
10158 #[doc = "Get human readable input type name\n # Arguments\n\n* `type` - - InputType\n # Returns\n\nstring"]
10159 pub fn input_get_type_name(type_: InputType) -> *const core::ffi::c_char;
10160}
10161pub const ViewOrientationHorizontal: ViewOrientation = ViewOrientation(0);
10162pub const ViewOrientationHorizontalFlip: ViewOrientation = ViewOrientation(1);
10163pub const ViewOrientationVertical: ViewOrientation = ViewOrientation(2);
10164pub const ViewOrientationVerticalFlip: ViewOrientation = ViewOrientation(3);
10165#[repr(transparent)]
10166#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10167pub struct ViewOrientation(pub core::ffi::c_uchar);
10168#[repr(C)]
10169#[derive(Debug, Copy, Clone)]
10170pub struct View {
10171 _unused: [u8; 0],
10172}
10173#[doc = "View Draw callback\n # Arguments\n\n* `canvas` - pointer to canvas\n * `model` - pointer to model\n called from GUI thread"]
10174pub type ViewDrawCallback = ::core::option::Option<
10175 unsafe extern "C" fn(canvas: *mut Canvas, model: *mut core::ffi::c_void),
10176>;
10177#[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"]
10178pub type ViewInputCallback = ::core::option::Option<
10179 unsafe extern "C" fn(event: *mut InputEvent, context: *mut core::ffi::c_void) -> bool,
10180>;
10181#[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"]
10182pub type ViewCustomCallback = ::core::option::Option<
10183 unsafe extern "C" fn(event: u32, context: *mut core::ffi::c_void) -> bool,
10184>;
10185#[doc = "View navigation callback\n # Arguments\n\n* `context` - pointer to context\n # Returns\n\nnext view id\n called from GUI thread"]
10186pub type ViewNavigationCallback =
10187 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> u32>;
10188#[doc = "View callback\n # Arguments\n\n* `context` - pointer to context\n called from GUI thread"]
10189pub type ViewCallback =
10190 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
10191#[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"]
10192pub type ViewUpdateCallback =
10193 ::core::option::Option<unsafe extern "C" fn(view: *mut View, context: *mut core::ffi::c_void)>;
10194#[doc = "Model is not allocated"]
10195pub const ViewModelTypeNone: ViewModelType = ViewModelType(0);
10196#[doc = "Model consist of atomic types and/or partial update is not critical for rendering.\n Lock free."]
10197pub const ViewModelTypeLockFree: ViewModelType = ViewModelType(1);
10198#[doc = "Model access is guarded with mutex.\n Locking gui thread."]
10199pub const ViewModelTypeLocking: ViewModelType = ViewModelType(2);
10200#[repr(transparent)]
10201#[doc = "View model types"]
10202#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10203pub struct ViewModelType(pub core::ffi::c_uchar);
10204unsafe extern "C" {
10205 #[doc = "Allocate and init View\n # Returns\n\nView instance"]
10206 pub fn view_alloc() -> *mut View;
10207}
10208unsafe extern "C" {
10209 #[doc = "Free View\n\n # Arguments\n\n* `view` - instance"]
10210 pub fn view_free(view: *mut View);
10211}
10212unsafe extern "C" {
10213 #[doc = "Tie IconAnimation with View\n\n # Arguments\n\n* `view` - View instance\n * `icon_animation` - IconAnimation instance"]
10214 pub fn view_tie_icon_animation(view: *mut View, icon_animation: *mut IconAnimation);
10215}
10216unsafe extern "C" {
10217 #[doc = "Set View Draw callback\n\n callback will be invoked on the GUI thread\n\n # Arguments\n\n* `view` - View instance\n * `callback` - draw callback"]
10218 pub fn view_set_draw_callback(view: *mut View, callback: ViewDrawCallback);
10219}
10220unsafe extern "C" {
10221 #[doc = "Set View Input callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - input callback"]
10222 pub fn view_set_input_callback(view: *mut View, callback: ViewInputCallback);
10223}
10224unsafe extern "C" {
10225 #[doc = "Set View Custom callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - input callback"]
10226 pub fn view_set_custom_callback(view: *mut View, callback: ViewCustomCallback);
10227}
10228unsafe extern "C" {
10229 #[doc = "Set Navigation Previous callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - input callback"]
10230 pub fn view_set_previous_callback(view: *mut View, callback: ViewNavigationCallback);
10231}
10232unsafe extern "C" {
10233 #[doc = "Set Enter callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - callback"]
10234 pub fn view_set_enter_callback(view: *mut View, callback: ViewCallback);
10235}
10236unsafe extern "C" {
10237 #[doc = "Set Exit callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - callback"]
10238 pub fn view_set_exit_callback(view: *mut View, callback: ViewCallback);
10239}
10240unsafe extern "C" {
10241 #[doc = "Set Update callback\n\n # Arguments\n\n* `view` - View instance\n * `callback` - callback"]
10242 pub fn view_set_update_callback(view: *mut View, callback: ViewUpdateCallback);
10243}
10244unsafe extern "C" {
10245 #[doc = "Set View Draw callback\n\n # Arguments\n\n* `view` - View instance\n * `context` - context for callbacks"]
10246 pub fn view_set_update_callback_context(view: *mut View, context: *mut core::ffi::c_void);
10247}
10248unsafe extern "C" {
10249 #[doc = "Set View Draw callback\n\n # Arguments\n\n* `view` - View instance\n * `context` - context for callbacks"]
10250 pub fn view_set_context(view: *mut View, context: *mut core::ffi::c_void);
10251}
10252unsafe extern "C" {
10253 #[doc = "Set View Orientation\n\n # Arguments\n\n* `view` - View instance\n * `orientation` - either vertical or horizontal"]
10254 pub fn view_set_orientation(view: *mut View, orientation: ViewOrientation);
10255}
10256unsafe extern "C" {
10257 #[doc = "Allocate view model.\n\n # Arguments\n\n* `view` - View instance\n * `type` - View Model Type\n * `size` - size"]
10258 pub fn view_allocate_model(view: *mut View, type_: ViewModelType, size: usize);
10259}
10260unsafe extern "C" {
10261 #[doc = "Free view model data memory.\n\n # Arguments\n\n* `view` - View instance"]
10262 pub fn view_free_model(view: *mut View);
10263}
10264unsafe extern "C" {
10265 #[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"]
10266 pub fn view_get_model(view: *mut View) -> *mut core::ffi::c_void;
10267}
10268unsafe extern "C" {
10269 #[doc = "Commit view model\n\n # Arguments\n\n* `view` - View instance\n * `update` - true if you want to emit view update, false otherwise"]
10270 pub fn view_commit_model(view: *mut View, update: bool);
10271}
10272#[repr(C)]
10273#[derive(Debug, Copy, Clone)]
10274pub struct FileBrowser {
10275 _unused: [u8; 0],
10276}
10277pub type FileBrowserCallback =
10278 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
10279pub type FileBrowserLoadItemCallback = ::core::option::Option<
10280 unsafe extern "C" fn(
10281 path: *mut FuriString,
10282 context: *mut core::ffi::c_void,
10283 icon: *mut *mut u8,
10284 item_name: *mut FuriString,
10285 ) -> bool,
10286>;
10287unsafe extern "C" {
10288 pub fn file_browser_alloc(result_path: *mut FuriString) -> *mut FileBrowser;
10289}
10290unsafe extern "C" {
10291 pub fn file_browser_free(browser: *mut FileBrowser);
10292}
10293unsafe extern "C" {
10294 pub fn file_browser_get_view(browser: *mut FileBrowser) -> *mut View;
10295}
10296unsafe extern "C" {
10297 pub fn file_browser_configure(
10298 browser: *mut FileBrowser,
10299 extension: *const core::ffi::c_char,
10300 base_path: *const core::ffi::c_char,
10301 skip_assets: bool,
10302 hide_dot_files: bool,
10303 file_icon: *const Icon,
10304 hide_ext: bool,
10305 );
10306}
10307unsafe extern "C" {
10308 pub fn file_browser_start(browser: *mut FileBrowser, path: *mut FuriString);
10309}
10310unsafe extern "C" {
10311 pub fn file_browser_stop(browser: *mut FileBrowser);
10312}
10313unsafe extern "C" {
10314 pub fn file_browser_set_callback(
10315 browser: *mut FileBrowser,
10316 callback: FileBrowserCallback,
10317 context: *mut core::ffi::c_void,
10318 );
10319}
10320unsafe extern "C" {
10321 pub fn file_browser_set_item_callback(
10322 browser: *mut FileBrowser,
10323 callback: FileBrowserLoadItemCallback,
10324 context: *mut core::ffi::c_void,
10325 );
10326}
10327#[repr(C)]
10328#[derive(Debug, Copy, Clone)]
10329pub struct DialogsApp {
10330 _unused: [u8; 0],
10331}
10332#[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"]
10333#[repr(C)]
10334#[derive(Debug, Copy, Clone)]
10335pub struct DialogsFileBrowserOptions {
10336 pub extension: *const core::ffi::c_char,
10337 pub base_path: *const core::ffi::c_char,
10338 pub skip_assets: bool,
10339 pub hide_dot_files: bool,
10340 pub icon: *const Icon,
10341 pub hide_ext: bool,
10342 pub item_loader_callback: FileBrowserLoadItemCallback,
10343 pub item_loader_context: *mut core::ffi::c_void,
10344}
10345#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10346const _: () = {
10347 ["Size of DialogsFileBrowserOptions"]
10348 [::core::mem::size_of::<DialogsFileBrowserOptions>() - 28usize];
10349 ["Alignment of DialogsFileBrowserOptions"]
10350 [::core::mem::align_of::<DialogsFileBrowserOptions>() - 4usize];
10351 ["Offset of field: DialogsFileBrowserOptions::extension"]
10352 [::core::mem::offset_of!(DialogsFileBrowserOptions, extension) - 0usize];
10353 ["Offset of field: DialogsFileBrowserOptions::base_path"]
10354 [::core::mem::offset_of!(DialogsFileBrowserOptions, base_path) - 4usize];
10355 ["Offset of field: DialogsFileBrowserOptions::skip_assets"]
10356 [::core::mem::offset_of!(DialogsFileBrowserOptions, skip_assets) - 8usize];
10357 ["Offset of field: DialogsFileBrowserOptions::hide_dot_files"]
10358 [::core::mem::offset_of!(DialogsFileBrowserOptions, hide_dot_files) - 9usize];
10359 ["Offset of field: DialogsFileBrowserOptions::icon"]
10360 [::core::mem::offset_of!(DialogsFileBrowserOptions, icon) - 12usize];
10361 ["Offset of field: DialogsFileBrowserOptions::hide_ext"]
10362 [::core::mem::offset_of!(DialogsFileBrowserOptions, hide_ext) - 16usize];
10363 ["Offset of field: DialogsFileBrowserOptions::item_loader_callback"]
10364 [::core::mem::offset_of!(DialogsFileBrowserOptions, item_loader_callback) - 20usize];
10365 ["Offset of field: DialogsFileBrowserOptions::item_loader_context"]
10366 [::core::mem::offset_of!(DialogsFileBrowserOptions, item_loader_context) - 24usize];
10367};
10368unsafe extern "C" {
10369 #[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"]
10370 pub fn dialog_file_browser_set_basic_options(
10371 options: *mut DialogsFileBrowserOptions,
10372 extension: *const core::ffi::c_char,
10373 icon: *const Icon,
10374 );
10375}
10376unsafe extern "C" {
10377 #[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"]
10378 pub fn dialog_file_browser_show(
10379 context: *mut DialogsApp,
10380 result_path: *mut FuriString,
10381 path: *mut FuriString,
10382 options: *const DialogsFileBrowserOptions,
10383 ) -> bool;
10384}
10385pub const DialogMessageButtonBack: DialogMessageButton = DialogMessageButton(0);
10386pub const DialogMessageButtonLeft: DialogMessageButton = DialogMessageButton(1);
10387pub const DialogMessageButtonCenter: DialogMessageButton = DialogMessageButton(2);
10388pub const DialogMessageButtonRight: DialogMessageButton = DialogMessageButton(3);
10389#[repr(transparent)]
10390#[doc = "Message result type"]
10391#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10392pub struct DialogMessageButton(pub core::ffi::c_uchar);
10393#[repr(C)]
10394#[derive(Debug, Copy, Clone)]
10395pub struct DialogMessage {
10396 _unused: [u8; 0],
10397}
10398unsafe extern "C" {
10399 #[doc = "Allocate and fill message\n # Returns\n\nDialogMessage*"]
10400 pub fn dialog_message_alloc() -> *mut DialogMessage;
10401}
10402unsafe extern "C" {
10403 #[doc = "Free message struct\n # Arguments\n\n* `message` - message pointer"]
10404 pub fn dialog_message_free(message: *mut DialogMessage);
10405}
10406unsafe extern "C" {
10407 #[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"]
10408 pub fn dialog_message_set_text(
10409 message: *mut DialogMessage,
10410 text: *const core::ffi::c_char,
10411 x: u8,
10412 y: u8,
10413 horizontal: Align,
10414 vertical: Align,
10415 );
10416}
10417unsafe extern "C" {
10418 #[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"]
10419 pub fn dialog_message_set_header(
10420 message: *mut DialogMessage,
10421 text: *const core::ffi::c_char,
10422 x: u8,
10423 y: u8,
10424 horizontal: Align,
10425 vertical: Align,
10426 );
10427}
10428unsafe extern "C" {
10429 #[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"]
10430 pub fn dialog_message_set_icon(message: *mut DialogMessage, icon: *const Icon, x: u8, y: u8);
10431}
10432unsafe extern "C" {
10433 #[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"]
10434 pub fn dialog_message_set_buttons(
10435 message: *mut DialogMessage,
10436 left: *const core::ffi::c_char,
10437 center: *const core::ffi::c_char,
10438 right: *const core::ffi::c_char,
10439 );
10440}
10441unsafe extern "C" {
10442 #[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"]
10443 pub fn dialog_message_show(
10444 context: *mut DialogsApp,
10445 message: *const DialogMessage,
10446 ) -> DialogMessageButton;
10447}
10448unsafe extern "C" {
10449 #[doc = "Show SD error message (with question sign)\n # Arguments\n\n* `context` -\n * `error_text` -"]
10450 pub fn dialog_message_show_storage_error(
10451 context: *mut DialogsApp,
10452 error_text: *const core::ffi::c_char,
10453 );
10454}
10455pub const DolphinAppSubGhz: DolphinApp = DolphinApp(0);
10456pub const DolphinAppRfid: DolphinApp = DolphinApp(1);
10457pub const DolphinAppNfc: DolphinApp = DolphinApp(2);
10458pub const DolphinAppIr: DolphinApp = DolphinApp(3);
10459pub const DolphinAppIbutton: DolphinApp = DolphinApp(4);
10460pub const DolphinAppBadusb: DolphinApp = DolphinApp(5);
10461pub const DolphinAppPlugin: DolphinApp = DolphinApp(6);
10462pub const DolphinAppMAX: DolphinApp = DolphinApp(7);
10463#[repr(transparent)]
10464#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10465pub struct DolphinApp(pub core::ffi::c_uchar);
10466pub const DolphinDeedSubGhzReceiverInfo: DolphinDeed = DolphinDeed(0);
10467pub const DolphinDeedSubGhzSave: DolphinDeed = DolphinDeed(1);
10468pub const DolphinDeedSubGhzRawRec: DolphinDeed = DolphinDeed(2);
10469pub const DolphinDeedSubGhzAddManually: DolphinDeed = DolphinDeed(3);
10470pub const DolphinDeedSubGhzSend: DolphinDeed = DolphinDeed(4);
10471pub const DolphinDeedSubGhzFrequencyAnalyzer: DolphinDeed = DolphinDeed(5);
10472pub const DolphinDeedRfidRead: DolphinDeed = DolphinDeed(6);
10473pub const DolphinDeedRfidReadSuccess: DolphinDeed = DolphinDeed(7);
10474pub const DolphinDeedRfidSave: DolphinDeed = DolphinDeed(8);
10475pub const DolphinDeedRfidEmulate: DolphinDeed = DolphinDeed(9);
10476pub const DolphinDeedRfidAdd: DolphinDeed = DolphinDeed(10);
10477pub const DolphinDeedNfcRead: DolphinDeed = DolphinDeed(11);
10478pub const DolphinDeedNfcReadSuccess: DolphinDeed = DolphinDeed(12);
10479pub const DolphinDeedNfcSave: DolphinDeed = DolphinDeed(13);
10480pub const DolphinDeedNfcDetectReader: DolphinDeed = DolphinDeed(14);
10481pub const DolphinDeedNfcEmulate: DolphinDeed = DolphinDeed(15);
10482pub const DolphinDeedNfcKeyAdd: DolphinDeed = DolphinDeed(16);
10483pub const DolphinDeedNfcAddSave: DolphinDeed = DolphinDeed(17);
10484pub const DolphinDeedNfcAddEmulate: DolphinDeed = DolphinDeed(18);
10485pub const DolphinDeedIrSend: DolphinDeed = DolphinDeed(19);
10486pub const DolphinDeedIrLearnSuccess: DolphinDeed = DolphinDeed(20);
10487pub const DolphinDeedIrSave: DolphinDeed = DolphinDeed(21);
10488pub const DolphinDeedIbuttonRead: DolphinDeed = DolphinDeed(22);
10489pub const DolphinDeedIbuttonReadSuccess: DolphinDeed = DolphinDeed(23);
10490pub const DolphinDeedIbuttonSave: DolphinDeed = DolphinDeed(24);
10491pub const DolphinDeedIbuttonEmulate: DolphinDeed = DolphinDeed(25);
10492pub const DolphinDeedIbuttonAdd: DolphinDeed = DolphinDeed(26);
10493pub const DolphinDeedBadUsbPlayScript: DolphinDeed = DolphinDeed(27);
10494pub const DolphinDeedU2fAuthorized: DolphinDeed = DolphinDeed(28);
10495pub const DolphinDeedGpioUartBridge: DolphinDeed = DolphinDeed(29);
10496pub const DolphinDeedPluginStart: DolphinDeed = DolphinDeed(30);
10497pub const DolphinDeedPluginGameStart: DolphinDeed = DolphinDeed(31);
10498pub const DolphinDeedPluginGameWin: DolphinDeed = DolphinDeed(32);
10499pub const DolphinDeedMAX: DolphinDeed = DolphinDeed(33);
10500pub const DolphinDeedTestLeft: DolphinDeed = DolphinDeed(34);
10501pub const DolphinDeedTestRight: DolphinDeed = DolphinDeed(35);
10502#[repr(transparent)]
10503#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10504pub struct DolphinDeed(pub core::ffi::c_uchar);
10505#[repr(C)]
10506#[derive(Debug, Copy, Clone)]
10507pub struct DolphinDeedWeight {
10508 pub icounter: u8,
10509 pub app: DolphinApp,
10510}
10511#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10512const _: () = {
10513 ["Size of DolphinDeedWeight"][::core::mem::size_of::<DolphinDeedWeight>() - 2usize];
10514 ["Alignment of DolphinDeedWeight"][::core::mem::align_of::<DolphinDeedWeight>() - 1usize];
10515 ["Offset of field: DolphinDeedWeight::icounter"]
10516 [::core::mem::offset_of!(DolphinDeedWeight, icounter) - 0usize];
10517 ["Offset of field: DolphinDeedWeight::app"]
10518 [::core::mem::offset_of!(DolphinDeedWeight, app) - 1usize];
10519};
10520#[repr(C)]
10521#[derive(Debug, Copy, Clone)]
10522pub struct DolphinDeedLimits {
10523 pub app: DolphinApp,
10524 pub icounter_limit: u8,
10525}
10526#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10527const _: () = {
10528 ["Size of DolphinDeedLimits"][::core::mem::size_of::<DolphinDeedLimits>() - 2usize];
10529 ["Alignment of DolphinDeedLimits"][::core::mem::align_of::<DolphinDeedLimits>() - 1usize];
10530 ["Offset of field: DolphinDeedLimits::app"]
10531 [::core::mem::offset_of!(DolphinDeedLimits, app) - 0usize];
10532 ["Offset of field: DolphinDeedLimits::icounter_limit"]
10533 [::core::mem::offset_of!(DolphinDeedLimits, icounter_limit) - 1usize];
10534};
10535unsafe extern "C" {
10536 pub fn dolphin_deed_get_app(deed: DolphinDeed) -> DolphinApp;
10537}
10538unsafe extern "C" {
10539 pub fn dolphin_deed_get_app_limit(app: DolphinApp) -> u8;
10540}
10541unsafe extern "C" {
10542 pub fn dolphin_deed_get_weight(deed: DolphinDeed) -> u8;
10543}
10544#[repr(C)]
10545#[derive(Debug, Copy, Clone)]
10546pub struct Dolphin {
10547 _unused: [u8; 0],
10548}
10549#[repr(C)]
10550#[derive(Debug, Copy, Clone)]
10551pub struct DolphinStats {
10552 pub icounter: u32,
10553 pub butthurt: u32,
10554 pub timestamp: u64,
10555 pub level: u8,
10556 pub level_up_is_pending: bool,
10557}
10558#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10559const _: () = {
10560 ["Size of DolphinStats"][::core::mem::size_of::<DolphinStats>() - 24usize];
10561 ["Alignment of DolphinStats"][::core::mem::align_of::<DolphinStats>() - 8usize];
10562 ["Offset of field: DolphinStats::icounter"]
10563 [::core::mem::offset_of!(DolphinStats, icounter) - 0usize];
10564 ["Offset of field: DolphinStats::butthurt"]
10565 [::core::mem::offset_of!(DolphinStats, butthurt) - 4usize];
10566 ["Offset of field: DolphinStats::timestamp"]
10567 [::core::mem::offset_of!(DolphinStats, timestamp) - 8usize];
10568 ["Offset of field: DolphinStats::level"]
10569 [::core::mem::offset_of!(DolphinStats, level) - 16usize];
10570 ["Offset of field: DolphinStats::level_up_is_pending"]
10571 [::core::mem::offset_of!(DolphinStats, level_up_is_pending) - 17usize];
10572};
10573#[repr(C)]
10574#[derive(Debug, Copy, Clone)]
10575pub struct DolphinSettings {
10576 pub happy_mode: bool,
10577}
10578#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10579const _: () = {
10580 ["Size of DolphinSettings"][::core::mem::size_of::<DolphinSettings>() - 1usize];
10581 ["Alignment of DolphinSettings"][::core::mem::align_of::<DolphinSettings>() - 1usize];
10582 ["Offset of field: DolphinSettings::happy_mode"]
10583 [::core::mem::offset_of!(DolphinSettings, happy_mode) - 0usize];
10584};
10585pub const DolphinPubsubEventUpdate: DolphinPubsubEvent = DolphinPubsubEvent(0);
10586#[repr(transparent)]
10587#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10588pub struct DolphinPubsubEvent(pub core::ffi::c_uchar);
10589unsafe extern "C" {
10590 #[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"]
10591 pub fn dolphin_deed(deed: DolphinDeed);
10592}
10593unsafe extern "C" {
10594 pub fn dolphin_get_settings(dolphin: *mut Dolphin, settings: *mut DolphinSettings);
10595}
10596unsafe extern "C" {
10597 pub fn dolphin_set_settings(dolphin: *mut Dolphin, settings: *mut DolphinSettings);
10598}
10599unsafe extern "C" {
10600 #[doc = "Retrieve dolphin stats\n Thread safe, blocking"]
10601 pub fn dolphin_stats(dolphin: *mut Dolphin) -> DolphinStats;
10602}
10603unsafe extern "C" {
10604 #[doc = "Flush dolphin queue and save state\n Thread safe, blocking"]
10605 pub fn dolphin_flush(dolphin: *mut Dolphin);
10606}
10607unsafe extern "C" {
10608 pub fn dolphin_upgrade_level(dolphin: *mut Dolphin);
10609}
10610unsafe extern "C" {
10611 pub fn dolphin_get_pubsub(dolphin: *mut Dolphin) -> *mut FuriPubSub;
10612}
10613#[repr(C)]
10614#[derive(Debug, Copy, Clone)]
10615pub struct Expansion {
10616 _unused: [u8; 0],
10617}
10618unsafe extern "C" {
10619 #[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."]
10620 pub fn expansion_enable(instance: *mut Expansion);
10621}
10622unsafe extern "C" {
10623 #[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."]
10624 pub fn expansion_disable(instance: *mut Expansion);
10625}
10626unsafe extern "C" {
10627 #[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."]
10628 pub fn expansion_set_listen_serial(instance: *mut Expansion, serial_id: FuriHalSerialId);
10629}
10630unsafe extern "C" {
10631 #[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)"]
10632 pub fn elements_progress_bar(canvas: *mut Canvas, x: i32, y: i32, width: usize, progress: f32);
10633}
10634unsafe extern "C" {
10635 #[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"]
10636 pub fn elements_progress_bar_with_text(
10637 canvas: *mut Canvas,
10638 x: i32,
10639 y: i32,
10640 width: usize,
10641 progress: f32,
10642 text: *const core::ffi::c_char,
10643 );
10644}
10645unsafe extern "C" {
10646 #[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"]
10647 pub fn elements_scrollbar_pos(
10648 canvas: *mut Canvas,
10649 x: i32,
10650 y: i32,
10651 height: usize,
10652 pos: usize,
10653 total: usize,
10654 );
10655}
10656unsafe extern "C" {
10657 #[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"]
10658 pub fn elements_scrollbar(canvas: *mut Canvas, pos: usize, total: usize);
10659}
10660unsafe extern "C" {
10661 #[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"]
10662 pub fn elements_frame(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
10663}
10664unsafe extern "C" {
10665 #[doc = "Draw button in left corner\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - button text"]
10666 pub fn elements_button_left(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10667}
10668unsafe extern "C" {
10669 #[doc = "Draw button in right corner\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - button text"]
10670 pub fn elements_button_right(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10671}
10672unsafe extern "C" {
10673 #[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"]
10674 pub fn elements_button_up(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10675}
10676unsafe extern "C" {
10677 #[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"]
10678 pub fn elements_button_down(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10679}
10680unsafe extern "C" {
10681 #[doc = "Draw button in center\n\n # Arguments\n\n* `canvas` - Canvas instance\n * `str` - button text"]
10682 pub fn elements_button_center(canvas: *mut Canvas, str_: *const core::ffi::c_char);
10683}
10684unsafe extern "C" {
10685 #[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)"]
10686 pub fn elements_multiline_text_aligned(
10687 canvas: *mut Canvas,
10688 x: i32,
10689 y: i32,
10690 horizontal: Align,
10691 vertical: Align,
10692 text: *const core::ffi::c_char,
10693 );
10694}
10695unsafe extern "C" {
10696 #[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)"]
10697 pub fn elements_multiline_text(
10698 canvas: *mut Canvas,
10699 x: i32,
10700 y: i32,
10701 text: *const core::ffi::c_char,
10702 );
10703}
10704unsafe extern "C" {
10705 #[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)"]
10706 pub fn elements_multiline_text_framed(
10707 canvas: *mut Canvas,
10708 x: i32,
10709 y: i32,
10710 text: *const core::ffi::c_char,
10711 );
10712}
10713unsafe extern "C" {
10714 #[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"]
10715 pub fn elements_slightly_rounded_frame(
10716 canvas: *mut Canvas,
10717 x: i32,
10718 y: i32,
10719 width: usize,
10720 height: usize,
10721 );
10722}
10723unsafe extern "C" {
10724 #[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"]
10725 pub fn elements_slightly_rounded_box(
10726 canvas: *mut Canvas,
10727 x: i32,
10728 y: i32,
10729 width: usize,
10730 height: usize,
10731 );
10732}
10733unsafe extern "C" {
10734 #[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"]
10735 pub fn elements_bold_rounded_frame(
10736 canvas: *mut Canvas,
10737 x: i32,
10738 y: i32,
10739 width: usize,
10740 height: usize,
10741 );
10742}
10743unsafe extern "C" {
10744 #[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"]
10745 pub fn elements_bubble(canvas: *mut Canvas, x: i32, y: i32, width: usize, height: usize);
10746}
10747unsafe extern "C" {
10748 #[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"]
10749 pub fn elements_bubble_str(
10750 canvas: *mut Canvas,
10751 x: i32,
10752 y: i32,
10753 text: *const core::ffi::c_char,
10754 horizontal: Align,
10755 vertical: Align,
10756 );
10757}
10758unsafe extern "C" {
10759 #[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"]
10760 pub fn elements_string_fit_width(canvas: *mut Canvas, string: *mut FuriString, width: usize);
10761}
10762unsafe extern "C" {
10763 #[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"]
10764 pub fn elements_scrollable_text_line(
10765 canvas: *mut Canvas,
10766 x: i32,
10767 y: i32,
10768 width: usize,
10769 string: *mut FuriString,
10770 scroll: usize,
10771 ellipsis: bool,
10772 );
10773}
10774unsafe extern "C" {
10775 #[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"]
10776 pub fn elements_text_box(
10777 canvas: *mut Canvas,
10778 x: i32,
10779 y: i32,
10780 width: usize,
10781 height: usize,
10782 horizontal: Align,
10783 vertical: Align,
10784 text: *const core::ffi::c_char,
10785 strip_to_dots: bool,
10786 );
10787}
10788#[repr(C)]
10789#[derive(Debug, Copy, Clone)]
10790pub struct ViewPort {
10791 _unused: [u8; 0],
10792}
10793pub const ViewPortOrientationHorizontal: ViewPortOrientation = ViewPortOrientation(0);
10794pub const ViewPortOrientationHorizontalFlip: ViewPortOrientation = ViewPortOrientation(1);
10795pub const ViewPortOrientationVertical: ViewPortOrientation = ViewPortOrientation(2);
10796pub const ViewPortOrientationVerticalFlip: ViewPortOrientation = ViewPortOrientation(3);
10797#[doc = "< Special value, don't use it"]
10798pub const ViewPortOrientationMAX: ViewPortOrientation = ViewPortOrientation(4);
10799#[repr(transparent)]
10800#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10801pub struct ViewPortOrientation(pub core::ffi::c_uchar);
10802#[doc = "ViewPort Draw callback\n called from GUI thread"]
10803pub type ViewPortDrawCallback = ::core::option::Option<
10804 unsafe extern "C" fn(canvas: *mut Canvas, context: *mut core::ffi::c_void),
10805>;
10806#[doc = "ViewPort Input callback\n called from GUI thread"]
10807pub type ViewPortInputCallback = ::core::option::Option<
10808 unsafe extern "C" fn(event: *mut InputEvent, context: *mut core::ffi::c_void),
10809>;
10810unsafe extern "C" {
10811 #[doc = "ViewPort allocator\n\n always returns view_port or stops system if not enough memory.\n\n # Returns\n\nViewPort instance"]
10812 pub fn view_port_alloc() -> *mut ViewPort;
10813}
10814unsafe extern "C" {
10815 #[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"]
10816 pub fn view_port_free(view_port: *mut ViewPort);
10817}
10818unsafe extern "C" {
10819 #[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."]
10820 pub fn view_port_set_width(view_port: *mut ViewPort, width: u8);
10821}
10822unsafe extern "C" {
10823 pub fn view_port_get_width(view_port: *const ViewPort) -> u8;
10824}
10825unsafe extern "C" {
10826 #[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."]
10827 pub fn view_port_set_height(view_port: *mut ViewPort, height: u8);
10828}
10829unsafe extern "C" {
10830 pub fn view_port_get_height(view_port: *const ViewPort) -> u8;
10831}
10832unsafe extern "C" {
10833 #[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"]
10834 pub fn view_port_enabled_set(view_port: *mut ViewPort, enabled: bool);
10835}
10836unsafe extern "C" {
10837 pub fn view_port_is_enabled(view_port: *const ViewPort) -> bool;
10838}
10839unsafe extern "C" {
10840 #[doc = "Set the ViewPort draw callback\n\n `callback` will be invoked on the GUI thread.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `callback` - the draw callback function\n * `context` - context to pass to callback"]
10841 pub fn view_port_draw_callback_set(
10842 view_port: *mut ViewPort,
10843 callback: ViewPortDrawCallback,
10844 context: *mut core::ffi::c_void,
10845 );
10846}
10847unsafe extern "C" {
10848 #[doc = "Set the ViewPort input callback.\n\n `callback` will be invoked on the GUI thread.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `callback` - the input callback function\n * `context` - context to pass to callback"]
10849 pub fn view_port_input_callback_set(
10850 view_port: *mut ViewPort,
10851 callback: ViewPortInputCallback,
10852 context: *mut core::ffi::c_void,
10853 );
10854}
10855unsafe extern "C" {
10856 #[doc = "Emit update signal to GUI system.\n\n Rendering will happen later, after the GUI system (gui_srv) has processed the signal.\n\n # Arguments\n\n* `view_port` - ViewPort instance"]
10857 pub fn view_port_update(view_port: *mut ViewPort);
10858}
10859unsafe extern "C" {
10860 #[doc = "Set ViewPort orientation.\n\n # Arguments\n\n* `view_port` - ViewPort instance\n * `orientation` - display orientation, horizontal or vertical."]
10861 pub fn view_port_set_orientation(view_port: *mut ViewPort, orientation: ViewPortOrientation);
10862}
10863unsafe extern "C" {
10864 pub fn view_port_get_orientation(view_port: *const ViewPort) -> ViewPortOrientation;
10865}
10866#[doc = "< Desktop layer for internal use. Like fullscreen but with status bar"]
10867pub const GuiLayerDesktop: GuiLayer = GuiLayer(0);
10868#[doc = "< Window layer, status bar is shown"]
10869pub const GuiLayerWindow: GuiLayer = GuiLayer(1);
10870#[doc = "< Status bar left-side layer, auto-layout"]
10871pub const GuiLayerStatusBarLeft: GuiLayer = GuiLayer(2);
10872#[doc = "< Status bar right-side layer, auto-layout"]
10873pub const GuiLayerStatusBarRight: GuiLayer = GuiLayer(3);
10874#[doc = "< Fullscreen layer, no status bar"]
10875pub const GuiLayerFullscreen: GuiLayer = GuiLayer(4);
10876#[doc = "< Don't use or move, special value"]
10877pub const GuiLayerMAX: GuiLayer = GuiLayer(5);
10878#[repr(transparent)]
10879#[doc = "Gui layers"]
10880#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10881pub struct GuiLayer(pub core::ffi::c_uchar);
10882#[doc = "Gui Canvas Commit Callback"]
10883pub type GuiCanvasCommitCallback = ::core::option::Option<
10884 unsafe extern "C" fn(
10885 data: *mut u8,
10886 size: usize,
10887 orientation: CanvasOrientation,
10888 context: *mut core::ffi::c_void,
10889 ),
10890>;
10891#[repr(C)]
10892#[derive(Debug, Copy, Clone)]
10893pub struct Gui {
10894 _unused: [u8; 0],
10895}
10896unsafe extern "C" {
10897 #[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"]
10898 pub fn gui_add_view_port(gui: *mut Gui, view_port: *mut ViewPort, layer: GuiLayer);
10899}
10900unsafe extern "C" {
10901 #[doc = "Remove view_port from rendering tree\n\n > thread safe\n\n # Arguments\n\n* `gui` - Gui instance\n * `view_port` - ViewPort instance"]
10902 pub fn gui_remove_view_port(gui: *mut Gui, view_port: *mut ViewPort);
10903}
10904unsafe extern "C" {
10905 #[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"]
10906 pub fn gui_view_port_send_to_front(gui: *mut Gui, view_port: *mut ViewPort);
10907}
10908unsafe extern "C" {
10909 #[doc = "Send ViewPort to the back\n\n Places selected ViewPort to the bottom of the drawing stack\n\n # Arguments\n\n* `gui` - Gui instance\n * `view_port` - ViewPort instance"]
10910 pub fn gui_view_port_send_to_back(gui: *mut Gui, view_port: *mut ViewPort);
10911}
10912unsafe extern "C" {
10913 #[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"]
10914 pub fn gui_add_framebuffer_callback(
10915 gui: *mut Gui,
10916 callback: GuiCanvasCommitCallback,
10917 context: *mut core::ffi::c_void,
10918 );
10919}
10920unsafe extern "C" {
10921 #[doc = "Remove gui canvas commit callback\n\n # Arguments\n\n* `gui` - Gui instance\n * `callback` - GuiCanvasCommitCallback\n * `context` - GuiCanvasCommitCallback context"]
10922 pub fn gui_remove_framebuffer_callback(
10923 gui: *mut Gui,
10924 callback: GuiCanvasCommitCallback,
10925 context: *mut core::ffi::c_void,
10926 );
10927}
10928unsafe extern "C" {
10929 #[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"]
10930 pub fn gui_get_framebuffer_size(gui: *const Gui) -> usize;
10931}
10932unsafe extern "C" {
10933 #[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"]
10934 pub fn gui_set_lockdown(gui: *mut Gui, lockdown: bool);
10935}
10936unsafe extern "C" {
10937 #[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"]
10938 pub fn gui_direct_draw_acquire(gui: *mut Gui) -> *mut Canvas;
10939}
10940unsafe extern "C" {
10941 #[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"]
10942 pub fn gui_direct_draw_release(gui: *mut Gui);
10943}
10944#[repr(C)]
10945#[derive(Debug, Copy, Clone)]
10946pub struct Icon {
10947 pub width: u16,
10948 pub height: u16,
10949 pub frame_count: u8,
10950 pub frame_rate: u8,
10951 pub frames: *const *const u8,
10952}
10953#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10954const _: () = {
10955 ["Size of Icon"][::core::mem::size_of::<Icon>() - 12usize];
10956 ["Alignment of Icon"][::core::mem::align_of::<Icon>() - 4usize];
10957 ["Offset of field: Icon::width"][::core::mem::offset_of!(Icon, width) - 0usize];
10958 ["Offset of field: Icon::height"][::core::mem::offset_of!(Icon, height) - 2usize];
10959 ["Offset of field: Icon::frame_count"][::core::mem::offset_of!(Icon, frame_count) - 4usize];
10960 ["Offset of field: Icon::frame_rate"][::core::mem::offset_of!(Icon, frame_rate) - 5usize];
10961 ["Offset of field: Icon::frames"][::core::mem::offset_of!(Icon, frames) - 8usize];
10962};
10963#[repr(C)]
10964#[derive(Debug, Copy, Clone)]
10965pub struct ButtonMenu {
10966 _unused: [u8; 0],
10967}
10968#[repr(C)]
10969#[derive(Debug, Copy, Clone)]
10970pub struct ButtonMenuItem {
10971 _unused: [u8; 0],
10972}
10973#[doc = "Callback for any button menu actions"]
10974pub type ButtonMenuItemCallback = ::core::option::Option<
10975 unsafe extern "C" fn(context: *mut core::ffi::c_void, index: i32, type_: InputType),
10976>;
10977pub const ButtonMenuItemTypeCommon: ButtonMenuItemType = ButtonMenuItemType(0);
10978pub const ButtonMenuItemTypeControl: ButtonMenuItemType = ButtonMenuItemType(1);
10979#[repr(transparent)]
10980#[doc = "Type of button. Difference in drawing buttons."]
10981#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
10982pub struct ButtonMenuItemType(pub core::ffi::c_uchar);
10983unsafe extern "C" {
10984 #[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"]
10985 pub fn button_menu_get_view(button_menu: *mut ButtonMenu) -> *mut View;
10986}
10987unsafe extern "C" {
10988 #[doc = "Clean button menu\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance"]
10989 pub fn button_menu_reset(button_menu: *mut ButtonMenu);
10990}
10991unsafe extern "C" {
10992 #[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"]
10993 pub fn button_menu_add_item(
10994 button_menu: *mut ButtonMenu,
10995 label: *const core::ffi::c_char,
10996 index: i32,
10997 callback: ButtonMenuItemCallback,
10998 type_: ButtonMenuItemType,
10999 callback_context: *mut core::ffi::c_void,
11000 ) -> *mut ButtonMenuItem;
11001}
11002unsafe extern "C" {
11003 #[doc = "Allocate and initialize new instance of ButtonMenu model\n\n # Returns\n\njust-created ButtonMenu model"]
11004 pub fn button_menu_alloc() -> *mut ButtonMenu;
11005}
11006unsafe extern "C" {
11007 #[doc = "Free ButtonMenu element\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance"]
11008 pub fn button_menu_free(button_menu: *mut ButtonMenu);
11009}
11010unsafe extern "C" {
11011 #[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"]
11012 pub fn button_menu_set_header(button_menu: *mut ButtonMenu, header: *const core::ffi::c_char);
11013}
11014unsafe extern "C" {
11015 #[doc = "Set selected item\n\n # Arguments\n\n* `button_menu` - ButtonMenu instance\n * `index` - index of ButtonMenu to be selected"]
11016 pub fn button_menu_set_selected_item(button_menu: *mut ButtonMenu, index: u32);
11017}
11018#[repr(C)]
11019#[derive(Debug, Copy, Clone)]
11020pub struct ButtonPanel {
11021 _unused: [u8; 0],
11022}
11023#[doc = "Callback type to call for handling selecting button_panel items"]
11024pub type ButtonItemCallback = ::core::option::Option<
11025 unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32, type_: InputType),
11026>;
11027unsafe extern "C" {
11028 #[doc = "Allocate new button_panel module.\n\n # Returns\n\nButtonPanel instance"]
11029 pub fn button_panel_alloc() -> *mut ButtonPanel;
11030}
11031unsafe extern "C" {
11032 #[doc = "Free button_panel module.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance"]
11033 pub fn button_panel_free(button_panel: *mut ButtonPanel);
11034}
11035unsafe extern "C" {
11036 #[doc = "Free items from button_panel module. Preallocated matrix stays unchanged.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance"]
11037 pub fn button_panel_reset(button_panel: *mut ButtonPanel);
11038}
11039unsafe extern "C" {
11040 #[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"]
11041 pub fn button_panel_reserve(button_panel: *mut ButtonPanel, reserve_x: usize, reserve_y: usize);
11042}
11043unsafe extern "C" {
11044 #[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"]
11045 pub fn button_panel_add_item(
11046 button_panel: *mut ButtonPanel,
11047 index: u32,
11048 matrix_place_x: u16,
11049 matrix_place_y: u16,
11050 x: u16,
11051 y: u16,
11052 icon_name: *const Icon,
11053 icon_name_selected: *const Icon,
11054 callback: ButtonItemCallback,
11055 callback_context: *mut core::ffi::c_void,
11056 );
11057}
11058unsafe extern "C" {
11059 #[doc = "Get button_panel view.\n\n # Arguments\n\n* `button_panel` - ButtonPanel instance\n\n # Returns\n\nacquired view"]
11060 pub fn button_panel_get_view(button_panel: *mut ButtonPanel) -> *mut View;
11061}
11062unsafe extern "C" {
11063 #[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"]
11064 pub fn button_panel_add_label(
11065 button_panel: *mut ButtonPanel,
11066 x: u16,
11067 y: u16,
11068 font: Font,
11069 label_str: *const core::ffi::c_char,
11070 );
11071}
11072unsafe extern "C" {
11073 #[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"]
11074 pub fn button_panel_add_icon(
11075 button_panel: *mut ButtonPanel,
11076 x: u16,
11077 y: u16,
11078 icon_name: *const Icon,
11079 );
11080}
11081#[repr(C)]
11082#[derive(Debug, Copy, Clone)]
11083pub struct ByteInput {
11084 _unused: [u8; 0],
11085}
11086#[doc = "callback that is executed on save button press"]
11087pub type ByteInputCallback =
11088 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11089#[doc = "callback that is executed when byte buffer is changed"]
11090pub type ByteChangedCallback =
11091 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11092unsafe extern "C" {
11093 #[doc = "Allocate and initialize byte input. This byte input is used to enter bytes.\n\n # Returns\n\nByteInput instance pointer"]
11094 pub fn byte_input_alloc() -> *mut ByteInput;
11095}
11096unsafe extern "C" {
11097 #[doc = "Deinitialize and free byte input\n\n # Arguments\n\n* `byte_input` - Byte input instance"]
11098 pub fn byte_input_free(byte_input: *mut ByteInput);
11099}
11100unsafe extern "C" {
11101 #[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"]
11102 pub fn byte_input_get_view(byte_input: *mut ByteInput) -> *mut View;
11103}
11104unsafe extern "C" {
11105 #[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"]
11106 pub fn byte_input_set_result_callback(
11107 byte_input: *mut ByteInput,
11108 input_callback: ByteInputCallback,
11109 changed_callback: ByteChangedCallback,
11110 callback_context: *mut core::ffi::c_void,
11111 bytes: *mut u8,
11112 bytes_count: u8,
11113 );
11114}
11115unsafe extern "C" {
11116 #[doc = "Set byte input header text\n\n # Arguments\n\n* `byte_input` - byte input instance\n * `text` - text to be shown"]
11117 pub fn byte_input_set_header_text(byte_input: *mut ByteInput, text: *const core::ffi::c_char);
11118}
11119#[repr(C)]
11120#[derive(Debug, Copy, Clone)]
11121pub struct DateTimeInput {
11122 _unused: [u8; 0],
11123}
11124#[doc = "callback that is executed on value change"]
11125pub type DateTimeChangedCallback =
11126 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11127#[doc = "callback that is executed on back button press"]
11128pub type DateTimeDoneCallback =
11129 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11130unsafe extern "C" {
11131 #[doc = "Allocate and initialize date/time input\n\n This screen used to input a date and time\n\n # Returns\n\nDateTimeInput instance"]
11132 pub fn date_time_input_alloc() -> *mut DateTimeInput;
11133}
11134unsafe extern "C" {
11135 #[doc = "Deinitialize and free date/time input\n\n # Arguments\n\n* `date_time_input` - Date/time input instance"]
11136 pub fn date_time_input_free(date_time_input: *mut DateTimeInput);
11137}
11138unsafe extern "C" {
11139 #[doc = "Get date/time input view\n\n # Arguments\n\n* `date_time_input` - Date/time input instance\n\n # Returns\n\nView instance that can be used for embedding"]
11140 pub fn date_time_input_get_view(date_time_input: *mut DateTimeInput) -> *mut View;
11141}
11142unsafe extern "C" {
11143 #[doc = "Set date/time input result callback\n\n # Arguments\n\n* `date_time_input` - date/time input instance\n * `changed_callback` - changed callback fn\n * `done_callback` - finished callback fn\n * `callback_context` - callback context\n * `datetime` - date/time value"]
11144 pub fn date_time_input_set_result_callback(
11145 date_time_input: *mut DateTimeInput,
11146 changed_callback: DateTimeChangedCallback,
11147 done_callback: DateTimeDoneCallback,
11148 callback_context: *mut core::ffi::c_void,
11149 datetime: *mut DateTime,
11150 );
11151}
11152unsafe extern "C" {
11153 #[doc = "Set date/time fields which can be edited\n\n # Arguments\n\n* `date_time_input` - date/time input instance\n * `year` - whether to allow editing the year\n * `month` - whether to allow editing the month\n * `day` - whether to allow editing the day\n * `hour` - whether to allow editing the hour\n * `minute` - whether to allow editing the minute\n * `second` - whether to allow editing the second"]
11154 pub fn date_time_input_set_editable_fields(
11155 date_time_input: *mut DateTimeInput,
11156 year: bool,
11157 month: bool,
11158 day: bool,
11159 hour: bool,
11160 minute: bool,
11161 second: bool,
11162 );
11163}
11164#[repr(C)]
11165#[derive(Debug, Copy, Clone)]
11166pub struct DialogEx {
11167 _unused: [u8; 0],
11168}
11169pub const DialogExResultLeft: DialogExResult = DialogExResult(0);
11170pub const DialogExResultCenter: DialogExResult = DialogExResult(1);
11171pub const DialogExResultRight: DialogExResult = DialogExResult(2);
11172pub const DialogExPressLeft: DialogExResult = DialogExResult(3);
11173pub const DialogExPressCenter: DialogExResult = DialogExResult(4);
11174pub const DialogExPressRight: DialogExResult = DialogExResult(5);
11175pub const DialogExReleaseLeft: DialogExResult = DialogExResult(6);
11176pub const DialogExReleaseCenter: DialogExResult = DialogExResult(7);
11177pub const DialogExReleaseRight: DialogExResult = DialogExResult(8);
11178#[repr(transparent)]
11179#[doc = "DialogEx result"]
11180#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11181pub struct DialogExResult(pub core::ffi::c_uchar);
11182#[doc = "DialogEx result callback type\n comes from GUI thread"]
11183pub type DialogExResultCallback = ::core::option::Option<
11184 unsafe extern "C" fn(result: DialogExResult, context: *mut core::ffi::c_void),
11185>;
11186unsafe extern "C" {
11187 #[doc = "Allocate and initialize dialog\n\n This dialog used to ask simple questions\n\n # Returns\n\nDialogEx instance"]
11188 pub fn dialog_ex_alloc() -> *mut DialogEx;
11189}
11190unsafe extern "C" {
11191 #[doc = "Deinitialize and free dialog\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11192 pub fn dialog_ex_free(dialog_ex: *mut DialogEx);
11193}
11194unsafe extern "C" {
11195 #[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"]
11196 pub fn dialog_ex_get_view(dialog_ex: *mut DialogEx) -> *mut View;
11197}
11198unsafe extern "C" {
11199 #[doc = "Set dialog result callback\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `callback` - result callback function"]
11200 pub fn dialog_ex_set_result_callback(
11201 dialog_ex: *mut DialogEx,
11202 callback: DialogExResultCallback,
11203 );
11204}
11205unsafe extern "C" {
11206 #[doc = "Set dialog context\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance\n * `context` - context pointer, will be passed to result callback"]
11207 pub fn dialog_ex_set_context(dialog_ex: *mut DialogEx, context: *mut core::ffi::c_void);
11208}
11209unsafe extern "C" {
11210 #[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"]
11211 pub fn dialog_ex_set_header(
11212 dialog_ex: *mut DialogEx,
11213 text: *const core::ffi::c_char,
11214 x: u8,
11215 y: u8,
11216 horizontal: Align,
11217 vertical: Align,
11218 );
11219}
11220unsafe extern "C" {
11221 #[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"]
11222 pub fn dialog_ex_set_text(
11223 dialog_ex: *mut DialogEx,
11224 text: *const core::ffi::c_char,
11225 x: u8,
11226 y: u8,
11227 horizontal: Align,
11228 vertical: Align,
11229 );
11230}
11231unsafe extern "C" {
11232 #[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"]
11233 pub fn dialog_ex_set_icon(dialog_ex: *mut DialogEx, x: u8, y: u8, icon: *const Icon);
11234}
11235unsafe extern "C" {
11236 #[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"]
11237 pub fn dialog_ex_set_left_button_text(dialog_ex: *mut DialogEx, text: *const core::ffi::c_char);
11238}
11239unsafe extern "C" {
11240 #[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"]
11241 pub fn dialog_ex_set_center_button_text(
11242 dialog_ex: *mut DialogEx,
11243 text: *const core::ffi::c_char,
11244 );
11245}
11246unsafe extern "C" {
11247 #[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"]
11248 pub fn dialog_ex_set_right_button_text(
11249 dialog_ex: *mut DialogEx,
11250 text: *const core::ffi::c_char,
11251 );
11252}
11253unsafe extern "C" {
11254 #[doc = "Clean dialog\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11255 pub fn dialog_ex_reset(dialog_ex: *mut DialogEx);
11256}
11257unsafe extern "C" {
11258 #[doc = "Enable press/release events\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11259 pub fn dialog_ex_enable_extended_events(dialog_ex: *mut DialogEx);
11260}
11261unsafe extern "C" {
11262 #[doc = "Disable press/release events\n\n # Arguments\n\n* `dialog_ex` - DialogEx instance"]
11263 pub fn dialog_ex_disable_extended_events(dialog_ex: *mut DialogEx);
11264}
11265#[repr(C)]
11266#[derive(Debug, Copy, Clone)]
11267pub struct EmptyScreen {
11268 _unused: [u8; 0],
11269}
11270unsafe extern "C" {
11271 #[doc = "Allocate and initialize empty screen\n\n This empty screen used to ask simple questions like Yes/\n\n # Returns\n\nEmptyScreen instance"]
11272 pub fn empty_screen_alloc() -> *mut EmptyScreen;
11273}
11274unsafe extern "C" {
11275 #[doc = "Deinitialize and free empty screen\n\n # Arguments\n\n* `empty_screen` - Empty screen instance"]
11276 pub fn empty_screen_free(empty_screen: *mut EmptyScreen);
11277}
11278unsafe extern "C" {
11279 #[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"]
11280 pub fn empty_screen_get_view(empty_screen: *mut EmptyScreen) -> *mut View;
11281}
11282#[repr(C)]
11283#[derive(Debug, Copy, Clone)]
11284pub struct BrowserWorker {
11285 _unused: [u8; 0],
11286}
11287pub type BrowserWorkerFolderOpenCallback = ::core::option::Option<
11288 unsafe extern "C" fn(
11289 context: *mut core::ffi::c_void,
11290 item_cnt: u32,
11291 file_idx: i32,
11292 is_root: bool,
11293 ),
11294>;
11295pub type BrowserWorkerListLoadCallback = ::core::option::Option<
11296 unsafe extern "C" fn(context: *mut core::ffi::c_void, list_load_offset: u32),
11297>;
11298pub type BrowserWorkerListItemCallback = ::core::option::Option<
11299 unsafe extern "C" fn(
11300 context: *mut core::ffi::c_void,
11301 item_path: *mut FuriString,
11302 is_folder: bool,
11303 is_last: bool,
11304 ),
11305>;
11306pub type BrowserWorkerLongLoadCallback =
11307 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11308unsafe extern "C" {
11309 pub fn file_browser_worker_alloc(
11310 path: *mut FuriString,
11311 base_path: *const core::ffi::c_char,
11312 ext_filter: *const core::ffi::c_char,
11313 skip_assets: bool,
11314 hide_dot_files: bool,
11315 ) -> *mut BrowserWorker;
11316}
11317unsafe extern "C" {
11318 pub fn file_browser_worker_free(browser: *mut BrowserWorker);
11319}
11320unsafe extern "C" {
11321 pub fn file_browser_worker_set_callback_context(
11322 browser: *mut BrowserWorker,
11323 context: *mut core::ffi::c_void,
11324 );
11325}
11326unsafe extern "C" {
11327 pub fn file_browser_worker_set_folder_callback(
11328 browser: *mut BrowserWorker,
11329 cb: BrowserWorkerFolderOpenCallback,
11330 );
11331}
11332unsafe extern "C" {
11333 pub fn file_browser_worker_set_list_callback(
11334 browser: *mut BrowserWorker,
11335 cb: BrowserWorkerListLoadCallback,
11336 );
11337}
11338unsafe extern "C" {
11339 pub fn file_browser_worker_set_item_callback(
11340 browser: *mut BrowserWorker,
11341 cb: BrowserWorkerListItemCallback,
11342 );
11343}
11344unsafe extern "C" {
11345 pub fn file_browser_worker_set_long_load_callback(
11346 browser: *mut BrowserWorker,
11347 cb: BrowserWorkerLongLoadCallback,
11348 );
11349}
11350unsafe extern "C" {
11351 pub fn file_browser_worker_set_config(
11352 browser: *mut BrowserWorker,
11353 path: *mut FuriString,
11354 ext_filter: *const core::ffi::c_char,
11355 skip_assets: bool,
11356 hide_dot_files: bool,
11357 );
11358}
11359unsafe extern "C" {
11360 pub fn file_browser_worker_folder_enter(
11361 browser: *mut BrowserWorker,
11362 path: *mut FuriString,
11363 item_idx: i32,
11364 );
11365}
11366unsafe extern "C" {
11367 pub fn file_browser_worker_is_in_start_folder(browser: *mut BrowserWorker) -> bool;
11368}
11369unsafe extern "C" {
11370 pub fn file_browser_worker_folder_exit(browser: *mut BrowserWorker);
11371}
11372unsafe extern "C" {
11373 pub fn file_browser_worker_folder_refresh(browser: *mut BrowserWorker, item_idx: i32);
11374}
11375unsafe extern "C" {
11376 pub fn file_browser_worker_load(browser: *mut BrowserWorker, offset: u32, count: u32);
11377}
11378#[repr(C)]
11379#[derive(Debug, Copy, Clone)]
11380pub struct Loading {
11381 _unused: [u8; 0],
11382}
11383unsafe extern "C" {
11384 #[doc = "Allocate and initialize\n\n This View used to show system is doing some processing\n\n # Returns\n\nLoading View instance"]
11385 pub fn loading_alloc() -> *mut Loading;
11386}
11387unsafe extern "C" {
11388 #[doc = "Deinitialize and free Loading View\n\n # Arguments\n\n* `instance` - Loading instance"]
11389 pub fn loading_free(instance: *mut Loading);
11390}
11391unsafe extern "C" {
11392 #[doc = "Get Loading view\n\n # Arguments\n\n* `instance` - Loading instance\n\n # Returns\n\nView instance that can be used for embedding"]
11393 pub fn loading_get_view(instance: *mut Loading) -> *mut View;
11394}
11395#[repr(C)]
11396#[derive(Debug, Copy, Clone)]
11397pub struct Menu {
11398 _unused: [u8; 0],
11399}
11400#[doc = "Menu Item Callback"]
11401pub type MenuItemCallback =
11402 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32)>;
11403unsafe extern "C" {
11404 #[doc = "Menu allocation and initialization\n\n # Returns\n\nMenu instance"]
11405 pub fn menu_alloc() -> *mut Menu;
11406}
11407unsafe extern "C" {
11408 #[doc = "Free menu\n\n # Arguments\n\n* `menu` - Menu instance"]
11409 pub fn menu_free(menu: *mut Menu);
11410}
11411unsafe extern "C" {
11412 #[doc = "Get Menu view\n\n # Arguments\n\n* `menu` - Menu instance\n\n # Returns\n\nView instance"]
11413 pub fn menu_get_view(menu: *mut Menu) -> *mut View;
11414}
11415unsafe extern "C" {
11416 #[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"]
11417 pub fn menu_add_item(
11418 menu: *mut Menu,
11419 label: *const core::ffi::c_char,
11420 icon: *const Icon,
11421 index: u32,
11422 callback: MenuItemCallback,
11423 context: *mut core::ffi::c_void,
11424 );
11425}
11426unsafe extern "C" {
11427 #[doc = "Clean menu\n > **Note:** this function does not free menu instance\n\n # Arguments\n\n* `menu` - Menu instance"]
11428 pub fn menu_reset(menu: *mut Menu);
11429}
11430unsafe extern "C" {
11431 #[doc = "Set current menu item\n\n # Arguments\n\n* `menu` - Menu instance\n * `index` - The index"]
11432 pub fn menu_set_selected_item(menu: *mut Menu, index: u32);
11433}
11434#[repr(C)]
11435#[derive(Debug, Copy, Clone)]
11436pub struct NumberInput {
11437 _unused: [u8; 0],
11438}
11439#[doc = "Callback to be called on save button press"]
11440pub type NumberInputCallback =
11441 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, number: i32)>;
11442unsafe extern "C" {
11443 #[doc = "Allocate and initialize Number input.\n\n This Number input is used to enter Numbers (Integers).\n\n # Returns\n\nNumberInput instance pointer"]
11444 pub fn number_input_alloc() -> *mut NumberInput;
11445}
11446unsafe extern "C" {
11447 #[doc = "Deinitialize and free byte input\n\n # Arguments\n\n* `number_input` - Number input instance"]
11448 pub fn number_input_free(number_input: *mut NumberInput);
11449}
11450unsafe extern "C" {
11451 #[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"]
11452 pub fn number_input_get_view(number_input: *mut NumberInput) -> *mut View;
11453}
11454unsafe extern "C" {
11455 #[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"]
11456 pub fn number_input_set_result_callback(
11457 number_input: *mut NumberInput,
11458 input_callback: NumberInputCallback,
11459 callback_context: *mut core::ffi::c_void,
11460 current_number: i32,
11461 min_value: i32,
11462 max_value: i32,
11463 );
11464}
11465unsafe extern "C" {
11466 #[doc = "Set byte input header text\n\n # Arguments\n\n* `number_input` - byte input instance\n * `text` - text to be shown"]
11467 pub fn number_input_set_header_text(
11468 number_input: *mut NumberInput,
11469 text: *const core::ffi::c_char,
11470 );
11471}
11472#[repr(C)]
11473#[derive(Debug, Copy, Clone)]
11474pub struct Popup {
11475 _unused: [u8; 0],
11476}
11477#[doc = "Popup result callback type\n comes from GUI thread"]
11478pub type PopupCallback =
11479 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11480unsafe extern "C" {
11481 #[doc = "Allocate and initialize popup\n\n This popup used to ask simple questions like Yes/\n\n # Returns\n\nPopup instance"]
11482 pub fn popup_alloc() -> *mut Popup;
11483}
11484unsafe extern "C" {
11485 #[doc = "Deinitialize and free popup\n\n # Arguments\n\n* `popup` - Popup instance"]
11486 pub fn popup_free(popup: *mut Popup);
11487}
11488unsafe extern "C" {
11489 #[doc = "Get popup view\n\n # Arguments\n\n* `popup` - Popup instance\n\n # Returns\n\nView instance that can be used for embedding"]
11490 pub fn popup_get_view(popup: *mut Popup) -> *mut View;
11491}
11492unsafe extern "C" {
11493 #[doc = "Set popup timeout callback\n\n # Arguments\n\n* `popup` - Popup instance\n * `callback` - PopupCallback"]
11494 pub fn popup_set_callback(popup: *mut Popup, callback: PopupCallback);
11495}
11496unsafe extern "C" {
11497 #[doc = "Set popup context\n\n # Arguments\n\n* `popup` - Popup instance\n * `context` - context pointer, will be passed to result callback"]
11498 pub fn popup_set_context(popup: *mut Popup, context: *mut core::ffi::c_void);
11499}
11500unsafe extern "C" {
11501 #[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"]
11502 pub fn popup_set_header(
11503 popup: *mut Popup,
11504 text: *const core::ffi::c_char,
11505 x: u8,
11506 y: u8,
11507 horizontal: Align,
11508 vertical: Align,
11509 );
11510}
11511unsafe extern "C" {
11512 #[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"]
11513 pub fn popup_set_text(
11514 popup: *mut Popup,
11515 text: *const core::ffi::c_char,
11516 x: u8,
11517 y: u8,
11518 horizontal: Align,
11519 vertical: Align,
11520 );
11521}
11522unsafe extern "C" {
11523 #[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"]
11524 pub fn popup_set_icon(popup: *mut Popup, x: u8, y: u8, icon: *const Icon);
11525}
11526unsafe extern "C" {
11527 #[doc = "Set popup timeout\n\n # Arguments\n\n* `popup` - Popup instance\n * `timeout_in_ms` - popup timeout value in milliseconds"]
11528 pub fn popup_set_timeout(popup: *mut Popup, timeout_in_ms: u32);
11529}
11530unsafe extern "C" {
11531 #[doc = "Enable popup timeout\n\n # Arguments\n\n* `popup` - Popup instance"]
11532 pub fn popup_enable_timeout(popup: *mut Popup);
11533}
11534unsafe extern "C" {
11535 #[doc = "Disable popup timeout\n\n # Arguments\n\n* `popup` - Popup instance"]
11536 pub fn popup_disable_timeout(popup: *mut Popup);
11537}
11538unsafe extern "C" {
11539 #[doc = "Reset popup instance state\n\n # Arguments\n\n* `popup` - Popup instance"]
11540 pub fn popup_reset(popup: *mut Popup);
11541}
11542#[repr(C)]
11543#[derive(Debug, Copy, Clone)]
11544pub struct Submenu {
11545 _unused: [u8; 0],
11546}
11547pub type SubmenuItemCallback =
11548 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32)>;
11549pub type SubmenuItemCallbackEx = ::core::option::Option<
11550 unsafe extern "C" fn(context: *mut core::ffi::c_void, input_type: InputType, index: u32),
11551>;
11552unsafe extern "C" {
11553 #[doc = "Allocate and initialize submenu\n\n This submenu is used to select one option\n\n # Returns\n\nSubmenu instance"]
11554 pub fn submenu_alloc() -> *mut Submenu;
11555}
11556unsafe extern "C" {
11557 #[doc = "Deinitialize and free submenu\n\n # Arguments\n\n* `submenu` - Submenu instance"]
11558 pub fn submenu_free(submenu: *mut Submenu);
11559}
11560unsafe extern "C" {
11561 #[doc = "Get submenu view\n\n # Arguments\n\n* `submenu` - Submenu instance\n\n # Returns\n\nView instance that can be used for embedding"]
11562 pub fn submenu_get_view(submenu: *mut Submenu) -> *mut View;
11563}
11564unsafe extern "C" {
11565 #[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"]
11566 pub fn submenu_add_item(
11567 submenu: *mut Submenu,
11568 label: *const core::ffi::c_char,
11569 index: u32,
11570 callback: SubmenuItemCallback,
11571 callback_context: *mut core::ffi::c_void,
11572 );
11573}
11574unsafe extern "C" {
11575 #[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"]
11576 pub fn submenu_add_item_ex(
11577 submenu: *mut Submenu,
11578 label: *const core::ffi::c_char,
11579 index: u32,
11580 callback: SubmenuItemCallbackEx,
11581 callback_context: *mut core::ffi::c_void,
11582 );
11583}
11584unsafe extern "C" {
11585 #[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"]
11586 pub fn submenu_change_item_label(
11587 submenu: *mut Submenu,
11588 index: u32,
11589 label: *const core::ffi::c_char,
11590 );
11591}
11592unsafe extern "C" {
11593 #[doc = "Remove all items from submenu\n\n # Arguments\n\n* `submenu` - Submenu instance"]
11594 pub fn submenu_reset(submenu: *mut Submenu);
11595}
11596unsafe extern "C" {
11597 #[doc = "Get submenu selected item index\n\n # Arguments\n\n* `submenu` - Submenu instance\n\n # Returns\n\nIndex of the selected item"]
11598 pub fn submenu_get_selected_item(submenu: *mut Submenu) -> u32;
11599}
11600unsafe extern "C" {
11601 #[doc = "Set submenu selected item by index\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `index` - The index of the selected item"]
11602 pub fn submenu_set_selected_item(submenu: *mut Submenu, index: u32);
11603}
11604unsafe extern "C" {
11605 #[doc = "Set optional header for submenu\n\n # Arguments\n\n* `submenu` - Submenu instance\n * `header` - header to set"]
11606 pub fn submenu_set_header(submenu: *mut Submenu, header: *const core::ffi::c_char);
11607}
11608#[repr(C)]
11609#[derive(Debug, Copy, Clone)]
11610pub struct TextBox {
11611 _unused: [u8; 0],
11612}
11613pub const TextBoxFontText: TextBoxFont = TextBoxFont(0);
11614pub const TextBoxFontHex: TextBoxFont = TextBoxFont(1);
11615#[repr(transparent)]
11616#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11617pub struct TextBoxFont(pub core::ffi::c_uchar);
11618pub const TextBoxFocusStart: TextBoxFocus = TextBoxFocus(0);
11619pub const TextBoxFocusEnd: TextBoxFocus = TextBoxFocus(1);
11620#[repr(transparent)]
11621#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11622pub struct TextBoxFocus(pub core::ffi::c_uchar);
11623unsafe extern "C" {
11624 #[doc = "Allocate and initialize text_box\n\n # Returns\n\nTextBox instance"]
11625 pub fn text_box_alloc() -> *mut TextBox;
11626}
11627unsafe extern "C" {
11628 #[doc = "Deinitialize and free text_box\n\n # Arguments\n\n* `text_box` - text_box instance"]
11629 pub fn text_box_free(text_box: *mut TextBox);
11630}
11631unsafe extern "C" {
11632 #[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"]
11633 pub fn text_box_get_view(text_box: *mut TextBox) -> *mut View;
11634}
11635unsafe extern "C" {
11636 #[doc = "Clean text_box\n\n # Arguments\n\n* `text_box` - TextBox instance"]
11637 pub fn text_box_reset(text_box: *mut TextBox);
11638}
11639unsafe extern "C" {
11640 #[doc = "Set text for text_box\n\n # Arguments\n\n* `text_box` - TextBox instance\n * `text` - text to set"]
11641 pub fn text_box_set_text(text_box: *mut TextBox, text: *const core::ffi::c_char);
11642}
11643unsafe extern "C" {
11644 #[doc = "Set TextBox font\n\n # Arguments\n\n* `text_box` - TextBox instance\n * `font` - TextBoxFont instance"]
11645 pub fn text_box_set_font(text_box: *mut TextBox, font: TextBoxFont);
11646}
11647unsafe extern "C" {
11648 #[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"]
11649 pub fn text_box_set_focus(text_box: *mut TextBox, focus: TextBoxFocus);
11650}
11651#[repr(C)]
11652#[derive(Debug, Copy, Clone)]
11653pub struct ValidatorIsFile {
11654 _unused: [u8; 0],
11655}
11656unsafe extern "C" {
11657 pub fn validator_is_file_alloc_init(
11658 app_path_folder: *const core::ffi::c_char,
11659 app_extension: *const core::ffi::c_char,
11660 current_name: *const core::ffi::c_char,
11661 ) -> *mut ValidatorIsFile;
11662}
11663unsafe extern "C" {
11664 pub fn validator_is_file_free(instance: *mut ValidatorIsFile);
11665}
11666unsafe extern "C" {
11667 pub fn validator_is_file_callback(
11668 text: *const core::ffi::c_char,
11669 error: *mut FuriString,
11670 context: *mut core::ffi::c_void,
11671 ) -> bool;
11672}
11673#[repr(C)]
11674#[derive(Debug, Copy, Clone)]
11675pub struct TextInput {
11676 _unused: [u8; 0],
11677}
11678pub type TextInputCallback =
11679 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11680pub type TextInputValidatorCallback = ::core::option::Option<
11681 unsafe extern "C" fn(
11682 text: *const core::ffi::c_char,
11683 error: *mut FuriString,
11684 context: *mut core::ffi::c_void,
11685 ) -> bool,
11686>;
11687unsafe extern "C" {
11688 #[doc = "Allocate and initialize text input\n\n This text input is used to enter string\n\n # Returns\n\nTextInput instance"]
11689 pub fn text_input_alloc() -> *mut TextInput;
11690}
11691unsafe extern "C" {
11692 #[doc = "Deinitialize and free text input\n\n # Arguments\n\n* `text_input` - TextInput instance"]
11693 pub fn text_input_free(text_input: *mut TextInput);
11694}
11695unsafe extern "C" {
11696 #[doc = "Clean text input view Note: this function does not free memory\n\n # Arguments\n\n* `text_input` - Text input instance"]
11697 pub fn text_input_reset(text_input: *mut TextInput);
11698}
11699unsafe extern "C" {
11700 #[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"]
11701 pub fn text_input_get_view(text_input: *mut TextInput) -> *mut View;
11702}
11703unsafe extern "C" {
11704 #[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"]
11705 pub fn text_input_set_result_callback(
11706 text_input: *mut TextInput,
11707 callback: TextInputCallback,
11708 callback_context: *mut core::ffi::c_void,
11709 text_buffer: *mut core::ffi::c_char,
11710 text_buffer_size: usize,
11711 clear_default_text: bool,
11712 );
11713}
11714unsafe extern "C" {
11715 #[doc = "Sets the minimum length of a TextInput\n # Arguments\n\n* `[in]` - text_input TextInput\n * `[in]` - minimum_length Minimum input length"]
11716 pub fn text_input_set_minimum_length(text_input: *mut TextInput, minimum_length: usize);
11717}
11718unsafe extern "C" {
11719 pub fn text_input_set_validator(
11720 text_input: *mut TextInput,
11721 callback: TextInputValidatorCallback,
11722 callback_context: *mut core::ffi::c_void,
11723 );
11724}
11725unsafe extern "C" {
11726 pub fn text_input_get_validator_callback(
11727 text_input: *mut TextInput,
11728 ) -> TextInputValidatorCallback;
11729}
11730unsafe extern "C" {
11731 pub fn text_input_get_validator_callback_context(
11732 text_input: *mut TextInput,
11733 ) -> *mut core::ffi::c_void;
11734}
11735unsafe extern "C" {
11736 #[doc = "Set text input header text\n\n # Arguments\n\n* `text_input` - TextInput instance\n * `text` - text to be shown"]
11737 pub fn text_input_set_header_text(text_input: *mut TextInput, text: *const core::ffi::c_char);
11738}
11739#[repr(C)]
11740#[derive(Debug, Copy, Clone)]
11741pub struct VariableItemList {
11742 _unused: [u8; 0],
11743}
11744#[repr(C)]
11745#[derive(Debug, Copy, Clone)]
11746pub struct VariableItem {
11747 _unused: [u8; 0],
11748}
11749pub type VariableItemChangeCallback =
11750 ::core::option::Option<unsafe extern "C" fn(item: *mut VariableItem)>;
11751pub type VariableItemListEnterCallback =
11752 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, index: u32)>;
11753unsafe extern "C" {
11754 #[doc = "Allocate and initialize VariableItemList\n\n # Returns\n\nVariableItemList*"]
11755 pub fn variable_item_list_alloc() -> *mut VariableItemList;
11756}
11757unsafe extern "C" {
11758 #[doc = "Deinitialize and free VariableItemList\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance"]
11759 pub fn variable_item_list_free(variable_item_list: *mut VariableItemList);
11760}
11761unsafe extern "C" {
11762 #[doc = "Clear all elements from list\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance"]
11763 pub fn variable_item_list_reset(variable_item_list: *mut VariableItemList);
11764}
11765unsafe extern "C" {
11766 #[doc = "Get VariableItemList View instance\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance\n\n # Returns\n\nView instance"]
11767 pub fn variable_item_list_get_view(variable_item_list: *mut VariableItemList) -> *mut View;
11768}
11769unsafe extern "C" {
11770 #[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"]
11771 pub fn variable_item_list_add(
11772 variable_item_list: *mut VariableItemList,
11773 label: *const core::ffi::c_char,
11774 values_count: u8,
11775 change_callback: VariableItemChangeCallback,
11776 context: *mut core::ffi::c_void,
11777 ) -> *mut VariableItem;
11778}
11779unsafe extern "C" {
11780 #[doc = "Set enter callback\n\n # Arguments\n\n* `variable_item_list` - VariableItemList instance\n * `callback` - VariableItemListEnterCallback instance\n * `context` - pointer to context"]
11781 pub fn variable_item_list_set_enter_callback(
11782 variable_item_list: *mut VariableItemList,
11783 callback: VariableItemListEnterCallback,
11784 context: *mut core::ffi::c_void,
11785 );
11786}
11787unsafe extern "C" {
11788 pub fn variable_item_list_set_selected_item(
11789 variable_item_list: *mut VariableItemList,
11790 index: u8,
11791 );
11792}
11793unsafe extern "C" {
11794 pub fn variable_item_list_get_selected_item_index(
11795 variable_item_list: *mut VariableItemList,
11796 ) -> u8;
11797}
11798unsafe extern "C" {
11799 #[doc = "Set item label\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `label` - The label text"]
11800 pub fn variable_item_set_item_label(item: *mut VariableItem, label: *const core::ffi::c_char);
11801}
11802unsafe extern "C" {
11803 #[doc = "Set item current selected index\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `current_value_index` - The current value index"]
11804 pub fn variable_item_set_current_value_index(item: *mut VariableItem, current_value_index: u8);
11805}
11806unsafe extern "C" {
11807 #[doc = "Set number of values for item\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `values_count` - The new values count"]
11808 pub fn variable_item_set_values_count(item: *mut VariableItem, values_count: u8);
11809}
11810unsafe extern "C" {
11811 #[doc = "Set item current selected text\n\n # Arguments\n\n* `item` - VariableItem* instance\n * `current_value_text` - The current value text"]
11812 pub fn variable_item_set_current_value_text(
11813 item: *mut VariableItem,
11814 current_value_text: *const core::ffi::c_char,
11815 );
11816}
11817unsafe extern "C" {
11818 #[doc = "Get item current selected index\n\n # Arguments\n\n* `item` - VariableItem* instance\n\n # Returns\n\nuint8_t current selected index"]
11819 pub fn variable_item_get_current_value_index(item: *mut VariableItem) -> u8;
11820}
11821unsafe extern "C" {
11822 #[doc = "Get item context\n\n # Arguments\n\n* `item` - VariableItem* instance\n\n # Returns\n\nvoid* item context"]
11823 pub fn variable_item_get_context(item: *mut VariableItem) -> *mut core::ffi::c_void;
11824}
11825pub const GuiButtonTypeLeft: GuiButtonType = GuiButtonType(0);
11826pub const GuiButtonTypeCenter: GuiButtonType = GuiButtonType(1);
11827pub const GuiButtonTypeRight: GuiButtonType = GuiButtonType(2);
11828#[repr(transparent)]
11829#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11830pub struct GuiButtonType(pub core::ffi::c_uchar);
11831pub type ButtonCallback = ::core::option::Option<
11832 unsafe extern "C" fn(result: GuiButtonType, type_: InputType, context: *mut core::ffi::c_void),
11833>;
11834#[repr(C)]
11835#[derive(Debug, Copy, Clone)]
11836pub struct Widget {
11837 _unused: [u8; 0],
11838}
11839#[repr(C)]
11840#[derive(Debug, Copy, Clone)]
11841pub struct WidgetElement {
11842 _unused: [u8; 0],
11843}
11844unsafe extern "C" {
11845 #[doc = "Allocate Widget that holds Widget Elements\n\n # Returns\n\nWidget instance"]
11846 pub fn widget_alloc() -> *mut Widget;
11847}
11848unsafe extern "C" {
11849 #[doc = "Free Widget\n > **Note:** this function free allocated Widget Elements\n\n # Arguments\n\n* `widget` - Widget instance"]
11850 pub fn widget_free(widget: *mut Widget);
11851}
11852unsafe extern "C" {
11853 #[doc = "Reset Widget\n\n # Arguments\n\n* `widget` - Widget instance"]
11854 pub fn widget_reset(widget: *mut Widget);
11855}
11856unsafe extern "C" {
11857 #[doc = "Get Widget view\n\n # Arguments\n\n* `widget` - Widget instance\n\n # Returns\n\nView instance"]
11858 pub fn widget_get_view(widget: *mut Widget) -> *mut View;
11859}
11860unsafe extern "C" {
11861 #[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"]
11862 pub fn widget_add_string_multiline_element(
11863 widget: *mut Widget,
11864 x: u8,
11865 y: u8,
11866 horizontal: Align,
11867 vertical: Align,
11868 font: Font,
11869 text: *const core::ffi::c_char,
11870 );
11871}
11872unsafe extern "C" {
11873 #[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"]
11874 pub fn widget_add_string_element(
11875 widget: *mut Widget,
11876 x: u8,
11877 y: u8,
11878 horizontal: Align,
11879 vertical: Align,
11880 font: Font,
11881 text: *const core::ffi::c_char,
11882 );
11883}
11884unsafe extern "C" {
11885 #[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"]
11886 pub fn widget_add_text_box_element(
11887 widget: *mut Widget,
11888 x: u8,
11889 y: u8,
11890 width: u8,
11891 height: u8,
11892 horizontal: Align,
11893 vertical: Align,
11894 text: *const core::ffi::c_char,
11895 strip_to_dots: bool,
11896 );
11897}
11898unsafe extern "C" {
11899 #[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"]
11900 pub fn widget_add_text_scroll_element(
11901 widget: *mut Widget,
11902 x: u8,
11903 y: u8,
11904 width: u8,
11905 height: u8,
11906 text: *const core::ffi::c_char,
11907 );
11908}
11909unsafe extern "C" {
11910 #[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"]
11911 pub fn widget_add_button_element(
11912 widget: *mut Widget,
11913 button_type: GuiButtonType,
11914 text: *const core::ffi::c_char,
11915 callback: ButtonCallback,
11916 context: *mut core::ffi::c_void,
11917 );
11918}
11919unsafe extern "C" {
11920 #[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"]
11921 pub fn widget_add_icon_element(widget: *mut Widget, x: u8, y: u8, icon: *const Icon);
11922}
11923unsafe extern "C" {
11924 #[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"]
11925 pub fn widget_add_rect_element(
11926 widget: *mut Widget,
11927 x: u8,
11928 y: u8,
11929 width: u8,
11930 height: u8,
11931 radius: u8,
11932 fill: bool,
11933 );
11934}
11935unsafe extern "C" {
11936 #[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"]
11937 pub fn widget_add_circle_element(widget: *mut Widget, x: u8, y: u8, radius: u8, fill: bool);
11938}
11939unsafe extern "C" {
11940 #[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"]
11941 pub fn widget_add_line_element(widget: *mut Widget, x1: u8, y1: u8, x2: u8, y2: u8);
11942}
11943pub const SceneManagerEventTypeCustom: SceneManagerEventType = SceneManagerEventType(0);
11944pub const SceneManagerEventTypeBack: SceneManagerEventType = SceneManagerEventType(1);
11945pub const SceneManagerEventTypeTick: SceneManagerEventType = SceneManagerEventType(2);
11946#[repr(transparent)]
11947#[doc = "Scene Manager events type"]
11948#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
11949pub struct SceneManagerEventType(pub core::ffi::c_uchar);
11950#[doc = "Scene Manager event"]
11951#[repr(C)]
11952#[derive(Debug, Copy, Clone)]
11953pub struct SceneManagerEvent {
11954 pub type_: SceneManagerEventType,
11955 pub event: u32,
11956}
11957#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11958const _: () = {
11959 ["Size of SceneManagerEvent"][::core::mem::size_of::<SceneManagerEvent>() - 8usize];
11960 ["Alignment of SceneManagerEvent"][::core::mem::align_of::<SceneManagerEvent>() - 4usize];
11961 ["Offset of field: SceneManagerEvent::type_"]
11962 [::core::mem::offset_of!(SceneManagerEvent, type_) - 0usize];
11963 ["Offset of field: SceneManagerEvent::event"]
11964 [::core::mem::offset_of!(SceneManagerEvent, event) - 4usize];
11965};
11966#[doc = "Prototype for Scene on_enter handler"]
11967pub type AppSceneOnEnterCallback =
11968 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11969#[doc = "Prototype for Scene on_event handler"]
11970pub type AppSceneOnEventCallback = ::core::option::Option<
11971 unsafe extern "C" fn(context: *mut core::ffi::c_void, event: SceneManagerEvent) -> bool,
11972>;
11973#[doc = "Prototype for Scene on_exit handler"]
11974pub type AppSceneOnExitCallback =
11975 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
11976#[doc = "Scene Manager configuration structure\n Contains array of Scene handlers"]
11977#[repr(C)]
11978#[derive(Debug, Copy, Clone)]
11979pub struct SceneManagerHandlers {
11980 pub on_enter_handlers: *const AppSceneOnEnterCallback,
11981 pub on_event_handlers: *const AppSceneOnEventCallback,
11982 pub on_exit_handlers: *const AppSceneOnExitCallback,
11983 pub scene_num: u32,
11984}
11985#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11986const _: () = {
11987 ["Size of SceneManagerHandlers"][::core::mem::size_of::<SceneManagerHandlers>() - 16usize];
11988 ["Alignment of SceneManagerHandlers"][::core::mem::align_of::<SceneManagerHandlers>() - 4usize];
11989 ["Offset of field: SceneManagerHandlers::on_enter_handlers"]
11990 [::core::mem::offset_of!(SceneManagerHandlers, on_enter_handlers) - 0usize];
11991 ["Offset of field: SceneManagerHandlers::on_event_handlers"]
11992 [::core::mem::offset_of!(SceneManagerHandlers, on_event_handlers) - 4usize];
11993 ["Offset of field: SceneManagerHandlers::on_exit_handlers"]
11994 [::core::mem::offset_of!(SceneManagerHandlers, on_exit_handlers) - 8usize];
11995 ["Offset of field: SceneManagerHandlers::scene_num"]
11996 [::core::mem::offset_of!(SceneManagerHandlers, scene_num) - 12usize];
11997};
11998#[repr(C)]
11999#[derive(Debug, Copy, Clone)]
12000pub struct SceneManager {
12001 _unused: [u8; 0],
12002}
12003unsafe extern "C" {
12004 #[doc = "Set Scene state\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n * `state` - Scene new state"]
12005 pub fn scene_manager_set_scene_state(
12006 scene_manager: *mut SceneManager,
12007 scene_id: u32,
12008 state: u32,
12009 );
12010}
12011unsafe extern "C" {
12012 #[doc = "Get Scene state\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `scene_id` - Scene ID\n\n # Returns\n\nScene state"]
12013 pub fn scene_manager_get_scene_state(scene_manager: *const SceneManager, scene_id: u32) -> u32;
12014}
12015unsafe extern "C" {
12016 #[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"]
12017 pub fn scene_manager_alloc(
12018 app_scene_handlers: *const SceneManagerHandlers,
12019 context: *mut core::ffi::c_void,
12020 ) -> *mut SceneManager;
12021}
12022unsafe extern "C" {
12023 #[doc = "Free Scene Manager with allocated Scenes\n\n # Arguments\n\n* `scene_manager` - SceneManager instance"]
12024 pub fn scene_manager_free(scene_manager: *mut SceneManager);
12025}
12026unsafe extern "C" {
12027 #[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"]
12028 pub fn scene_manager_handle_custom_event(
12029 scene_manager: *mut SceneManager,
12030 custom_event: u32,
12031 ) -> bool;
12032}
12033unsafe extern "C" {
12034 #[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"]
12035 pub fn scene_manager_handle_back_event(scene_manager: *mut SceneManager) -> bool;
12036}
12037unsafe extern "C" {
12038 #[doc = "Tick event handler\n\n Calls Scene event handler with Tick event parameter\n\n # Arguments\n\n* `scene_manager` - SceneManager instance"]
12039 pub fn scene_manager_handle_tick_event(scene_manager: *mut SceneManager);
12040}
12041unsafe extern "C" {
12042 #[doc = "Add and run next Scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n * `next_scene_id` - next Scene ID"]
12043 pub fn scene_manager_next_scene(scene_manager: *mut SceneManager, next_scene_id: u32);
12044}
12045unsafe extern "C" {
12046 #[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"]
12047 pub fn scene_manager_previous_scene(scene_manager: *mut SceneManager) -> bool;
12048}
12049unsafe extern "C" {
12050 #[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"]
12051 pub fn scene_manager_has_previous_scene(
12052 scene_manager: *const SceneManager,
12053 scene_id: u32,
12054 ) -> bool;
12055}
12056unsafe extern "C" {
12057 #[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"]
12058 pub fn scene_manager_search_and_switch_to_previous_scene(
12059 scene_manager: *mut SceneManager,
12060 scene_id: u32,
12061 ) -> bool;
12062}
12063unsafe extern "C" {
12064 #[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"]
12065 pub fn scene_manager_search_and_switch_to_previous_scene_one_of(
12066 scene_manager: *mut SceneManager,
12067 scene_ids: *const u32,
12068 scene_ids_size: usize,
12069 ) -> bool;
12070}
12071unsafe extern "C" {
12072 #[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"]
12073 pub fn scene_manager_search_and_switch_to_another_scene(
12074 scene_manager: *mut SceneManager,
12075 scene_id: u32,
12076 ) -> bool;
12077}
12078unsafe extern "C" {
12079 #[doc = "Get id of current scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance\n\n # Returns\n\nScene ID"]
12080 pub fn scene_manager_get_current_scene(scene_manager: *mut SceneManager) -> u32;
12081}
12082unsafe extern "C" {
12083 #[doc = "Exit from current scene\n\n # Arguments\n\n* `scene_manager` - SceneManager instance"]
12084 pub fn scene_manager_stop(scene_manager: *mut SceneManager);
12085}
12086#[doc = "< Desktop layer: fullscreen with status bar on top of it. For internal usage."]
12087pub const ViewDispatcherTypeDesktop: ViewDispatcherType = ViewDispatcherType(0);
12088#[doc = "< Window layer: with status bar"]
12089pub const ViewDispatcherTypeWindow: ViewDispatcherType = ViewDispatcherType(1);
12090#[doc = "< Fullscreen layer: without status bar"]
12091pub const ViewDispatcherTypeFullscreen: ViewDispatcherType = ViewDispatcherType(2);
12092#[repr(transparent)]
12093#[doc = "ViewDispatcher view_port placement"]
12094#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12095pub struct ViewDispatcherType(pub core::ffi::c_uchar);
12096#[repr(C)]
12097#[derive(Debug, Copy, Clone)]
12098pub struct ViewDispatcher {
12099 _unused: [u8; 0],
12100}
12101#[doc = "Prototype for custom event callback"]
12102pub type ViewDispatcherCustomEventCallback = ::core::option::Option<
12103 unsafe extern "C" fn(context: *mut core::ffi::c_void, event: u32) -> bool,
12104>;
12105#[doc = "Prototype for navigation event callback"]
12106pub type ViewDispatcherNavigationEventCallback =
12107 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> bool>;
12108#[doc = "Prototype for tick event callback"]
12109pub type ViewDispatcherTickEventCallback =
12110 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
12111unsafe extern "C" {
12112 #[doc = "Allocate ViewDispatcher instance\n\n # Returns\n\npointer to ViewDispatcher instance"]
12113 pub fn view_dispatcher_alloc() -> *mut ViewDispatcher;
12114}
12115unsafe extern "C" {
12116 #[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"]
12117 pub fn view_dispatcher_alloc_ex(loop_: *mut FuriEventLoop) -> *mut ViewDispatcher;
12118}
12119unsafe extern "C" {
12120 #[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"]
12121 pub fn view_dispatcher_free(view_dispatcher: *mut ViewDispatcher);
12122}
12123unsafe extern "C" {
12124 #[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"]
12125 pub fn view_dispatcher_enable_queue(view_dispatcher: *mut ViewDispatcher);
12126}
12127unsafe extern "C" {
12128 #[doc = "Send custom event\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `event` (direction in) - The event"]
12129 pub fn view_dispatcher_send_custom_event(view_dispatcher: *mut ViewDispatcher, event: u32);
12130}
12131unsafe extern "C" {
12132 #[doc = "Set custom event handler\n\n > **Note:** this will be called on the thread that invoked view_dispatcher_run\n\n Called when a Custom Event is received, if it is not consumed by view\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `callback` - ViewDispatcherCustomEventCallback instance"]
12133 pub fn view_dispatcher_set_custom_event_callback(
12134 view_dispatcher: *mut ViewDispatcher,
12135 callback: ViewDispatcherCustomEventCallback,
12136 );
12137}
12138unsafe extern "C" {
12139 #[doc = "Set navigation event handler\n\n > **Note:** this will be called on the thread that invoked view_dispatcher_run\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"]
12140 pub fn view_dispatcher_set_navigation_event_callback(
12141 view_dispatcher: *mut ViewDispatcher,
12142 callback: ViewDispatcherNavigationEventCallback,
12143 );
12144}
12145unsafe extern "C" {
12146 #[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 > **Note:** `callback` will be called on the thread that invoked view_dispatcher_run\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `callback` - ViewDispatcherTickEventCallback\n * `tick_period` - callback call period"]
12147 pub fn view_dispatcher_set_tick_event_callback(
12148 view_dispatcher: *mut ViewDispatcher,
12149 callback: ViewDispatcherTickEventCallback,
12150 tick_period: u32,
12151 );
12152}
12153unsafe extern "C" {
12154 #[doc = "Set event callback context\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `context` - pointer to context"]
12155 pub fn view_dispatcher_set_event_callback_context(
12156 view_dispatcher: *mut ViewDispatcher,
12157 context: *mut core::ffi::c_void,
12158 );
12159}
12160unsafe extern "C" {
12161 #[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."]
12162 pub fn view_dispatcher_get_event_loop(
12163 view_dispatcher: *mut ViewDispatcher,
12164 ) -> *mut FuriEventLoop;
12165}
12166unsafe extern "C" {
12167 #[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"]
12168 pub fn view_dispatcher_run(view_dispatcher: *mut ViewDispatcher);
12169}
12170unsafe extern "C" {
12171 #[doc = "Stop ViewDispatcher\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12172 pub fn view_dispatcher_stop(view_dispatcher: *mut ViewDispatcher);
12173}
12174unsafe extern "C" {
12175 #[doc = "Check if a view exists at id.\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `view_id` - View id to check\n\n # Returns\n\nTrue if a view has been added with id, false if not."]
12176 pub fn view_dispatcher_check_id(view_dispatcher: *mut ViewDispatcher, view_id: u32) -> bool;
12177}
12178unsafe extern "C" {
12179 #[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"]
12180 pub fn view_dispatcher_add_view(
12181 view_dispatcher: *mut ViewDispatcher,
12182 view_id: u32,
12183 view: *mut View,
12184 );
12185}
12186unsafe extern "C" {
12187 #[doc = "Remove view from ViewDispatcher\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance\n * `view_id` - View id to remove"]
12188 pub fn view_dispatcher_remove_view(view_dispatcher: *mut ViewDispatcher, view_id: u32);
12189}
12190unsafe extern "C" {
12191 #[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"]
12192 pub fn view_dispatcher_switch_to_view(view_dispatcher: *mut ViewDispatcher, view_id: u32);
12193}
12194unsafe extern "C" {
12195 #[doc = "Send ViewPort of this ViewDispatcher instance to front\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12196 pub fn view_dispatcher_send_to_front(view_dispatcher: *mut ViewDispatcher);
12197}
12198unsafe extern "C" {
12199 #[doc = "Send ViewPort of this ViewDispatcher instance to back\n\n # Arguments\n\n* `view_dispatcher` - ViewDispatcher instance"]
12200 pub fn view_dispatcher_send_to_back(view_dispatcher: *mut ViewDispatcher);
12201}
12202unsafe extern "C" {
12203 #[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"]
12204 pub fn view_dispatcher_attach_to_gui(
12205 view_dispatcher: *mut ViewDispatcher,
12206 gui: *mut Gui,
12207 type_: ViewDispatcherType,
12208 );
12209}
12210#[repr(C)]
12211#[derive(Debug, Copy, Clone)]
12212pub struct ViewHolder {
12213 _unused: [u8; 0],
12214}
12215#[doc = "Free callback type"]
12216pub type FreeCallback =
12217 ::core::option::Option<unsafe extern "C" fn(free_context: *mut core::ffi::c_void)>;
12218#[doc = "Back callback type\n\n Will be called from the GUI thread"]
12219pub type BackCallback =
12220 ::core::option::Option<unsafe extern "C" fn(back_context: *mut core::ffi::c_void)>;
12221unsafe extern "C" {
12222 #[doc = "Allocate ViewHolder\n # Returns\n\npointer to ViewHolder instance"]
12223 pub fn view_holder_alloc() -> *mut ViewHolder;
12224}
12225unsafe extern "C" {
12226 #[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"]
12227 pub fn view_holder_free(view_holder: *mut ViewHolder);
12228}
12229unsafe extern "C" {
12230 #[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"]
12231 pub fn view_holder_set_view(view_holder: *mut ViewHolder, view: *mut View);
12232}
12233unsafe extern "C" {
12234 #[doc = "Set Free callback\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n * `free_callback` - callback pointer\n * `free_context` - callback context"]
12235 pub fn view_holder_set_free_callback(
12236 view_holder: *mut ViewHolder,
12237 free_callback: FreeCallback,
12238 free_context: *mut core::ffi::c_void,
12239 );
12240}
12241unsafe extern "C" {
12242 #[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"]
12243 pub fn view_holder_get_free_context(view_holder: *mut ViewHolder) -> *mut core::ffi::c_void;
12244}
12245unsafe extern "C" {
12246 #[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"]
12247 pub fn view_holder_set_back_callback(
12248 view_holder: *mut ViewHolder,
12249 back_callback: BackCallback,
12250 back_context: *mut core::ffi::c_void,
12251 );
12252}
12253unsafe extern "C" {
12254 #[doc = "Attach ViewHolder to GUI\n\n # Arguments\n\n* `view_holder` - ViewHolder instance\n * `gui` - GUI instance to attach to"]
12255 pub fn view_holder_attach_to_gui(view_holder: *mut ViewHolder, gui: *mut Gui);
12256}
12257unsafe extern "C" {
12258 #[doc = "View Update Handler\n\n # Arguments\n\n* `view` - View Instance\n * `context` - ViewHolder instance"]
12259 pub fn view_holder_update(view: *mut View, context: *mut core::ffi::c_void);
12260}
12261unsafe extern "C" {
12262 #[doc = "Send ViewPort of this ViewHolder instance to front\n\n # Arguments\n\n* `view_holder` - ViewHolder instance"]
12263 pub fn view_holder_send_to_front(view_holder: *mut ViewHolder);
12264}
12265unsafe extern "C" {
12266 #[doc = "Send ViewPort of this ViewHolder instance to back\n\n # Arguments\n\n* `view_holder` - ViewHolder instance"]
12267 pub fn view_holder_send_to_back(view_holder: *mut ViewHolder);
12268}
12269#[repr(C)]
12270#[derive(Debug, Copy, Clone)]
12271pub struct ViewStack {
12272 _unused: [u8; 0],
12273}
12274unsafe extern "C" {
12275 #[doc = "Allocate and init ViewStack\n\n # Returns\n\nViewStack instance"]
12276 pub fn view_stack_alloc() -> *mut ViewStack;
12277}
12278unsafe extern "C" {
12279 #[doc = "Free ViewStack instance\n\n # Arguments\n\n* `view_stack` - instance"]
12280 pub fn view_stack_free(view_stack: *mut ViewStack);
12281}
12282unsafe extern "C" {
12283 #[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"]
12284 pub fn view_stack_get_view(view_stack: *mut ViewStack) -> *mut View;
12285}
12286unsafe extern "C" {
12287 #[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"]
12288 pub fn view_stack_add_view(view_stack: *mut ViewStack, view: *mut View);
12289}
12290unsafe extern "C" {
12291 #[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"]
12292 pub fn view_stack_remove_view(view_stack: *mut ViewStack, view: *mut View);
12293}
12294unsafe extern "C" {
12295 pub static firmware_api_interface: *const ElfApiInterface;
12296}
12297#[repr(C)]
12298#[derive(Debug, Copy, Clone)]
12299pub struct Loader {
12300 _unused: [u8; 0],
12301}
12302pub const LoaderStatusOk: LoaderStatus = LoaderStatus(0);
12303pub const LoaderStatusErrorAppStarted: LoaderStatus = LoaderStatus(1);
12304pub const LoaderStatusErrorUnknownApp: LoaderStatus = LoaderStatus(2);
12305pub const LoaderStatusErrorInternal: LoaderStatus = LoaderStatus(3);
12306#[repr(transparent)]
12307#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12308pub struct LoaderStatus(pub core::ffi::c_uchar);
12309pub const LoaderEventTypeApplicationBeforeLoad: LoaderEventType = LoaderEventType(0);
12310pub const LoaderEventTypeApplicationLoadFailed: LoaderEventType = LoaderEventType(1);
12311pub const LoaderEventTypeApplicationStopped: LoaderEventType = LoaderEventType(2);
12312pub const LoaderEventTypeNoMoreAppsInQueue: LoaderEventType = LoaderEventType(3);
12313#[repr(transparent)]
12314#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12315pub struct LoaderEventType(pub core::ffi::c_uchar);
12316#[repr(C)]
12317#[derive(Debug, Copy, Clone)]
12318pub struct LoaderEvent {
12319 pub type_: LoaderEventType,
12320}
12321#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12322const _: () = {
12323 ["Size of LoaderEvent"][::core::mem::size_of::<LoaderEvent>() - 1usize];
12324 ["Alignment of LoaderEvent"][::core::mem::align_of::<LoaderEvent>() - 1usize];
12325 ["Offset of field: LoaderEvent::type_"][::core::mem::offset_of!(LoaderEvent, type_) - 0usize];
12326};
12327pub const LoaderDeferredLaunchFlagNone: LoaderDeferredLaunchFlag = LoaderDeferredLaunchFlag(0);
12328pub const LoaderDeferredLaunchFlagGui: LoaderDeferredLaunchFlag = LoaderDeferredLaunchFlag(2);
12329#[repr(transparent)]
12330#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12331pub struct LoaderDeferredLaunchFlag(pub core::ffi::c_uchar);
12332unsafe extern "C" {
12333 #[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"]
12334 pub fn loader_start(
12335 instance: *mut Loader,
12336 name: *const core::ffi::c_char,
12337 args: *const core::ffi::c_char,
12338 error_message: *mut FuriString,
12339 ) -> LoaderStatus;
12340}
12341unsafe extern "C" {
12342 #[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"]
12343 pub fn loader_start_with_gui_error(
12344 loader: *mut Loader,
12345 name: *const core::ffi::c_char,
12346 args: *const core::ffi::c_char,
12347 ) -> LoaderStatus;
12348}
12349unsafe extern "C" {
12350 #[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"]
12351 pub fn loader_start_detached_with_gui_error(
12352 loader: *mut Loader,
12353 name: *const core::ffi::c_char,
12354 args: *const core::ffi::c_char,
12355 );
12356}
12357unsafe extern "C" {
12358 #[doc = "Lock application start\n # Arguments\n\n* `instance` (direction in) - loader instance\n # Returns\n\ntrue on success"]
12359 pub fn loader_lock(instance: *mut Loader) -> bool;
12360}
12361unsafe extern "C" {
12362 #[doc = "Unlock application start\n # Arguments\n\n* `instance` (direction in) - loader instance"]
12363 pub fn loader_unlock(instance: *mut Loader);
12364}
12365unsafe extern "C" {
12366 #[doc = "Check if loader is locked\n # Arguments\n\n* `instance` (direction in) - loader instance\n # Returns\n\ntrue if locked"]
12367 pub fn loader_is_locked(instance: *mut Loader) -> bool;
12368}
12369unsafe extern "C" {
12370 #[doc = "Show loader menu\n # Arguments\n\n* `instance` (direction in) - loader instance"]
12371 pub fn loader_show_menu(instance: *mut Loader);
12372}
12373unsafe extern "C" {
12374 #[doc = "Get loader pubsub\n # Arguments\n\n* `instance` (direction in) - loader instance\n # Returns\n\nFuriPubSub*"]
12375 pub fn loader_get_pubsub(instance: *mut Loader) -> *mut FuriPubSub;
12376}
12377unsafe extern "C" {
12378 #[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"]
12379 pub fn loader_signal(instance: *mut Loader, signal: u32, arg: *mut core::ffi::c_void) -> bool;
12380}
12381unsafe extern "C" {
12382 #[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"]
12383 pub fn loader_get_application_name(instance: *mut Loader, name: *mut FuriString) -> bool;
12384}
12385unsafe extern "C" {
12386 #[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"]
12387 pub fn loader_get_application_launch_path(instance: *mut Loader, name: *mut FuriString)
12388 -> bool;
12389}
12390unsafe extern "C" {
12391 #[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"]
12392 pub fn loader_enqueue_launch(
12393 instance: *mut Loader,
12394 name: *const core::ffi::c_char,
12395 args: *const core::ffi::c_char,
12396 flags: LoaderDeferredLaunchFlag,
12397 );
12398}
12399unsafe extern "C" {
12400 #[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"]
12401 pub fn loader_clear_launch_queue(instance: *mut Loader);
12402}
12403#[doc = "< Metric measurement units"]
12404pub const LocaleMeasurementUnitsMetric: LocaleMeasurementUnits = LocaleMeasurementUnits(0);
12405#[doc = "< Imperial measurement units"]
12406pub const LocaleMeasurementUnitsImperial: LocaleMeasurementUnits = LocaleMeasurementUnits(1);
12407#[repr(transparent)]
12408#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12409pub struct LocaleMeasurementUnits(pub core::ffi::c_uchar);
12410#[doc = "< 24-hour format"]
12411pub const LocaleTimeFormat24h: LocaleTimeFormat = LocaleTimeFormat(0);
12412#[doc = "< 12-hour format"]
12413pub const LocaleTimeFormat12h: LocaleTimeFormat = LocaleTimeFormat(1);
12414#[repr(transparent)]
12415#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12416pub struct LocaleTimeFormat(pub core::ffi::c_uchar);
12417#[doc = "< Day/Month/Year"]
12418pub const LocaleDateFormatDMY: LocaleDateFormat = LocaleDateFormat(0);
12419#[doc = "< Month/Day/Year"]
12420pub const LocaleDateFormatMDY: LocaleDateFormat = LocaleDateFormat(1);
12421#[doc = "< Year/Month/Day"]
12422pub const LocaleDateFormatYMD: LocaleDateFormat = LocaleDateFormat(2);
12423#[repr(transparent)]
12424#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12425pub struct LocaleDateFormat(pub core::ffi::c_uchar);
12426unsafe extern "C" {
12427 #[doc = "Get Locale measurement units\n\n # Returns\n\nThe locale measurement units."]
12428 pub fn locale_get_measurement_unit() -> LocaleMeasurementUnits;
12429}
12430unsafe extern "C" {
12431 #[doc = "Set locale measurement units\n\n # Arguments\n\n* `format` (direction in) - The locale measurements units"]
12432 pub fn locale_set_measurement_unit(format: LocaleMeasurementUnits);
12433}
12434unsafe extern "C" {
12435 #[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"]
12436 pub fn locale_fahrenheit_to_celsius(temp_f: f32) -> f32;
12437}
12438unsafe extern "C" {
12439 #[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"]
12440 pub fn locale_celsius_to_fahrenheit(temp_c: f32) -> f32;
12441}
12442unsafe extern "C" {
12443 #[doc = "Get Locale time format\n\n # Returns\n\nThe locale time format."]
12444 pub fn locale_get_time_format() -> LocaleTimeFormat;
12445}
12446unsafe extern "C" {
12447 #[doc = "Set Locale Time Format\n\n # Arguments\n\n* `format` (direction in) - The Locale Time Format"]
12448 pub fn locale_set_time_format(format: LocaleTimeFormat);
12449}
12450unsafe extern "C" {
12451 #[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"]
12452 pub fn locale_format_time(
12453 out_str: *mut FuriString,
12454 datetime: *const DateTime,
12455 format: LocaleTimeFormat,
12456 show_seconds: bool,
12457 );
12458}
12459unsafe extern "C" {
12460 #[doc = "Get Locale DateFormat\n\n # Returns\n\nThe Locale DateFormat."]
12461 pub fn locale_get_date_format() -> LocaleDateFormat;
12462}
12463unsafe extern "C" {
12464 #[doc = "Set Locale DateFormat\n\n # Arguments\n\n* `format` (direction in) - The Locale DateFormat"]
12465 pub fn locale_set_date_format(format: LocaleDateFormat);
12466}
12467unsafe extern "C" {
12468 #[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"]
12469 pub fn locale_format_date(
12470 out_str: *mut FuriString,
12471 datetime: *const DateTime,
12472 format: LocaleDateFormat,
12473 separator: *const core::ffi::c_char,
12474 );
12475}
12476#[repr(C)]
12477#[derive(Debug, Copy, Clone)]
12478pub struct NotificationApp {
12479 _unused: [u8; 0],
12480}
12481#[repr(C)]
12482#[derive(Debug, Copy, Clone)]
12483pub struct NotificationMessageDataSound {
12484 pub frequency: f32,
12485 pub volume: f32,
12486}
12487#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12488const _: () = {
12489 ["Size of NotificationMessageDataSound"]
12490 [::core::mem::size_of::<NotificationMessageDataSound>() - 8usize];
12491 ["Alignment of NotificationMessageDataSound"]
12492 [::core::mem::align_of::<NotificationMessageDataSound>() - 4usize];
12493 ["Offset of field: NotificationMessageDataSound::frequency"]
12494 [::core::mem::offset_of!(NotificationMessageDataSound, frequency) - 0usize];
12495 ["Offset of field: NotificationMessageDataSound::volume"]
12496 [::core::mem::offset_of!(NotificationMessageDataSound, volume) - 4usize];
12497};
12498#[repr(C)]
12499#[derive(Debug, Copy, Clone)]
12500pub struct NotificationMessageDataLed {
12501 pub value: u8,
12502}
12503#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12504const _: () = {
12505 ["Size of NotificationMessageDataLed"]
12506 [::core::mem::size_of::<NotificationMessageDataLed>() - 1usize];
12507 ["Alignment of NotificationMessageDataLed"]
12508 [::core::mem::align_of::<NotificationMessageDataLed>() - 1usize];
12509 ["Offset of field: NotificationMessageDataLed::value"]
12510 [::core::mem::offset_of!(NotificationMessageDataLed, value) - 0usize];
12511};
12512#[repr(C)]
12513#[derive(Debug, Copy, Clone)]
12514pub struct NotificationMessageDataVibro {
12515 pub on: bool,
12516}
12517#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12518const _: () = {
12519 ["Size of NotificationMessageDataVibro"]
12520 [::core::mem::size_of::<NotificationMessageDataVibro>() - 1usize];
12521 ["Alignment of NotificationMessageDataVibro"]
12522 [::core::mem::align_of::<NotificationMessageDataVibro>() - 1usize];
12523 ["Offset of field: NotificationMessageDataVibro::on"]
12524 [::core::mem::offset_of!(NotificationMessageDataVibro, on) - 0usize];
12525};
12526#[repr(C)]
12527#[derive(Debug, Copy, Clone)]
12528pub struct NotificationMessageDataDelay {
12529 pub length: u32,
12530}
12531#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12532const _: () = {
12533 ["Size of NotificationMessageDataDelay"]
12534 [::core::mem::size_of::<NotificationMessageDataDelay>() - 4usize];
12535 ["Alignment of NotificationMessageDataDelay"]
12536 [::core::mem::align_of::<NotificationMessageDataDelay>() - 4usize];
12537 ["Offset of field: NotificationMessageDataDelay::length"]
12538 [::core::mem::offset_of!(NotificationMessageDataDelay, length) - 0usize];
12539};
12540#[repr(C)]
12541#[derive(Debug, Copy, Clone)]
12542pub struct NotificationMessageDataForcedSettings {
12543 pub speaker_volume: f32,
12544 pub vibro: bool,
12545 pub display_brightness: f32,
12546}
12547#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12548const _: () = {
12549 ["Size of NotificationMessageDataForcedSettings"]
12550 [::core::mem::size_of::<NotificationMessageDataForcedSettings>() - 12usize];
12551 ["Alignment of NotificationMessageDataForcedSettings"]
12552 [::core::mem::align_of::<NotificationMessageDataForcedSettings>() - 4usize];
12553 ["Offset of field: NotificationMessageDataForcedSettings::speaker_volume"]
12554 [::core::mem::offset_of!(NotificationMessageDataForcedSettings, speaker_volume) - 0usize];
12555 ["Offset of field: NotificationMessageDataForcedSettings::vibro"]
12556 [::core::mem::offset_of!(NotificationMessageDataForcedSettings, vibro) - 4usize];
12557 ["Offset of field: NotificationMessageDataForcedSettings::display_brightness"][::core::mem::offset_of!(
12558 NotificationMessageDataForcedSettings,
12559 display_brightness
12560 ) - 8usize];
12561};
12562#[repr(C)]
12563#[derive(Debug, Copy, Clone)]
12564pub struct NotificationMessageDataLedBlink {
12565 pub on_time: u16,
12566 pub period: u16,
12567 pub color: Light,
12568}
12569#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12570const _: () = {
12571 ["Size of NotificationMessageDataLedBlink"]
12572 [::core::mem::size_of::<NotificationMessageDataLedBlink>() - 6usize];
12573 ["Alignment of NotificationMessageDataLedBlink"]
12574 [::core::mem::align_of::<NotificationMessageDataLedBlink>() - 2usize];
12575 ["Offset of field: NotificationMessageDataLedBlink::on_time"]
12576 [::core::mem::offset_of!(NotificationMessageDataLedBlink, on_time) - 0usize];
12577 ["Offset of field: NotificationMessageDataLedBlink::period"]
12578 [::core::mem::offset_of!(NotificationMessageDataLedBlink, period) - 2usize];
12579 ["Offset of field: NotificationMessageDataLedBlink::color"]
12580 [::core::mem::offset_of!(NotificationMessageDataLedBlink, color) - 4usize];
12581};
12582#[repr(C)]
12583#[derive(Copy, Clone)]
12584pub union NotificationMessageData {
12585 pub sound: NotificationMessageDataSound,
12586 pub led: NotificationMessageDataLed,
12587 pub led_blink: NotificationMessageDataLedBlink,
12588 pub vibro: NotificationMessageDataVibro,
12589 pub delay: NotificationMessageDataDelay,
12590 pub forced_settings: NotificationMessageDataForcedSettings,
12591}
12592#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12593const _: () = {
12594 ["Size of NotificationMessageData"]
12595 [::core::mem::size_of::<NotificationMessageData>() - 12usize];
12596 ["Alignment of NotificationMessageData"]
12597 [::core::mem::align_of::<NotificationMessageData>() - 4usize];
12598 ["Offset of field: NotificationMessageData::sound"]
12599 [::core::mem::offset_of!(NotificationMessageData, sound) - 0usize];
12600 ["Offset of field: NotificationMessageData::led"]
12601 [::core::mem::offset_of!(NotificationMessageData, led) - 0usize];
12602 ["Offset of field: NotificationMessageData::led_blink"]
12603 [::core::mem::offset_of!(NotificationMessageData, led_blink) - 0usize];
12604 ["Offset of field: NotificationMessageData::vibro"]
12605 [::core::mem::offset_of!(NotificationMessageData, vibro) - 0usize];
12606 ["Offset of field: NotificationMessageData::delay"]
12607 [::core::mem::offset_of!(NotificationMessageData, delay) - 0usize];
12608 ["Offset of field: NotificationMessageData::forced_settings"]
12609 [::core::mem::offset_of!(NotificationMessageData, forced_settings) - 0usize];
12610};
12611pub const NotificationMessageTypeVibro: NotificationMessageType = NotificationMessageType(0);
12612pub const NotificationMessageTypeSoundOn: NotificationMessageType = NotificationMessageType(1);
12613pub const NotificationMessageTypeSoundOff: NotificationMessageType = NotificationMessageType(2);
12614pub const NotificationMessageTypeLedRed: NotificationMessageType = NotificationMessageType(3);
12615pub const NotificationMessageTypeLedGreen: NotificationMessageType = NotificationMessageType(4);
12616pub const NotificationMessageTypeLedBlue: NotificationMessageType = NotificationMessageType(5);
12617pub const NotificationMessageTypeLedBlinkStart: NotificationMessageType =
12618 NotificationMessageType(6);
12619pub const NotificationMessageTypeLedBlinkStop: NotificationMessageType = NotificationMessageType(7);
12620pub const NotificationMessageTypeLedBlinkColor: NotificationMessageType =
12621 NotificationMessageType(8);
12622pub const NotificationMessageTypeDelay: NotificationMessageType = NotificationMessageType(9);
12623pub const NotificationMessageTypeLedDisplayBacklight: NotificationMessageType =
12624 NotificationMessageType(10);
12625pub const NotificationMessageTypeLedDisplayBacklightEnforceOn: NotificationMessageType =
12626 NotificationMessageType(11);
12627pub const NotificationMessageTypeLedDisplayBacklightEnforceAuto: NotificationMessageType =
12628 NotificationMessageType(12);
12629pub const NotificationMessageTypeDoNotReset: NotificationMessageType = NotificationMessageType(13);
12630pub const NotificationMessageTypeForceSpeakerVolumeSetting: NotificationMessageType =
12631 NotificationMessageType(14);
12632pub const NotificationMessageTypeForceVibroSetting: NotificationMessageType =
12633 NotificationMessageType(15);
12634pub const NotificationMessageTypeForceDisplayBrightnessSetting: NotificationMessageType =
12635 NotificationMessageType(16);
12636pub const NotificationMessageTypeLedBrightnessSettingApply: NotificationMessageType =
12637 NotificationMessageType(17);
12638pub const NotificationMessageTypeLcdContrastUpdate: NotificationMessageType =
12639 NotificationMessageType(18);
12640#[repr(transparent)]
12641#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12642pub struct NotificationMessageType(pub core::ffi::c_uchar);
12643#[repr(C)]
12644#[derive(Copy, Clone)]
12645pub struct NotificationMessage {
12646 pub type_: NotificationMessageType,
12647 pub data: NotificationMessageData,
12648}
12649#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12650const _: () = {
12651 ["Size of NotificationMessage"][::core::mem::size_of::<NotificationMessage>() - 16usize];
12652 ["Alignment of NotificationMessage"][::core::mem::align_of::<NotificationMessage>() - 4usize];
12653 ["Offset of field: NotificationMessage::type_"]
12654 [::core::mem::offset_of!(NotificationMessage, type_) - 0usize];
12655 ["Offset of field: NotificationMessage::data"]
12656 [::core::mem::offset_of!(NotificationMessage, data) - 4usize];
12657};
12658pub type NotificationSequence = [*const NotificationMessage; 0usize];
12659unsafe extern "C" {
12660 pub fn notification_message(app: *mut NotificationApp, sequence: *const NotificationSequence);
12661}
12662unsafe extern "C" {
12663 pub fn notification_message_block(
12664 app: *mut NotificationApp,
12665 sequence: *const NotificationSequence,
12666 );
12667}
12668unsafe extern "C" {
12669 #[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"]
12670 pub fn notification_internal_message(
12671 app: *mut NotificationApp,
12672 sequence: *const NotificationSequence,
12673 );
12674}
12675unsafe extern "C" {
12676 #[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"]
12677 pub fn notification_internal_message_block(
12678 app: *mut NotificationApp,
12679 sequence: *const NotificationSequence,
12680 );
12681}
12682unsafe extern "C" {
12683 pub static message_click: NotificationMessage;
12684}
12685unsafe extern "C" {
12686 pub static message_note_c0: NotificationMessage;
12687}
12688unsafe extern "C" {
12689 pub static message_note_cs0: NotificationMessage;
12690}
12691unsafe extern "C" {
12692 pub static message_note_d0: NotificationMessage;
12693}
12694unsafe extern "C" {
12695 pub static message_note_ds0: NotificationMessage;
12696}
12697unsafe extern "C" {
12698 pub static message_note_e0: NotificationMessage;
12699}
12700unsafe extern "C" {
12701 pub static message_note_f0: NotificationMessage;
12702}
12703unsafe extern "C" {
12704 pub static message_note_fs0: NotificationMessage;
12705}
12706unsafe extern "C" {
12707 pub static message_note_g0: NotificationMessage;
12708}
12709unsafe extern "C" {
12710 pub static message_note_gs0: NotificationMessage;
12711}
12712unsafe extern "C" {
12713 pub static message_note_a0: NotificationMessage;
12714}
12715unsafe extern "C" {
12716 pub static message_note_as0: NotificationMessage;
12717}
12718unsafe extern "C" {
12719 pub static message_note_b0: NotificationMessage;
12720}
12721unsafe extern "C" {
12722 pub static message_note_c1: NotificationMessage;
12723}
12724unsafe extern "C" {
12725 pub static message_note_cs1: NotificationMessage;
12726}
12727unsafe extern "C" {
12728 pub static message_note_d1: NotificationMessage;
12729}
12730unsafe extern "C" {
12731 pub static message_note_ds1: NotificationMessage;
12732}
12733unsafe extern "C" {
12734 pub static message_note_e1: NotificationMessage;
12735}
12736unsafe extern "C" {
12737 pub static message_note_f1: NotificationMessage;
12738}
12739unsafe extern "C" {
12740 pub static message_note_fs1: NotificationMessage;
12741}
12742unsafe extern "C" {
12743 pub static message_note_g1: NotificationMessage;
12744}
12745unsafe extern "C" {
12746 pub static message_note_gs1: NotificationMessage;
12747}
12748unsafe extern "C" {
12749 pub static message_note_a1: NotificationMessage;
12750}
12751unsafe extern "C" {
12752 pub static message_note_as1: NotificationMessage;
12753}
12754unsafe extern "C" {
12755 pub static message_note_b1: NotificationMessage;
12756}
12757unsafe extern "C" {
12758 pub static message_note_c2: NotificationMessage;
12759}
12760unsafe extern "C" {
12761 pub static message_note_cs2: NotificationMessage;
12762}
12763unsafe extern "C" {
12764 pub static message_note_d2: NotificationMessage;
12765}
12766unsafe extern "C" {
12767 pub static message_note_ds2: NotificationMessage;
12768}
12769unsafe extern "C" {
12770 pub static message_note_e2: NotificationMessage;
12771}
12772unsafe extern "C" {
12773 pub static message_note_f2: NotificationMessage;
12774}
12775unsafe extern "C" {
12776 pub static message_note_fs2: NotificationMessage;
12777}
12778unsafe extern "C" {
12779 pub static message_note_g2: NotificationMessage;
12780}
12781unsafe extern "C" {
12782 pub static message_note_gs2: NotificationMessage;
12783}
12784unsafe extern "C" {
12785 pub static message_note_a2: NotificationMessage;
12786}
12787unsafe extern "C" {
12788 pub static message_note_as2: NotificationMessage;
12789}
12790unsafe extern "C" {
12791 pub static message_note_b2: NotificationMessage;
12792}
12793unsafe extern "C" {
12794 pub static message_note_c3: NotificationMessage;
12795}
12796unsafe extern "C" {
12797 pub static message_note_cs3: NotificationMessage;
12798}
12799unsafe extern "C" {
12800 pub static message_note_d3: NotificationMessage;
12801}
12802unsafe extern "C" {
12803 pub static message_note_ds3: NotificationMessage;
12804}
12805unsafe extern "C" {
12806 pub static message_note_e3: NotificationMessage;
12807}
12808unsafe extern "C" {
12809 pub static message_note_f3: NotificationMessage;
12810}
12811unsafe extern "C" {
12812 pub static message_note_fs3: NotificationMessage;
12813}
12814unsafe extern "C" {
12815 pub static message_note_g3: NotificationMessage;
12816}
12817unsafe extern "C" {
12818 pub static message_note_gs3: NotificationMessage;
12819}
12820unsafe extern "C" {
12821 pub static message_note_a3: NotificationMessage;
12822}
12823unsafe extern "C" {
12824 pub static message_note_as3: NotificationMessage;
12825}
12826unsafe extern "C" {
12827 pub static message_note_b3: NotificationMessage;
12828}
12829unsafe extern "C" {
12830 pub static message_note_c4: NotificationMessage;
12831}
12832unsafe extern "C" {
12833 pub static message_note_cs4: NotificationMessage;
12834}
12835unsafe extern "C" {
12836 pub static message_note_d4: NotificationMessage;
12837}
12838unsafe extern "C" {
12839 pub static message_note_ds4: NotificationMessage;
12840}
12841unsafe extern "C" {
12842 pub static message_note_e4: NotificationMessage;
12843}
12844unsafe extern "C" {
12845 pub static message_note_f4: NotificationMessage;
12846}
12847unsafe extern "C" {
12848 pub static message_note_fs4: NotificationMessage;
12849}
12850unsafe extern "C" {
12851 pub static message_note_g4: NotificationMessage;
12852}
12853unsafe extern "C" {
12854 pub static message_note_gs4: NotificationMessage;
12855}
12856unsafe extern "C" {
12857 pub static message_note_a4: NotificationMessage;
12858}
12859unsafe extern "C" {
12860 pub static message_note_as4: NotificationMessage;
12861}
12862unsafe extern "C" {
12863 pub static message_note_b4: NotificationMessage;
12864}
12865unsafe extern "C" {
12866 pub static message_note_c5: NotificationMessage;
12867}
12868unsafe extern "C" {
12869 pub static message_note_cs5: NotificationMessage;
12870}
12871unsafe extern "C" {
12872 pub static message_note_d5: NotificationMessage;
12873}
12874unsafe extern "C" {
12875 pub static message_note_ds5: NotificationMessage;
12876}
12877unsafe extern "C" {
12878 pub static message_note_e5: NotificationMessage;
12879}
12880unsafe extern "C" {
12881 pub static message_note_f5: NotificationMessage;
12882}
12883unsafe extern "C" {
12884 pub static message_note_fs5: NotificationMessage;
12885}
12886unsafe extern "C" {
12887 pub static message_note_g5: NotificationMessage;
12888}
12889unsafe extern "C" {
12890 pub static message_note_gs5: NotificationMessage;
12891}
12892unsafe extern "C" {
12893 pub static message_note_a5: NotificationMessage;
12894}
12895unsafe extern "C" {
12896 pub static message_note_as5: NotificationMessage;
12897}
12898unsafe extern "C" {
12899 pub static message_note_b5: NotificationMessage;
12900}
12901unsafe extern "C" {
12902 pub static message_note_c6: NotificationMessage;
12903}
12904unsafe extern "C" {
12905 pub static message_note_cs6: NotificationMessage;
12906}
12907unsafe extern "C" {
12908 pub static message_note_d6: NotificationMessage;
12909}
12910unsafe extern "C" {
12911 pub static message_note_ds6: NotificationMessage;
12912}
12913unsafe extern "C" {
12914 pub static message_note_e6: NotificationMessage;
12915}
12916unsafe extern "C" {
12917 pub static message_note_f6: NotificationMessage;
12918}
12919unsafe extern "C" {
12920 pub static message_note_fs6: NotificationMessage;
12921}
12922unsafe extern "C" {
12923 pub static message_note_g6: NotificationMessage;
12924}
12925unsafe extern "C" {
12926 pub static message_note_gs6: NotificationMessage;
12927}
12928unsafe extern "C" {
12929 pub static message_note_a6: NotificationMessage;
12930}
12931unsafe extern "C" {
12932 pub static message_note_as6: NotificationMessage;
12933}
12934unsafe extern "C" {
12935 pub static message_note_b6: NotificationMessage;
12936}
12937unsafe extern "C" {
12938 pub static message_note_c7: NotificationMessage;
12939}
12940unsafe extern "C" {
12941 pub static message_note_cs7: NotificationMessage;
12942}
12943unsafe extern "C" {
12944 pub static message_note_d7: NotificationMessage;
12945}
12946unsafe extern "C" {
12947 pub static message_note_ds7: NotificationMessage;
12948}
12949unsafe extern "C" {
12950 pub static message_note_e7: NotificationMessage;
12951}
12952unsafe extern "C" {
12953 pub static message_note_f7: NotificationMessage;
12954}
12955unsafe extern "C" {
12956 pub static message_note_fs7: NotificationMessage;
12957}
12958unsafe extern "C" {
12959 pub static message_note_g7: NotificationMessage;
12960}
12961unsafe extern "C" {
12962 pub static message_note_gs7: NotificationMessage;
12963}
12964unsafe extern "C" {
12965 pub static message_note_a7: NotificationMessage;
12966}
12967unsafe extern "C" {
12968 pub static message_note_as7: NotificationMessage;
12969}
12970unsafe extern "C" {
12971 pub static message_note_b7: NotificationMessage;
12972}
12973unsafe extern "C" {
12974 pub static message_note_c8: NotificationMessage;
12975}
12976unsafe extern "C" {
12977 pub static message_note_cs8: NotificationMessage;
12978}
12979unsafe extern "C" {
12980 pub static message_note_d8: NotificationMessage;
12981}
12982unsafe extern "C" {
12983 pub static message_note_ds8: NotificationMessage;
12984}
12985unsafe extern "C" {
12986 pub static message_note_e8: NotificationMessage;
12987}
12988unsafe extern "C" {
12989 pub static message_note_f8: NotificationMessage;
12990}
12991unsafe extern "C" {
12992 pub static message_note_fs8: NotificationMessage;
12993}
12994unsafe extern "C" {
12995 pub static message_note_g8: NotificationMessage;
12996}
12997unsafe extern "C" {
12998 pub static message_note_gs8: NotificationMessage;
12999}
13000unsafe extern "C" {
13001 pub static message_note_a8: NotificationMessage;
13002}
13003unsafe extern "C" {
13004 pub static message_note_as8: NotificationMessage;
13005}
13006unsafe extern "C" {
13007 pub static message_note_b8: NotificationMessage;
13008}
13009unsafe extern "C" {
13010 #[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"]
13011 pub fn notification_messages_notes_frequency_from_name(
13012 note_name: *const core::ffi::c_char,
13013 ) -> f32;
13014}
13015unsafe extern "C" {
13016 #[doc = "Messages"]
13017 pub static message_display_backlight_on: NotificationMessage;
13018}
13019unsafe extern "C" {
13020 pub static message_display_backlight_off: NotificationMessage;
13021}
13022unsafe extern "C" {
13023 pub static message_display_backlight_enforce_on: NotificationMessage;
13024}
13025unsafe extern "C" {
13026 pub static message_display_backlight_enforce_auto: NotificationMessage;
13027}
13028unsafe extern "C" {
13029 pub static message_red_255: NotificationMessage;
13030}
13031unsafe extern "C" {
13032 pub static message_green_255: NotificationMessage;
13033}
13034unsafe extern "C" {
13035 pub static message_blue_255: NotificationMessage;
13036}
13037unsafe extern "C" {
13038 pub static message_red_0: NotificationMessage;
13039}
13040unsafe extern "C" {
13041 pub static message_green_0: NotificationMessage;
13042}
13043unsafe extern "C" {
13044 pub static message_blue_0: NotificationMessage;
13045}
13046unsafe extern "C" {
13047 pub static message_blink_start_10: NotificationMessage;
13048}
13049unsafe extern "C" {
13050 pub static message_blink_start_100: NotificationMessage;
13051}
13052unsafe extern "C" {
13053 pub static message_blink_stop: NotificationMessage;
13054}
13055unsafe extern "C" {
13056 pub static message_blink_set_color_red: NotificationMessage;
13057}
13058unsafe extern "C" {
13059 pub static message_blink_set_color_green: NotificationMessage;
13060}
13061unsafe extern "C" {
13062 pub static message_blink_set_color_blue: NotificationMessage;
13063}
13064unsafe extern "C" {
13065 pub static message_blink_set_color_cyan: NotificationMessage;
13066}
13067unsafe extern "C" {
13068 pub static message_blink_set_color_magenta: NotificationMessage;
13069}
13070unsafe extern "C" {
13071 pub static message_blink_set_color_yellow: NotificationMessage;
13072}
13073unsafe extern "C" {
13074 pub static message_blink_set_color_white: NotificationMessage;
13075}
13076unsafe extern "C" {
13077 pub static message_delay_1: NotificationMessage;
13078}
13079unsafe extern "C" {
13080 pub static message_delay_10: NotificationMessage;
13081}
13082unsafe extern "C" {
13083 pub static message_delay_25: NotificationMessage;
13084}
13085unsafe extern "C" {
13086 pub static message_delay_50: NotificationMessage;
13087}
13088unsafe extern "C" {
13089 pub static message_delay_100: NotificationMessage;
13090}
13091unsafe extern "C" {
13092 pub static message_delay_250: NotificationMessage;
13093}
13094unsafe extern "C" {
13095 pub static message_delay_500: NotificationMessage;
13096}
13097unsafe extern "C" {
13098 pub static message_delay_1000: NotificationMessage;
13099}
13100unsafe extern "C" {
13101 pub static message_sound_off: NotificationMessage;
13102}
13103unsafe extern "C" {
13104 pub static message_vibro_on: NotificationMessage;
13105}
13106unsafe extern "C" {
13107 pub static message_vibro_off: NotificationMessage;
13108}
13109unsafe extern "C" {
13110 pub static message_do_not_reset: NotificationMessage;
13111}
13112unsafe extern "C" {
13113 pub static message_force_speaker_volume_setting_1f: NotificationMessage;
13114}
13115unsafe extern "C" {
13116 pub static message_force_vibro_setting_on: NotificationMessage;
13117}
13118unsafe extern "C" {
13119 pub static message_force_vibro_setting_off: NotificationMessage;
13120}
13121unsafe extern "C" {
13122 pub static message_force_display_brightness_setting_1f: NotificationMessage;
13123}
13124unsafe extern "C" {
13125 pub static message_lcd_contrast_update: NotificationMessage;
13126}
13127unsafe extern "C" {
13128 #[doc = "Message sequences"]
13129 pub static sequence_reset_red: NotificationSequence;
13130}
13131unsafe extern "C" {
13132 pub static sequence_reset_green: NotificationSequence;
13133}
13134unsafe extern "C" {
13135 pub static sequence_reset_blue: NotificationSequence;
13136}
13137unsafe extern "C" {
13138 pub static sequence_reset_rgb: NotificationSequence;
13139}
13140unsafe extern "C" {
13141 pub static sequence_reset_display: NotificationSequence;
13142}
13143unsafe extern "C" {
13144 pub static sequence_reset_sound: NotificationSequence;
13145}
13146unsafe extern "C" {
13147 pub static sequence_reset_vibro: NotificationSequence;
13148}
13149unsafe extern "C" {
13150 pub static sequence_set_vibro_on: NotificationSequence;
13151}
13152unsafe extern "C" {
13153 #[doc = "Display: backlight wakeup"]
13154 pub static sequence_display_backlight_on: NotificationSequence;
13155}
13156unsafe extern "C" {
13157 #[doc = "Display: backlight force off"]
13158 pub static sequence_display_backlight_off: NotificationSequence;
13159}
13160unsafe extern "C" {
13161 #[doc = "Display: backlight force off after a delay of 1000ms"]
13162 pub static sequence_display_backlight_off_delay_1000: NotificationSequence;
13163}
13164unsafe extern "C" {
13165 #[doc = "Display: backlight always on lock"]
13166 pub static sequence_display_backlight_enforce_on: NotificationSequence;
13167}
13168unsafe extern "C" {
13169 #[doc = "Display: backlight always on unlock"]
13170 pub static sequence_display_backlight_enforce_auto: NotificationSequence;
13171}
13172unsafe extern "C" {
13173 pub static sequence_charging: NotificationSequence;
13174}
13175unsafe extern "C" {
13176 pub static sequence_charged: NotificationSequence;
13177}
13178unsafe extern "C" {
13179 pub static sequence_not_charging: NotificationSequence;
13180}
13181unsafe extern "C" {
13182 pub static sequence_set_only_red_255: NotificationSequence;
13183}
13184unsafe extern "C" {
13185 pub static sequence_set_only_green_255: NotificationSequence;
13186}
13187unsafe extern "C" {
13188 pub static sequence_set_only_blue_255: NotificationSequence;
13189}
13190unsafe extern "C" {
13191 pub static sequence_set_red_255: NotificationSequence;
13192}
13193unsafe extern "C" {
13194 pub static sequence_set_green_255: NotificationSequence;
13195}
13196unsafe extern "C" {
13197 pub static sequence_set_blue_255: NotificationSequence;
13198}
13199unsafe extern "C" {
13200 pub static sequence_solid_yellow: NotificationSequence;
13201}
13202unsafe extern "C" {
13203 pub static sequence_blink_blue_10: NotificationSequence;
13204}
13205unsafe extern "C" {
13206 pub static sequence_blink_red_10: NotificationSequence;
13207}
13208unsafe extern "C" {
13209 pub static sequence_blink_green_10: NotificationSequence;
13210}
13211unsafe extern "C" {
13212 pub static sequence_blink_yellow_10: NotificationSequence;
13213}
13214unsafe extern "C" {
13215 pub static sequence_blink_cyan_10: NotificationSequence;
13216}
13217unsafe extern "C" {
13218 pub static sequence_blink_magenta_10: NotificationSequence;
13219}
13220unsafe extern "C" {
13221 pub static sequence_blink_red_100: NotificationSequence;
13222}
13223unsafe extern "C" {
13224 pub static sequence_blink_green_100: NotificationSequence;
13225}
13226unsafe extern "C" {
13227 pub static sequence_blink_blue_100: NotificationSequence;
13228}
13229unsafe extern "C" {
13230 pub static sequence_blink_yellow_100: NotificationSequence;
13231}
13232unsafe extern "C" {
13233 pub static sequence_blink_cyan_100: NotificationSequence;
13234}
13235unsafe extern "C" {
13236 pub static sequence_blink_magenta_100: NotificationSequence;
13237}
13238unsafe extern "C" {
13239 pub static sequence_blink_white_100: NotificationSequence;
13240}
13241unsafe extern "C" {
13242 pub static sequence_blink_start_blue: NotificationSequence;
13243}
13244unsafe extern "C" {
13245 pub static sequence_blink_start_red: NotificationSequence;
13246}
13247unsafe extern "C" {
13248 pub static sequence_blink_start_green: NotificationSequence;
13249}
13250unsafe extern "C" {
13251 pub static sequence_blink_start_yellow: NotificationSequence;
13252}
13253unsafe extern "C" {
13254 pub static sequence_blink_start_cyan: NotificationSequence;
13255}
13256unsafe extern "C" {
13257 pub static sequence_blink_start_magenta: NotificationSequence;
13258}
13259unsafe extern "C" {
13260 pub static sequence_blink_stop: NotificationSequence;
13261}
13262unsafe extern "C" {
13263 pub static sequence_single_vibro: NotificationSequence;
13264}
13265unsafe extern "C" {
13266 pub static sequence_double_vibro: NotificationSequence;
13267}
13268unsafe extern "C" {
13269 pub static sequence_success: NotificationSequence;
13270}
13271unsafe extern "C" {
13272 pub static sequence_semi_success: NotificationSequence;
13273}
13274unsafe extern "C" {
13275 pub static sequence_error: NotificationSequence;
13276}
13277unsafe extern "C" {
13278 pub static sequence_audiovisual_alert: NotificationSequence;
13279}
13280unsafe extern "C" {
13281 pub static sequence_lcd_contrast_update: NotificationSequence;
13282}
13283unsafe extern "C" {
13284 pub static sequence_empty: NotificationSequence;
13285}
13286#[repr(C)]
13287#[derive(Debug, Copy, Clone)]
13288pub struct Power {
13289 _unused: [u8; 0],
13290}
13291pub const PowerBootModeNormal: PowerBootMode = PowerBootMode(0);
13292pub const PowerBootModeDfu: PowerBootMode = PowerBootMode(1);
13293pub const PowerBootModeUpdateStart: PowerBootMode = PowerBootMode(2);
13294#[repr(transparent)]
13295#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13296pub struct PowerBootMode(pub core::ffi::c_uchar);
13297pub const PowerEventTypeStopCharging: PowerEventType = PowerEventType(0);
13298pub const PowerEventTypeStartCharging: PowerEventType = PowerEventType(1);
13299pub const PowerEventTypeFullyCharged: PowerEventType = PowerEventType(2);
13300pub const PowerEventTypeBatteryLevelChanged: PowerEventType = PowerEventType(3);
13301#[repr(transparent)]
13302#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13303pub struct PowerEventType(pub core::ffi::c_uchar);
13304#[repr(C)]
13305#[derive(Copy, Clone)]
13306pub union PowerEventData {
13307 pub battery_level: u8,
13308}
13309#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13310const _: () = {
13311 ["Size of PowerEventData"][::core::mem::size_of::<PowerEventData>() - 1usize];
13312 ["Alignment of PowerEventData"][::core::mem::align_of::<PowerEventData>() - 1usize];
13313 ["Offset of field: PowerEventData::battery_level"]
13314 [::core::mem::offset_of!(PowerEventData, battery_level) - 0usize];
13315};
13316#[repr(C)]
13317#[derive(Copy, Clone)]
13318pub struct PowerEvent {
13319 pub type_: PowerEventType,
13320 pub data: PowerEventData,
13321}
13322#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13323const _: () = {
13324 ["Size of PowerEvent"][::core::mem::size_of::<PowerEvent>() - 2usize];
13325 ["Alignment of PowerEvent"][::core::mem::align_of::<PowerEvent>() - 1usize];
13326 ["Offset of field: PowerEvent::type_"][::core::mem::offset_of!(PowerEvent, type_) - 0usize];
13327 ["Offset of field: PowerEvent::data"][::core::mem::offset_of!(PowerEvent, data) - 1usize];
13328};
13329#[repr(C)]
13330#[derive(Debug, Copy, Clone)]
13331pub struct PowerInfo {
13332 pub gauge_is_ok: bool,
13333 pub is_charging: bool,
13334 pub is_shutdown_requested: bool,
13335 pub is_otg_enabled: bool,
13336 pub current_charger: f32,
13337 pub current_gauge: f32,
13338 pub voltage_battery_charge_limit: f32,
13339 pub voltage_charger: f32,
13340 pub voltage_gauge: f32,
13341 pub voltage_vbus: f32,
13342 pub capacity_remaining: u32,
13343 pub capacity_full: u32,
13344 pub temperature_charger: f32,
13345 pub temperature_gauge: f32,
13346 pub charge: u8,
13347 pub health: u8,
13348}
13349#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13350const _: () = {
13351 ["Size of PowerInfo"][::core::mem::size_of::<PowerInfo>() - 48usize];
13352 ["Alignment of PowerInfo"][::core::mem::align_of::<PowerInfo>() - 4usize];
13353 ["Offset of field: PowerInfo::gauge_is_ok"]
13354 [::core::mem::offset_of!(PowerInfo, gauge_is_ok) - 0usize];
13355 ["Offset of field: PowerInfo::is_charging"]
13356 [::core::mem::offset_of!(PowerInfo, is_charging) - 1usize];
13357 ["Offset of field: PowerInfo::is_shutdown_requested"]
13358 [::core::mem::offset_of!(PowerInfo, is_shutdown_requested) - 2usize];
13359 ["Offset of field: PowerInfo::is_otg_enabled"]
13360 [::core::mem::offset_of!(PowerInfo, is_otg_enabled) - 3usize];
13361 ["Offset of field: PowerInfo::current_charger"]
13362 [::core::mem::offset_of!(PowerInfo, current_charger) - 4usize];
13363 ["Offset of field: PowerInfo::current_gauge"]
13364 [::core::mem::offset_of!(PowerInfo, current_gauge) - 8usize];
13365 ["Offset of field: PowerInfo::voltage_battery_charge_limit"]
13366 [::core::mem::offset_of!(PowerInfo, voltage_battery_charge_limit) - 12usize];
13367 ["Offset of field: PowerInfo::voltage_charger"]
13368 [::core::mem::offset_of!(PowerInfo, voltage_charger) - 16usize];
13369 ["Offset of field: PowerInfo::voltage_gauge"]
13370 [::core::mem::offset_of!(PowerInfo, voltage_gauge) - 20usize];
13371 ["Offset of field: PowerInfo::voltage_vbus"]
13372 [::core::mem::offset_of!(PowerInfo, voltage_vbus) - 24usize];
13373 ["Offset of field: PowerInfo::capacity_remaining"]
13374 [::core::mem::offset_of!(PowerInfo, capacity_remaining) - 28usize];
13375 ["Offset of field: PowerInfo::capacity_full"]
13376 [::core::mem::offset_of!(PowerInfo, capacity_full) - 32usize];
13377 ["Offset of field: PowerInfo::temperature_charger"]
13378 [::core::mem::offset_of!(PowerInfo, temperature_charger) - 36usize];
13379 ["Offset of field: PowerInfo::temperature_gauge"]
13380 [::core::mem::offset_of!(PowerInfo, temperature_gauge) - 40usize];
13381 ["Offset of field: PowerInfo::charge"][::core::mem::offset_of!(PowerInfo, charge) - 44usize];
13382 ["Offset of field: PowerInfo::health"][::core::mem::offset_of!(PowerInfo, health) - 45usize];
13383};
13384unsafe extern "C" {
13385 #[doc = "Power off device"]
13386 pub fn power_off(power: *mut Power);
13387}
13388unsafe extern "C" {
13389 #[doc = "Reboot device\n\n # Arguments\n\n* `mode` - PowerBootMode"]
13390 pub fn power_reboot(power: *mut Power, mode: PowerBootMode);
13391}
13392unsafe extern "C" {
13393 #[doc = "Get power info\n\n # Arguments\n\n* `power` - Power instance\n * `info` - PowerInfo instance"]
13394 pub fn power_get_info(power: *mut Power, info: *mut PowerInfo);
13395}
13396unsafe extern "C" {
13397 #[doc = "Get power event pubsub handler\n\n # Arguments\n\n* `power` - Power instance\n\n # Returns\n\nFuriPubSub instance"]
13398 pub fn power_get_pubsub(power: *mut Power) -> *mut FuriPubSub;
13399}
13400unsafe extern "C" {
13401 #[doc = "Check battery health\n\n # Returns\n\ntrue if battery is healthy"]
13402 pub fn power_is_battery_healthy(power: *mut Power) -> bool;
13403}
13404unsafe extern "C" {
13405 #[doc = "Enable or disable battery low level notification message\n\n # Arguments\n\n* `power` - Power instance\n * `enable` - true - enable, false - disable"]
13406 pub fn power_enable_low_battery_level_notification(power: *mut Power, enable: bool);
13407}
13408unsafe extern "C" {
13409 #[doc = "Enable or disable OTG\n\n # Arguments\n\n* `power` - Power instance\n * `enable` - true - enable, false - disable"]
13410 pub fn power_enable_otg(power: *mut Power, enable: bool);
13411}
13412unsafe extern "C" {
13413 #[doc = "Check OTG status\n\n # Returns\n\ntrue if OTG is requested"]
13414 pub fn power_is_otg_enabled(power: *mut Power) -> bool;
13415}
13416#[repr(C)]
13417#[derive(Debug, Copy, Clone)]
13418pub struct Rpc {
13419 _unused: [u8; 0],
13420}
13421#[repr(C)]
13422#[derive(Debug, Copy, Clone)]
13423pub struct RpcSession {
13424 _unused: [u8; 0],
13425}
13426#[doc = "Callback to send to client any data (e.g. response to command)"]
13427pub type RpcSendBytesCallback = ::core::option::Option<
13428 unsafe extern "C" fn(context: *mut core::ffi::c_void, bytes: *mut u8, bytes_len: usize),
13429>;
13430#[doc = "Callback to notify client that buffer is empty"]
13431pub type RpcBufferIsEmptyCallback =
13432 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
13433#[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."]
13434pub type RpcSessionClosedCallback =
13435 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
13436#[doc = "Callback to notify transport layer that session was closed\n and all operations were finished"]
13437pub type RpcSessionTerminatedCallback =
13438 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
13439pub const RpcOwnerUnknown: RpcOwner = RpcOwner(0);
13440pub const RpcOwnerBle: RpcOwner = RpcOwner(1);
13441pub const RpcOwnerUsb: RpcOwner = RpcOwner(2);
13442pub const RpcOwnerUart: RpcOwner = RpcOwner(3);
13443pub const RpcOwnerCount: RpcOwner = RpcOwner(4);
13444#[repr(transparent)]
13445#[doc = "RPC owner"]
13446#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13447pub struct RpcOwner(pub core::ffi::c_uchar);
13448unsafe extern "C" {
13449 #[doc = "Get RPC session owner\n\n # Arguments\n\n* `session` - pointer to RpcSession descriptor\n # Returns\n\nsession owner"]
13450 pub fn rpc_session_get_owner(session: *mut RpcSession) -> RpcOwner;
13451}
13452unsafe extern "C" {
13453 #[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"]
13454 pub fn rpc_session_open(rpc: *mut Rpc, owner: RpcOwner) -> *mut RpcSession;
13455}
13456unsafe extern "C" {
13457 #[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"]
13458 pub fn rpc_session_close(session: *mut RpcSession);
13459}
13460unsafe extern "C" {
13461 #[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"]
13462 pub fn rpc_session_set_context(session: *mut RpcSession, context: *mut core::ffi::c_void);
13463}
13464unsafe extern "C" {
13465 #[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)"]
13466 pub fn rpc_session_set_send_bytes_callback(
13467 session: *mut RpcSession,
13468 callback: RpcSendBytesCallback,
13469 );
13470}
13471unsafe extern "C" {
13472 #[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"]
13473 pub fn rpc_session_set_buffer_is_empty_callback(
13474 session: *mut RpcSession,
13475 callback: RpcBufferIsEmptyCallback,
13476 );
13477}
13478unsafe extern "C" {
13479 #[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)"]
13480 pub fn rpc_session_set_close_callback(
13481 session: *mut RpcSession,
13482 callback: RpcSessionClosedCallback,
13483 );
13484}
13485unsafe extern "C" {
13486 #[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"]
13487 pub fn rpc_session_set_terminated_callback(
13488 session: *mut RpcSession,
13489 callback: RpcSessionTerminatedCallback,
13490 );
13491}
13492unsafe extern "C" {
13493 #[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"]
13494 pub fn rpc_session_feed(
13495 session: *mut RpcSession,
13496 buffer: *const u8,
13497 size: usize,
13498 timeout: u32,
13499 ) -> usize;
13500}
13501unsafe extern "C" {
13502 #[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"]
13503 pub fn rpc_session_get_available_size(session: *mut RpcSession) -> usize;
13504}
13505pub const RpcAppSystemErrorCodeNone: RpcAppSystemErrorCode = RpcAppSystemErrorCode(0);
13506#[doc = "There are no errors"]
13507pub const RpcAppSystemErrorCodeParseFile: RpcAppSystemErrorCode = RpcAppSystemErrorCode(1);
13508#[doc = "File parsing error, or wrong file structure, or missing required parameters. more accurate data can be obtained through the debug port"]
13509pub const RpcAppSystemErrorCodeRegionLock: RpcAppSystemErrorCode = RpcAppSystemErrorCode(2);
13510#[doc = "Requested function is blocked by regional settings"]
13511pub const RpcAppSystemErrorCodeInternalParse: RpcAppSystemErrorCode = RpcAppSystemErrorCode(3);
13512#[repr(transparent)]
13513#[doc = "Enumeration of possible error codes for application which can be started through rpc"]
13514#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13515pub struct RpcAppSystemErrorCode(pub core::ffi::c_uchar);
13516#[doc = "< No data is provided by the event."]
13517pub const RpcAppSystemEventDataTypeNone: RpcAppSystemEventDataType = RpcAppSystemEventDataType(0);
13518#[doc = "< Event data contains a zero-terminated string."]
13519pub const RpcAppSystemEventDataTypeString: RpcAppSystemEventDataType = RpcAppSystemEventDataType(1);
13520#[doc = "< Event data contains a signed 32-bit integer."]
13521pub const RpcAppSystemEventDataTypeInt32: RpcAppSystemEventDataType = RpcAppSystemEventDataType(2);
13522#[doc = "< Event data contains zero or more bytes."]
13523pub const RpcAppSystemEventDataTypeBytes: RpcAppSystemEventDataType = RpcAppSystemEventDataType(3);
13524#[repr(transparent)]
13525#[doc = "Enumeration of possible event data types."]
13526#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13527pub struct RpcAppSystemEventDataType(pub core::ffi::c_uchar);
13528#[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."]
13529#[repr(C)]
13530#[derive(Copy, Clone)]
13531pub struct RpcAppSystemEventData {
13532 #[doc = "< Type of the data. The meaning of other fields depends on this one."]
13533 pub type_: RpcAppSystemEventDataType,
13534 pub __bindgen_anon_1: RpcAppSystemEventData__bindgen_ty_1,
13535}
13536#[repr(C)]
13537#[derive(Copy, Clone)]
13538pub union RpcAppSystemEventData__bindgen_ty_1 {
13539 #[doc = "< Pointer to a zero-terminated character string."]
13540 pub string: *const core::ffi::c_char,
13541 #[doc = "< Signed 32-bit integer value."]
13542 pub i32_: i32,
13543 #[doc = "< Byte array of arbitrary length."]
13544 pub bytes: RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1,
13545}
13546#[repr(C)]
13547#[derive(Debug, Copy, Clone)]
13548pub struct RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1 {
13549 #[doc = "< Pointer to the byte array data."]
13550 pub ptr: *const u8,
13551 #[doc = "< Size of the byte array, in bytes."]
13552 pub size: usize,
13553}
13554#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13555const _: () = {
13556 ["Size of RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1"]
13557 [::core::mem::size_of::<RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1>() - 8usize];
13558 ["Alignment of RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1"]
13559 [::core::mem::align_of::<RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1>() - 4usize];
13560 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1::ptr"]
13561 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1, ptr) - 0usize];
13562 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1::size"]
13563 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1__bindgen_ty_1, size) - 4usize];
13564};
13565#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13566const _: () = {
13567 ["Size of RpcAppSystemEventData__bindgen_ty_1"]
13568 [::core::mem::size_of::<RpcAppSystemEventData__bindgen_ty_1>() - 8usize];
13569 ["Alignment of RpcAppSystemEventData__bindgen_ty_1"]
13570 [::core::mem::align_of::<RpcAppSystemEventData__bindgen_ty_1>() - 4usize];
13571 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1::string"]
13572 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1, string) - 0usize];
13573 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1::i32_"]
13574 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1, i32_) - 0usize];
13575 ["Offset of field: RpcAppSystemEventData__bindgen_ty_1::bytes"]
13576 [::core::mem::offset_of!(RpcAppSystemEventData__bindgen_ty_1, bytes) - 0usize];
13577};
13578#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13579const _: () = {
13580 ["Size of RpcAppSystemEventData"][::core::mem::size_of::<RpcAppSystemEventData>() - 12usize];
13581 ["Alignment of RpcAppSystemEventData"]
13582 [::core::mem::align_of::<RpcAppSystemEventData>() - 4usize];
13583 ["Offset of field: RpcAppSystemEventData::type_"]
13584 [::core::mem::offset_of!(RpcAppSystemEventData, type_) - 0usize];
13585};
13586#[doc = "Denotes an invalid state.\n\n An event of this type shall never be passed into the callback."]
13587pub const RpcAppEventTypeInvalid: RpcAppSystemEventType = RpcAppSystemEventType(0);
13588#[doc = "The client side has closed the session.\n\n After receiving this event, the RPC context is no more valid."]
13589pub const RpcAppEventTypeSessionClose: RpcAppSystemEventType = RpcAppSystemEventType(1);
13590#[doc = "The client has requested the application to exit.\n\n The application must exit after receiving this command."]
13591pub const RpcAppEventTypeAppExit: RpcAppSystemEventType = RpcAppSystemEventType(2);
13592#[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."]
13593pub const RpcAppEventTypeLoadFile: RpcAppSystemEventType = RpcAppSystemEventType(3);
13594#[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."]
13595pub const RpcAppEventTypeButtonPress: RpcAppSystemEventType = RpcAppSystemEventType(4);
13596#[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."]
13597pub const RpcAppEventTypeButtonRelease: RpcAppSystemEventType = RpcAppSystemEventType(5);
13598#[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."]
13599pub const RpcAppEventTypeButtonPressRelease: RpcAppSystemEventType = RpcAppSystemEventType(6);
13600#[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."]
13601pub const RpcAppEventTypeDataExchange: RpcAppSystemEventType = RpcAppSystemEventType(7);
13602#[repr(transparent)]
13603#[doc = "Enumeration of possible event types."]
13604#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13605pub struct RpcAppSystemEventType(pub core::ffi::c_uchar);
13606#[doc = "RPC application subsystem event structure."]
13607#[repr(C)]
13608#[derive(Copy, Clone)]
13609pub struct RpcAppSystemEvent {
13610 #[doc = "< Type of the event."]
13611 pub type_: RpcAppSystemEventType,
13612 #[doc = "< Data associated with the event."]
13613 pub data: RpcAppSystemEventData,
13614}
13615#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13616const _: () = {
13617 ["Size of RpcAppSystemEvent"][::core::mem::size_of::<RpcAppSystemEvent>() - 16usize];
13618 ["Alignment of RpcAppSystemEvent"][::core::mem::align_of::<RpcAppSystemEvent>() - 4usize];
13619 ["Offset of field: RpcAppSystemEvent::type_"]
13620 [::core::mem::offset_of!(RpcAppSystemEvent, type_) - 0usize];
13621 ["Offset of field: RpcAppSystemEvent::data"]
13622 [::core::mem::offset_of!(RpcAppSystemEvent, data) - 4usize];
13623};
13624#[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."]
13625pub type RpcAppSystemCallback = ::core::option::Option<
13626 unsafe extern "C" fn(event: *const RpcAppSystemEvent, context: *mut core::ffi::c_void),
13627>;
13628#[repr(C)]
13629#[derive(Debug, Copy, Clone)]
13630pub struct RpcAppSystem {
13631 _unused: [u8; 0],
13632}
13633unsafe extern "C" {
13634 #[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."]
13635 pub fn rpc_system_app_set_callback(
13636 rpc_app: *mut RpcAppSystem,
13637 callback: RpcAppSystemCallback,
13638 context: *mut core::ffi::c_void,
13639 );
13640}
13641unsafe extern "C" {
13642 #[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."]
13643 pub fn rpc_system_app_send_started(rpc_app: *mut RpcAppSystem);
13644}
13645unsafe extern "C" {
13646 #[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."]
13647 pub fn rpc_system_app_send_exited(rpc_app: *mut RpcAppSystem);
13648}
13649unsafe extern "C" {
13650 #[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)."]
13651 pub fn rpc_system_app_confirm(rpc_app: *mut RpcAppSystem, result: bool);
13652}
13653unsafe extern "C" {
13654 #[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."]
13655 pub fn rpc_system_app_set_error_code(rpc_app: *mut RpcAppSystem, error_code: u32);
13656}
13657unsafe extern "C" {
13658 #[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."]
13659 pub fn rpc_system_app_set_error_text(
13660 rpc_app: *mut RpcAppSystem,
13661 error_text: *const core::ffi::c_char,
13662 );
13663}
13664unsafe extern "C" {
13665 #[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."]
13666 pub fn rpc_system_app_error_reset(rpc_app: *mut RpcAppSystem);
13667}
13668unsafe extern "C" {
13669 #[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."]
13670 pub fn rpc_system_app_exchange_data(
13671 rpc_app: *mut RpcAppSystem,
13672 data: *const u8,
13673 data_size: usize,
13674 );
13675}
13676pub const BitLibParityEven: BitLibParity = BitLibParity(0);
13677pub const BitLibParityOdd: BitLibParity = BitLibParity(1);
13678pub const BitLibParityAlways0: BitLibParity = BitLibParity(2);
13679pub const BitLibParityAlways1: BitLibParity = BitLibParity(3);
13680#[repr(transparent)]
13681#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
13682pub struct BitLibParity(pub core::ffi::c_uchar);
13683unsafe extern "C" {
13684 #[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"]
13685 pub fn bit_lib_push_bit(data: *mut u8, data_size: usize, bit: bool);
13686}
13687unsafe extern "C" {
13688 #[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"]
13689 pub fn bit_lib_set_bit(data: *mut u8, position: usize, bit: bool);
13690}
13691unsafe extern "C" {
13692 #[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."]
13693 pub fn bit_lib_set_bits(data: *mut u8, position: usize, byte: u8, length: u8);
13694}
13695unsafe extern "C" {
13696 #[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."]
13697 pub fn bit_lib_get_bit(data: *const u8, position: usize) -> bool;
13698}
13699unsafe extern "C" {
13700 #[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."]
13701 pub fn bit_lib_get_bits(data: *const u8, position: usize, length: u8) -> u8;
13702}
13703unsafe extern "C" {
13704 #[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."]
13705 pub fn bit_lib_get_bits_16(data: *const u8, position: usize, length: u8) -> u16;
13706}
13707unsafe extern "C" {
13708 #[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."]
13709 pub fn bit_lib_get_bits_32(data: *const u8, position: usize, length: u8) -> u32;
13710}
13711unsafe extern "C" {
13712 #[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."]
13713 pub fn bit_lib_get_bits_64(data: *const u8, position: usize, length: u8) -> u64;
13714}
13715unsafe extern "C" {
13716 #[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"]
13717 pub fn bit_lib_test_parity_32(bits: u32, parity: BitLibParity) -> bool;
13718}
13719unsafe extern "C" {
13720 #[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"]
13721 pub fn bit_lib_test_parity(
13722 data: *const u8,
13723 position: usize,
13724 length: u8,
13725 parity: BitLibParity,
13726 parity_length: u8,
13727 ) -> bool;
13728}
13729unsafe extern "C" {
13730 #[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"]
13731 pub fn bit_lib_add_parity(
13732 data: *const u8,
13733 position: usize,
13734 dest: *mut u8,
13735 dest_position: usize,
13736 source_length: u8,
13737 parity_length: u8,
13738 parity: BitLibParity,
13739 ) -> usize;
13740}
13741unsafe extern "C" {
13742 #[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"]
13743 pub fn bit_lib_remove_bit_every_nth(data: *mut u8, position: usize, length: u8, n: u8)
13744 -> usize;
13745}
13746unsafe extern "C" {
13747 #[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"]
13748 pub fn bit_lib_copy_bits(
13749 data: *mut u8,
13750 position: usize,
13751 length: usize,
13752 source: *const u8,
13753 source_position: usize,
13754 );
13755}
13756unsafe extern "C" {
13757 #[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"]
13758 pub fn bit_lib_reverse_bits(data: *mut u8, position: usize, length: u8);
13759}
13760unsafe extern "C" {
13761 #[doc = "Count 1 bits in data\n\n # Arguments\n\n* `data` -\n # Returns\n\nuint8_t set bit count"]
13762 pub fn bit_lib_get_bit_count(data: u32) -> u8;
13763}
13764unsafe extern "C" {
13765 #[doc = "Print data as bit array\n\n # Arguments\n\n* `data` -\n * `length` -"]
13766 pub fn bit_lib_print_bits(data: *const u8, length: usize);
13767}
13768#[repr(C)]
13769#[derive(Debug, Copy, Clone)]
13770pub struct BitLibRegion {
13771 pub mark: core::ffi::c_char,
13772 pub start: usize,
13773 pub length: usize,
13774}
13775#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13776const _: () = {
13777 ["Size of BitLibRegion"][::core::mem::size_of::<BitLibRegion>() - 12usize];
13778 ["Alignment of BitLibRegion"][::core::mem::align_of::<BitLibRegion>() - 4usize];
13779 ["Offset of field: BitLibRegion::mark"][::core::mem::offset_of!(BitLibRegion, mark) - 0usize];
13780 ["Offset of field: BitLibRegion::start"][::core::mem::offset_of!(BitLibRegion, start) - 4usize];
13781 ["Offset of field: BitLibRegion::length"]
13782 [::core::mem::offset_of!(BitLibRegion, length) - 8usize];
13783};
13784unsafe extern "C" {
13785 #[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` -"]
13786 pub fn bit_lib_print_regions(
13787 regions: *const BitLibRegion,
13788 region_count: usize,
13789 data: *const u8,
13790 length: usize,
13791 );
13792}
13793unsafe extern "C" {
13794 #[doc = "Reverse bits in uint16_t, faster than generic bit_lib_reverse_bits.\n\n # Arguments\n\n* `data` -\n # Returns\n\nuint16_t"]
13795 pub fn bit_lib_reverse_16_fast(data: u16) -> u16;
13796}
13797unsafe extern "C" {
13798 #[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"]
13799 pub fn bit_lib_reverse_8_fast(byte: u8) -> u8;
13800}
13801unsafe extern "C" {
13802 #[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"]
13803 pub fn bit_lib_crc8(
13804 data: *const u8,
13805 data_size: usize,
13806 polynom: u8,
13807 init: u8,
13808 ref_in: bool,
13809 ref_out: bool,
13810 xor_out: u8,
13811 ) -> u16;
13812}
13813unsafe extern "C" {
13814 #[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"]
13815 pub fn bit_lib_crc16(
13816 data: *const u8,
13817 data_size: usize,
13818 polynom: u16,
13819 init: u16,
13820 ref_in: bool,
13821 ref_out: bool,
13822 xor_out: u16,
13823 ) -> u16;
13824}
13825unsafe extern "C" {
13826 #[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"]
13827 pub fn bit_lib_num_to_bytes_be(src: u64, len: u8, dest: *mut u8);
13828}
13829unsafe extern "C" {
13830 #[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"]
13831 pub fn bit_lib_num_to_bytes_le(src: u64, len: u8, dest: *mut u8);
13832}
13833unsafe extern "C" {
13834 #[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"]
13835 pub fn bit_lib_bytes_to_num_be(src: *const u8, len: u8) -> u64;
13836}
13837unsafe extern "C" {
13838 #[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"]
13839 pub fn bit_lib_bytes_to_num_le(src: *const u8, len: u8) -> u64;
13840}
13841unsafe extern "C" {
13842 #[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"]
13843 pub fn bit_lib_bytes_to_num_bcd(src: *const u8, len: u8, is_bcd: *mut bool) -> u64;
13844}
13845#[doc = "Optional arguments to pass along with profile template as\n FuriHalBleProfileParams for tuning profile behavior"]
13846#[repr(C)]
13847#[derive(Debug, Copy, Clone)]
13848pub struct BleProfileHidParams {
13849 #[doc = "< Prefix for device name. Length must be less than 8"]
13850 pub device_name_prefix: *const core::ffi::c_char,
13851 #[doc = "< XOR mask for device address, for uniqueness"]
13852 pub mac_xor: u16,
13853}
13854#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13855const _: () = {
13856 ["Size of BleProfileHidParams"][::core::mem::size_of::<BleProfileHidParams>() - 8usize];
13857 ["Alignment of BleProfileHidParams"][::core::mem::align_of::<BleProfileHidParams>() - 4usize];
13858 ["Offset of field: BleProfileHidParams::device_name_prefix"]
13859 [::core::mem::offset_of!(BleProfileHidParams, device_name_prefix) - 0usize];
13860 ["Offset of field: BleProfileHidParams::mac_xor"]
13861 [::core::mem::offset_of!(BleProfileHidParams, mac_xor) - 4usize];
13862};
13863#[repr(C)]
13864#[derive(Debug, Copy, Clone)]
13865pub struct BleServiceHid {
13866 _unused: [u8; 0],
13867}
13868#[repr(C)]
13869#[derive(Debug, Copy, Clone)]
13870pub struct DigitalSignal {
13871 _unused: [u8; 0],
13872}
13873unsafe extern "C" {
13874 #[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."]
13875 pub fn digital_signal_add_period(signal: *mut DigitalSignal, ticks: u32);
13876}
13877unsafe extern "C" {
13878 #[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."]
13879 pub fn digital_signal_add_period_with_level(
13880 signal: *mut DigitalSignal,
13881 ticks: u32,
13882 level: bool,
13883 );
13884}
13885unsafe extern "C" {
13886 #[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."]
13887 pub fn digital_signal_get_start_level(signal: *const DigitalSignal) -> bool;
13888}
13889unsafe extern "C" {
13890 #[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."]
13891 pub fn digital_signal_set_start_level(signal: *mut DigitalSignal, level: bool);
13892}
13893unsafe extern "C" {
13894 #[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."]
13895 pub fn digital_signal_get_size(signal: *const DigitalSignal) -> u32;
13896}
13897#[repr(C)]
13898#[derive(Debug, Copy, Clone)]
13899pub struct DigitalSequence {
13900 _unused: [u8; 0],
13901}
13902unsafe extern "C" {
13903 #[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."]
13904 pub fn digital_sequence_register_signal(
13905 sequence: *mut DigitalSequence,
13906 signal_index: u8,
13907 signal: *const DigitalSignal,
13908 );
13909}
13910unsafe extern "C" {
13911 #[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)."]
13912 pub fn digital_sequence_add_signal(sequence: *mut DigitalSequence, signal_index: u8);
13913}
13914unsafe extern "C" {
13915 #[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."]
13916 pub fn digital_sequence_transmit(sequence: *mut DigitalSequence);
13917}
13918unsafe extern "C" {
13919 #[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"]
13920 pub fn st25r3916_read_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: *mut u8);
13921}
13922unsafe extern "C" {
13923 #[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"]
13924 pub fn st25r3916_read_burst_regs(
13925 handle: *const FuriHalSpiBusHandle,
13926 reg_start: u8,
13927 values: *mut u8,
13928 length: u8,
13929 );
13930}
13931unsafe extern "C" {
13932 #[doc = "Write register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `val` - - value to write"]
13933 pub fn st25r3916_write_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: u8);
13934}
13935unsafe extern "C" {
13936 #[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"]
13937 pub fn st25r3916_write_burst_regs(
13938 handle: *const FuriHalSpiBusHandle,
13939 reg_start: u8,
13940 values: *const u8,
13941 length: u8,
13942 );
13943}
13944unsafe extern "C" {
13945 #[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"]
13946 pub fn st25r3916_reg_write_fifo(
13947 handle: *const FuriHalSpiBusHandle,
13948 buff: *const u8,
13949 length: usize,
13950 );
13951}
13952unsafe extern "C" {
13953 #[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"]
13954 pub fn st25r3916_reg_read_fifo(
13955 handle: *const FuriHalSpiBusHandle,
13956 buff: *mut u8,
13957 length: usize,
13958 );
13959}
13960unsafe extern "C" {
13961 #[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"]
13962 pub fn st25r3916_write_pta_mem(
13963 handle: *const FuriHalSpiBusHandle,
13964 values: *const u8,
13965 length: usize,
13966 );
13967}
13968unsafe extern "C" {
13969 #[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"]
13970 pub fn st25r3916_read_pta_mem(
13971 handle: *const FuriHalSpiBusHandle,
13972 values: *mut u8,
13973 length: usize,
13974 );
13975}
13976unsafe extern "C" {
13977 #[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"]
13978 pub fn st25r3916_write_ptf_mem(
13979 handle: *const FuriHalSpiBusHandle,
13980 values: *const u8,
13981 length: usize,
13982 );
13983}
13984unsafe extern "C" {
13985 #[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"]
13986 pub fn st25r3916_write_pttsn_mem(
13987 handle: *const FuriHalSpiBusHandle,
13988 values: *mut u8,
13989 length: usize,
13990 );
13991}
13992unsafe extern "C" {
13993 #[doc = "Send Direct command\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `cmd` - - direct command"]
13994 pub fn st25r3916_direct_cmd(handle: *const FuriHalSpiBusHandle, cmd: u8);
13995}
13996unsafe extern "C" {
13997 #[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"]
13998 pub fn st25r3916_read_test_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: *mut u8);
13999}
14000unsafe extern "C" {
14001 #[doc = "Write test register\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `reg` - - register address\n * `val` - - value to write"]
14002 pub fn st25r3916_write_test_reg(handle: *const FuriHalSpiBusHandle, reg: u8, val: u8);
14003}
14004unsafe extern "C" {
14005 #[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"]
14006 pub fn st25r3916_clear_reg_bits(handle: *const FuriHalSpiBusHandle, reg: u8, clr_mask: u8);
14007}
14008unsafe extern "C" {
14009 #[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"]
14010 pub fn st25r3916_set_reg_bits(handle: *const FuriHalSpiBusHandle, reg: u8, set_mask: u8);
14011}
14012unsafe extern "C" {
14013 #[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"]
14014 pub fn st25r3916_change_reg_bits(
14015 handle: *const FuriHalSpiBusHandle,
14016 reg: u8,
14017 mask: u8,
14018 value: u8,
14019 );
14020}
14021unsafe extern "C" {
14022 #[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"]
14023 pub fn st25r3916_modify_reg(
14024 handle: *const FuriHalSpiBusHandle,
14025 reg: u8,
14026 clr_mask: u8,
14027 set_mask: u8,
14028 );
14029}
14030unsafe extern "C" {
14031 #[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"]
14032 pub fn st25r3916_change_test_reg_bits(
14033 handle: *const FuriHalSpiBusHandle,
14034 reg: u8,
14035 mask: u8,
14036 value: u8,
14037 );
14038}
14039unsafe extern "C" {
14040 #[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"]
14041 pub fn st25r3916_check_reg(
14042 handle: *const FuriHalSpiBusHandle,
14043 reg: u8,
14044 mask: u8,
14045 val: u8,
14046 ) -> bool;
14047}
14048unsafe extern "C" {
14049 #[doc = "Mask st25r3916 interrupts\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n * `mask` - - mask of interrupts to be disabled"]
14050 pub fn st25r3916_mask_irq(handle: *const FuriHalSpiBusHandle, mask: u32);
14051}
14052unsafe extern "C" {
14053 #[doc = "Get st25r3916 interrupts\n\n # Arguments\n\n* `handle` - - pointer to FuriHalSpiBusHandle instance\n\n # Returns\n\nreceived interrupts"]
14054 pub fn st25r3916_get_irq(handle: *const FuriHalSpiBusHandle) -> u32;
14055}
14056unsafe extern "C" {
14057 #[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"]
14058 pub fn st25r3916_write_fifo(handle: *const FuriHalSpiBusHandle, buff: *const u8, bits: usize);
14059}
14060unsafe extern "C" {
14061 #[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"]
14062 pub fn st25r3916_read_fifo(
14063 handle: *const FuriHalSpiBusHandle,
14064 buff: *mut u8,
14065 buff_size: usize,
14066 buff_bits: *mut usize,
14067 ) -> bool;
14068}
14069unsafe extern "C" {
14070 #[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"]
14071 pub fn elf_resolve_from_hashtable(
14072 interface: *const ElfApiInterface,
14073 hash: u32,
14074 address: *mut Elf32_Addr,
14075 ) -> bool;
14076}
14077unsafe extern "C" {
14078 pub fn elf_symbolname_hash(s: *const core::ffi::c_char) -> u32;
14079}
14080#[repr(C)]
14081#[derive(Debug, Copy, Clone)]
14082pub struct CompositeApiResolver {
14083 _unused: [u8; 0],
14084}
14085unsafe extern "C" {
14086 #[doc = "Allocate composite API resolver\n # Returns\n\nCompositeApiResolver* instance"]
14087 pub fn composite_api_resolver_alloc() -> *mut CompositeApiResolver;
14088}
14089unsafe extern "C" {
14090 #[doc = "Free composite API resolver\n # Arguments\n\n* `resolver` - Instance"]
14091 pub fn composite_api_resolver_free(resolver: *mut CompositeApiResolver);
14092}
14093unsafe extern "C" {
14094 #[doc = "Add API resolver to composite resolver\n # Arguments\n\n* `resolver` - Instance\n * `interface` - API resolver"]
14095 pub fn composite_api_resolver_add(
14096 resolver: *mut CompositeApiResolver,
14097 interface: *const ElfApiInterface,
14098 );
14099}
14100unsafe extern "C" {
14101 #[doc = "Get API interface from composite resolver\n # Arguments\n\n* `resolver` - Instance\n # Returns\n\nAPI interface"]
14102 pub fn composite_api_resolver_get(
14103 resolver: *mut CompositeApiResolver,
14104 ) -> *const ElfApiInterface;
14105}
14106#[repr(C)]
14107#[derive(Debug, Copy, Clone)]
14108pub struct PluginManager {
14109 _unused: [u8; 0],
14110}
14111pub const PluginManagerErrorNone: PluginManagerError = PluginManagerError(0);
14112pub const PluginManagerErrorLoaderError: PluginManagerError = PluginManagerError(1);
14113pub const PluginManagerErrorApplicationIdMismatch: PluginManagerError = PluginManagerError(2);
14114pub const PluginManagerErrorAPIVersionMismatch: PluginManagerError = PluginManagerError(3);
14115#[repr(transparent)]
14116#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14117pub struct PluginManagerError(pub core::ffi::c_uchar);
14118unsafe extern "C" {
14119 #[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"]
14120 pub fn plugin_manager_alloc(
14121 application_id: *const core::ffi::c_char,
14122 api_version: u32,
14123 api_interface: *const ElfApiInterface,
14124 ) -> *mut PluginManager;
14125}
14126unsafe extern "C" {
14127 #[doc = "Frees PluginManager\n # Arguments\n\n* `manager` - PluginManager instance"]
14128 pub fn plugin_manager_free(manager: *mut PluginManager);
14129}
14130unsafe extern "C" {
14131 #[doc = "Loads single plugin by full path\n # Arguments\n\n* `manager` - PluginManager instance\n * `path` - Path to plugin\n # Returns\n\nError code"]
14132 pub fn plugin_manager_load_single(
14133 manager: *mut PluginManager,
14134 path: *const core::ffi::c_char,
14135 ) -> PluginManagerError;
14136}
14137unsafe extern "C" {
14138 #[doc = "Loads all plugins from specified directory\n # Arguments\n\n* `manager` - PluginManager instance\n * `path` - Path to directory\n # Returns\n\nError code"]
14139 pub fn plugin_manager_load_all(
14140 manager: *mut PluginManager,
14141 path: *const core::ffi::c_char,
14142 ) -> PluginManagerError;
14143}
14144unsafe extern "C" {
14145 #[doc = "Returns number of loaded plugins\n # Arguments\n\n* `manager` - PluginManager instance\n # Returns\n\nNumber of loaded plugins"]
14146 pub fn plugin_manager_get_count(manager: *mut PluginManager) -> u32;
14147}
14148unsafe extern "C" {
14149 #[doc = "Returns plugin descriptor by index\n # Arguments\n\n* `manager` - PluginManager instance\n * `index` - Plugin index\n # Returns\n\nPlugin descriptor"]
14150 pub fn plugin_manager_get(
14151 manager: *mut PluginManager,
14152 index: u32,
14153 ) -> *const FlipperAppPluginDescriptor;
14154}
14155unsafe extern "C" {
14156 #[doc = "Returns plugin entry point by index\n # Arguments\n\n* `manager` - PluginManager instance\n * `index` - Plugin index\n # Returns\n\nPlugin entry point"]
14157 pub fn plugin_manager_get_ep(
14158 manager: *mut PluginManager,
14159 index: u32,
14160 ) -> *const core::ffi::c_void;
14161}
14162#[repr(C)]
14163#[derive(Debug, Copy, Clone)]
14164pub struct FlipperFormat {
14165 _unused: [u8; 0],
14166}
14167pub const FlipperFormatOffsetFromCurrent: FlipperFormatOffset = FlipperFormatOffset(0);
14168pub const FlipperFormatOffsetFromStart: FlipperFormatOffset = FlipperFormatOffset(1);
14169pub const FlipperFormatOffsetFromEnd: FlipperFormatOffset = FlipperFormatOffset(2);
14170#[repr(transparent)]
14171#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14172pub struct FlipperFormatOffset(pub core::ffi::c_uchar);
14173unsafe extern "C" {
14174 #[doc = "Allocate FlipperFormat as string.\n\n # Returns\n\nFlipperFormat* pointer to a FlipperFormat instance"]
14175 pub fn flipper_format_string_alloc() -> *mut FlipperFormat;
14176}
14177unsafe extern "C" {
14178 #[doc = "Allocate FlipperFormat as file.\n\n # Arguments\n\n* `storage` - The storage\n\n # Returns\n\nFlipperFormat* pointer to a FlipperFormat instance"]
14179 pub fn flipper_format_file_alloc(storage: *mut Storage) -> *mut FlipperFormat;
14180}
14181unsafe extern "C" {
14182 #[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"]
14183 pub fn flipper_format_buffered_file_alloc(storage: *mut Storage) -> *mut FlipperFormat;
14184}
14185unsafe extern "C" {
14186 #[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"]
14187 pub fn flipper_format_file_open_existing(
14188 flipper_format: *mut FlipperFormat,
14189 path: *const core::ffi::c_char,
14190 ) -> bool;
14191}
14192unsafe extern "C" {
14193 #[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"]
14194 pub fn flipper_format_buffered_file_open_existing(
14195 flipper_format: *mut FlipperFormat,
14196 path: *const core::ffi::c_char,
14197 ) -> bool;
14198}
14199unsafe extern "C" {
14200 #[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"]
14201 pub fn flipper_format_file_open_append(
14202 flipper_format: *mut FlipperFormat,
14203 path: *const core::ffi::c_char,
14204 ) -> bool;
14205}
14206unsafe extern "C" {
14207 #[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"]
14208 pub fn flipper_format_file_open_always(
14209 flipper_format: *mut FlipperFormat,
14210 path: *const core::ffi::c_char,
14211 ) -> bool;
14212}
14213unsafe extern "C" {
14214 #[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"]
14215 pub fn flipper_format_buffered_file_open_always(
14216 flipper_format: *mut FlipperFormat,
14217 path: *const core::ffi::c_char,
14218 ) -> bool;
14219}
14220unsafe extern "C" {
14221 #[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"]
14222 pub fn flipper_format_file_open_new(
14223 flipper_format: *mut FlipperFormat,
14224 path: *const core::ffi::c_char,
14225 ) -> bool;
14226}
14227unsafe extern "C" {
14228 #[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"]
14229 pub fn flipper_format_file_close(flipper_format: *mut FlipperFormat) -> bool;
14230}
14231unsafe extern "C" {
14232 #[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"]
14233 pub fn flipper_format_buffered_file_close(flipper_format: *mut FlipperFormat) -> bool;
14234}
14235unsafe extern "C" {
14236 #[doc = "Free FlipperFormat.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance"]
14237 pub fn flipper_format_free(flipper_format: *mut FlipperFormat);
14238}
14239unsafe extern "C" {
14240 #[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."]
14241 pub fn flipper_format_set_strict_mode(flipper_format: *mut FlipperFormat, strict_mode: bool);
14242}
14243unsafe extern "C" {
14244 #[doc = "Rewind the RW pointer.\n\n # Arguments\n\n* `flipper_format` - Pointer to a FlipperFormat instance\n\n # Returns\n\nTrue on success"]
14245 pub fn flipper_format_rewind(flipper_format: *mut FlipperFormat) -> bool;
14246}
14247unsafe extern "C" {
14248 #[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"]
14249 pub fn flipper_format_tell(flipper_format: *mut FlipperFormat) -> usize;
14250}
14251unsafe extern "C" {
14252 #[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"]
14253 pub fn flipper_format_seek(
14254 flipper_format: *mut FlipperFormat,
14255 offset: i32,
14256 anchor: FlipperFormatOffset,
14257 ) -> bool;
14258}
14259unsafe extern "C" {
14260 #[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"]
14261 pub fn flipper_format_seek_to_end(flipper_format: *mut FlipperFormat) -> bool;
14262}
14263unsafe extern "C" {
14264 #[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"]
14265 pub fn flipper_format_key_exist(
14266 flipper_format: *mut FlipperFormat,
14267 key: *const core::ffi::c_char,
14268 ) -> bool;
14269}
14270unsafe extern "C" {
14271 #[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"]
14272 pub fn flipper_format_read_header(
14273 flipper_format: *mut FlipperFormat,
14274 filetype: *mut FuriString,
14275 version: *mut u32,
14276 ) -> bool;
14277}
14278unsafe extern "C" {
14279 #[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"]
14280 pub fn flipper_format_write_header(
14281 flipper_format: *mut FlipperFormat,
14282 filetype: *mut FuriString,
14283 version: u32,
14284 ) -> bool;
14285}
14286unsafe extern "C" {
14287 #[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"]
14288 pub fn flipper_format_write_header_cstr(
14289 flipper_format: *mut FlipperFormat,
14290 filetype: *const core::ffi::c_char,
14291 version: u32,
14292 ) -> bool;
14293}
14294unsafe extern "C" {
14295 #[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"]
14296 pub fn flipper_format_get_value_count(
14297 flipper_format: *mut FlipperFormat,
14298 key: *const core::ffi::c_char,
14299 count: *mut u32,
14300 ) -> bool;
14301}
14302unsafe extern "C" {
14303 #[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"]
14304 pub fn flipper_format_read_string(
14305 flipper_format: *mut FlipperFormat,
14306 key: *const core::ffi::c_char,
14307 data: *mut FuriString,
14308 ) -> bool;
14309}
14310unsafe extern "C" {
14311 #[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"]
14312 pub fn flipper_format_write_string(
14313 flipper_format: *mut FlipperFormat,
14314 key: *const core::ffi::c_char,
14315 data: *mut FuriString,
14316 ) -> bool;
14317}
14318unsafe extern "C" {
14319 #[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"]
14320 pub fn flipper_format_write_string_cstr(
14321 flipper_format: *mut FlipperFormat,
14322 key: *const core::ffi::c_char,
14323 data: *const core::ffi::c_char,
14324 ) -> bool;
14325}
14326unsafe extern "C" {
14327 #[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"]
14328 pub fn flipper_format_read_hex_uint64(
14329 flipper_format: *mut FlipperFormat,
14330 key: *const core::ffi::c_char,
14331 data: *mut u64,
14332 data_size: u16,
14333 ) -> bool;
14334}
14335unsafe extern "C" {
14336 #[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"]
14337 pub fn flipper_format_write_hex_uint64(
14338 flipper_format: *mut FlipperFormat,
14339 key: *const core::ffi::c_char,
14340 data: *const u64,
14341 data_size: u16,
14342 ) -> bool;
14343}
14344unsafe extern "C" {
14345 #[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"]
14346 pub fn flipper_format_read_uint32(
14347 flipper_format: *mut FlipperFormat,
14348 key: *const core::ffi::c_char,
14349 data: *mut u32,
14350 data_size: u16,
14351 ) -> bool;
14352}
14353unsafe extern "C" {
14354 #[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"]
14355 pub fn flipper_format_write_uint32(
14356 flipper_format: *mut FlipperFormat,
14357 key: *const core::ffi::c_char,
14358 data: *const u32,
14359 data_size: u16,
14360 ) -> bool;
14361}
14362unsafe extern "C" {
14363 #[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"]
14364 pub fn flipper_format_read_int32(
14365 flipper_format: *mut FlipperFormat,
14366 key: *const core::ffi::c_char,
14367 data: *mut i32,
14368 data_size: u16,
14369 ) -> bool;
14370}
14371unsafe extern "C" {
14372 #[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"]
14373 pub fn flipper_format_write_int32(
14374 flipper_format: *mut FlipperFormat,
14375 key: *const core::ffi::c_char,
14376 data: *const i32,
14377 data_size: u16,
14378 ) -> bool;
14379}
14380unsafe extern "C" {
14381 #[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"]
14382 pub fn flipper_format_read_bool(
14383 flipper_format: *mut FlipperFormat,
14384 key: *const core::ffi::c_char,
14385 data: *mut bool,
14386 data_size: u16,
14387 ) -> bool;
14388}
14389unsafe extern "C" {
14390 #[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"]
14391 pub fn flipper_format_write_bool(
14392 flipper_format: *mut FlipperFormat,
14393 key: *const core::ffi::c_char,
14394 data: *const bool,
14395 data_size: u16,
14396 ) -> bool;
14397}
14398unsafe extern "C" {
14399 #[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"]
14400 pub fn flipper_format_read_float(
14401 flipper_format: *mut FlipperFormat,
14402 key: *const core::ffi::c_char,
14403 data: *mut f32,
14404 data_size: u16,
14405 ) -> bool;
14406}
14407unsafe extern "C" {
14408 #[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"]
14409 pub fn flipper_format_write_float(
14410 flipper_format: *mut FlipperFormat,
14411 key: *const core::ffi::c_char,
14412 data: *const f32,
14413 data_size: u16,
14414 ) -> bool;
14415}
14416unsafe extern "C" {
14417 #[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"]
14418 pub fn flipper_format_read_hex(
14419 flipper_format: *mut FlipperFormat,
14420 key: *const core::ffi::c_char,
14421 data: *mut u8,
14422 data_size: u16,
14423 ) -> bool;
14424}
14425unsafe extern "C" {
14426 #[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"]
14427 pub fn flipper_format_write_hex(
14428 flipper_format: *mut FlipperFormat,
14429 key: *const core::ffi::c_char,
14430 data: *const u8,
14431 data_size: u16,
14432 ) -> bool;
14433}
14434unsafe extern "C" {
14435 #[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"]
14436 pub fn flipper_format_write_comment(
14437 flipper_format: *mut FlipperFormat,
14438 data: *mut FuriString,
14439 ) -> bool;
14440}
14441unsafe extern "C" {
14442 #[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"]
14443 pub fn flipper_format_write_comment_cstr(
14444 flipper_format: *mut FlipperFormat,
14445 data: *const core::ffi::c_char,
14446 ) -> bool;
14447}
14448unsafe extern "C" {
14449 #[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"]
14450 pub fn flipper_format_write_empty_line(flipper_format: *mut FlipperFormat) -> bool;
14451}
14452unsafe extern "C" {
14453 #[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"]
14454 pub fn flipper_format_delete_key(
14455 flipper_format: *mut FlipperFormat,
14456 key: *const core::ffi::c_char,
14457 ) -> bool;
14458}
14459unsafe extern "C" {
14460 #[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"]
14461 pub fn flipper_format_update_string(
14462 flipper_format: *mut FlipperFormat,
14463 key: *const core::ffi::c_char,
14464 data: *mut FuriString,
14465 ) -> bool;
14466}
14467unsafe extern "C" {
14468 #[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"]
14469 pub fn flipper_format_update_string_cstr(
14470 flipper_format: *mut FlipperFormat,
14471 key: *const core::ffi::c_char,
14472 data: *const core::ffi::c_char,
14473 ) -> bool;
14474}
14475unsafe extern "C" {
14476 #[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"]
14477 pub fn flipper_format_update_uint32(
14478 flipper_format: *mut FlipperFormat,
14479 key: *const core::ffi::c_char,
14480 data: *const u32,
14481 data_size: u16,
14482 ) -> bool;
14483}
14484unsafe extern "C" {
14485 #[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"]
14486 pub fn flipper_format_update_int32(
14487 flipper_format: *mut FlipperFormat,
14488 key: *const core::ffi::c_char,
14489 data: *const i32,
14490 data_size: u16,
14491 ) -> bool;
14492}
14493unsafe extern "C" {
14494 #[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"]
14495 pub fn flipper_format_update_bool(
14496 flipper_format: *mut FlipperFormat,
14497 key: *const core::ffi::c_char,
14498 data: *const bool,
14499 data_size: u16,
14500 ) -> bool;
14501}
14502unsafe extern "C" {
14503 #[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"]
14504 pub fn flipper_format_update_float(
14505 flipper_format: *mut FlipperFormat,
14506 key: *const core::ffi::c_char,
14507 data: *const f32,
14508 data_size: u16,
14509 ) -> bool;
14510}
14511unsafe extern "C" {
14512 #[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"]
14513 pub fn flipper_format_update_hex(
14514 flipper_format: *mut FlipperFormat,
14515 key: *const core::ffi::c_char,
14516 data: *const u8,
14517 data_size: u16,
14518 ) -> bool;
14519}
14520unsafe extern "C" {
14521 #[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"]
14522 pub fn flipper_format_insert_or_update_string(
14523 flipper_format: *mut FlipperFormat,
14524 key: *const core::ffi::c_char,
14525 data: *mut FuriString,
14526 ) -> bool;
14527}
14528unsafe extern "C" {
14529 #[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"]
14530 pub fn flipper_format_insert_or_update_string_cstr(
14531 flipper_format: *mut FlipperFormat,
14532 key: *const core::ffi::c_char,
14533 data: *const core::ffi::c_char,
14534 ) -> bool;
14535}
14536unsafe extern "C" {
14537 #[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"]
14538 pub fn flipper_format_insert_or_update_uint32(
14539 flipper_format: *mut FlipperFormat,
14540 key: *const core::ffi::c_char,
14541 data: *const u32,
14542 data_size: u16,
14543 ) -> bool;
14544}
14545unsafe extern "C" {
14546 #[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"]
14547 pub fn flipper_format_insert_or_update_int32(
14548 flipper_format: *mut FlipperFormat,
14549 key: *const core::ffi::c_char,
14550 data: *const i32,
14551 data_size: u16,
14552 ) -> bool;
14553}
14554unsafe extern "C" {
14555 #[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"]
14556 pub fn flipper_format_insert_or_update_bool(
14557 flipper_format: *mut FlipperFormat,
14558 key: *const core::ffi::c_char,
14559 data: *const bool,
14560 data_size: u16,
14561 ) -> bool;
14562}
14563unsafe extern "C" {
14564 #[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"]
14565 pub fn flipper_format_insert_or_update_float(
14566 flipper_format: *mut FlipperFormat,
14567 key: *const core::ffi::c_char,
14568 data: *const f32,
14569 data_size: u16,
14570 ) -> bool;
14571}
14572unsafe extern "C" {
14573 #[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"]
14574 pub fn flipper_format_insert_or_update_hex(
14575 flipper_format: *mut FlipperFormat,
14576 key: *const core::ffi::c_char,
14577 data: *const u8,
14578 data_size: u16,
14579 ) -> bool;
14580}
14581#[repr(C)]
14582#[derive(Debug, Copy, Clone)]
14583pub struct Stream {
14584 _unused: [u8; 0],
14585}
14586pub const StreamOffsetFromCurrent: StreamOffset = StreamOffset(0);
14587pub const StreamOffsetFromStart: StreamOffset = StreamOffset(1);
14588pub const StreamOffsetFromEnd: StreamOffset = StreamOffset(2);
14589#[repr(transparent)]
14590#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14591pub struct StreamOffset(pub core::ffi::c_uchar);
14592pub const StreamDirectionForward: StreamDirection = StreamDirection(0);
14593pub const StreamDirectionBackward: StreamDirection = StreamDirection(1);
14594#[repr(transparent)]
14595#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14596pub struct StreamDirection(pub core::ffi::c_uchar);
14597pub type StreamWriteCB = ::core::option::Option<
14598 unsafe extern "C" fn(stream: *mut Stream, context: *const core::ffi::c_void) -> bool,
14599>;
14600unsafe extern "C" {
14601 #[doc = "Free Stream\n # Arguments\n\n* `stream` - Stream instance"]
14602 pub fn stream_free(stream: *mut Stream);
14603}
14604unsafe extern "C" {
14605 #[doc = "Clean (empty) Stream\n # Arguments\n\n* `stream` - Stream instance"]
14606 pub fn stream_clean(stream: *mut Stream);
14607}
14608unsafe extern "C" {
14609 #[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"]
14610 pub fn stream_eof(stream: *mut Stream) -> bool;
14611}
14612unsafe extern "C" {
14613 #[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"]
14614 pub fn stream_seek(stream: *mut Stream, offset: i32, offset_type: StreamOffset) -> bool;
14615}
14616unsafe extern "C" {
14617 #[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"]
14618 pub fn stream_seek_to_char(
14619 stream: *mut Stream,
14620 c: core::ffi::c_char,
14621 direction: StreamDirection,
14622 ) -> bool;
14623}
14624unsafe extern "C" {
14625 #[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"]
14626 pub fn stream_tell(stream: *mut Stream) -> usize;
14627}
14628unsafe extern "C" {
14629 #[doc = "Gets the size of the stream\n # Arguments\n\n* `stream` - Stream instance\n # Returns\n\nsize_t size of the stream"]
14630 pub fn stream_size(stream: *mut Stream) -> usize;
14631}
14632unsafe extern "C" {
14633 #[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"]
14634 pub fn stream_write(stream: *mut Stream, data: *const u8, size: usize) -> usize;
14635}
14636unsafe extern "C" {
14637 #[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"]
14638 pub fn stream_read(stream: *mut Stream, data: *mut u8, count: usize) -> usize;
14639}
14640unsafe extern "C" {
14641 #[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"]
14642 pub fn stream_delete_and_insert(
14643 stream: *mut Stream,
14644 delete_size: usize,
14645 write_callback: StreamWriteCB,
14646 context: *const core::ffi::c_void,
14647 ) -> bool;
14648}
14649unsafe extern "C" {
14650 #[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"]
14651 pub fn stream_read_line(stream: *mut Stream, str_result: *mut FuriString) -> bool;
14652}
14653unsafe extern "C" {
14654 #[doc = "Moves the RW pointer to the start\n # Arguments\n\n* `stream` - Stream instance"]
14655 pub fn stream_rewind(stream: *mut Stream) -> bool;
14656}
14657unsafe extern "C" {
14658 #[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"]
14659 pub fn stream_write_char(stream: *mut Stream, c: core::ffi::c_char) -> usize;
14660}
14661unsafe extern "C" {
14662 #[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"]
14663 pub fn stream_write_string(stream: *mut Stream, string: *mut FuriString) -> usize;
14664}
14665unsafe extern "C" {
14666 #[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"]
14667 pub fn stream_write_cstring(stream: *mut Stream, string: *const core::ffi::c_char) -> usize;
14668}
14669unsafe extern "C" {
14670 #[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"]
14671 pub fn stream_write_format(stream: *mut Stream, format: *const core::ffi::c_char, ...)
14672 -> usize;
14673}
14674unsafe extern "C" {
14675 #[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"]
14676 pub fn stream_write_vaformat(
14677 stream: *mut Stream,
14678 format: *const core::ffi::c_char,
14679 args: va_list,
14680 ) -> usize;
14681}
14682unsafe extern "C" {
14683 #[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"]
14684 pub fn stream_insert(stream: *mut Stream, data: *const u8, size: usize) -> bool;
14685}
14686unsafe extern "C" {
14687 #[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"]
14688 pub fn stream_insert_char(stream: *mut Stream, c: core::ffi::c_char) -> bool;
14689}
14690unsafe extern "C" {
14691 #[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"]
14692 pub fn stream_insert_string(stream: *mut Stream, string: *mut FuriString) -> bool;
14693}
14694unsafe extern "C" {
14695 #[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"]
14696 pub fn stream_insert_cstring(stream: *mut Stream, string: *const core::ffi::c_char) -> bool;
14697}
14698unsafe extern "C" {
14699 #[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"]
14700 pub fn stream_insert_format(stream: *mut Stream, format: *const core::ffi::c_char, ...)
14701 -> bool;
14702}
14703unsafe extern "C" {
14704 #[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"]
14705 pub fn stream_insert_vaformat(
14706 stream: *mut Stream,
14707 format: *const core::ffi::c_char,
14708 args: va_list,
14709 ) -> bool;
14710}
14711unsafe extern "C" {
14712 #[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"]
14713 pub fn stream_delete_and_insert_char(
14714 stream: *mut Stream,
14715 delete_size: usize,
14716 c: core::ffi::c_char,
14717 ) -> bool;
14718}
14719unsafe extern "C" {
14720 #[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"]
14721 pub fn stream_delete_and_insert_string(
14722 stream: *mut Stream,
14723 delete_size: usize,
14724 string: *mut FuriString,
14725 ) -> bool;
14726}
14727unsafe extern "C" {
14728 #[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"]
14729 pub fn stream_delete_and_insert_cstring(
14730 stream: *mut Stream,
14731 delete_size: usize,
14732 string: *const core::ffi::c_char,
14733 ) -> bool;
14734}
14735unsafe extern "C" {
14736 #[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"]
14737 pub fn stream_delete_and_insert_format(
14738 stream: *mut Stream,
14739 delete_size: usize,
14740 format: *const core::ffi::c_char,
14741 ...
14742 ) -> bool;
14743}
14744unsafe extern "C" {
14745 #[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"]
14746 pub fn stream_delete_and_insert_vaformat(
14747 stream: *mut Stream,
14748 delete_size: usize,
14749 format: *const core::ffi::c_char,
14750 args: va_list,
14751 ) -> bool;
14752}
14753unsafe extern "C" {
14754 #[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"]
14755 pub fn stream_delete(stream: *mut Stream, size: usize) -> bool;
14756}
14757unsafe extern "C" {
14758 #[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"]
14759 pub fn stream_copy(stream_from: *mut Stream, stream_to: *mut Stream, size: usize) -> usize;
14760}
14761unsafe extern "C" {
14762 #[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"]
14763 pub fn stream_copy_full(stream_from: *mut Stream, stream_to: *mut Stream) -> usize;
14764}
14765unsafe extern "C" {
14766 #[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"]
14767 pub fn stream_split(
14768 stream: *mut Stream,
14769 stream_left: *mut Stream,
14770 stream_right: *mut Stream,
14771 ) -> bool;
14772}
14773unsafe extern "C" {
14774 #[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"]
14775 pub fn stream_load_from_file(
14776 stream: *mut Stream,
14777 storage: *mut Storage,
14778 path: *const core::ffi::c_char,
14779 ) -> usize;
14780}
14781unsafe extern "C" {
14782 #[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"]
14783 pub fn stream_save_to_file(
14784 stream: *mut Stream,
14785 storage: *mut Storage,
14786 path: *const core::ffi::c_char,
14787 mode: FS_OpenMode,
14788 ) -> usize;
14789}
14790unsafe extern "C" {
14791 #[doc = "Dump stream inner data (size, RW position, content)\n # Arguments\n\n* `stream` - Stream instance"]
14792 pub fn stream_dump_data(stream: *mut Stream);
14793}
14794unsafe extern "C" {
14795 #[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*"]
14796 pub fn flipper_format_get_raw_stream(flipper_format: *mut FlipperFormat) -> *mut Stream;
14797}
14798pub const FlipperStreamValueIgnore: FlipperStreamValue = FlipperStreamValue(0);
14799pub const FlipperStreamValueStr: FlipperStreamValue = FlipperStreamValue(1);
14800pub const FlipperStreamValueHex: FlipperStreamValue = FlipperStreamValue(2);
14801pub const FlipperStreamValueFloat: FlipperStreamValue = FlipperStreamValue(3);
14802pub const FlipperStreamValueInt32: FlipperStreamValue = FlipperStreamValue(4);
14803pub const FlipperStreamValueUint32: FlipperStreamValue = FlipperStreamValue(5);
14804pub const FlipperStreamValueHexUint64: FlipperStreamValue = FlipperStreamValue(6);
14805pub const FlipperStreamValueBool: FlipperStreamValue = FlipperStreamValue(7);
14806#[repr(transparent)]
14807#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14808pub struct FlipperStreamValue(pub core::ffi::c_uchar);
14809#[repr(C)]
14810#[derive(Debug, Copy, Clone)]
14811pub struct FlipperStreamWriteData {
14812 pub key: *const core::ffi::c_char,
14813 pub type_: FlipperStreamValue,
14814 pub data: *const core::ffi::c_void,
14815 pub data_size: usize,
14816}
14817#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14818const _: () = {
14819 ["Size of FlipperStreamWriteData"][::core::mem::size_of::<FlipperStreamWriteData>() - 16usize];
14820 ["Alignment of FlipperStreamWriteData"]
14821 [::core::mem::align_of::<FlipperStreamWriteData>() - 4usize];
14822 ["Offset of field: FlipperStreamWriteData::key"]
14823 [::core::mem::offset_of!(FlipperStreamWriteData, key) - 0usize];
14824 ["Offset of field: FlipperStreamWriteData::type_"]
14825 [::core::mem::offset_of!(FlipperStreamWriteData, type_) - 4usize];
14826 ["Offset of field: FlipperStreamWriteData::data"]
14827 [::core::mem::offset_of!(FlipperStreamWriteData, data) - 8usize];
14828 ["Offset of field: FlipperStreamWriteData::data_size"]
14829 [::core::mem::offset_of!(FlipperStreamWriteData, data_size) - 12usize];
14830};
14831unsafe extern "C" {
14832 #[doc = "Writes a key/value pair to the stream.\n # Arguments\n\n* `stream` -\n * `write_data` -\n # Returns\n\ntrue\n false"]
14833 pub fn flipper_format_stream_write_value_line(
14834 stream: *mut Stream,
14835 write_data: *mut FlipperStreamWriteData,
14836 ) -> bool;
14837}
14838unsafe extern "C" {
14839 #[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"]
14840 pub fn flipper_format_stream_read_value_line(
14841 stream: *mut Stream,
14842 key: *const core::ffi::c_char,
14843 type_: FlipperStreamValue,
14844 _data: *mut core::ffi::c_void,
14845 data_size: usize,
14846 strict_mode: bool,
14847 ) -> bool;
14848}
14849unsafe extern "C" {
14850 #[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"]
14851 pub fn flipper_format_stream_get_value_count(
14852 stream: *mut Stream,
14853 key: *const core::ffi::c_char,
14854 count: *mut u32,
14855 strict_mode: bool,
14856 ) -> bool;
14857}
14858unsafe extern "C" {
14859 #[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"]
14860 pub fn flipper_format_stream_delete_key_and_write(
14861 stream: *mut Stream,
14862 write_data: *mut FlipperStreamWriteData,
14863 strict_mode: bool,
14864 ) -> bool;
14865}
14866unsafe extern "C" {
14867 #[doc = "Writes a comment string to the stream.\n # Arguments\n\n* `stream` -\n * `data` -\n # Returns\n\ntrue\n false"]
14868 pub fn flipper_format_stream_write_comment_cstr(
14869 stream: *mut Stream,
14870 data: *const core::ffi::c_char,
14871 ) -> bool;
14872}
14873pub type iButtonProtocolId = i32;
14874pub const iButtonProtocolIdInvalid: _bindgen_ty_2 = _bindgen_ty_2(-1);
14875#[repr(transparent)]
14876#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14877pub struct _bindgen_ty_2(pub core::ffi::c_schar);
14878pub const iButtonProtocolFeatureExtData: iButtonProtocolFeature = iButtonProtocolFeature(1);
14879pub const iButtonProtocolFeatureWriteId: iButtonProtocolFeature = iButtonProtocolFeature(2);
14880pub const iButtonProtocolFeatureWriteCopy: iButtonProtocolFeature = iButtonProtocolFeature(4);
14881#[repr(transparent)]
14882#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
14883pub struct iButtonProtocolFeature(pub core::ffi::c_uchar);
14884#[repr(C)]
14885#[derive(Debug, Copy, Clone)]
14886pub struct iButtonEditableData {
14887 pub ptr: *mut u8,
14888 pub size: usize,
14889}
14890#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14891const _: () = {
14892 ["Size of iButtonEditableData"][::core::mem::size_of::<iButtonEditableData>() - 8usize];
14893 ["Alignment of iButtonEditableData"][::core::mem::align_of::<iButtonEditableData>() - 4usize];
14894 ["Offset of field: iButtonEditableData::ptr"]
14895 [::core::mem::offset_of!(iButtonEditableData, ptr) - 0usize];
14896 ["Offset of field: iButtonEditableData::size"]
14897 [::core::mem::offset_of!(iButtonEditableData, size) - 4usize];
14898};
14899#[repr(C)]
14900#[derive(Debug, Copy, Clone)]
14901pub struct iButtonKey {
14902 _unused: [u8; 0],
14903}
14904unsafe extern "C" {
14905 #[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"]
14906 pub fn ibutton_key_alloc(data_size: usize) -> *mut iButtonKey;
14907}
14908unsafe extern "C" {
14909 #[doc = "Destroy the key object, free resources\n # Arguments\n\n* `[in]` - key pointer to the key object"]
14910 pub fn ibutton_key_free(key: *mut iButtonKey);
14911}
14912unsafe extern "C" {
14913 #[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"]
14914 pub fn ibutton_key_get_protocol_id(key: *const iButtonKey) -> iButtonProtocolId;
14915}
14916unsafe extern "C" {
14917 #[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"]
14918 pub fn ibutton_key_set_protocol_id(key: *mut iButtonKey, protocol_id: iButtonProtocolId);
14919}
14920unsafe extern "C" {
14921 #[doc = "Reset the protocol id and data held by the key\n # Arguments\n\n* `[in]` - key pointer to the key object"]
14922 pub fn ibutton_key_reset(key: *mut iButtonKey);
14923}
14924#[repr(C)]
14925#[derive(Debug, Copy, Clone)]
14926pub struct iButtonProtocols {
14927 _unused: [u8; 0],
14928}
14929unsafe extern "C" {
14930 #[doc = "Allocate an iButtonProtocols object\n # Returns\n\npointer to an iButtonProtocols object"]
14931 pub fn ibutton_protocols_alloc() -> *mut iButtonProtocols;
14932}
14933unsafe extern "C" {
14934 #[doc = "Destroy an iButtonProtocols object, free resources\n # Arguments\n\n* `[in]` - protocols pointer to an iButtonProtocols object"]
14935 pub fn ibutton_protocols_free(protocols: *mut iButtonProtocols);
14936}
14937unsafe extern "C" {
14938 #[doc = "Get the total number of available protocols"]
14939 pub fn ibutton_protocols_get_protocol_count() -> u32;
14940}
14941unsafe extern "C" {
14942 #[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"]
14943 pub fn ibutton_protocols_get_max_data_size(protocols: *mut iButtonProtocols) -> usize;
14944}
14945unsafe extern "C" {
14946 #[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"]
14947 pub fn ibutton_protocols_get_id_by_name(
14948 protocols: *mut iButtonProtocols,
14949 name: *const core::ffi::c_char,
14950 ) -> iButtonProtocolId;
14951}
14952unsafe extern "C" {
14953 #[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"]
14954 pub fn ibutton_protocols_get_manufacturer(
14955 protocols: *mut iButtonProtocols,
14956 id: iButtonProtocolId,
14957 ) -> *const core::ffi::c_char;
14958}
14959unsafe extern "C" {
14960 #[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"]
14961 pub fn ibutton_protocols_get_name(
14962 protocols: *mut iButtonProtocols,
14963 id: iButtonProtocolId,
14964 ) -> *const core::ffi::c_char;
14965}
14966unsafe extern "C" {
14967 #[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"]
14968 pub fn ibutton_protocols_get_features(
14969 protocols: *mut iButtonProtocols,
14970 id: iButtonProtocolId,
14971 ) -> u32;
14972}
14973unsafe extern "C" {
14974 #[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"]
14975 pub fn ibutton_protocols_read(protocols: *mut iButtonProtocols, key: *mut iButtonKey) -> bool;
14976}
14977unsafe extern "C" {
14978 #[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"]
14979 pub fn ibutton_protocols_write_id(
14980 protocols: *mut iButtonProtocols,
14981 key: *mut iButtonKey,
14982 ) -> bool;
14983}
14984unsafe extern "C" {
14985 #[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"]
14986 pub fn ibutton_protocols_write_copy(
14987 protocols: *mut iButtonProtocols,
14988 key: *mut iButtonKey,
14989 ) -> bool;
14990}
14991unsafe extern "C" {
14992 #[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"]
14993 pub fn ibutton_protocols_emulate_start(protocols: *mut iButtonProtocols, key: *mut iButtonKey);
14994}
14995unsafe extern "C" {
14996 #[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"]
14997 pub fn ibutton_protocols_emulate_stop(protocols: *mut iButtonProtocols, key: *mut iButtonKey);
14998}
14999unsafe extern "C" {
15000 #[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"]
15001 pub fn ibutton_protocols_save(
15002 protocols: *mut iButtonProtocols,
15003 key: *const iButtonKey,
15004 file_name: *const core::ffi::c_char,
15005 ) -> bool;
15006}
15007unsafe extern "C" {
15008 #[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"]
15009 pub fn ibutton_protocols_load(
15010 protocols: *mut iButtonProtocols,
15011 key: *mut iButtonKey,
15012 file_name: *const core::ffi::c_char,
15013 ) -> bool;
15014}
15015unsafe extern "C" {
15016 #[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)"]
15017 pub fn ibutton_protocols_render_uid(
15018 protocols: *mut iButtonProtocols,
15019 key: *const iButtonKey,
15020 result: *mut FuriString,
15021 );
15022}
15023unsafe extern "C" {
15024 #[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)"]
15025 pub fn ibutton_protocols_render_data(
15026 protocols: *mut iButtonProtocols,
15027 key: *const iButtonKey,
15028 result: *mut FuriString,
15029 );
15030}
15031unsafe extern "C" {
15032 #[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)"]
15033 pub fn ibutton_protocols_render_brief_data(
15034 protocols: *mut iButtonProtocols,
15035 key: *const iButtonKey,
15036 result: *mut FuriString,
15037 );
15038}
15039unsafe extern "C" {
15040 #[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)"]
15041 pub fn ibutton_protocols_render_error(
15042 protocols: *mut iButtonProtocols,
15043 key: *const iButtonKey,
15044 result: *mut FuriString,
15045 );
15046}
15047unsafe extern "C" {
15048 #[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"]
15049 pub fn ibutton_protocols_is_valid(
15050 protocols: *mut iButtonProtocols,
15051 key: *const iButtonKey,
15052 ) -> bool;
15053}
15054unsafe extern "C" {
15055 #[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"]
15056 pub fn ibutton_protocols_get_editable_data(
15057 protocols: *mut iButtonProtocols,
15058 key: *const iButtonKey,
15059 editable: *mut iButtonEditableData,
15060 );
15061}
15062unsafe extern "C" {
15063 #[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"]
15064 pub fn ibutton_protocols_apply_edits(protocols: *mut iButtonProtocols, key: *const iButtonKey);
15065}
15066pub const iButtonWorkerWriteOK: iButtonWorkerWriteResult = iButtonWorkerWriteResult(0);
15067pub const iButtonWorkerWriteSameKey: iButtonWorkerWriteResult = iButtonWorkerWriteResult(1);
15068pub const iButtonWorkerWriteNoDetect: iButtonWorkerWriteResult = iButtonWorkerWriteResult(2);
15069pub const iButtonWorkerWriteCannotWrite: iButtonWorkerWriteResult = iButtonWorkerWriteResult(3);
15070#[repr(transparent)]
15071#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15072pub struct iButtonWorkerWriteResult(pub core::ffi::c_uchar);
15073pub type iButtonWorkerReadCallback =
15074 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
15075pub type iButtonWorkerWriteCallback = ::core::option::Option<
15076 unsafe extern "C" fn(context: *mut core::ffi::c_void, result: iButtonWorkerWriteResult),
15077>;
15078pub type iButtonWorkerEmulateCallback =
15079 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, emulated: bool)>;
15080#[repr(C)]
15081#[derive(Debug, Copy, Clone)]
15082pub struct iButtonWorker {
15083 _unused: [u8; 0],
15084}
15085unsafe extern "C" {
15086 #[doc = "Allocate ibutton worker\n # Returns\n\niButtonWorker*"]
15087 pub fn ibutton_worker_alloc(protocols: *mut iButtonProtocols) -> *mut iButtonWorker;
15088}
15089unsafe extern "C" {
15090 #[doc = "Free ibutton worker\n # Arguments\n\n* `worker` -"]
15091 pub fn ibutton_worker_free(worker: *mut iButtonWorker);
15092}
15093unsafe extern "C" {
15094 #[doc = "Start ibutton worker thread\n # Arguments\n\n* `worker` -"]
15095 pub fn ibutton_worker_start_thread(worker: *mut iButtonWorker);
15096}
15097unsafe extern "C" {
15098 #[doc = "Stop ibutton worker thread\n # Arguments\n\n* `worker` -"]
15099 pub fn ibutton_worker_stop_thread(worker: *mut iButtonWorker);
15100}
15101unsafe extern "C" {
15102 #[doc = "Set \"read success\" callback\n # Arguments\n\n* `worker` -\n * `callback` -\n * `context` -"]
15103 pub fn ibutton_worker_read_set_callback(
15104 worker: *mut iButtonWorker,
15105 callback: iButtonWorkerReadCallback,
15106 context: *mut core::ffi::c_void,
15107 );
15108}
15109unsafe extern "C" {
15110 #[doc = "Start read mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15111 pub fn ibutton_worker_read_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15112}
15113unsafe extern "C" {
15114 #[doc = "Set \"write event\" callback\n # Arguments\n\n* `worker` -\n * `callback` -\n * `context` -"]
15115 pub fn ibutton_worker_write_set_callback(
15116 worker: *mut iButtonWorker,
15117 callback: iButtonWorkerWriteCallback,
15118 context: *mut core::ffi::c_void,
15119 );
15120}
15121unsafe extern "C" {
15122 #[doc = "Start write blank mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15123 pub fn ibutton_worker_write_id_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15124}
15125unsafe extern "C" {
15126 #[doc = "Start write copy mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15127 pub fn ibutton_worker_write_copy_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15128}
15129unsafe extern "C" {
15130 #[doc = "Set \"emulate success\" callback\n # Arguments\n\n* `worker` -\n * `callback` -\n * `context` -"]
15131 pub fn ibutton_worker_emulate_set_callback(
15132 worker: *mut iButtonWorker,
15133 callback: iButtonWorkerEmulateCallback,
15134 context: *mut core::ffi::c_void,
15135 );
15136}
15137unsafe extern "C" {
15138 #[doc = "Start emulate mode\n # Arguments\n\n* `worker` -\n * `key` -"]
15139 pub fn ibutton_worker_emulate_start(worker: *mut iButtonWorker, key: *mut iButtonKey);
15140}
15141unsafe extern "C" {
15142 #[doc = "Stop all modes\n # Arguments\n\n* `worker` -"]
15143 pub fn ibutton_worker_stop(worker: *mut iButtonWorker);
15144}
15145unsafe extern "C" {
15146 pub fn __wrap_strtof(in_: *const core::ffi::c_char, tail: *mut *mut core::ffi::c_char) -> f32;
15147}
15148unsafe extern "C" {
15149 pub fn __wrap_strtod(in_: *const core::ffi::c_char, tail: *mut *mut core::ffi::c_char) -> f64;
15150}
15151#[repr(C)]
15152#[derive(Debug, Copy, Clone)]
15153pub struct InfraredDecoderHandler {
15154 _unused: [u8; 0],
15155}
15156#[repr(C)]
15157#[derive(Debug, Copy, Clone)]
15158pub struct InfraredEncoderHandler {
15159 _unused: [u8; 0],
15160}
15161pub const InfraredProtocolUnknown: InfraredProtocol = InfraredProtocol(-1);
15162pub const InfraredProtocolNEC: InfraredProtocol = InfraredProtocol(0);
15163pub const InfraredProtocolNECext: InfraredProtocol = InfraredProtocol(1);
15164pub const InfraredProtocolNEC42: InfraredProtocol = InfraredProtocol(2);
15165pub const InfraredProtocolNEC42ext: InfraredProtocol = InfraredProtocol(3);
15166pub const InfraredProtocolSamsung32: InfraredProtocol = InfraredProtocol(4);
15167pub const InfraredProtocolRC6: InfraredProtocol = InfraredProtocol(5);
15168pub const InfraredProtocolRC5: InfraredProtocol = InfraredProtocol(6);
15169pub const InfraredProtocolRC5X: InfraredProtocol = InfraredProtocol(7);
15170pub const InfraredProtocolSIRC: InfraredProtocol = InfraredProtocol(8);
15171pub const InfraredProtocolSIRC15: InfraredProtocol = InfraredProtocol(9);
15172pub const InfraredProtocolSIRC20: InfraredProtocol = InfraredProtocol(10);
15173pub const InfraredProtocolKaseikyo: InfraredProtocol = InfraredProtocol(11);
15174pub const InfraredProtocolRCA: InfraredProtocol = InfraredProtocol(12);
15175pub const InfraredProtocolPioneer: InfraredProtocol = InfraredProtocol(13);
15176pub const InfraredProtocolMAX: InfraredProtocol = InfraredProtocol(14);
15177#[repr(transparent)]
15178#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15179pub struct InfraredProtocol(pub core::ffi::c_schar);
15180#[repr(C)]
15181#[derive(Debug, Copy, Clone)]
15182pub struct InfraredMessage {
15183 pub protocol: InfraredProtocol,
15184 pub address: u32,
15185 pub command: u32,
15186 pub repeat: bool,
15187}
15188#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15189const _: () = {
15190 ["Size of InfraredMessage"][::core::mem::size_of::<InfraredMessage>() - 16usize];
15191 ["Alignment of InfraredMessage"][::core::mem::align_of::<InfraredMessage>() - 4usize];
15192 ["Offset of field: InfraredMessage::protocol"]
15193 [::core::mem::offset_of!(InfraredMessage, protocol) - 0usize];
15194 ["Offset of field: InfraredMessage::address"]
15195 [::core::mem::offset_of!(InfraredMessage, address) - 4usize];
15196 ["Offset of field: InfraredMessage::command"]
15197 [::core::mem::offset_of!(InfraredMessage, command) - 8usize];
15198 ["Offset of field: InfraredMessage::repeat"]
15199 [::core::mem::offset_of!(InfraredMessage, repeat) - 12usize];
15200};
15201pub const InfraredStatusError: InfraredStatus = InfraredStatus(0);
15202pub const InfraredStatusOk: InfraredStatus = InfraredStatus(1);
15203pub const InfraredStatusDone: InfraredStatus = InfraredStatus(2);
15204pub const InfraredStatusReady: InfraredStatus = InfraredStatus(3);
15205#[repr(transparent)]
15206#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15207pub struct InfraredStatus(pub core::ffi::c_uchar);
15208unsafe extern "C" {
15209 #[doc = "Initialize decoder.\n\n # Returns\n\nreturns pointer to INFRARED decoder handler if success, otherwise - error."]
15210 pub fn infrared_alloc_decoder() -> *mut InfraredDecoderHandler;
15211}
15212unsafe extern "C" {
15213 #[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."]
15214 pub fn infrared_decode(
15215 handler: *mut InfraredDecoderHandler,
15216 level: bool,
15217 duration: u32,
15218 ) -> *const InfraredMessage;
15219}
15220unsafe extern "C" {
15221 #[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."]
15222 pub fn infrared_check_decoder_ready(
15223 handler: *mut InfraredDecoderHandler,
15224 ) -> *const InfraredMessage;
15225}
15226unsafe extern "C" {
15227 #[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().`"]
15228 pub fn infrared_free_decoder(handler: *mut InfraredDecoderHandler);
15229}
15230unsafe extern "C" {
15231 #[doc = "Reset INFRARED decoder.\n\n # Arguments\n\n* `handler` (direction in) - - handler to INFRARED decoders. Should be acquired with `infrared_alloc_decoder().`"]
15232 pub fn infrared_reset_decoder(handler: *mut InfraredDecoderHandler);
15233}
15234unsafe extern "C" {
15235 #[doc = "Get protocol name by protocol enum.\n\n # Arguments\n\n* `protocol` (direction in) - - protocol identifier.\n # Returns\n\nstring to protocol name."]
15236 pub fn infrared_get_protocol_name(protocol: InfraredProtocol) -> *const core::ffi::c_char;
15237}
15238unsafe extern "C" {
15239 #[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."]
15240 pub fn infrared_get_protocol_by_name(
15241 protocol_name: *const core::ffi::c_char,
15242 ) -> InfraredProtocol;
15243}
15244unsafe extern "C" {
15245 #[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."]
15246 pub fn infrared_get_protocol_address_length(protocol: InfraredProtocol) -> u8;
15247}
15248unsafe extern "C" {
15249 #[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."]
15250 pub fn infrared_get_protocol_command_length(protocol: InfraredProtocol) -> u8;
15251}
15252unsafe extern "C" {
15253 #[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."]
15254 pub fn infrared_is_protocol_valid(protocol: InfraredProtocol) -> bool;
15255}
15256unsafe extern "C" {
15257 #[doc = "Allocate INFRARED encoder.\n\n # Returns\n\nencoder handler."]
15258 pub fn infrared_alloc_encoder() -> *mut InfraredEncoderHandler;
15259}
15260unsafe extern "C" {
15261 #[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().`"]
15262 pub fn infrared_free_encoder(handler: *mut InfraredEncoderHandler);
15263}
15264unsafe extern "C" {
15265 #[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."]
15266 pub fn infrared_encode(
15267 handler: *mut InfraredEncoderHandler,
15268 duration: *mut u32,
15269 level: *mut bool,
15270 ) -> InfraredStatus;
15271}
15272unsafe extern "C" {
15273 #[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."]
15274 pub fn infrared_reset_encoder(
15275 handler: *mut InfraredEncoderHandler,
15276 message: *const InfraredMessage,
15277 );
15278}
15279unsafe extern "C" {
15280 #[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"]
15281 pub fn infrared_get_protocol_frequency(protocol: InfraredProtocol) -> u32;
15282}
15283unsafe extern "C" {
15284 #[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"]
15285 pub fn infrared_get_protocol_duty_cycle(protocol: InfraredProtocol) -> f32;
15286}
15287unsafe extern "C" {
15288 #[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"]
15289 pub fn infrared_get_protocol_min_repeat_count(protocol: InfraredProtocol) -> usize;
15290}
15291pub const InfraredErrorCodeNone: InfraredErrorCode = InfraredErrorCode(0);
15292pub const InfraredErrorCodeFileOperationFailed: InfraredErrorCode = InfraredErrorCode(8388608);
15293pub const InfraredErrorCodeWrongFileType: InfraredErrorCode = InfraredErrorCode(2147483904);
15294pub const InfraredErrorCodeWrongFileVersion: InfraredErrorCode = InfraredErrorCode(2147484160);
15295pub const InfraredErrorCodeSignalTypeUnknown: InfraredErrorCode = InfraredErrorCode(2147484416);
15296pub const InfraredErrorCodeSignalNameNotFound: InfraredErrorCode = InfraredErrorCode(2147484672);
15297pub const InfraredErrorCodeSignalUnableToReadType: InfraredErrorCode =
15298 InfraredErrorCode(2147484928);
15299pub const InfraredErrorCodeSignalUnableToWriteType: InfraredErrorCode =
15300 InfraredErrorCode(2147485184);
15301pub const InfraredErrorCodeSignalRawUnableToReadFrequency: InfraredErrorCode =
15302 InfraredErrorCode(2147485440);
15303pub const InfraredErrorCodeSignalRawUnableToReadDutyCycle: InfraredErrorCode =
15304 InfraredErrorCode(2147485696);
15305pub const InfraredErrorCodeSignalRawUnableToReadTimingsSize: InfraredErrorCode =
15306 InfraredErrorCode(2147485952);
15307pub const InfraredErrorCodeSignalRawUnableToReadTooLongData: InfraredErrorCode =
15308 InfraredErrorCode(2147486208);
15309pub const InfraredErrorCodeSignalRawUnableToReadData: InfraredErrorCode =
15310 InfraredErrorCode(2147486464);
15311pub const InfraredErrorCodeSignalRawUnableToWriteFrequency: InfraredErrorCode =
15312 InfraredErrorCode(2147486720);
15313pub const InfraredErrorCodeSignalRawUnableToWriteDutyCycle: InfraredErrorCode =
15314 InfraredErrorCode(2147486976);
15315pub const InfraredErrorCodeSignalRawUnableToWriteData: InfraredErrorCode =
15316 InfraredErrorCode(2147487232);
15317pub const InfraredErrorCodeSignalMessageUnableToReadProtocol: InfraredErrorCode =
15318 InfraredErrorCode(2147487488);
15319pub const InfraredErrorCodeSignalMessageUnableToReadAddress: InfraredErrorCode =
15320 InfraredErrorCode(2147487744);
15321pub const InfraredErrorCodeSignalMessageUnableToReadCommand: InfraredErrorCode =
15322 InfraredErrorCode(2147488000);
15323pub const InfraredErrorCodeSignalMessageIsInvalid: InfraredErrorCode =
15324 InfraredErrorCode(2147488256);
15325pub const InfraredErrorCodeSignalMessageUnableToWriteProtocol: InfraredErrorCode =
15326 InfraredErrorCode(2147488512);
15327pub const InfraredErrorCodeSignalMessageUnableToWriteAddress: InfraredErrorCode =
15328 InfraredErrorCode(2147488768);
15329pub const InfraredErrorCodeSignalMessageUnableToWriteCommand: InfraredErrorCode =
15330 InfraredErrorCode(2147489024);
15331#[repr(transparent)]
15332#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15333pub struct InfraredErrorCode(pub core::ffi::c_uint);
15334#[repr(C)]
15335#[derive(Debug, Copy, Clone)]
15336pub struct InfraredBruteForce {
15337 _unused: [u8; 0],
15338}
15339#[repr(C)]
15340#[derive(Debug, Copy, Clone)]
15341pub struct InfraredSignal {
15342 _unused: [u8; 0],
15343}
15344#[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."]
15345#[repr(C)]
15346#[derive(Debug, Copy, Clone)]
15347pub struct InfraredRawSignal {
15348 #[doc = "< Number of elements in the timings array."]
15349 pub timings_size: usize,
15350 #[doc = "< Pointer to an array of timings describing the signal."]
15351 pub timings: *mut u32,
15352 #[doc = "< Carrier frequency of the signal."]
15353 pub frequency: u32,
15354 #[doc = "< Duty cycle of the signal."]
15355 pub duty_cycle: f32,
15356}
15357#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15358const _: () = {
15359 ["Size of InfraredRawSignal"][::core::mem::size_of::<InfraredRawSignal>() - 16usize];
15360 ["Alignment of InfraredRawSignal"][::core::mem::align_of::<InfraredRawSignal>() - 4usize];
15361 ["Offset of field: InfraredRawSignal::timings_size"]
15362 [::core::mem::offset_of!(InfraredRawSignal, timings_size) - 0usize];
15363 ["Offset of field: InfraredRawSignal::timings"]
15364 [::core::mem::offset_of!(InfraredRawSignal, timings) - 4usize];
15365 ["Offset of field: InfraredRawSignal::frequency"]
15366 [::core::mem::offset_of!(InfraredRawSignal, frequency) - 8usize];
15367 ["Offset of field: InfraredRawSignal::duty_cycle"]
15368 [::core::mem::offset_of!(InfraredRawSignal, duty_cycle) - 12usize];
15369};
15370pub const FuriHalInfraredTxPinInternal: FuriHalInfraredTxPin = FuriHalInfraredTxPin(0);
15371pub const FuriHalInfraredTxPinExtPA7: FuriHalInfraredTxPin = FuriHalInfraredTxPin(1);
15372pub const FuriHalInfraredTxPinMax: FuriHalInfraredTxPin = FuriHalInfraredTxPin(2);
15373#[repr(transparent)]
15374#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15375pub struct FuriHalInfraredTxPin(pub core::ffi::c_uchar);
15376#[doc = "< New data obtained"]
15377pub const FuriHalInfraredTxGetDataStateOk: FuriHalInfraredTxGetDataState =
15378 FuriHalInfraredTxGetDataState(0);
15379#[doc = "< New data obtained, and this is end of package"]
15380pub const FuriHalInfraredTxGetDataStateDone: FuriHalInfraredTxGetDataState =
15381 FuriHalInfraredTxGetDataState(1);
15382#[doc = "< New data obtained, and this is end of package and no more data available"]
15383pub const FuriHalInfraredTxGetDataStateLastDone: FuriHalInfraredTxGetDataState =
15384 FuriHalInfraredTxGetDataState(2);
15385#[repr(transparent)]
15386#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15387pub struct FuriHalInfraredTxGetDataState(pub core::ffi::c_uchar);
15388#[doc = "Callback type for providing data to INFRARED DMA TX system. It is called every tim"]
15389pub type FuriHalInfraredTxGetDataISRCallback = ::core::option::Option<
15390 unsafe extern "C" fn(
15391 context: *mut core::ffi::c_void,
15392 duration: *mut u32,
15393 level: *mut bool,
15394 ) -> FuriHalInfraredTxGetDataState,
15395>;
15396#[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."]
15397pub type FuriHalInfraredTxSignalSentISRCallback =
15398 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
15399#[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"]
15400pub type FuriHalInfraredRxCaptureCallback = ::core::option::Option<
15401 unsafe extern "C" fn(ctx: *mut core::ffi::c_void, level: bool, duration: u32),
15402>;
15403#[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"]
15404pub type FuriHalInfraredRxTimeoutCallback =
15405 ::core::option::Option<unsafe extern "C" fn(ctx: *mut core::ffi::c_void)>;
15406unsafe extern "C" {
15407 #[doc = "Initialize INFRARED RX timer to receive interrupts.\n\n It provides interrupts for every RX-signal edge changing with its duration."]
15408 pub fn furi_hal_infrared_async_rx_start();
15409}
15410unsafe extern "C" {
15411 #[doc = "Deinitialize INFRARED RX interrupt."]
15412 pub fn furi_hal_infrared_async_rx_stop();
15413}
15414unsafe extern "C" {
15415 #[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."]
15416 pub fn furi_hal_infrared_async_rx_set_timeout(timeout_us: u32);
15417}
15418unsafe extern "C" {
15419 #[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"]
15420 pub fn furi_hal_infrared_async_rx_set_capture_isr_callback(
15421 callback: FuriHalInfraredRxCaptureCallback,
15422 ctx: *mut core::ffi::c_void,
15423 );
15424}
15425unsafe extern "C" {
15426 #[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"]
15427 pub fn furi_hal_infrared_async_rx_set_timeout_isr_callback(
15428 callback: FuriHalInfraredRxTimeoutCallback,
15429 ctx: *mut core::ffi::c_void,
15430 );
15431}
15432unsafe extern "C" {
15433 #[doc = "Check if INFRARED is in use now.\n\n # Returns\n\ntrue if INFRARED is busy, false otherwise."]
15434 pub fn furi_hal_infrared_is_busy() -> bool;
15435}
15436unsafe extern "C" {
15437 #[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"]
15438 pub fn furi_hal_infrared_async_tx_set_data_isr_callback(
15439 callback: FuriHalInfraredTxGetDataISRCallback,
15440 context: *mut core::ffi::c_void,
15441 );
15442}
15443unsafe extern "C" {
15444 #[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"]
15445 pub fn furi_hal_infrared_async_tx_start(freq: u32, duty_cycle: f32);
15446}
15447unsafe extern "C" {
15448 #[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)."]
15449 pub fn furi_hal_infrared_async_tx_stop();
15450}
15451unsafe extern "C" {
15452 #[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)."]
15453 pub fn furi_hal_infrared_async_tx_wait_termination();
15454}
15455unsafe extern "C" {
15456 #[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"]
15457 pub fn furi_hal_infrared_async_tx_set_signal_sent_isr_callback(
15458 callback: FuriHalInfraredTxSignalSentISRCallback,
15459 context: *mut core::ffi::c_void,
15460 );
15461}
15462unsafe extern "C" {
15463 #[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."]
15464 pub fn furi_hal_infrared_detect_tx_output() -> FuriHalInfraredTxPin;
15465}
15466unsafe extern "C" {
15467 #[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."]
15468 pub fn furi_hal_infrared_set_tx_output(tx_pin: FuriHalInfraredTxPin);
15469}
15470unsafe extern "C" {
15471 #[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."]
15472 pub fn infrared_send(message: *const InfraredMessage, times: core::ffi::c_int);
15473}
15474unsafe extern "C" {
15475 #[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"]
15476 pub fn infrared_send_raw(timings: *const u32, timings_cnt: u32, start_from_mark: bool);
15477}
15478unsafe extern "C" {
15479 #[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"]
15480 pub fn infrared_send_raw_ext(
15481 timings: *const u32,
15482 timings_cnt: u32,
15483 start_from_mark: bool,
15484 frequency: u32,
15485 duty_cycle: f32,
15486 );
15487}
15488#[repr(C)]
15489#[derive(Debug, Copy, Clone)]
15490pub struct InfraredWorker {
15491 _unused: [u8; 0],
15492}
15493#[repr(C)]
15494#[derive(Debug, Copy, Clone)]
15495pub struct InfraredWorkerSignal {
15496 _unused: [u8; 0],
15497}
15498pub const InfraredWorkerGetSignalResponseNew: InfraredWorkerGetSignalResponse =
15499 InfraredWorkerGetSignalResponse(0);
15500#[doc = "Signal, provided by callback is new and encoder should be reseted"]
15501pub const InfraredWorkerGetSignalResponseSame: InfraredWorkerGetSignalResponse =
15502 InfraredWorkerGetSignalResponse(1);
15503#[doc = "Signal, provided by callback is same. No encoder resetting."]
15504pub const InfraredWorkerGetSignalResponseStop: InfraredWorkerGetSignalResponse =
15505 InfraredWorkerGetSignalResponse(2);
15506#[repr(transparent)]
15507#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15508pub struct InfraredWorkerGetSignalResponse(pub core::ffi::c_uchar);
15509#[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()"]
15510pub type InfraredWorkerGetSignalCallback = ::core::option::Option<
15511 unsafe extern "C" fn(
15512 context: *mut core::ffi::c_void,
15513 instance: *mut InfraredWorker,
15514 ) -> InfraredWorkerGetSignalResponse,
15515>;
15516#[doc = "Callback type for 'message is sent' event"]
15517pub type InfraredWorkerMessageSentCallback =
15518 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
15519#[doc = "Callback type to call by InfraredWorker thread when new signal is received"]
15520pub type InfraredWorkerReceivedSignalCallback = ::core::option::Option<
15521 unsafe extern "C" fn(
15522 context: *mut core::ffi::c_void,
15523 received_signal: *mut InfraredWorkerSignal,
15524 ),
15525>;
15526unsafe extern "C" {
15527 #[doc = "Allocate InfraredWorker\n\n # Returns\n\njust created instance of InfraredWorker"]
15528 pub fn infrared_worker_alloc() -> *mut InfraredWorker;
15529}
15530unsafe extern "C" {
15531 #[doc = "Free InfraredWorker\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15532 pub fn infrared_worker_free(instance: *mut InfraredWorker);
15533}
15534unsafe extern "C" {
15535 #[doc = "Start InfraredWorker thread, initialise furi_hal, prepare all work.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15536 pub fn infrared_worker_rx_start(instance: *mut InfraredWorker);
15537}
15538unsafe extern "C" {
15539 #[doc = "Stop InfraredWorker thread, deinitialize furi_hal.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15540 pub fn infrared_worker_rx_stop(instance: *mut InfraredWorker);
15541}
15542unsafe extern "C" {
15543 #[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"]
15544 pub fn infrared_worker_rx_set_received_signal_callback(
15545 instance: *mut InfraredWorker,
15546 callback: InfraredWorkerReceivedSignalCallback,
15547 context: *mut core::ffi::c_void,
15548 );
15549}
15550unsafe extern "C" {
15551 #[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"]
15552 pub fn infrared_worker_rx_enable_blink_on_receiving(
15553 instance: *mut InfraredWorker,
15554 enable: bool,
15555 );
15556}
15557unsafe extern "C" {
15558 #[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"]
15559 pub fn infrared_worker_rx_enable_signal_decoding(instance: *mut InfraredWorker, enable: bool);
15560}
15561unsafe extern "C" {
15562 #[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"]
15563 pub fn infrared_worker_signal_is_decoded(signal: *const InfraredWorkerSignal) -> bool;
15564}
15565unsafe extern "C" {
15566 #[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"]
15567 pub fn infrared_worker_tx_start(instance: *mut InfraredWorker);
15568}
15569unsafe extern "C" {
15570 #[doc = "Stop transmitting signal. Waits for end of current signal and stops transmission.\n\n # Arguments\n\n* `instance` (direction in) - - InfraredWorker instance"]
15571 pub fn infrared_worker_tx_stop(instance: *mut InfraredWorker);
15572}
15573unsafe extern "C" {
15574 #[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"]
15575 pub fn infrared_worker_tx_set_get_signal_callback(
15576 instance: *mut InfraredWorker,
15577 callback: InfraredWorkerGetSignalCallback,
15578 context: *mut core::ffi::c_void,
15579 );
15580}
15581unsafe extern "C" {
15582 #[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"]
15583 pub fn infrared_worker_tx_set_signal_sent_callback(
15584 instance: *mut InfraredWorker,
15585 callback: InfraredWorkerMessageSentCallback,
15586 context: *mut core::ffi::c_void,
15587 );
15588}
15589unsafe extern "C" {
15590 #[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"]
15591 pub fn infrared_worker_tx_get_signal_steady_callback(
15592 context: *mut core::ffi::c_void,
15593 instance: *mut InfraredWorker,
15594 ) -> InfraredWorkerGetSignalResponse;
15595}
15596unsafe extern "C" {
15597 #[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"]
15598 pub fn infrared_worker_get_raw_signal(
15599 signal: *const InfraredWorkerSignal,
15600 timings: *mut *const u32,
15601 timings_cnt: *mut usize,
15602 );
15603}
15604unsafe extern "C" {
15605 #[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"]
15606 pub fn infrared_worker_get_decoded_signal(
15607 signal: *const InfraredWorkerSignal,
15608 ) -> *const InfraredMessage;
15609}
15610unsafe extern "C" {
15611 #[doc = "Set current decoded signal for InfraredWorker instance\n\n # Arguments\n\n* `instance` (direction out) - - InfraredWorker instance\n * `message` (direction in) - - decoded signal"]
15612 pub fn infrared_worker_set_decoded_signal(
15613 instance: *mut InfraredWorker,
15614 message: *const InfraredMessage,
15615 );
15616}
15617unsafe extern "C" {
15618 #[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)"]
15619 pub fn infrared_worker_set_raw_signal(
15620 instance: *mut InfraredWorker,
15621 timings: *const u32,
15622 timings_cnt: usize,
15623 frequency: u32,
15624 duty_cycle: f32,
15625 );
15626}
15627pub type ProtocolAlloc = ::core::option::Option<unsafe extern "C" fn() -> *mut core::ffi::c_void>;
15628pub type ProtocolFree =
15629 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void)>;
15630pub type ProtocolGetData =
15631 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void) -> *mut u8>;
15632pub type ProtocolDecoderStart =
15633 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void)>;
15634pub type ProtocolDecoderFeed = ::core::option::Option<
15635 unsafe extern "C" fn(protocol: *mut core::ffi::c_void, level: bool, duration: u32) -> bool,
15636>;
15637pub type ProtocolEncoderStart =
15638 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void) -> bool>;
15639pub type ProtocolEncoderYield =
15640 ::core::option::Option<unsafe extern "C" fn(protocol: *mut core::ffi::c_void) -> LevelDuration>;
15641pub type ProtocolRenderData = ::core::option::Option<
15642 unsafe extern "C" fn(protocol: *mut core::ffi::c_void, result: *mut FuriString),
15643>;
15644pub type ProtocolWriteData = ::core::option::Option<
15645 unsafe extern "C" fn(protocol: *mut core::ffi::c_void, data: *mut core::ffi::c_void) -> bool,
15646>;
15647#[repr(C)]
15648#[derive(Debug, Copy, Clone)]
15649pub struct ProtocolDecoder {
15650 pub start: ProtocolDecoderStart,
15651 pub feed: ProtocolDecoderFeed,
15652}
15653#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15654const _: () = {
15655 ["Size of ProtocolDecoder"][::core::mem::size_of::<ProtocolDecoder>() - 8usize];
15656 ["Alignment of ProtocolDecoder"][::core::mem::align_of::<ProtocolDecoder>() - 4usize];
15657 ["Offset of field: ProtocolDecoder::start"]
15658 [::core::mem::offset_of!(ProtocolDecoder, start) - 0usize];
15659 ["Offset of field: ProtocolDecoder::feed"]
15660 [::core::mem::offset_of!(ProtocolDecoder, feed) - 4usize];
15661};
15662#[repr(C)]
15663#[derive(Debug, Copy, Clone)]
15664pub struct ProtocolEncoder {
15665 pub start: ProtocolEncoderStart,
15666 pub yield_: ProtocolEncoderYield,
15667}
15668#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15669const _: () = {
15670 ["Size of ProtocolEncoder"][::core::mem::size_of::<ProtocolEncoder>() - 8usize];
15671 ["Alignment of ProtocolEncoder"][::core::mem::align_of::<ProtocolEncoder>() - 4usize];
15672 ["Offset of field: ProtocolEncoder::start"]
15673 [::core::mem::offset_of!(ProtocolEncoder, start) - 0usize];
15674 ["Offset of field: ProtocolEncoder::yield_"]
15675 [::core::mem::offset_of!(ProtocolEncoder, yield_) - 4usize];
15676};
15677#[repr(C)]
15678#[derive(Debug, Copy, Clone)]
15679pub struct ProtocolBase {
15680 pub data_size: usize,
15681 pub name: *const core::ffi::c_char,
15682 pub manufacturer: *const core::ffi::c_char,
15683 pub features: u32,
15684 pub validate_count: u8,
15685 pub alloc: ProtocolAlloc,
15686 pub free: ProtocolFree,
15687 pub get_data: ProtocolGetData,
15688 pub decoder: ProtocolDecoder,
15689 pub encoder: ProtocolEncoder,
15690 pub render_uid: ProtocolRenderData,
15691 pub render_data: ProtocolRenderData,
15692 pub render_brief_data: ProtocolRenderData,
15693 pub write_data: ProtocolWriteData,
15694}
15695#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15696const _: () = {
15697 ["Size of ProtocolBase"][::core::mem::size_of::<ProtocolBase>() - 64usize];
15698 ["Alignment of ProtocolBase"][::core::mem::align_of::<ProtocolBase>() - 4usize];
15699 ["Offset of field: ProtocolBase::data_size"]
15700 [::core::mem::offset_of!(ProtocolBase, data_size) - 0usize];
15701 ["Offset of field: ProtocolBase::name"][::core::mem::offset_of!(ProtocolBase, name) - 4usize];
15702 ["Offset of field: ProtocolBase::manufacturer"]
15703 [::core::mem::offset_of!(ProtocolBase, manufacturer) - 8usize];
15704 ["Offset of field: ProtocolBase::features"]
15705 [::core::mem::offset_of!(ProtocolBase, features) - 12usize];
15706 ["Offset of field: ProtocolBase::validate_count"]
15707 [::core::mem::offset_of!(ProtocolBase, validate_count) - 16usize];
15708 ["Offset of field: ProtocolBase::alloc"]
15709 [::core::mem::offset_of!(ProtocolBase, alloc) - 20usize];
15710 ["Offset of field: ProtocolBase::free"][::core::mem::offset_of!(ProtocolBase, free) - 24usize];
15711 ["Offset of field: ProtocolBase::get_data"]
15712 [::core::mem::offset_of!(ProtocolBase, get_data) - 28usize];
15713 ["Offset of field: ProtocolBase::decoder"]
15714 [::core::mem::offset_of!(ProtocolBase, decoder) - 32usize];
15715 ["Offset of field: ProtocolBase::encoder"]
15716 [::core::mem::offset_of!(ProtocolBase, encoder) - 40usize];
15717 ["Offset of field: ProtocolBase::render_uid"]
15718 [::core::mem::offset_of!(ProtocolBase, render_uid) - 48usize];
15719 ["Offset of field: ProtocolBase::render_data"]
15720 [::core::mem::offset_of!(ProtocolBase, render_data) - 52usize];
15721 ["Offset of field: ProtocolBase::render_brief_data"]
15722 [::core::mem::offset_of!(ProtocolBase, render_brief_data) - 56usize];
15723 ["Offset of field: ProtocolBase::write_data"]
15724 [::core::mem::offset_of!(ProtocolBase, write_data) - 60usize];
15725};
15726#[repr(C)]
15727#[derive(Debug, Copy, Clone)]
15728pub struct ProtocolDict {
15729 _unused: [u8; 0],
15730}
15731pub type ProtocolId = i32;
15732unsafe extern "C" {
15733 pub fn protocol_dict_alloc(
15734 protocols: *const *const ProtocolBase,
15735 protocol_count: usize,
15736 ) -> *mut ProtocolDict;
15737}
15738unsafe extern "C" {
15739 pub fn protocol_dict_free(dict: *mut ProtocolDict);
15740}
15741unsafe extern "C" {
15742 pub fn protocol_dict_set_data(
15743 dict: *mut ProtocolDict,
15744 protocol_index: usize,
15745 data: *const u8,
15746 data_size: usize,
15747 );
15748}
15749unsafe extern "C" {
15750 pub fn protocol_dict_get_data(
15751 dict: *mut ProtocolDict,
15752 protocol_index: usize,
15753 data: *mut u8,
15754 data_size: usize,
15755 );
15756}
15757unsafe extern "C" {
15758 pub fn protocol_dict_get_data_size(dict: *mut ProtocolDict, protocol_index: usize) -> usize;
15759}
15760unsafe extern "C" {
15761 pub fn protocol_dict_get_max_data_size(dict: *mut ProtocolDict) -> usize;
15762}
15763unsafe extern "C" {
15764 pub fn protocol_dict_get_name(
15765 dict: *mut ProtocolDict,
15766 protocol_index: usize,
15767 ) -> *const core::ffi::c_char;
15768}
15769unsafe extern "C" {
15770 pub fn protocol_dict_get_manufacturer(
15771 dict: *mut ProtocolDict,
15772 protocol_index: usize,
15773 ) -> *const core::ffi::c_char;
15774}
15775unsafe extern "C" {
15776 pub fn protocol_dict_decoders_start(dict: *mut ProtocolDict);
15777}
15778unsafe extern "C" {
15779 pub fn protocol_dict_get_features(dict: *mut ProtocolDict, protocol_index: usize) -> u32;
15780}
15781unsafe extern "C" {
15782 pub fn protocol_dict_decoders_feed(
15783 dict: *mut ProtocolDict,
15784 level: bool,
15785 duration: u32,
15786 ) -> ProtocolId;
15787}
15788unsafe extern "C" {
15789 pub fn protocol_dict_decoders_feed_by_feature(
15790 dict: *mut ProtocolDict,
15791 feature: u32,
15792 level: bool,
15793 duration: u32,
15794 ) -> ProtocolId;
15795}
15796unsafe extern "C" {
15797 pub fn protocol_dict_decoders_feed_by_id(
15798 dict: *mut ProtocolDict,
15799 protocol_index: usize,
15800 level: bool,
15801 duration: u32,
15802 ) -> ProtocolId;
15803}
15804unsafe extern "C" {
15805 pub fn protocol_dict_encoder_start(dict: *mut ProtocolDict, protocol_index: usize) -> bool;
15806}
15807unsafe extern "C" {
15808 pub fn protocol_dict_encoder_yield(
15809 dict: *mut ProtocolDict,
15810 protocol_index: usize,
15811 ) -> LevelDuration;
15812}
15813unsafe extern "C" {
15814 pub fn protocol_dict_render_uid(
15815 dict: *mut ProtocolDict,
15816 result: *mut FuriString,
15817 protocol_index: usize,
15818 );
15819}
15820unsafe extern "C" {
15821 pub fn protocol_dict_render_data(
15822 dict: *mut ProtocolDict,
15823 result: *mut FuriString,
15824 protocol_index: usize,
15825 );
15826}
15827unsafe extern "C" {
15828 pub fn protocol_dict_render_brief_data(
15829 dict: *mut ProtocolDict,
15830 result: *mut FuriString,
15831 protocol_index: usize,
15832 );
15833}
15834unsafe extern "C" {
15835 pub fn protocol_dict_get_validate_count(dict: *mut ProtocolDict, protocol_index: usize) -> u32;
15836}
15837unsafe extern "C" {
15838 pub fn protocol_dict_get_protocol_by_name(
15839 dict: *mut ProtocolDict,
15840 name: *const core::ffi::c_char,
15841 ) -> ProtocolId;
15842}
15843unsafe extern "C" {
15844 pub fn protocol_dict_get_write_data(
15845 dict: *mut ProtocolDict,
15846 protocol_index: usize,
15847 data: *mut core::ffi::c_void,
15848 ) -> bool;
15849}
15850#[repr(C)]
15851#[derive(Debug, Copy, Clone)]
15852pub struct LFRFIDT5577 {
15853 pub block: [u32; 8usize],
15854 pub blocks_to_write: u32,
15855 pub mask: u8,
15856}
15857#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15858const _: () = {
15859 ["Size of LFRFIDT5577"][::core::mem::size_of::<LFRFIDT5577>() - 40usize];
15860 ["Alignment of LFRFIDT5577"][::core::mem::align_of::<LFRFIDT5577>() - 4usize];
15861 ["Offset of field: LFRFIDT5577::block"][::core::mem::offset_of!(LFRFIDT5577, block) - 0usize];
15862 ["Offset of field: LFRFIDT5577::blocks_to_write"]
15863 [::core::mem::offset_of!(LFRFIDT5577, blocks_to_write) - 32usize];
15864 ["Offset of field: LFRFIDT5577::mask"][::core::mem::offset_of!(LFRFIDT5577, mask) - 36usize];
15865};
15866unsafe extern "C" {
15867 #[doc = "Write T5577 tag data to tag\n\n # Arguments\n\n* `data` -"]
15868 pub fn t5577_write(data: *mut LFRFIDT5577);
15869}
15870unsafe extern "C" {
15871 pub fn t5577_write_with_pass(data: *mut LFRFIDT5577, password: u32);
15872}
15873unsafe extern "C" {
15874 pub fn t5577_write_with_mask(data: *mut LFRFIDT5577, page: u8, with_pass: bool, password: u32);
15875}
15876#[repr(C)]
15877#[derive(Debug, Copy, Clone)]
15878pub struct LFRFIDEM4305 {
15879 #[doc = "< Word data to write"]
15880 pub word: [u32; 16usize],
15881 #[doc = "< Word mask"]
15882 pub mask: u16,
15883}
15884#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15885const _: () = {
15886 ["Size of LFRFIDEM4305"][::core::mem::size_of::<LFRFIDEM4305>() - 68usize];
15887 ["Alignment of LFRFIDEM4305"][::core::mem::align_of::<LFRFIDEM4305>() - 4usize];
15888 ["Offset of field: LFRFIDEM4305::word"][::core::mem::offset_of!(LFRFIDEM4305, word) - 0usize];
15889 ["Offset of field: LFRFIDEM4305::mask"][::core::mem::offset_of!(LFRFIDEM4305, mask) - 64usize];
15890};
15891unsafe extern "C" {
15892 #[doc = "Write EM4305 tag data to tag\n\n # Arguments\n\n* `data` - The data to write (mask is taken from that data)"]
15893 pub fn em4305_write(data: *mut LFRFIDEM4305);
15894}
15895pub const LFRFIDFeatureASK: LFRFIDFeature = LFRFIDFeature(1);
15896#[doc = "ASK Demodulation"]
15897pub const LFRFIDFeaturePSK: LFRFIDFeature = LFRFIDFeature(2);
15898#[repr(transparent)]
15899#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15900pub struct LFRFIDFeature(pub core::ffi::c_uchar);
15901pub const LFRFIDProtocolEM4100: LFRFIDProtocol = LFRFIDProtocol(0);
15902pub const LFRFIDProtocolEM410032: LFRFIDProtocol = LFRFIDProtocol(1);
15903pub const LFRFIDProtocolEM410016: LFRFIDProtocol = LFRFIDProtocol(2);
15904pub const LFRFIDProtocolElectra: LFRFIDProtocol = LFRFIDProtocol(3);
15905pub const LFRFIDProtocolH10301: LFRFIDProtocol = LFRFIDProtocol(4);
15906pub const LFRFIDProtocolIdteck: LFRFIDProtocol = LFRFIDProtocol(5);
15907pub const LFRFIDProtocolIndala26: LFRFIDProtocol = LFRFIDProtocol(6);
15908pub const LFRFIDProtocolIOProxXSF: LFRFIDProtocol = LFRFIDProtocol(7);
15909pub const LFRFIDProtocolAwid: LFRFIDProtocol = LFRFIDProtocol(8);
15910pub const LFRFIDProtocolFDXA: LFRFIDProtocol = LFRFIDProtocol(9);
15911pub const LFRFIDProtocolFDXB: LFRFIDProtocol = LFRFIDProtocol(10);
15912pub const LFRFIDProtocolHidGeneric: LFRFIDProtocol = LFRFIDProtocol(11);
15913pub const LFRFIDProtocolHidExGeneric: LFRFIDProtocol = LFRFIDProtocol(12);
15914pub const LFRFIDProtocolPyramid: LFRFIDProtocol = LFRFIDProtocol(13);
15915pub const LFRFIDProtocolViking: LFRFIDProtocol = LFRFIDProtocol(14);
15916pub const LFRFIDProtocolJablotron: LFRFIDProtocol = LFRFIDProtocol(15);
15917pub const LFRFIDProtocolParadox: LFRFIDProtocol = LFRFIDProtocol(16);
15918pub const LFRFIDProtocolPACStanley: LFRFIDProtocol = LFRFIDProtocol(17);
15919pub const LFRFIDProtocolKeri: LFRFIDProtocol = LFRFIDProtocol(18);
15920pub const LFRFIDProtocolGallagher: LFRFIDProtocol = LFRFIDProtocol(19);
15921pub const LFRFIDProtocolNexwatch: LFRFIDProtocol = LFRFIDProtocol(20);
15922pub const LFRFIDProtocolSecurakey: LFRFIDProtocol = LFRFIDProtocol(21);
15923pub const LFRFIDProtocolGProxII: LFRFIDProtocol = LFRFIDProtocol(22);
15924pub const LFRFIDProtocolNoralsy: LFRFIDProtocol = LFRFIDProtocol(23);
15925pub const LFRFIDProtocolMax: LFRFIDProtocol = LFRFIDProtocol(24);
15926#[repr(transparent)]
15927#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15928pub struct LFRFIDProtocol(pub core::ffi::c_uchar);
15929unsafe extern "C" {
15930 pub static lfrfid_protocols: [*const ProtocolBase; 0usize];
15931}
15932pub const LFRFIDWriteTypeT5577: LFRFIDWriteType = LFRFIDWriteType(0);
15933pub const LFRFIDWriteTypeEM4305: LFRFIDWriteType = LFRFIDWriteType(1);
15934pub const LFRFIDWriteTypeMax: LFRFIDWriteType = LFRFIDWriteType(2);
15935#[repr(transparent)]
15936#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
15937pub struct LFRFIDWriteType(pub core::ffi::c_uchar);
15938#[repr(C)]
15939#[derive(Copy, Clone)]
15940pub struct LFRFIDWriteRequest {
15941 pub write_type: LFRFIDWriteType,
15942 pub __bindgen_anon_1: LFRFIDWriteRequest__bindgen_ty_1,
15943}
15944#[repr(C)]
15945#[derive(Copy, Clone)]
15946pub union LFRFIDWriteRequest__bindgen_ty_1 {
15947 pub t5577: LFRFIDT5577,
15948 pub em4305: LFRFIDEM4305,
15949}
15950#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15951const _: () = {
15952 ["Size of LFRFIDWriteRequest__bindgen_ty_1"]
15953 [::core::mem::size_of::<LFRFIDWriteRequest__bindgen_ty_1>() - 68usize];
15954 ["Alignment of LFRFIDWriteRequest__bindgen_ty_1"]
15955 [::core::mem::align_of::<LFRFIDWriteRequest__bindgen_ty_1>() - 4usize];
15956 ["Offset of field: LFRFIDWriteRequest__bindgen_ty_1::t5577"]
15957 [::core::mem::offset_of!(LFRFIDWriteRequest__bindgen_ty_1, t5577) - 0usize];
15958 ["Offset of field: LFRFIDWriteRequest__bindgen_ty_1::em4305"]
15959 [::core::mem::offset_of!(LFRFIDWriteRequest__bindgen_ty_1, em4305) - 0usize];
15960};
15961#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15962const _: () = {
15963 ["Size of LFRFIDWriteRequest"][::core::mem::size_of::<LFRFIDWriteRequest>() - 72usize];
15964 ["Alignment of LFRFIDWriteRequest"][::core::mem::align_of::<LFRFIDWriteRequest>() - 4usize];
15965 ["Offset of field: LFRFIDWriteRequest::write_type"]
15966 [::core::mem::offset_of!(LFRFIDWriteRequest, write_type) - 0usize];
15967};
15968unsafe extern "C" {
15969 #[doc = "Save protocol from dictionary to file\n\n # Arguments\n\n* `dict` -\n * `protocol` -\n * `filename` -\n # Returns\n\ntrue\n false"]
15970 pub fn lfrfid_dict_file_save(
15971 dict: *mut ProtocolDict,
15972 protocol: ProtocolId,
15973 filename: *const core::ffi::c_char,
15974 ) -> bool;
15975}
15976unsafe extern "C" {
15977 #[doc = "Load protocol from file to dictionary\n\n # Arguments\n\n* `dict` -\n * `filename` -\n # Returns\n\nProtocolId"]
15978 pub fn lfrfid_dict_file_load(
15979 dict: *mut ProtocolDict,
15980 filename: *const core::ffi::c_char,
15981 ) -> ProtocolId;
15982}
15983#[repr(C)]
15984#[derive(Debug, Copy, Clone)]
15985pub struct LFRFIDRawFile {
15986 _unused: [u8; 0],
15987}
15988unsafe extern "C" {
15989 #[doc = "Allocate a new LFRFIDRawFile instance\n\n # Arguments\n\n* `storage` -\n # Returns\n\nLFRFIDRawFile*"]
15990 pub fn lfrfid_raw_file_alloc(storage: *mut Storage) -> *mut LFRFIDRawFile;
15991}
15992unsafe extern "C" {
15993 #[doc = "Free a LFRFIDRawFile instance\n\n # Arguments\n\n* `file` -"]
15994 pub fn lfrfid_raw_file_free(file: *mut LFRFIDRawFile);
15995}
15996unsafe extern "C" {
15997 #[doc = "Open RAW file for writing\n\n # Arguments\n\n* `file` -\n * `file_path` -\n # Returns\n\nbool"]
15998 pub fn lfrfid_raw_file_open_write(
15999 file: *mut LFRFIDRawFile,
16000 file_path: *const core::ffi::c_char,
16001 ) -> bool;
16002}
16003unsafe extern "C" {
16004 #[doc = "Open RAW file for reading\n # Arguments\n\n* `file` -\n * `file_path` -\n # Returns\n\nbool"]
16005 pub fn lfrfid_raw_file_open_read(
16006 file: *mut LFRFIDRawFile,
16007 file_path: *const core::ffi::c_char,
16008 ) -> bool;
16009}
16010unsafe extern "C" {
16011 #[doc = "Write RAW file header\n\n # Arguments\n\n* `file` -\n * `frequency` -\n * `duty_cycle` -\n * `max_buffer_size` -\n # Returns\n\nbool"]
16012 pub fn lfrfid_raw_file_write_header(
16013 file: *mut LFRFIDRawFile,
16014 frequency: f32,
16015 duty_cycle: f32,
16016 max_buffer_size: u32,
16017 ) -> bool;
16018}
16019unsafe extern "C" {
16020 #[doc = "Write data to RAW file\n\n # Arguments\n\n* `file` -\n * `buffer_data` -\n * `buffer_size` -\n # Returns\n\nbool"]
16021 pub fn lfrfid_raw_file_write_buffer(
16022 file: *mut LFRFIDRawFile,
16023 buffer_data: *mut u8,
16024 buffer_size: usize,
16025 ) -> bool;
16026}
16027unsafe extern "C" {
16028 #[doc = "Read RAW file header\n\n # Arguments\n\n* `file` -\n * `frequency` -\n * `duty_cycle` -\n # Returns\n\nbool"]
16029 pub fn lfrfid_raw_file_read_header(
16030 file: *mut LFRFIDRawFile,
16031 frequency: *mut f32,
16032 duty_cycle: *mut f32,
16033 ) -> bool;
16034}
16035unsafe extern "C" {
16036 #[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"]
16037 pub fn lfrfid_raw_file_read_pair(
16038 file: *mut LFRFIDRawFile,
16039 duration: *mut u32,
16040 pulse: *mut u32,
16041 pass_end: *mut bool,
16042 ) -> bool;
16043}
16044pub const LFRFIDWorkerWriteOK: LFRFIDWorkerWriteResult = LFRFIDWorkerWriteResult(0);
16045pub const LFRFIDWorkerWriteProtocolCannotBeWritten: LFRFIDWorkerWriteResult =
16046 LFRFIDWorkerWriteResult(1);
16047pub const LFRFIDWorkerWriteFobCannotBeWritten: LFRFIDWorkerWriteResult = LFRFIDWorkerWriteResult(2);
16048pub const LFRFIDWorkerWriteTooLongToWrite: LFRFIDWorkerWriteResult = LFRFIDWorkerWriteResult(3);
16049#[repr(transparent)]
16050#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16051pub struct LFRFIDWorkerWriteResult(pub core::ffi::c_uchar);
16052pub const LFRFIDWorkerReadTypeAuto: LFRFIDWorkerReadType = LFRFIDWorkerReadType(0);
16053pub const LFRFIDWorkerReadTypeASKOnly: LFRFIDWorkerReadType = LFRFIDWorkerReadType(1);
16054pub const LFRFIDWorkerReadTypePSKOnly: LFRFIDWorkerReadType = LFRFIDWorkerReadType(2);
16055#[repr(transparent)]
16056#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16057pub struct LFRFIDWorkerReadType(pub core::ffi::c_uchar);
16058pub const LFRFIDWorkerReadSenseStart: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(0);
16059pub const LFRFIDWorkerReadSenseEnd: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(1);
16060pub const LFRFIDWorkerReadSenseCardStart: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(2);
16061pub const LFRFIDWorkerReadSenseCardEnd: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(3);
16062pub const LFRFIDWorkerReadStartASK: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(4);
16063pub const LFRFIDWorkerReadStartPSK: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(5);
16064pub const LFRFIDWorkerReadDone: LFRFIDWorkerReadResult = LFRFIDWorkerReadResult(6);
16065#[repr(transparent)]
16066#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16067pub struct LFRFIDWorkerReadResult(pub core::ffi::c_uchar);
16068pub const LFRFIDWorkerReadRawFileError: LFRFIDWorkerReadRawResult = LFRFIDWorkerReadRawResult(0);
16069pub const LFRFIDWorkerReadRawOverrun: LFRFIDWorkerReadRawResult = LFRFIDWorkerReadRawResult(1);
16070#[repr(transparent)]
16071#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16072pub struct LFRFIDWorkerReadRawResult(pub core::ffi::c_uchar);
16073pub const LFRFIDWorkerEmulateRawFileError: LFRFIDWorkerEmulateRawResult =
16074 LFRFIDWorkerEmulateRawResult(0);
16075pub const LFRFIDWorkerEmulateRawOverrun: LFRFIDWorkerEmulateRawResult =
16076 LFRFIDWorkerEmulateRawResult(1);
16077#[repr(transparent)]
16078#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16079pub struct LFRFIDWorkerEmulateRawResult(pub core::ffi::c_uchar);
16080pub type LFRFIDWorkerReadCallback = ::core::option::Option<
16081 unsafe extern "C" fn(
16082 result: LFRFIDWorkerReadResult,
16083 protocol: ProtocolId,
16084 context: *mut core::ffi::c_void,
16085 ),
16086>;
16087pub type LFRFIDWorkerWriteCallback = ::core::option::Option<
16088 unsafe extern "C" fn(result: LFRFIDWorkerWriteResult, context: *mut core::ffi::c_void),
16089>;
16090pub type LFRFIDWorkerReadRawCallback = ::core::option::Option<
16091 unsafe extern "C" fn(result: LFRFIDWorkerReadRawResult, context: *mut core::ffi::c_void),
16092>;
16093pub type LFRFIDWorkerEmulateRawCallback = ::core::option::Option<
16094 unsafe extern "C" fn(result: LFRFIDWorkerEmulateRawResult, context: *mut core::ffi::c_void),
16095>;
16096#[repr(C)]
16097#[derive(Debug, Copy, Clone)]
16098pub struct LFRFIDWorker {
16099 _unused: [u8; 0],
16100}
16101unsafe extern "C" {
16102 #[doc = "Allocate LF-RFID worker\n # Returns\n\nLFRFIDWorker*"]
16103 pub fn lfrfid_worker_alloc(dict: *mut ProtocolDict) -> *mut LFRFIDWorker;
16104}
16105unsafe extern "C" {
16106 #[doc = "Free LF-RFID worker\n\n # Arguments\n\n* `worker` - The worker"]
16107 pub fn lfrfid_worker_free(worker: *mut LFRFIDWorker);
16108}
16109unsafe extern "C" {
16110 #[doc = "Start LF-RFID worker thread\n\n # Arguments\n\n* `worker` - The worker"]
16111 pub fn lfrfid_worker_start_thread(worker: *mut LFRFIDWorker);
16112}
16113unsafe extern "C" {
16114 #[doc = "Stop LF-RFID worker thread\n\n # Arguments\n\n* `worker` - The worker"]
16115 pub fn lfrfid_worker_stop_thread(worker: *mut LFRFIDWorker);
16116}
16117unsafe extern "C" {
16118 #[doc = "Start read mode\n\n # Arguments\n\n* `worker` - The worker\n * `type` - The type\n * `callback` - The callback\n * `context` - The context"]
16119 pub fn lfrfid_worker_read_start(
16120 worker: *mut LFRFIDWorker,
16121 type_: LFRFIDWorkerReadType,
16122 callback: LFRFIDWorkerReadCallback,
16123 context: *mut core::ffi::c_void,
16124 );
16125}
16126unsafe extern "C" {
16127 #[doc = "Start write mode\n\n # Arguments\n\n* `worker` - The worker\n * `protocol` - The protocol\n * `callback` - The callback\n * `context` - The context"]
16128 pub fn lfrfid_worker_write_start(
16129 worker: *mut LFRFIDWorker,
16130 protocol: LFRFIDProtocol,
16131 callback: LFRFIDWorkerWriteCallback,
16132 context: *mut core::ffi::c_void,
16133 );
16134}
16135unsafe extern "C" {
16136 #[doc = "Start emulate mode\n\n # Arguments\n\n* `worker` - The worker\n * `protocol` (direction in) - The protocol"]
16137 pub fn lfrfid_worker_emulate_start(worker: *mut LFRFIDWorker, protocol: LFRFIDProtocol);
16138}
16139unsafe extern "C" {
16140 #[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"]
16141 pub fn lfrfid_worker_read_raw_start(
16142 worker: *mut LFRFIDWorker,
16143 filename: *const core::ffi::c_char,
16144 type_: LFRFIDWorkerReadType,
16145 callback: LFRFIDWorkerReadRawCallback,
16146 context: *mut core::ffi::c_void,
16147 );
16148}
16149unsafe extern "C" {
16150 #[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"]
16151 pub fn lfrfid_worker_emulate_raw_start(
16152 worker: *mut LFRFIDWorker,
16153 filename: *const core::ffi::c_char,
16154 callback: LFRFIDWorkerEmulateRawCallback,
16155 context: *mut core::ffi::c_void,
16156 );
16157}
16158unsafe extern "C" {
16159 #[doc = "Stop all modes\n\n # Arguments\n\n* `worker` - The worker"]
16160 pub fn lfrfid_worker_stop(worker: *mut LFRFIDWorker);
16161}
16162#[repr(C)]
16163#[derive(Debug, Copy, Clone)]
16164pub struct LFRFIDRawWorker {
16165 _unused: [u8; 0],
16166}
16167unsafe extern "C" {
16168 #[doc = "Allocate a new LFRFIDRawWorker instance\n\n # Returns\n\nLFRFIDRawWorker*"]
16169 pub fn lfrfid_raw_worker_alloc() -> *mut LFRFIDRawWorker;
16170}
16171unsafe extern "C" {
16172 #[doc = "Free a LFRFIDRawWorker instance\n\n # Arguments\n\n* `worker` - LFRFIDRawWorker instance"]
16173 pub fn lfrfid_raw_worker_free(worker: *mut LFRFIDRawWorker);
16174}
16175unsafe extern "C" {
16176 #[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"]
16177 pub fn lfrfid_raw_worker_start_read(
16178 worker: *mut LFRFIDRawWorker,
16179 file_path: *const core::ffi::c_char,
16180 frequency: f32,
16181 duty_cycle: f32,
16182 callback: LFRFIDWorkerReadRawCallback,
16183 context: *mut core::ffi::c_void,
16184 );
16185}
16186unsafe extern "C" {
16187 #[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"]
16188 pub fn lfrfid_raw_worker_start_emulate(
16189 worker: *mut LFRFIDRawWorker,
16190 file_path: *const core::ffi::c_char,
16191 callback: LFRFIDWorkerEmulateRawCallback,
16192 context: *mut core::ffi::c_void,
16193 );
16194}
16195unsafe extern "C" {
16196 #[doc = "Stop worker\n\n # Arguments\n\n* `worker` -"]
16197 pub fn lfrfid_raw_worker_stop(worker: *mut LFRFIDRawWorker);
16198}
16199#[doc = "Line Coding Structure"]
16200#[repr(C, packed)]
16201#[derive(Debug, Copy, Clone)]
16202pub struct usb_cdc_line_coding {
16203 #[doc = "<Data terminal rate, in bits per second."]
16204 pub dwDTERate: u32,
16205 #[doc = "<Stop bits."]
16206 pub bCharFormat: u8,
16207 #[doc = "<Parity."]
16208 pub bParityType: u8,
16209 #[doc = "<Data bits (5,6,7,8 or 16)."]
16210 pub bDataBits: u8,
16211}
16212#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16213const _: () = {
16214 ["Size of usb_cdc_line_coding"][::core::mem::size_of::<usb_cdc_line_coding>() - 7usize];
16215 ["Alignment of usb_cdc_line_coding"][::core::mem::align_of::<usb_cdc_line_coding>() - 1usize];
16216 ["Offset of field: usb_cdc_line_coding::dwDTERate"]
16217 [::core::mem::offset_of!(usb_cdc_line_coding, dwDTERate) - 0usize];
16218 ["Offset of field: usb_cdc_line_coding::bCharFormat"]
16219 [::core::mem::offset_of!(usb_cdc_line_coding, bCharFormat) - 4usize];
16220 ["Offset of field: usb_cdc_line_coding::bParityType"]
16221 [::core::mem::offset_of!(usb_cdc_line_coding, bParityType) - 5usize];
16222 ["Offset of field: usb_cdc_line_coding::bDataBits"]
16223 [::core::mem::offset_of!(usb_cdc_line_coding, bDataBits) - 6usize];
16224};
16225#[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."]
16226#[repr(C)]
16227#[derive(Debug, Copy, Clone)]
16228pub struct mbedtls_des3_context {
16229 #[doc = "< 3DES subkeys"]
16230 pub private_sk: [u32; 96usize],
16231}
16232#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16233const _: () = {
16234 ["Size of mbedtls_des3_context"][::core::mem::size_of::<mbedtls_des3_context>() - 384usize];
16235 ["Alignment of mbedtls_des3_context"][::core::mem::align_of::<mbedtls_des3_context>() - 4usize];
16236 ["Offset of field: mbedtls_des3_context::private_sk"]
16237 [::core::mem::offset_of!(mbedtls_des3_context, private_sk) - 0usize];
16238};
16239pub type mjs_val_t = u64;
16240#[repr(C)]
16241#[derive(Debug, Copy, Clone)]
16242pub struct mjs {
16243 _unused: [u8; 0],
16244}
16245pub const MJS_TYPE_UNDEFINED: mjs_type = mjs_type(0);
16246pub const MJS_TYPE_NULL: mjs_type = mjs_type(1);
16247pub const MJS_TYPE_BOOLEAN: mjs_type = mjs_type(2);
16248pub const MJS_TYPE_NUMBER: mjs_type = mjs_type(3);
16249pub const MJS_TYPE_STRING: mjs_type = mjs_type(4);
16250pub const MJS_TYPE_FOREIGN: mjs_type = mjs_type(5);
16251pub const MJS_TYPE_ARRAY_BUF: mjs_type = mjs_type(6);
16252pub const MJS_TYPE_ARRAY_BUF_VIEW: mjs_type = mjs_type(7);
16253pub const MJS_TYPE_OBJECT_GENERIC: mjs_type = mjs_type(8);
16254pub const MJS_TYPE_OBJECT_ARRAY: mjs_type = mjs_type(9);
16255pub const MJS_TYPE_OBJECT_FUNCTION: mjs_type = mjs_type(10);
16256pub const MJS_TYPES_CNT: mjs_type = mjs_type(11);
16257#[repr(transparent)]
16258#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16259pub struct mjs_type(pub core::ffi::c_uchar);
16260pub const MJS_OK: mjs_err = mjs_err(0);
16261pub const MJS_SYNTAX_ERROR: mjs_err = mjs_err(1);
16262pub const MJS_REFERENCE_ERROR: mjs_err = mjs_err(2);
16263pub const MJS_TYPE_ERROR: mjs_err = mjs_err(3);
16264pub const MJS_OUT_OF_MEMORY: mjs_err = mjs_err(4);
16265pub const MJS_INTERNAL_ERROR: mjs_err = mjs_err(5);
16266pub const MJS_NOT_IMPLEMENTED_ERROR: mjs_err = mjs_err(6);
16267pub const MJS_FILE_READ_ERROR: mjs_err = mjs_err(7);
16268pub const MJS_BAD_ARGS_ERROR: mjs_err = mjs_err(8);
16269pub const MJS_NEED_EXIT: mjs_err = mjs_err(9);
16270pub const MJS_ERRS_CNT: mjs_err = mjs_err(10);
16271#[repr(transparent)]
16272#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16273pub struct mjs_err(pub core::ffi::c_uchar);
16274pub use self::mjs_err as mjs_err_t;
16275pub type mjs_flags_poller_t = ::core::option::Option<unsafe extern "C" fn(mjs: *mut mjs)>;
16276unsafe extern "C" {
16277 pub fn mjs_create(context: *mut core::ffi::c_void) -> *mut mjs;
16278}
16279unsafe extern "C" {
16280 pub fn mjs_destroy(mjs: *mut mjs);
16281}
16282unsafe extern "C" {
16283 pub fn mjs_get_global(mjs: *mut mjs) -> mjs_val_t;
16284}
16285unsafe extern "C" {
16286 pub fn mjs_own(mjs: *mut mjs, v: *mut mjs_val_t);
16287}
16288unsafe extern "C" {
16289 pub fn mjs_disown(mjs: *mut mjs, v: *mut mjs_val_t) -> core::ffi::c_int;
16290}
16291unsafe extern "C" {
16292 pub fn mjs_set_errorf(
16293 mjs: *mut mjs,
16294 err: mjs_err_t,
16295 fmt: *const core::ffi::c_char,
16296 ...
16297 ) -> mjs_err_t;
16298}
16299unsafe extern "C" {
16300 pub fn mjs_exit(mjs: *mut mjs);
16301}
16302unsafe extern "C" {
16303 pub fn mjs_set_exec_flags_poller(mjs: *mut mjs, poller: mjs_flags_poller_t);
16304}
16305unsafe extern "C" {
16306 pub fn mjs_get_context(mjs: *mut mjs) -> *mut core::ffi::c_void;
16307}
16308unsafe extern "C" {
16309 pub fn mjs_prepend_errorf(
16310 mjs: *mut mjs,
16311 err: mjs_err_t,
16312 fmt: *const core::ffi::c_char,
16313 ...
16314 ) -> mjs_err_t;
16315}
16316unsafe extern "C" {
16317 pub fn mjs_print_error(
16318 mjs: *mut mjs,
16319 fp: *mut FILE,
16320 msg: *const core::ffi::c_char,
16321 print_stack_trace: core::ffi::c_int,
16322 );
16323}
16324unsafe extern "C" {
16325 pub fn mjs_strerror(mjs: *mut mjs, err: mjs_err) -> *const core::ffi::c_char;
16326}
16327unsafe extern "C" {
16328 pub fn mjs_get_stack_trace(mjs: *mut mjs) -> *const core::ffi::c_char;
16329}
16330unsafe extern "C" {
16331 pub fn mjs_set_generate_jsc(mjs: *mut mjs, generate_jsc: core::ffi::c_int);
16332}
16333unsafe extern "C" {
16334 pub fn mjs_nargs(mjs: *mut mjs) -> core::ffi::c_int;
16335}
16336unsafe extern "C" {
16337 pub fn mjs_arg(mjs: *mut mjs, n: core::ffi::c_int) -> mjs_val_t;
16338}
16339unsafe extern "C" {
16340 pub fn mjs_return(mjs: *mut mjs, v: mjs_val_t);
16341}
16342pub const MJS_DATAVIEW_U8: mjs_dataview_type_t = mjs_dataview_type_t(0);
16343pub const MJS_DATAVIEW_I8: mjs_dataview_type_t = mjs_dataview_type_t(1);
16344pub const MJS_DATAVIEW_U16: mjs_dataview_type_t = mjs_dataview_type_t(2);
16345pub const MJS_DATAVIEW_I16: mjs_dataview_type_t = mjs_dataview_type_t(3);
16346pub const MJS_DATAVIEW_U32: mjs_dataview_type_t = mjs_dataview_type_t(4);
16347pub const MJS_DATAVIEW_I32: mjs_dataview_type_t = mjs_dataview_type_t(5);
16348#[repr(transparent)]
16349#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16350pub struct mjs_dataview_type_t(pub core::ffi::c_uchar);
16351unsafe extern "C" {
16352 pub fn mjs_is_array_buf(v: mjs_val_t) -> core::ffi::c_int;
16353}
16354unsafe extern "C" {
16355 pub fn mjs_is_data_view(v: mjs_val_t) -> core::ffi::c_int;
16356}
16357unsafe extern "C" {
16358 pub fn mjs_is_typed_array(v: mjs_val_t) -> core::ffi::c_int;
16359}
16360unsafe extern "C" {
16361 pub fn mjs_mk_array_buf(
16362 mjs: *mut mjs,
16363 data: *mut core::ffi::c_char,
16364 buf_len: usize,
16365 ) -> mjs_val_t;
16366}
16367unsafe extern "C" {
16368 pub fn mjs_array_buf_get_ptr(
16369 mjs: *mut mjs,
16370 buf: mjs_val_t,
16371 bytelen: *mut usize,
16372 ) -> *mut core::ffi::c_char;
16373}
16374unsafe extern "C" {
16375 pub fn mjs_dataview_get_buf(mjs: *mut mjs, obj: mjs_val_t) -> mjs_val_t;
16376}
16377unsafe extern "C" {
16378 pub fn mjs_mk_array(mjs: *mut mjs) -> mjs_val_t;
16379}
16380unsafe extern "C" {
16381 pub fn mjs_array_length(mjs: *mut mjs, arr: mjs_val_t) -> core::ffi::c_ulong;
16382}
16383unsafe extern "C" {
16384 pub fn mjs_array_push(mjs: *mut mjs, arr: mjs_val_t, v: mjs_val_t) -> mjs_err_t;
16385}
16386unsafe extern "C" {
16387 pub fn mjs_array_get(arg1: *mut mjs, arr: mjs_val_t, index: core::ffi::c_ulong) -> mjs_val_t;
16388}
16389unsafe extern "C" {
16390 pub fn mjs_array_set(
16391 mjs: *mut mjs,
16392 arr: mjs_val_t,
16393 index: core::ffi::c_ulong,
16394 v: mjs_val_t,
16395 ) -> mjs_err_t;
16396}
16397unsafe extern "C" {
16398 pub fn mjs_is_array(v: mjs_val_t) -> core::ffi::c_int;
16399}
16400unsafe extern "C" {
16401 pub fn mjs_array_del(mjs: *mut mjs, arr: mjs_val_t, index: core::ffi::c_ulong);
16402}
16403unsafe extern "C" {
16404 pub fn mjs_exec(
16405 arg1: *mut mjs,
16406 src: *const core::ffi::c_char,
16407 res: *mut mjs_val_t,
16408 ) -> mjs_err_t;
16409}
16410unsafe extern "C" {
16411 pub fn mjs_exec_file(
16412 mjs: *mut mjs,
16413 path: *const core::ffi::c_char,
16414 res: *mut mjs_val_t,
16415 ) -> mjs_err_t;
16416}
16417unsafe extern "C" {
16418 pub fn mjs_apply(
16419 mjs: *mut mjs,
16420 res: *mut mjs_val_t,
16421 func: mjs_val_t,
16422 this_val: mjs_val_t,
16423 nargs: core::ffi::c_int,
16424 args: *mut mjs_val_t,
16425 ) -> mjs_err_t;
16426}
16427unsafe extern "C" {
16428 pub fn mjs_call(
16429 mjs: *mut mjs,
16430 res: *mut mjs_val_t,
16431 func: mjs_val_t,
16432 this_val: mjs_val_t,
16433 nargs: core::ffi::c_int,
16434 ...
16435 ) -> mjs_err_t;
16436}
16437unsafe extern "C" {
16438 pub fn mjs_get_this(mjs: *mut mjs) -> mjs_val_t;
16439}
16440pub const MJS_FFI_CTYPE_NONE: mjs_ffi_ctype = mjs_ffi_ctype(0);
16441pub const MJS_FFI_CTYPE_USERDATA: mjs_ffi_ctype = mjs_ffi_ctype(1);
16442pub const MJS_FFI_CTYPE_CALLBACK: mjs_ffi_ctype = mjs_ffi_ctype(2);
16443pub const MJS_FFI_CTYPE_INT: mjs_ffi_ctype = mjs_ffi_ctype(3);
16444pub const MJS_FFI_CTYPE_BOOL: mjs_ffi_ctype = mjs_ffi_ctype(4);
16445pub const MJS_FFI_CTYPE_DOUBLE: mjs_ffi_ctype = mjs_ffi_ctype(5);
16446pub const MJS_FFI_CTYPE_FLOAT: mjs_ffi_ctype = mjs_ffi_ctype(6);
16447pub const MJS_FFI_CTYPE_CHAR_PTR: mjs_ffi_ctype = mjs_ffi_ctype(7);
16448pub const MJS_FFI_CTYPE_VOID_PTR: mjs_ffi_ctype = mjs_ffi_ctype(8);
16449pub const MJS_FFI_CTYPE_STRUCT_MG_STR_PTR: mjs_ffi_ctype = mjs_ffi_ctype(9);
16450pub const MJS_FFI_CTYPE_STRUCT_MG_STR: mjs_ffi_ctype = mjs_ffi_ctype(10);
16451pub const MJS_FFI_CTYPE_INVALID: mjs_ffi_ctype = mjs_ffi_ctype(11);
16452#[repr(transparent)]
16453#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16454pub struct mjs_ffi_ctype(pub core::ffi::c_uchar);
16455pub type mjs_ffi_resolver_t = ::core::option::Option<
16456 unsafe extern "C" fn(
16457 handle: *mut core::ffi::c_void,
16458 symbol: *const core::ffi::c_char,
16459 ) -> *mut core::ffi::c_void,
16460>;
16461unsafe extern "C" {
16462 pub fn mjs_set_ffi_resolver(
16463 mjs: *mut mjs,
16464 dlsym: mjs_ffi_resolver_t,
16465 handle: *mut core::ffi::c_void,
16466 );
16467}
16468unsafe extern "C" {
16469 pub fn mjs_ffi_resolve(
16470 mjs: *mut mjs,
16471 symbol: *const core::ffi::c_char,
16472 ) -> *mut core::ffi::c_void;
16473}
16474unsafe extern "C" {
16475 pub fn mjs_is_object(v: mjs_val_t) -> core::ffi::c_int;
16476}
16477unsafe extern "C" {
16478 pub fn mjs_is_object_based(v: mjs_val_t) -> core::ffi::c_int;
16479}
16480unsafe extern "C" {
16481 pub fn mjs_mk_object(mjs: *mut mjs) -> mjs_val_t;
16482}
16483pub const MJS_STRUCT_FIELD_TYPE_INVALID: mjs_struct_field_type = mjs_struct_field_type(0);
16484pub const MJS_STRUCT_FIELD_TYPE_STRUCT: mjs_struct_field_type = mjs_struct_field_type(1);
16485pub const MJS_STRUCT_FIELD_TYPE_STRUCT_PTR: mjs_struct_field_type = mjs_struct_field_type(2);
16486pub const MJS_STRUCT_FIELD_TYPE_INT: mjs_struct_field_type = mjs_struct_field_type(3);
16487pub const MJS_STRUCT_FIELD_TYPE_BOOL: mjs_struct_field_type = mjs_struct_field_type(4);
16488pub const MJS_STRUCT_FIELD_TYPE_DOUBLE: mjs_struct_field_type = mjs_struct_field_type(5);
16489pub const MJS_STRUCT_FIELD_TYPE_FLOAT: mjs_struct_field_type = mjs_struct_field_type(6);
16490pub const MJS_STRUCT_FIELD_TYPE_CHAR_PTR: mjs_struct_field_type = mjs_struct_field_type(7);
16491pub const MJS_STRUCT_FIELD_TYPE_VOID_PTR: mjs_struct_field_type = mjs_struct_field_type(8);
16492pub const MJS_STRUCT_FIELD_TYPE_MG_STR_PTR: mjs_struct_field_type = mjs_struct_field_type(9);
16493pub const MJS_STRUCT_FIELD_TYPE_MG_STR: mjs_struct_field_type = mjs_struct_field_type(10);
16494pub const MJS_STRUCT_FIELD_TYPE_DATA: mjs_struct_field_type = mjs_struct_field_type(11);
16495pub const MJS_STRUCT_FIELD_TYPE_INT8: mjs_struct_field_type = mjs_struct_field_type(12);
16496pub const MJS_STRUCT_FIELD_TYPE_INT16: mjs_struct_field_type = mjs_struct_field_type(13);
16497pub const MJS_STRUCT_FIELD_TYPE_UINT8: mjs_struct_field_type = mjs_struct_field_type(14);
16498pub const MJS_STRUCT_FIELD_TYPE_UINT16: mjs_struct_field_type = mjs_struct_field_type(15);
16499pub const MJS_STRUCT_FIELD_TYPE_CUSTOM: mjs_struct_field_type = mjs_struct_field_type(16);
16500#[repr(transparent)]
16501#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16502pub struct mjs_struct_field_type(pub core::ffi::c_uchar);
16503#[repr(C)]
16504#[derive(Debug, Copy, Clone)]
16505pub struct mjs_c_struct_member {
16506 pub name: *const core::ffi::c_char,
16507 pub offset: core::ffi::c_int,
16508 pub type_: mjs_struct_field_type,
16509 pub arg: *const core::ffi::c_void,
16510}
16511#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16512const _: () = {
16513 ["Size of mjs_c_struct_member"][::core::mem::size_of::<mjs_c_struct_member>() - 16usize];
16514 ["Alignment of mjs_c_struct_member"][::core::mem::align_of::<mjs_c_struct_member>() - 4usize];
16515 ["Offset of field: mjs_c_struct_member::name"]
16516 [::core::mem::offset_of!(mjs_c_struct_member, name) - 0usize];
16517 ["Offset of field: mjs_c_struct_member::offset"]
16518 [::core::mem::offset_of!(mjs_c_struct_member, offset) - 4usize];
16519 ["Offset of field: mjs_c_struct_member::type_"]
16520 [::core::mem::offset_of!(mjs_c_struct_member, type_) - 8usize];
16521 ["Offset of field: mjs_c_struct_member::arg"]
16522 [::core::mem::offset_of!(mjs_c_struct_member, arg) - 12usize];
16523};
16524unsafe extern "C" {
16525 pub fn mjs_struct_to_obj(
16526 mjs: *mut mjs,
16527 base: *const core::ffi::c_void,
16528 members: *const mjs_c_struct_member,
16529 ) -> mjs_val_t;
16530}
16531unsafe extern "C" {
16532 pub fn mjs_get(
16533 mjs: *mut mjs,
16534 obj: mjs_val_t,
16535 name: *const core::ffi::c_char,
16536 name_len: usize,
16537 ) -> mjs_val_t;
16538}
16539unsafe extern "C" {
16540 pub fn mjs_get_v(mjs: *mut mjs, obj: mjs_val_t, name: mjs_val_t) -> mjs_val_t;
16541}
16542unsafe extern "C" {
16543 pub fn mjs_get_v_proto(mjs: *mut mjs, obj: mjs_val_t, key: mjs_val_t) -> mjs_val_t;
16544}
16545unsafe extern "C" {
16546 pub fn mjs_set(
16547 mjs: *mut mjs,
16548 obj: mjs_val_t,
16549 name: *const core::ffi::c_char,
16550 len: usize,
16551 val: mjs_val_t,
16552 ) -> mjs_err_t;
16553}
16554unsafe extern "C" {
16555 pub fn mjs_set_v(mjs: *mut mjs, obj: mjs_val_t, name: mjs_val_t, val: mjs_val_t) -> mjs_err_t;
16556}
16557unsafe extern "C" {
16558 pub fn mjs_del(
16559 mjs: *mut mjs,
16560 obj: mjs_val_t,
16561 name: *const core::ffi::c_char,
16562 len: usize,
16563 ) -> core::ffi::c_int;
16564}
16565unsafe extern "C" {
16566 pub fn mjs_next(mjs: *mut mjs, obj: mjs_val_t, iterator: *mut mjs_val_t) -> mjs_val_t;
16567}
16568pub type mjs_custom_obj_destructor_t =
16569 ::core::option::Option<unsafe extern "C" fn(mjs: *mut mjs, object: mjs_val_t)>;
16570pub type mjs_func_ptr_t = ::core::option::Option<unsafe extern "C" fn()>;
16571unsafe extern "C" {
16572 pub fn mjs_mk_null() -> mjs_val_t;
16573}
16574unsafe extern "C" {
16575 pub fn mjs_is_null(v: mjs_val_t) -> core::ffi::c_int;
16576}
16577unsafe extern "C" {
16578 pub fn mjs_mk_undefined() -> mjs_val_t;
16579}
16580unsafe extern "C" {
16581 pub fn mjs_is_undefined(v: mjs_val_t) -> core::ffi::c_int;
16582}
16583unsafe extern "C" {
16584 pub fn mjs_mk_number(mjs: *mut mjs, num: f64) -> mjs_val_t;
16585}
16586unsafe extern "C" {
16587 pub fn mjs_get_double(mjs: *mut mjs, v: mjs_val_t) -> f64;
16588}
16589unsafe extern "C" {
16590 pub fn mjs_get_int(mjs: *mut mjs, v: mjs_val_t) -> core::ffi::c_int;
16591}
16592unsafe extern "C" {
16593 pub fn mjs_get_int32(mjs: *mut mjs, v: mjs_val_t) -> i32;
16594}
16595unsafe extern "C" {
16596 pub fn mjs_is_number(v: mjs_val_t) -> core::ffi::c_int;
16597}
16598unsafe extern "C" {
16599 pub fn mjs_mk_foreign(mjs: *mut mjs, ptr: *mut core::ffi::c_void) -> mjs_val_t;
16600}
16601unsafe extern "C" {
16602 pub fn mjs_mk_foreign_func(mjs: *mut mjs, fn_: mjs_func_ptr_t) -> mjs_val_t;
16603}
16604unsafe extern "C" {
16605 pub fn mjs_get_ptr(mjs: *mut mjs, v: mjs_val_t) -> *mut core::ffi::c_void;
16606}
16607unsafe extern "C" {
16608 pub fn mjs_is_foreign(v: mjs_val_t) -> core::ffi::c_int;
16609}
16610unsafe extern "C" {
16611 pub fn mjs_mk_boolean(mjs: *mut mjs, v: core::ffi::c_int) -> mjs_val_t;
16612}
16613unsafe extern "C" {
16614 pub fn mjs_get_bool(mjs: *mut mjs, v: mjs_val_t) -> core::ffi::c_int;
16615}
16616unsafe extern "C" {
16617 pub fn mjs_is_boolean(v: mjs_val_t) -> core::ffi::c_int;
16618}
16619unsafe extern "C" {
16620 pub fn mjs_mk_function(mjs: *mut mjs, off: usize) -> mjs_val_t;
16621}
16622unsafe extern "C" {
16623 pub fn mjs_is_function(v: mjs_val_t) -> core::ffi::c_int;
16624}
16625unsafe extern "C" {
16626 pub fn mjs_mk_string(
16627 mjs: *mut mjs,
16628 str_: *const core::ffi::c_char,
16629 len: usize,
16630 copy: core::ffi::c_int,
16631 ) -> mjs_val_t;
16632}
16633unsafe extern "C" {
16634 pub fn mjs_is_string(v: mjs_val_t) -> core::ffi::c_int;
16635}
16636unsafe extern "C" {
16637 pub fn mjs_get_string(
16638 mjs: *mut mjs,
16639 v: *mut mjs_val_t,
16640 len: *mut usize,
16641 ) -> *const core::ffi::c_char;
16642}
16643unsafe extern "C" {
16644 pub fn mjs_get_cstring(mjs: *mut mjs, v: *mut mjs_val_t) -> *const core::ffi::c_char;
16645}
16646unsafe extern "C" {
16647 pub fn mjs_strcmp(
16648 mjs: *mut mjs,
16649 a: *mut mjs_val_t,
16650 b: *const core::ffi::c_char,
16651 len: usize,
16652 ) -> core::ffi::c_int;
16653}
16654pub type MjsPrintCallback = ::core::option::Option<
16655 unsafe extern "C" fn(ctx: *mut core::ffi::c_void, format: *const core::ffi::c_char, ...),
16656>;
16657unsafe extern "C" {
16658 pub fn mjs_typeof(v: mjs_val_t) -> *const core::ffi::c_char;
16659}
16660unsafe extern "C" {
16661 pub fn mjs_fprintf(v: mjs_val_t, mjs: *mut mjs, fp: *mut FILE);
16662}
16663unsafe extern "C" {
16664 pub fn mjs_sprintf(v: mjs_val_t, mjs: *mut mjs, buf: *mut core::ffi::c_char, buflen: usize);
16665}
16666unsafe extern "C" {
16667 pub fn mjs_disasm_all(
16668 mjs: *mut mjs,
16669 print_cb: MjsPrintCallback,
16670 print_ctx: *mut core::ffi::c_void,
16671 );
16672}
16673unsafe extern "C" {
16674 pub fn mjs_dump(
16675 mjs: *mut mjs,
16676 do_disasm: core::ffi::c_int,
16677 print_cb: MjsPrintCallback,
16678 print_ctx: *mut core::ffi::c_void,
16679 );
16680}
16681unsafe extern "C" {
16682 pub fn mjs_get_bcode_filename_by_offset(
16683 mjs: *mut mjs,
16684 offset: core::ffi::c_int,
16685 ) -> *const core::ffi::c_char;
16686}
16687unsafe extern "C" {
16688 pub fn mjs_get_lineno_by_offset(mjs: *mut mjs, offset: core::ffi::c_int) -> core::ffi::c_int;
16689}
16690unsafe extern "C" {
16691 pub fn mjs_get_offset_by_call_frame_num(
16692 mjs: *mut mjs,
16693 cf_num: core::ffi::c_int,
16694 ) -> core::ffi::c_int;
16695}
16696unsafe extern "C" {
16697 pub fn mjs_to_string(
16698 mjs: *mut mjs,
16699 v: *mut mjs_val_t,
16700 p: *mut *mut core::ffi::c_char,
16701 sizep: *mut usize,
16702 need_free: *mut core::ffi::c_int,
16703 ) -> mjs_err_t;
16704}
16705unsafe extern "C" {
16706 pub fn mjs_to_boolean_v(mjs: *mut mjs, v: mjs_val_t) -> mjs_val_t;
16707}
16708unsafe extern "C" {
16709 pub fn mjs_is_truthy(mjs: *mut mjs, v: mjs_val_t) -> core::ffi::c_int;
16710}
16711pub type pb_type_t = uint_least8_t;
16712pub type pb_size_t = uint_least16_t;
16713pub type pb_ssize_t = int_least16_t;
16714pub type pb_byte_t = uint_least8_t;
16715pub type pb_istream_t = pb_istream_s;
16716pub type pb_ostream_t = pb_ostream_s;
16717pub type pb_field_iter_t = pb_field_iter_s;
16718pub type pb_msgdesc_t = pb_msgdesc_s;
16719#[repr(C)]
16720#[derive(Debug, Copy, Clone)]
16721pub struct pb_msgdesc_s {
16722 pub field_info: *const u32,
16723 pub submsg_info: *const *const pb_msgdesc_t,
16724 pub default_value: *const pb_byte_t,
16725 pub field_callback: ::core::option::Option<
16726 unsafe extern "C" fn(
16727 istream: *mut pb_istream_t,
16728 ostream: *mut pb_ostream_t,
16729 field: *const pb_field_iter_t,
16730 ) -> bool,
16731 >,
16732 pub field_count: pb_size_t,
16733 pub required_field_count: pb_size_t,
16734 pub largest_tag: pb_size_t,
16735}
16736#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16737const _: () = {
16738 ["Size of pb_msgdesc_s"][::core::mem::size_of::<pb_msgdesc_s>() - 24usize];
16739 ["Alignment of pb_msgdesc_s"][::core::mem::align_of::<pb_msgdesc_s>() - 4usize];
16740 ["Offset of field: pb_msgdesc_s::field_info"]
16741 [::core::mem::offset_of!(pb_msgdesc_s, field_info) - 0usize];
16742 ["Offset of field: pb_msgdesc_s::submsg_info"]
16743 [::core::mem::offset_of!(pb_msgdesc_s, submsg_info) - 4usize];
16744 ["Offset of field: pb_msgdesc_s::default_value"]
16745 [::core::mem::offset_of!(pb_msgdesc_s, default_value) - 8usize];
16746 ["Offset of field: pb_msgdesc_s::field_callback"]
16747 [::core::mem::offset_of!(pb_msgdesc_s, field_callback) - 12usize];
16748 ["Offset of field: pb_msgdesc_s::field_count"]
16749 [::core::mem::offset_of!(pb_msgdesc_s, field_count) - 16usize];
16750 ["Offset of field: pb_msgdesc_s::required_field_count"]
16751 [::core::mem::offset_of!(pb_msgdesc_s, required_field_count) - 18usize];
16752 ["Offset of field: pb_msgdesc_s::largest_tag"]
16753 [::core::mem::offset_of!(pb_msgdesc_s, largest_tag) - 20usize];
16754};
16755#[repr(C)]
16756#[derive(Debug, Copy, Clone)]
16757pub struct pb_field_iter_s {
16758 pub descriptor: *const pb_msgdesc_t,
16759 pub message: *mut core::ffi::c_void,
16760 pub index: pb_size_t,
16761 pub field_info_index: pb_size_t,
16762 pub required_field_index: pb_size_t,
16763 pub submessage_index: pb_size_t,
16764 pub tag: pb_size_t,
16765 pub data_size: pb_size_t,
16766 pub array_size: pb_size_t,
16767 pub type_: pb_type_t,
16768 pub pField: *mut core::ffi::c_void,
16769 pub pData: *mut core::ffi::c_void,
16770 pub pSize: *mut core::ffi::c_void,
16771 pub submsg_desc: *const pb_msgdesc_t,
16772}
16773#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16774const _: () = {
16775 ["Size of pb_field_iter_s"][::core::mem::size_of::<pb_field_iter_s>() - 40usize];
16776 ["Alignment of pb_field_iter_s"][::core::mem::align_of::<pb_field_iter_s>() - 4usize];
16777 ["Offset of field: pb_field_iter_s::descriptor"]
16778 [::core::mem::offset_of!(pb_field_iter_s, descriptor) - 0usize];
16779 ["Offset of field: pb_field_iter_s::message"]
16780 [::core::mem::offset_of!(pb_field_iter_s, message) - 4usize];
16781 ["Offset of field: pb_field_iter_s::index"]
16782 [::core::mem::offset_of!(pb_field_iter_s, index) - 8usize];
16783 ["Offset of field: pb_field_iter_s::field_info_index"]
16784 [::core::mem::offset_of!(pb_field_iter_s, field_info_index) - 10usize];
16785 ["Offset of field: pb_field_iter_s::required_field_index"]
16786 [::core::mem::offset_of!(pb_field_iter_s, required_field_index) - 12usize];
16787 ["Offset of field: pb_field_iter_s::submessage_index"]
16788 [::core::mem::offset_of!(pb_field_iter_s, submessage_index) - 14usize];
16789 ["Offset of field: pb_field_iter_s::tag"]
16790 [::core::mem::offset_of!(pb_field_iter_s, tag) - 16usize];
16791 ["Offset of field: pb_field_iter_s::data_size"]
16792 [::core::mem::offset_of!(pb_field_iter_s, data_size) - 18usize];
16793 ["Offset of field: pb_field_iter_s::array_size"]
16794 [::core::mem::offset_of!(pb_field_iter_s, array_size) - 20usize];
16795 ["Offset of field: pb_field_iter_s::type_"]
16796 [::core::mem::offset_of!(pb_field_iter_s, type_) - 22usize];
16797 ["Offset of field: pb_field_iter_s::pField"]
16798 [::core::mem::offset_of!(pb_field_iter_s, pField) - 24usize];
16799 ["Offset of field: pb_field_iter_s::pData"]
16800 [::core::mem::offset_of!(pb_field_iter_s, pData) - 28usize];
16801 ["Offset of field: pb_field_iter_s::pSize"]
16802 [::core::mem::offset_of!(pb_field_iter_s, pSize) - 32usize];
16803 ["Offset of field: pb_field_iter_s::submsg_desc"]
16804 [::core::mem::offset_of!(pb_field_iter_s, submsg_desc) - 36usize];
16805};
16806pub type pb_field_t = pb_field_iter_t;
16807#[repr(C)]
16808#[derive(Debug, Copy, Clone)]
16809pub struct pb_bytes_array_s {
16810 pub size: pb_size_t,
16811 pub bytes: [pb_byte_t; 1usize],
16812}
16813#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16814const _: () = {
16815 ["Size of pb_bytes_array_s"][::core::mem::size_of::<pb_bytes_array_s>() - 4usize];
16816 ["Alignment of pb_bytes_array_s"][::core::mem::align_of::<pb_bytes_array_s>() - 2usize];
16817 ["Offset of field: pb_bytes_array_s::size"]
16818 [::core::mem::offset_of!(pb_bytes_array_s, size) - 0usize];
16819 ["Offset of field: pb_bytes_array_s::bytes"]
16820 [::core::mem::offset_of!(pb_bytes_array_s, bytes) - 2usize];
16821};
16822pub type pb_bytes_array_t = pb_bytes_array_s;
16823pub type pb_callback_t = pb_callback_s;
16824#[repr(C)]
16825#[derive(Copy, Clone)]
16826pub struct pb_callback_s {
16827 pub funcs: pb_callback_s__bindgen_ty_1,
16828 pub arg: *mut core::ffi::c_void,
16829}
16830#[repr(C)]
16831#[derive(Copy, Clone)]
16832pub union pb_callback_s__bindgen_ty_1 {
16833 pub decode: ::core::option::Option<
16834 unsafe extern "C" fn(
16835 stream: *mut pb_istream_t,
16836 field: *const pb_field_t,
16837 arg: *mut *mut core::ffi::c_void,
16838 ) -> bool,
16839 >,
16840 pub encode: ::core::option::Option<
16841 unsafe extern "C" fn(
16842 stream: *mut pb_ostream_t,
16843 field: *const pb_field_t,
16844 arg: *const *mut core::ffi::c_void,
16845 ) -> bool,
16846 >,
16847}
16848#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16849const _: () = {
16850 ["Size of pb_callback_s__bindgen_ty_1"]
16851 [::core::mem::size_of::<pb_callback_s__bindgen_ty_1>() - 4usize];
16852 ["Alignment of pb_callback_s__bindgen_ty_1"]
16853 [::core::mem::align_of::<pb_callback_s__bindgen_ty_1>() - 4usize];
16854 ["Offset of field: pb_callback_s__bindgen_ty_1::decode"]
16855 [::core::mem::offset_of!(pb_callback_s__bindgen_ty_1, decode) - 0usize];
16856 ["Offset of field: pb_callback_s__bindgen_ty_1::encode"]
16857 [::core::mem::offset_of!(pb_callback_s__bindgen_ty_1, encode) - 0usize];
16858};
16859#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16860const _: () = {
16861 ["Size of pb_callback_s"][::core::mem::size_of::<pb_callback_s>() - 8usize];
16862 ["Alignment of pb_callback_s"][::core::mem::align_of::<pb_callback_s>() - 4usize];
16863 ["Offset of field: pb_callback_s::funcs"]
16864 [::core::mem::offset_of!(pb_callback_s, funcs) - 0usize];
16865 ["Offset of field: pb_callback_s::arg"][::core::mem::offset_of!(pb_callback_s, arg) - 4usize];
16866};
16867unsafe extern "C" {
16868 pub fn pb_default_field_callback(
16869 istream: *mut pb_istream_t,
16870 ostream: *mut pb_ostream_t,
16871 field: *const pb_field_t,
16872 ) -> bool;
16873}
16874pub const PB_WT_VARINT: pb_wire_type_t = pb_wire_type_t(0);
16875pub const PB_WT_64BIT: pb_wire_type_t = pb_wire_type_t(1);
16876pub const PB_WT_STRING: pb_wire_type_t = pb_wire_type_t(2);
16877pub const PB_WT_32BIT: pb_wire_type_t = pb_wire_type_t(5);
16878pub const PB_WT_PACKED: pb_wire_type_t = pb_wire_type_t(255);
16879#[repr(transparent)]
16880#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
16881pub struct pb_wire_type_t(pub core::ffi::c_uchar);
16882pub type pb_extension_type_t = pb_extension_type_s;
16883pub type pb_extension_t = pb_extension_s;
16884#[repr(C)]
16885#[derive(Debug, Copy, Clone)]
16886pub struct pb_extension_type_s {
16887 pub decode: ::core::option::Option<
16888 unsafe extern "C" fn(
16889 stream: *mut pb_istream_t,
16890 extension: *mut pb_extension_t,
16891 tag: u32,
16892 wire_type: pb_wire_type_t,
16893 ) -> bool,
16894 >,
16895 pub encode: ::core::option::Option<
16896 unsafe extern "C" fn(stream: *mut pb_ostream_t, extension: *const pb_extension_t) -> bool,
16897 >,
16898 pub arg: *const core::ffi::c_void,
16899}
16900#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16901const _: () = {
16902 ["Size of pb_extension_type_s"][::core::mem::size_of::<pb_extension_type_s>() - 12usize];
16903 ["Alignment of pb_extension_type_s"][::core::mem::align_of::<pb_extension_type_s>() - 4usize];
16904 ["Offset of field: pb_extension_type_s::decode"]
16905 [::core::mem::offset_of!(pb_extension_type_s, decode) - 0usize];
16906 ["Offset of field: pb_extension_type_s::encode"]
16907 [::core::mem::offset_of!(pb_extension_type_s, encode) - 4usize];
16908 ["Offset of field: pb_extension_type_s::arg"]
16909 [::core::mem::offset_of!(pb_extension_type_s, arg) - 8usize];
16910};
16911#[repr(C)]
16912#[derive(Debug, Copy, Clone)]
16913pub struct pb_extension_s {
16914 pub type_: *const pb_extension_type_t,
16915 pub dest: *mut core::ffi::c_void,
16916 pub next: *mut pb_extension_t,
16917 pub found: bool,
16918}
16919#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16920const _: () = {
16921 ["Size of pb_extension_s"][::core::mem::size_of::<pb_extension_s>() - 16usize];
16922 ["Alignment of pb_extension_s"][::core::mem::align_of::<pb_extension_s>() - 4usize];
16923 ["Offset of field: pb_extension_s::type_"]
16924 [::core::mem::offset_of!(pb_extension_s, type_) - 0usize];
16925 ["Offset of field: pb_extension_s::dest"]
16926 [::core::mem::offset_of!(pb_extension_s, dest) - 4usize];
16927 ["Offset of field: pb_extension_s::next"]
16928 [::core::mem::offset_of!(pb_extension_s, next) - 8usize];
16929 ["Offset of field: pb_extension_s::found"]
16930 [::core::mem::offset_of!(pb_extension_s, found) - 12usize];
16931};
16932#[repr(C)]
16933#[derive(Debug, Copy, Clone)]
16934pub struct pb_istream_s {
16935 pub callback: ::core::option::Option<
16936 unsafe extern "C" fn(stream: *mut pb_istream_t, buf: *mut pb_byte_t, count: usize) -> bool,
16937 >,
16938 pub state: *mut core::ffi::c_void,
16939 pub bytes_left: usize,
16940 pub errmsg: *const core::ffi::c_char,
16941}
16942#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16943const _: () = {
16944 ["Size of pb_istream_s"][::core::mem::size_of::<pb_istream_s>() - 16usize];
16945 ["Alignment of pb_istream_s"][::core::mem::align_of::<pb_istream_s>() - 4usize];
16946 ["Offset of field: pb_istream_s::callback"]
16947 [::core::mem::offset_of!(pb_istream_s, callback) - 0usize];
16948 ["Offset of field: pb_istream_s::state"][::core::mem::offset_of!(pb_istream_s, state) - 4usize];
16949 ["Offset of field: pb_istream_s::bytes_left"]
16950 [::core::mem::offset_of!(pb_istream_s, bytes_left) - 8usize];
16951 ["Offset of field: pb_istream_s::errmsg"]
16952 [::core::mem::offset_of!(pb_istream_s, errmsg) - 12usize];
16953};
16954unsafe extern "C" {
16955 pub fn pb_decode(
16956 stream: *mut pb_istream_t,
16957 fields: *const pb_msgdesc_t,
16958 dest_struct: *mut core::ffi::c_void,
16959 ) -> bool;
16960}
16961unsafe extern "C" {
16962 pub fn pb_decode_ex(
16963 stream: *mut pb_istream_t,
16964 fields: *const pb_msgdesc_t,
16965 dest_struct: *mut core::ffi::c_void,
16966 flags: core::ffi::c_uint,
16967 ) -> bool;
16968}
16969unsafe extern "C" {
16970 pub fn pb_release(fields: *const pb_msgdesc_t, dest_struct: *mut core::ffi::c_void);
16971}
16972unsafe extern "C" {
16973 #[doc = "Functions for manipulating streams *"]
16974 pub fn pb_istream_from_buffer(buf: *const pb_byte_t, msglen: usize) -> pb_istream_t;
16975}
16976unsafe extern "C" {
16977 pub fn pb_read(stream: *mut pb_istream_t, buf: *mut pb_byte_t, count: usize) -> bool;
16978}
16979unsafe extern "C" {
16980 #[doc = "Helper functions for writing field callbacks *"]
16981 pub fn pb_decode_tag(
16982 stream: *mut pb_istream_t,
16983 wire_type: *mut pb_wire_type_t,
16984 tag: *mut u32,
16985 eof: *mut bool,
16986 ) -> bool;
16987}
16988unsafe extern "C" {
16989 pub fn pb_skip_field(stream: *mut pb_istream_t, wire_type: pb_wire_type_t) -> bool;
16990}
16991unsafe extern "C" {
16992 pub fn pb_decode_varint(stream: *mut pb_istream_t, dest: *mut u64) -> bool;
16993}
16994unsafe extern "C" {
16995 pub fn pb_decode_varint32(stream: *mut pb_istream_t, dest: *mut u32) -> bool;
16996}
16997unsafe extern "C" {
16998 pub fn pb_decode_bool(stream: *mut pb_istream_t, dest: *mut bool) -> bool;
16999}
17000unsafe extern "C" {
17001 pub fn pb_decode_svarint(stream: *mut pb_istream_t, dest: *mut i64) -> bool;
17002}
17003unsafe extern "C" {
17004 pub fn pb_decode_fixed32(stream: *mut pb_istream_t, dest: *mut core::ffi::c_void) -> bool;
17005}
17006unsafe extern "C" {
17007 pub fn pb_decode_fixed64(stream: *mut pb_istream_t, dest: *mut core::ffi::c_void) -> bool;
17008}
17009unsafe extern "C" {
17010 pub fn pb_make_string_substream(
17011 stream: *mut pb_istream_t,
17012 substream: *mut pb_istream_t,
17013 ) -> bool;
17014}
17015unsafe extern "C" {
17016 pub fn pb_close_string_substream(
17017 stream: *mut pb_istream_t,
17018 substream: *mut pb_istream_t,
17019 ) -> bool;
17020}
17021#[repr(C)]
17022#[derive(Debug, Copy, Clone)]
17023pub struct pb_ostream_s {
17024 pub callback: ::core::option::Option<
17025 unsafe extern "C" fn(
17026 stream: *mut pb_ostream_t,
17027 buf: *const pb_byte_t,
17028 count: usize,
17029 ) -> bool,
17030 >,
17031 pub state: *mut core::ffi::c_void,
17032 pub max_size: usize,
17033 pub bytes_written: usize,
17034 pub errmsg: *const core::ffi::c_char,
17035}
17036#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17037const _: () = {
17038 ["Size of pb_ostream_s"][::core::mem::size_of::<pb_ostream_s>() - 20usize];
17039 ["Alignment of pb_ostream_s"][::core::mem::align_of::<pb_ostream_s>() - 4usize];
17040 ["Offset of field: pb_ostream_s::callback"]
17041 [::core::mem::offset_of!(pb_ostream_s, callback) - 0usize];
17042 ["Offset of field: pb_ostream_s::state"][::core::mem::offset_of!(pb_ostream_s, state) - 4usize];
17043 ["Offset of field: pb_ostream_s::max_size"]
17044 [::core::mem::offset_of!(pb_ostream_s, max_size) - 8usize];
17045 ["Offset of field: pb_ostream_s::bytes_written"]
17046 [::core::mem::offset_of!(pb_ostream_s, bytes_written) - 12usize];
17047 ["Offset of field: pb_ostream_s::errmsg"]
17048 [::core::mem::offset_of!(pb_ostream_s, errmsg) - 16usize];
17049};
17050unsafe extern "C" {
17051 pub fn pb_encode(
17052 stream: *mut pb_ostream_t,
17053 fields: *const pb_msgdesc_t,
17054 src_struct: *const core::ffi::c_void,
17055 ) -> bool;
17056}
17057unsafe extern "C" {
17058 pub fn pb_encode_ex(
17059 stream: *mut pb_ostream_t,
17060 fields: *const pb_msgdesc_t,
17061 src_struct: *const core::ffi::c_void,
17062 flags: core::ffi::c_uint,
17063 ) -> bool;
17064}
17065unsafe extern "C" {
17066 pub fn pb_get_encoded_size(
17067 size: *mut usize,
17068 fields: *const pb_msgdesc_t,
17069 src_struct: *const core::ffi::c_void,
17070 ) -> bool;
17071}
17072unsafe extern "C" {
17073 #[doc = "Functions for manipulating streams *"]
17074 pub fn pb_ostream_from_buffer(buf: *mut pb_byte_t, bufsize: usize) -> pb_ostream_t;
17075}
17076unsafe extern "C" {
17077 pub fn pb_write(stream: *mut pb_ostream_t, buf: *const pb_byte_t, count: usize) -> bool;
17078}
17079unsafe extern "C" {
17080 #[doc = "Helper functions for writing field callbacks *"]
17081 pub fn pb_encode_tag_for_field(
17082 stream: *mut pb_ostream_t,
17083 field: *const pb_field_iter_t,
17084 ) -> bool;
17085}
17086unsafe extern "C" {
17087 pub fn pb_encode_tag(
17088 stream: *mut pb_ostream_t,
17089 wiretype: pb_wire_type_t,
17090 field_number: u32,
17091 ) -> bool;
17092}
17093unsafe extern "C" {
17094 pub fn pb_encode_varint(stream: *mut pb_ostream_t, value: u64) -> bool;
17095}
17096unsafe extern "C" {
17097 pub fn pb_encode_svarint(stream: *mut pb_ostream_t, value: i64) -> bool;
17098}
17099unsafe extern "C" {
17100 pub fn pb_encode_string(
17101 stream: *mut pb_ostream_t,
17102 buffer: *const pb_byte_t,
17103 size: usize,
17104 ) -> bool;
17105}
17106unsafe extern "C" {
17107 pub fn pb_encode_fixed32(stream: *mut pb_ostream_t, value: *const core::ffi::c_void) -> bool;
17108}
17109unsafe extern "C" {
17110 pub fn pb_encode_fixed64(stream: *mut pb_ostream_t, value: *const core::ffi::c_void) -> bool;
17111}
17112unsafe extern "C" {
17113 pub fn pb_encode_submessage(
17114 stream: *mut pb_ostream_t,
17115 fields: *const pb_msgdesc_t,
17116 src_struct: *const core::ffi::c_void,
17117 ) -> bool;
17118}
17119#[repr(C)]
17120#[derive(Debug, Copy, Clone)]
17121pub struct BitBuffer {
17122 _unused: [u8; 0],
17123}
17124unsafe extern "C" {
17125 #[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"]
17126 pub fn bit_buffer_alloc(capacity_bytes: usize) -> *mut BitBuffer;
17127}
17128unsafe extern "C" {
17129 #[doc = "Delete a BitBuffer instance.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance"]
17130 pub fn bit_buffer_free(buf: *mut BitBuffer);
17131}
17132unsafe extern "C" {
17133 #[doc = "Clear all data from a BitBuffer instance.\n\n # Arguments\n\n* `buf` (direction in, out) - pointer to a BitBuffer instance"]
17134 pub fn bit_buffer_reset(buf: *mut BitBuffer);
17135}
17136unsafe extern "C" {
17137 #[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"]
17138 pub fn bit_buffer_copy(buf: *mut BitBuffer, other: *const BitBuffer);
17139}
17140unsafe extern "C" {
17141 #[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"]
17142 pub fn bit_buffer_copy_right(buf: *mut BitBuffer, other: *const BitBuffer, start_index: usize);
17143}
17144unsafe extern "C" {
17145 #[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"]
17146 pub fn bit_buffer_copy_left(buf: *mut BitBuffer, other: *const BitBuffer, end_index: usize);
17147}
17148unsafe extern "C" {
17149 #[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"]
17150 pub fn bit_buffer_copy_bytes(buf: *mut BitBuffer, data: *const u8, size_bytes: usize);
17151}
17152unsafe extern "C" {
17153 #[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"]
17154 pub fn bit_buffer_copy_bits(buf: *mut BitBuffer, data: *const u8, size_bits: usize);
17155}
17156unsafe extern "C" {
17157 #[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..."]
17158 pub fn bit_buffer_copy_bytes_with_parity(
17159 buf: *mut BitBuffer,
17160 data: *const u8,
17161 size_bits: usize,
17162 );
17163}
17164unsafe extern "C" {
17165 #[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"]
17166 pub fn bit_buffer_write_bytes(
17167 buf: *const BitBuffer,
17168 dest: *mut core::ffi::c_void,
17169 size_bytes: usize,
17170 );
17171}
17172unsafe extern "C" {
17173 #[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..."]
17174 pub fn bit_buffer_write_bytes_with_parity(
17175 buf: *const BitBuffer,
17176 dest: *mut core::ffi::c_void,
17177 size_bytes: usize,
17178 bits_written: *mut usize,
17179 );
17180}
17181unsafe extern "C" {
17182 #[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"]
17183 pub fn bit_buffer_write_bytes_mid(
17184 buf: *const BitBuffer,
17185 dest: *mut core::ffi::c_void,
17186 start_index: usize,
17187 size_bytes: usize,
17188 );
17189}
17190unsafe extern "C" {
17191 #[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"]
17192 pub fn bit_buffer_has_partial_byte(buf: *const BitBuffer) -> bool;
17193}
17194unsafe extern "C" {
17195 #[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"]
17196 pub fn bit_buffer_starts_with_byte(buf: *const BitBuffer, byte: u8) -> bool;
17197}
17198unsafe extern "C" {
17199 #[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"]
17200 pub fn bit_buffer_get_capacity_bytes(buf: *const BitBuffer) -> usize;
17201}
17202unsafe extern "C" {
17203 #[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."]
17204 pub fn bit_buffer_get_size(buf: *const BitBuffer) -> usize;
17205}
17206unsafe extern "C" {
17207 #[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."]
17208 pub fn bit_buffer_get_size_bytes(buf: *const BitBuffer) -> usize;
17209}
17210unsafe extern "C" {
17211 #[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"]
17212 pub fn bit_buffer_get_byte(buf: *const BitBuffer, index: usize) -> u8;
17213}
17214unsafe extern "C" {
17215 #[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"]
17216 pub fn bit_buffer_get_byte_from_bit(buf: *const BitBuffer, index_bits: usize) -> u8;
17217}
17218unsafe extern "C" {
17219 #[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"]
17220 pub fn bit_buffer_get_data(buf: *const BitBuffer) -> *const u8;
17221}
17222unsafe extern "C" {
17223 #[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"]
17224 pub fn bit_buffer_get_parity(buf: *const BitBuffer) -> *const u8;
17225}
17226unsafe extern "C" {
17227 #[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"]
17228 pub fn bit_buffer_set_byte(buf: *mut BitBuffer, index: usize, byte: u8);
17229}
17230unsafe extern "C" {
17231 #[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"]
17232 pub fn bit_buffer_set_byte_with_parity(
17233 buff: *mut BitBuffer,
17234 index: usize,
17235 byte: u8,
17236 parity: bool,
17237 );
17238}
17239unsafe extern "C" {
17240 #[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"]
17241 pub fn bit_buffer_set_size(buf: *mut BitBuffer, new_size: usize);
17242}
17243unsafe extern "C" {
17244 #[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"]
17245 pub fn bit_buffer_set_size_bytes(buf: *mut BitBuffer, new_size_bytes: usize);
17246}
17247unsafe extern "C" {
17248 #[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"]
17249 pub fn bit_buffer_append(buf: *mut BitBuffer, other: *const BitBuffer);
17250}
17251unsafe extern "C" {
17252 #[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"]
17253 pub fn bit_buffer_append_right(
17254 buf: *mut BitBuffer,
17255 other: *const BitBuffer,
17256 start_index: usize,
17257 );
17258}
17259unsafe extern "C" {
17260 #[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"]
17261 pub fn bit_buffer_append_byte(buf: *mut BitBuffer, byte: u8);
17262}
17263unsafe extern "C" {
17264 #[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"]
17265 pub fn bit_buffer_append_bytes(buf: *mut BitBuffer, data: *const u8, size_bytes: usize);
17266}
17267unsafe extern "C" {
17268 #[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"]
17269 pub fn bit_buffer_append_bit(buf: *mut BitBuffer, bit: bool);
17270}
17271#[doc = "< Display full(verbose) name."]
17272pub const NfcDeviceNameTypeFull: NfcDeviceNameType = NfcDeviceNameType(0);
17273#[doc = "< Display shortened name."]
17274pub const NfcDeviceNameTypeShort: NfcDeviceNameType = NfcDeviceNameType(1);
17275#[repr(transparent)]
17276#[doc = "Verbosity level of the displayed NFC device name."]
17277#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17278pub struct NfcDeviceNameType(pub core::ffi::c_uchar);
17279#[doc = "Generic opaque type for protocol-specific NFC device data."]
17280pub type NfcDeviceData = core::ffi::c_void;
17281#[doc = "Allocate the protocol-specific NFC device data instance.\n\n # Returns\n\npointer to the allocated instance."]
17282pub type NfcDeviceAlloc = ::core::option::Option<unsafe extern "C" fn() -> *mut NfcDeviceData>;
17283#[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."]
17284pub type NfcDeviceFree = ::core::option::Option<unsafe extern "C" fn(data: *mut NfcDeviceData)>;
17285#[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."]
17286pub type NfcDeviceReset = ::core::option::Option<unsafe extern "C" fn(data: *mut NfcDeviceData)>;
17287#[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."]
17288pub type NfcDeviceCopy = ::core::option::Option<
17289 unsafe extern "C" fn(data: *mut NfcDeviceData, other: *const NfcDeviceData),
17290>;
17291#[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."]
17292pub type NfcDeviceVerify = ::core::option::Option<
17293 unsafe extern "C" fn(data: *mut NfcDeviceData, device_type: *const FuriString) -> bool,
17294>;
17295#[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."]
17296pub type NfcDeviceLoad = ::core::option::Option<
17297 unsafe extern "C" fn(data: *mut NfcDeviceData, ff: *mut FlipperFormat, version: u32) -> bool,
17298>;
17299#[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."]
17300pub type NfcDeviceSave = ::core::option::Option<
17301 unsafe extern "C" fn(data: *const NfcDeviceData, ff: *mut FlipperFormat) -> bool,
17302>;
17303#[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."]
17304pub type NfcDeviceEqual = ::core::option::Option<
17305 unsafe extern "C" fn(data: *const NfcDeviceData, other: *const NfcDeviceData) -> bool,
17306>;
17307#[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."]
17308pub type NfcDeviceGetName = ::core::option::Option<
17309 unsafe extern "C" fn(
17310 data: *const NfcDeviceData,
17311 name_type: NfcDeviceNameType,
17312 ) -> *const core::ffi::c_char,
17313>;
17314#[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."]
17315pub type NfcDeviceGetUid = ::core::option::Option<
17316 unsafe extern "C" fn(data: *const NfcDeviceData, uid_len: *mut usize) -> *const u8,
17317>;
17318#[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."]
17319pub type NfcDeviceSetUid = ::core::option::Option<
17320 unsafe extern "C" fn(data: *mut NfcDeviceData, uid: *const u8, uid_len: usize) -> bool,
17321>;
17322#[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."]
17323pub type NfcDeviceGetBaseData =
17324 ::core::option::Option<unsafe extern "C" fn(data: *const NfcDeviceData) -> *mut NfcDeviceData>;
17325#[doc = "Generic NFC device interface.\n\n Each protocol must fill this structure with its own function implementations."]
17326#[repr(C)]
17327#[derive(Debug, Copy, Clone)]
17328pub struct NfcDeviceBase {
17329 #[doc = "< Pointer to a statically-allocated string with the protocol name."]
17330 pub protocol_name: *const core::ffi::c_char,
17331 #[doc = "< Pointer to the alloc() function."]
17332 pub alloc: NfcDeviceAlloc,
17333 #[doc = "< Pointer to the free() function."]
17334 pub free: NfcDeviceFree,
17335 #[doc = "< Pointer to the reset() function."]
17336 pub reset: NfcDeviceReset,
17337 #[doc = "< Pointer to the copy() function."]
17338 pub copy: NfcDeviceCopy,
17339 #[doc = "< Deprecated. Set to NULL in new protocols."]
17340 pub verify: NfcDeviceVerify,
17341 #[doc = "< Pointer to the load() function."]
17342 pub load: NfcDeviceLoad,
17343 #[doc = "< Pointer to the save() function."]
17344 pub save: NfcDeviceSave,
17345 #[doc = "< Pointer to the is_equal() function."]
17346 pub is_equal: NfcDeviceEqual,
17347 #[doc = "< Pointer to the get_name() function."]
17348 pub get_name: NfcDeviceGetName,
17349 #[doc = "< Pointer to the get_uid() function."]
17350 pub get_uid: NfcDeviceGetUid,
17351 #[doc = "< Pointer to the set_uid() function."]
17352 pub set_uid: NfcDeviceSetUid,
17353 #[doc = "< Pointer to the get_base_data() function."]
17354 pub get_base_data: NfcDeviceGetBaseData,
17355}
17356#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17357const _: () = {
17358 ["Size of NfcDeviceBase"][::core::mem::size_of::<NfcDeviceBase>() - 52usize];
17359 ["Alignment of NfcDeviceBase"][::core::mem::align_of::<NfcDeviceBase>() - 4usize];
17360 ["Offset of field: NfcDeviceBase::protocol_name"]
17361 [::core::mem::offset_of!(NfcDeviceBase, protocol_name) - 0usize];
17362 ["Offset of field: NfcDeviceBase::alloc"]
17363 [::core::mem::offset_of!(NfcDeviceBase, alloc) - 4usize];
17364 ["Offset of field: NfcDeviceBase::free"][::core::mem::offset_of!(NfcDeviceBase, free) - 8usize];
17365 ["Offset of field: NfcDeviceBase::reset"]
17366 [::core::mem::offset_of!(NfcDeviceBase, reset) - 12usize];
17367 ["Offset of field: NfcDeviceBase::copy"]
17368 [::core::mem::offset_of!(NfcDeviceBase, copy) - 16usize];
17369 ["Offset of field: NfcDeviceBase::verify"]
17370 [::core::mem::offset_of!(NfcDeviceBase, verify) - 20usize];
17371 ["Offset of field: NfcDeviceBase::load"]
17372 [::core::mem::offset_of!(NfcDeviceBase, load) - 24usize];
17373 ["Offset of field: NfcDeviceBase::save"]
17374 [::core::mem::offset_of!(NfcDeviceBase, save) - 28usize];
17375 ["Offset of field: NfcDeviceBase::is_equal"]
17376 [::core::mem::offset_of!(NfcDeviceBase, is_equal) - 32usize];
17377 ["Offset of field: NfcDeviceBase::get_name"]
17378 [::core::mem::offset_of!(NfcDeviceBase, get_name) - 36usize];
17379 ["Offset of field: NfcDeviceBase::get_uid"]
17380 [::core::mem::offset_of!(NfcDeviceBase, get_uid) - 40usize];
17381 ["Offset of field: NfcDeviceBase::set_uid"]
17382 [::core::mem::offset_of!(NfcDeviceBase, set_uid) - 44usize];
17383 ["Offset of field: NfcDeviceBase::get_base_data"]
17384 [::core::mem::offset_of!(NfcDeviceBase, get_base_data) - 48usize];
17385};
17386pub const Iso14443_3aErrorNone: Iso14443_3aError = Iso14443_3aError(0);
17387pub const Iso14443_3aErrorNotPresent: Iso14443_3aError = Iso14443_3aError(1);
17388pub const Iso14443_3aErrorColResFailed: Iso14443_3aError = Iso14443_3aError(2);
17389pub const Iso14443_3aErrorBufferOverflow: Iso14443_3aError = Iso14443_3aError(3);
17390pub const Iso14443_3aErrorCommunication: Iso14443_3aError = Iso14443_3aError(4);
17391pub const Iso14443_3aErrorFieldOff: Iso14443_3aError = Iso14443_3aError(5);
17392pub const Iso14443_3aErrorWrongCrc: Iso14443_3aError = Iso14443_3aError(6);
17393pub const Iso14443_3aErrorTimeout: Iso14443_3aError = Iso14443_3aError(7);
17394#[repr(transparent)]
17395#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17396pub struct Iso14443_3aError(pub core::ffi::c_uchar);
17397#[repr(C)]
17398#[derive(Debug, Copy, Clone)]
17399pub struct Iso14443_3aSensResp {
17400 pub sens_resp: [u8; 2usize],
17401}
17402#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17403const _: () = {
17404 ["Size of Iso14443_3aSensResp"][::core::mem::size_of::<Iso14443_3aSensResp>() - 2usize];
17405 ["Alignment of Iso14443_3aSensResp"][::core::mem::align_of::<Iso14443_3aSensResp>() - 1usize];
17406 ["Offset of field: Iso14443_3aSensResp::sens_resp"]
17407 [::core::mem::offset_of!(Iso14443_3aSensResp, sens_resp) - 0usize];
17408};
17409#[repr(C)]
17410#[derive(Debug, Copy, Clone)]
17411pub struct Iso14443_3aSddReq {
17412 pub sel_cmd: u8,
17413 pub sel_par: u8,
17414 pub data: [u8; 4usize],
17415}
17416#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17417const _: () = {
17418 ["Size of Iso14443_3aSddReq"][::core::mem::size_of::<Iso14443_3aSddReq>() - 6usize];
17419 ["Alignment of Iso14443_3aSddReq"][::core::mem::align_of::<Iso14443_3aSddReq>() - 1usize];
17420 ["Offset of field: Iso14443_3aSddReq::sel_cmd"]
17421 [::core::mem::offset_of!(Iso14443_3aSddReq, sel_cmd) - 0usize];
17422 ["Offset of field: Iso14443_3aSddReq::sel_par"]
17423 [::core::mem::offset_of!(Iso14443_3aSddReq, sel_par) - 1usize];
17424 ["Offset of field: Iso14443_3aSddReq::data"]
17425 [::core::mem::offset_of!(Iso14443_3aSddReq, data) - 2usize];
17426};
17427#[repr(C)]
17428#[derive(Debug, Copy, Clone)]
17429pub struct Iso14443_3aSddResp {
17430 pub nfcid: [u8; 4usize],
17431 pub bss: u8,
17432}
17433#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17434const _: () = {
17435 ["Size of Iso14443_3aSddResp"][::core::mem::size_of::<Iso14443_3aSddResp>() - 5usize];
17436 ["Alignment of Iso14443_3aSddResp"][::core::mem::align_of::<Iso14443_3aSddResp>() - 1usize];
17437 ["Offset of field: Iso14443_3aSddResp::nfcid"]
17438 [::core::mem::offset_of!(Iso14443_3aSddResp, nfcid) - 0usize];
17439 ["Offset of field: Iso14443_3aSddResp::bss"]
17440 [::core::mem::offset_of!(Iso14443_3aSddResp, bss) - 4usize];
17441};
17442#[repr(C)]
17443#[derive(Debug, Copy, Clone)]
17444pub struct Iso14443_3aSelReq {
17445 pub sel_cmd: u8,
17446 pub sel_par: u8,
17447 pub nfcid: [u8; 4usize],
17448 pub bcc: u8,
17449}
17450#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17451const _: () = {
17452 ["Size of Iso14443_3aSelReq"][::core::mem::size_of::<Iso14443_3aSelReq>() - 7usize];
17453 ["Alignment of Iso14443_3aSelReq"][::core::mem::align_of::<Iso14443_3aSelReq>() - 1usize];
17454 ["Offset of field: Iso14443_3aSelReq::sel_cmd"]
17455 [::core::mem::offset_of!(Iso14443_3aSelReq, sel_cmd) - 0usize];
17456 ["Offset of field: Iso14443_3aSelReq::sel_par"]
17457 [::core::mem::offset_of!(Iso14443_3aSelReq, sel_par) - 1usize];
17458 ["Offset of field: Iso14443_3aSelReq::nfcid"]
17459 [::core::mem::offset_of!(Iso14443_3aSelReq, nfcid) - 2usize];
17460 ["Offset of field: Iso14443_3aSelReq::bcc"]
17461 [::core::mem::offset_of!(Iso14443_3aSelReq, bcc) - 6usize];
17462};
17463#[repr(C)]
17464#[derive(Debug, Copy, Clone)]
17465pub struct Iso14443_3aSelResp {
17466 pub sak: u8,
17467}
17468#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17469const _: () = {
17470 ["Size of Iso14443_3aSelResp"][::core::mem::size_of::<Iso14443_3aSelResp>() - 1usize];
17471 ["Alignment of Iso14443_3aSelResp"][::core::mem::align_of::<Iso14443_3aSelResp>() - 1usize];
17472 ["Offset of field: Iso14443_3aSelResp::sak"]
17473 [::core::mem::offset_of!(Iso14443_3aSelResp, sak) - 0usize];
17474};
17475#[repr(C)]
17476#[derive(Debug, Copy, Clone)]
17477pub struct Iso14443_3aData {
17478 pub uid: [u8; 10usize],
17479 pub uid_len: u8,
17480 pub atqa: [u8; 2usize],
17481 pub sak: u8,
17482}
17483#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17484const _: () = {
17485 ["Size of Iso14443_3aData"][::core::mem::size_of::<Iso14443_3aData>() - 14usize];
17486 ["Alignment of Iso14443_3aData"][::core::mem::align_of::<Iso14443_3aData>() - 1usize];
17487 ["Offset of field: Iso14443_3aData::uid"]
17488 [::core::mem::offset_of!(Iso14443_3aData, uid) - 0usize];
17489 ["Offset of field: Iso14443_3aData::uid_len"]
17490 [::core::mem::offset_of!(Iso14443_3aData, uid_len) - 10usize];
17491 ["Offset of field: Iso14443_3aData::atqa"]
17492 [::core::mem::offset_of!(Iso14443_3aData, atqa) - 11usize];
17493 ["Offset of field: Iso14443_3aData::sak"]
17494 [::core::mem::offset_of!(Iso14443_3aData, sak) - 13usize];
17495};
17496unsafe extern "C" {
17497 pub fn iso14443_3a_alloc() -> *mut Iso14443_3aData;
17498}
17499unsafe extern "C" {
17500 pub fn iso14443_3a_free(data: *mut Iso14443_3aData);
17501}
17502unsafe extern "C" {
17503 pub fn iso14443_3a_reset(data: *mut Iso14443_3aData);
17504}
17505unsafe extern "C" {
17506 pub fn iso14443_3a_copy(data: *mut Iso14443_3aData, other: *const Iso14443_3aData);
17507}
17508unsafe extern "C" {
17509 pub fn iso14443_3a_verify(data: *mut Iso14443_3aData, device_type: *const FuriString) -> bool;
17510}
17511unsafe extern "C" {
17512 pub fn iso14443_3a_load(
17513 data: *mut Iso14443_3aData,
17514 ff: *mut FlipperFormat,
17515 version: u32,
17516 ) -> bool;
17517}
17518unsafe extern "C" {
17519 pub fn iso14443_3a_save(data: *const Iso14443_3aData, ff: *mut FlipperFormat) -> bool;
17520}
17521unsafe extern "C" {
17522 pub fn iso14443_3a_is_equal(
17523 data: *const Iso14443_3aData,
17524 other: *const Iso14443_3aData,
17525 ) -> bool;
17526}
17527unsafe extern "C" {
17528 pub fn iso14443_3a_get_device_name(
17529 data: *const Iso14443_3aData,
17530 name_type: NfcDeviceNameType,
17531 ) -> *const core::ffi::c_char;
17532}
17533unsafe extern "C" {
17534 pub fn iso14443_3a_get_uid(data: *const Iso14443_3aData, uid_len: *mut usize) -> *const u8;
17535}
17536unsafe extern "C" {
17537 pub fn iso14443_3a_set_uid(data: *mut Iso14443_3aData, uid: *const u8, uid_len: usize) -> bool;
17538}
17539unsafe extern "C" {
17540 pub fn iso14443_3a_get_base_data(data: *const Iso14443_3aData) -> *mut Iso14443_3aData;
17541}
17542unsafe extern "C" {
17543 pub fn iso14443_3a_get_cuid(data: *const Iso14443_3aData) -> u32;
17544}
17545unsafe extern "C" {
17546 pub fn iso14443_3a_supports_iso14443_4(data: *const Iso14443_3aData) -> bool;
17547}
17548unsafe extern "C" {
17549 pub fn iso14443_3a_get_sak(data: *const Iso14443_3aData) -> u8;
17550}
17551unsafe extern "C" {
17552 pub fn iso14443_3a_get_atqa(data: *const Iso14443_3aData, atqa: *mut u8);
17553}
17554unsafe extern "C" {
17555 pub fn iso14443_3a_set_sak(data: *mut Iso14443_3aData, sak: u8);
17556}
17557unsafe extern "C" {
17558 pub fn iso14443_3a_set_atqa(data: *mut Iso14443_3aData, atqa: *const u8);
17559}
17560pub const MfClassicErrorNone: MfClassicError = MfClassicError(0);
17561pub const MfClassicErrorNotPresent: MfClassicError = MfClassicError(1);
17562pub const MfClassicErrorProtocol: MfClassicError = MfClassicError(2);
17563pub const MfClassicErrorAuth: MfClassicError = MfClassicError(3);
17564pub const MfClassicErrorPartialRead: MfClassicError = MfClassicError(4);
17565pub const MfClassicErrorTimeout: MfClassicError = MfClassicError(5);
17566#[repr(transparent)]
17567#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17568pub struct MfClassicError(pub core::ffi::c_uchar);
17569pub const MfClassicTypeMini: MfClassicType = MfClassicType(0);
17570pub const MfClassicType1k: MfClassicType = MfClassicType(1);
17571pub const MfClassicType4k: MfClassicType = MfClassicType(2);
17572pub const MfClassicTypeNum: MfClassicType = MfClassicType(3);
17573#[repr(transparent)]
17574#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17575pub struct MfClassicType(pub core::ffi::c_uchar);
17576pub const MfClassicActionDataRead: MfClassicAction = MfClassicAction(0);
17577pub const MfClassicActionDataWrite: MfClassicAction = MfClassicAction(1);
17578pub const MfClassicActionDataInc: MfClassicAction = MfClassicAction(2);
17579pub const MfClassicActionDataDec: MfClassicAction = MfClassicAction(3);
17580pub const MfClassicActionKeyARead: MfClassicAction = MfClassicAction(4);
17581pub const MfClassicActionKeyAWrite: MfClassicAction = MfClassicAction(5);
17582pub const MfClassicActionKeyBRead: MfClassicAction = MfClassicAction(6);
17583pub const MfClassicActionKeyBWrite: MfClassicAction = MfClassicAction(7);
17584pub const MfClassicActionACRead: MfClassicAction = MfClassicAction(8);
17585pub const MfClassicActionACWrite: MfClassicAction = MfClassicAction(9);
17586#[repr(transparent)]
17587#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17588pub struct MfClassicAction(pub core::ffi::c_uchar);
17589pub const MfClassicValueCommandIncrement: MfClassicValueCommand = MfClassicValueCommand(0);
17590pub const MfClassicValueCommandDecrement: MfClassicValueCommand = MfClassicValueCommand(1);
17591pub const MfClassicValueCommandRestore: MfClassicValueCommand = MfClassicValueCommand(2);
17592pub const MfClassicValueCommandInvalid: MfClassicValueCommand = MfClassicValueCommand(3);
17593#[repr(transparent)]
17594#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17595pub struct MfClassicValueCommand(pub core::ffi::c_uchar);
17596#[repr(C)]
17597#[derive(Debug, Copy, Clone)]
17598pub struct MfClassicBlock {
17599 pub data: [u8; 16usize],
17600}
17601#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17602const _: () = {
17603 ["Size of MfClassicBlock"][::core::mem::size_of::<MfClassicBlock>() - 16usize];
17604 ["Alignment of MfClassicBlock"][::core::mem::align_of::<MfClassicBlock>() - 1usize];
17605 ["Offset of field: MfClassicBlock::data"]
17606 [::core::mem::offset_of!(MfClassicBlock, data) - 0usize];
17607};
17608pub const MfClassicKeyTypeA: MfClassicKeyType = MfClassicKeyType(0);
17609pub const MfClassicKeyTypeB: MfClassicKeyType = MfClassicKeyType(1);
17610#[repr(transparent)]
17611#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17612pub struct MfClassicKeyType(pub core::ffi::c_uchar);
17613#[repr(C)]
17614#[derive(Debug, Copy, Clone)]
17615pub struct MfClassicKey {
17616 pub data: [u8; 6usize],
17617}
17618#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17619const _: () = {
17620 ["Size of MfClassicKey"][::core::mem::size_of::<MfClassicKey>() - 6usize];
17621 ["Alignment of MfClassicKey"][::core::mem::align_of::<MfClassicKey>() - 1usize];
17622 ["Offset of field: MfClassicKey::data"][::core::mem::offset_of!(MfClassicKey, data) - 0usize];
17623};
17624#[repr(C)]
17625#[derive(Debug, Copy, Clone)]
17626pub struct MfClassicAccessBits {
17627 pub data: [u8; 4usize],
17628}
17629#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17630const _: () = {
17631 ["Size of MfClassicAccessBits"][::core::mem::size_of::<MfClassicAccessBits>() - 4usize];
17632 ["Alignment of MfClassicAccessBits"][::core::mem::align_of::<MfClassicAccessBits>() - 1usize];
17633 ["Offset of field: MfClassicAccessBits::data"]
17634 [::core::mem::offset_of!(MfClassicAccessBits, data) - 0usize];
17635};
17636#[repr(C)]
17637#[derive(Debug, Copy, Clone)]
17638pub struct MfClassicNt {
17639 pub data: [u8; 4usize],
17640}
17641#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17642const _: () = {
17643 ["Size of MfClassicNt"][::core::mem::size_of::<MfClassicNt>() - 4usize];
17644 ["Alignment of MfClassicNt"][::core::mem::align_of::<MfClassicNt>() - 1usize];
17645 ["Offset of field: MfClassicNt::data"][::core::mem::offset_of!(MfClassicNt, data) - 0usize];
17646};
17647#[repr(C)]
17648#[derive(Debug, Copy, Clone)]
17649pub struct MfClassicAt {
17650 pub data: [u8; 4usize],
17651}
17652#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17653const _: () = {
17654 ["Size of MfClassicAt"][::core::mem::size_of::<MfClassicAt>() - 4usize];
17655 ["Alignment of MfClassicAt"][::core::mem::align_of::<MfClassicAt>() - 1usize];
17656 ["Offset of field: MfClassicAt::data"][::core::mem::offset_of!(MfClassicAt, data) - 0usize];
17657};
17658#[repr(C)]
17659#[derive(Debug, Copy, Clone)]
17660pub struct MfClassicNr {
17661 pub data: [u8; 4usize],
17662}
17663#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17664const _: () = {
17665 ["Size of MfClassicNr"][::core::mem::size_of::<MfClassicNr>() - 4usize];
17666 ["Alignment of MfClassicNr"][::core::mem::align_of::<MfClassicNr>() - 1usize];
17667 ["Offset of field: MfClassicNr::data"][::core::mem::offset_of!(MfClassicNr, data) - 0usize];
17668};
17669#[repr(C)]
17670#[derive(Debug, Copy, Clone)]
17671pub struct MfClassicAr {
17672 pub data: [u8; 4usize],
17673}
17674#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17675const _: () = {
17676 ["Size of MfClassicAr"][::core::mem::size_of::<MfClassicAr>() - 4usize];
17677 ["Alignment of MfClassicAr"][::core::mem::align_of::<MfClassicAr>() - 1usize];
17678 ["Offset of field: MfClassicAr::data"][::core::mem::offset_of!(MfClassicAr, data) - 0usize];
17679};
17680#[repr(C)]
17681#[derive(Debug, Copy, Clone)]
17682pub struct MfClassicAuthContext {
17683 pub block_num: u8,
17684 pub key: MfClassicKey,
17685 pub key_type: MfClassicKeyType,
17686 pub nt: MfClassicNt,
17687 pub nr: MfClassicNr,
17688 pub ar: MfClassicAr,
17689 pub at: MfClassicAt,
17690}
17691#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17692const _: () = {
17693 ["Size of MfClassicAuthContext"][::core::mem::size_of::<MfClassicAuthContext>() - 24usize];
17694 ["Alignment of MfClassicAuthContext"][::core::mem::align_of::<MfClassicAuthContext>() - 1usize];
17695 ["Offset of field: MfClassicAuthContext::block_num"]
17696 [::core::mem::offset_of!(MfClassicAuthContext, block_num) - 0usize];
17697 ["Offset of field: MfClassicAuthContext::key"]
17698 [::core::mem::offset_of!(MfClassicAuthContext, key) - 1usize];
17699 ["Offset of field: MfClassicAuthContext::key_type"]
17700 [::core::mem::offset_of!(MfClassicAuthContext, key_type) - 7usize];
17701 ["Offset of field: MfClassicAuthContext::nt"]
17702 [::core::mem::offset_of!(MfClassicAuthContext, nt) - 8usize];
17703 ["Offset of field: MfClassicAuthContext::nr"]
17704 [::core::mem::offset_of!(MfClassicAuthContext, nr) - 12usize];
17705 ["Offset of field: MfClassicAuthContext::ar"]
17706 [::core::mem::offset_of!(MfClassicAuthContext, ar) - 16usize];
17707 ["Offset of field: MfClassicAuthContext::at"]
17708 [::core::mem::offset_of!(MfClassicAuthContext, at) - 20usize];
17709};
17710#[repr(C)]
17711#[derive(Copy, Clone)]
17712pub union MfClassicSectorTrailer {
17713 pub block: MfClassicBlock,
17714 pub __bindgen_anon_1: MfClassicSectorTrailer__bindgen_ty_1,
17715}
17716#[repr(C)]
17717#[derive(Debug, Copy, Clone)]
17718pub struct MfClassicSectorTrailer__bindgen_ty_1 {
17719 pub key_a: MfClassicKey,
17720 pub access_bits: MfClassicAccessBits,
17721 pub key_b: MfClassicKey,
17722}
17723#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17724const _: () = {
17725 ["Size of MfClassicSectorTrailer__bindgen_ty_1"]
17726 [::core::mem::size_of::<MfClassicSectorTrailer__bindgen_ty_1>() - 16usize];
17727 ["Alignment of MfClassicSectorTrailer__bindgen_ty_1"]
17728 [::core::mem::align_of::<MfClassicSectorTrailer__bindgen_ty_1>() - 1usize];
17729 ["Offset of field: MfClassicSectorTrailer__bindgen_ty_1::key_a"]
17730 [::core::mem::offset_of!(MfClassicSectorTrailer__bindgen_ty_1, key_a) - 0usize];
17731 ["Offset of field: MfClassicSectorTrailer__bindgen_ty_1::access_bits"]
17732 [::core::mem::offset_of!(MfClassicSectorTrailer__bindgen_ty_1, access_bits) - 6usize];
17733 ["Offset of field: MfClassicSectorTrailer__bindgen_ty_1::key_b"]
17734 [::core::mem::offset_of!(MfClassicSectorTrailer__bindgen_ty_1, key_b) - 10usize];
17735};
17736#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17737const _: () = {
17738 ["Size of MfClassicSectorTrailer"][::core::mem::size_of::<MfClassicSectorTrailer>() - 16usize];
17739 ["Alignment of MfClassicSectorTrailer"]
17740 [::core::mem::align_of::<MfClassicSectorTrailer>() - 1usize];
17741 ["Offset of field: MfClassicSectorTrailer::block"]
17742 [::core::mem::offset_of!(MfClassicSectorTrailer, block) - 0usize];
17743};
17744#[repr(C)]
17745#[derive(Debug, Copy, Clone)]
17746pub struct MfClassicDeviceKeys {
17747 pub key_a_mask: u64,
17748 pub key_a: [MfClassicKey; 40usize],
17749 pub key_b_mask: u64,
17750 pub key_b: [MfClassicKey; 40usize],
17751}
17752#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17753const _: () = {
17754 ["Size of MfClassicDeviceKeys"][::core::mem::size_of::<MfClassicDeviceKeys>() - 496usize];
17755 ["Alignment of MfClassicDeviceKeys"][::core::mem::align_of::<MfClassicDeviceKeys>() - 8usize];
17756 ["Offset of field: MfClassicDeviceKeys::key_a_mask"]
17757 [::core::mem::offset_of!(MfClassicDeviceKeys, key_a_mask) - 0usize];
17758 ["Offset of field: MfClassicDeviceKeys::key_a"]
17759 [::core::mem::offset_of!(MfClassicDeviceKeys, key_a) - 8usize];
17760 ["Offset of field: MfClassicDeviceKeys::key_b_mask"]
17761 [::core::mem::offset_of!(MfClassicDeviceKeys, key_b_mask) - 248usize];
17762 ["Offset of field: MfClassicDeviceKeys::key_b"]
17763 [::core::mem::offset_of!(MfClassicDeviceKeys, key_b) - 256usize];
17764};
17765#[repr(C)]
17766#[derive(Debug, Copy, Clone)]
17767pub struct MfClassicData {
17768 pub iso14443_3a_data: *mut Iso14443_3aData,
17769 pub type_: MfClassicType,
17770 pub block_read_mask: [u32; 8usize],
17771 pub key_a_mask: u64,
17772 pub key_b_mask: u64,
17773 pub block: [MfClassicBlock; 256usize],
17774}
17775#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17776const _: () = {
17777 ["Size of MfClassicData"][::core::mem::size_of::<MfClassicData>() - 4152usize];
17778 ["Alignment of MfClassicData"][::core::mem::align_of::<MfClassicData>() - 8usize];
17779 ["Offset of field: MfClassicData::iso14443_3a_data"]
17780 [::core::mem::offset_of!(MfClassicData, iso14443_3a_data) - 0usize];
17781 ["Offset of field: MfClassicData::type_"]
17782 [::core::mem::offset_of!(MfClassicData, type_) - 4usize];
17783 ["Offset of field: MfClassicData::block_read_mask"]
17784 [::core::mem::offset_of!(MfClassicData, block_read_mask) - 8usize];
17785 ["Offset of field: MfClassicData::key_a_mask"]
17786 [::core::mem::offset_of!(MfClassicData, key_a_mask) - 40usize];
17787 ["Offset of field: MfClassicData::key_b_mask"]
17788 [::core::mem::offset_of!(MfClassicData, key_b_mask) - 48usize];
17789 ["Offset of field: MfClassicData::block"]
17790 [::core::mem::offset_of!(MfClassicData, block) - 56usize];
17791};
17792unsafe extern "C" {
17793 pub fn mf_classic_alloc() -> *mut MfClassicData;
17794}
17795unsafe extern "C" {
17796 pub fn mf_classic_free(data: *mut MfClassicData);
17797}
17798unsafe extern "C" {
17799 pub fn mf_classic_reset(data: *mut MfClassicData);
17800}
17801unsafe extern "C" {
17802 pub fn mf_classic_copy(data: *mut MfClassicData, other: *const MfClassicData);
17803}
17804unsafe extern "C" {
17805 pub fn mf_classic_verify(data: *mut MfClassicData, device_type: *const FuriString) -> bool;
17806}
17807unsafe extern "C" {
17808 pub fn mf_classic_load(data: *mut MfClassicData, ff: *mut FlipperFormat, version: u32) -> bool;
17809}
17810unsafe extern "C" {
17811 pub fn mf_classic_save(data: *const MfClassicData, ff: *mut FlipperFormat) -> bool;
17812}
17813unsafe extern "C" {
17814 pub fn mf_classic_is_equal(data: *const MfClassicData, other: *const MfClassicData) -> bool;
17815}
17816unsafe extern "C" {
17817 pub fn mf_classic_get_device_name(
17818 data: *const MfClassicData,
17819 name_type: NfcDeviceNameType,
17820 ) -> *const core::ffi::c_char;
17821}
17822unsafe extern "C" {
17823 pub fn mf_classic_get_uid(data: *const MfClassicData, uid_len: *mut usize) -> *const u8;
17824}
17825unsafe extern "C" {
17826 pub fn mf_classic_set_uid(data: *mut MfClassicData, uid: *const u8, uid_len: usize) -> bool;
17827}
17828unsafe extern "C" {
17829 pub fn mf_classic_get_base_data(data: *const MfClassicData) -> *mut Iso14443_3aData;
17830}
17831unsafe extern "C" {
17832 pub fn mf_classic_get_total_sectors_num(type_: MfClassicType) -> u8;
17833}
17834unsafe extern "C" {
17835 pub fn mf_classic_get_total_block_num(type_: MfClassicType) -> u16;
17836}
17837unsafe extern "C" {
17838 pub fn mf_classic_get_first_block_num_of_sector(sector: u8) -> u8;
17839}
17840unsafe extern "C" {
17841 pub fn mf_classic_get_blocks_num_in_sector(sector: u8) -> u8;
17842}
17843unsafe extern "C" {
17844 pub fn mf_classic_get_sector_trailer_num_by_sector(sector: u8) -> u8;
17845}
17846unsafe extern "C" {
17847 pub fn mf_classic_get_sector_trailer_num_by_block(block: u8) -> u8;
17848}
17849unsafe extern "C" {
17850 pub fn mf_classic_get_sector_trailer_by_sector(
17851 data: *const MfClassicData,
17852 sector_num: u8,
17853 ) -> *mut MfClassicSectorTrailer;
17854}
17855unsafe extern "C" {
17856 pub fn mf_classic_is_sector_trailer(block: u8) -> bool;
17857}
17858unsafe extern "C" {
17859 pub fn mf_classic_set_sector_trailer_read(
17860 data: *mut MfClassicData,
17861 block_num: u8,
17862 sec_tr: *mut MfClassicSectorTrailer,
17863 );
17864}
17865unsafe extern "C" {
17866 pub fn mf_classic_get_sector_by_block(block: u8) -> u8;
17867}
17868unsafe extern "C" {
17869 pub fn mf_classic_block_to_value(
17870 block: *const MfClassicBlock,
17871 value: *mut i32,
17872 addr: *mut u8,
17873 ) -> bool;
17874}
17875unsafe extern "C" {
17876 pub fn mf_classic_value_to_block(value: i32, addr: u8, block: *mut MfClassicBlock);
17877}
17878unsafe extern "C" {
17879 pub fn mf_classic_is_key_found(
17880 data: *const MfClassicData,
17881 sector_num: u8,
17882 key_type: MfClassicKeyType,
17883 ) -> bool;
17884}
17885unsafe extern "C" {
17886 pub fn mf_classic_set_key_found(
17887 data: *mut MfClassicData,
17888 sector_num: u8,
17889 key_type: MfClassicKeyType,
17890 key: u64,
17891 );
17892}
17893unsafe extern "C" {
17894 pub fn mf_classic_set_key_not_found(
17895 data: *mut MfClassicData,
17896 sector_num: u8,
17897 key_type: MfClassicKeyType,
17898 );
17899}
17900unsafe extern "C" {
17901 pub fn mf_classic_get_key(
17902 data: *const MfClassicData,
17903 sector_num: u8,
17904 key_type: MfClassicKeyType,
17905 ) -> MfClassicKey;
17906}
17907unsafe extern "C" {
17908 pub fn mf_classic_is_block_read(data: *const MfClassicData, block_num: u8) -> bool;
17909}
17910unsafe extern "C" {
17911 pub fn mf_classic_set_block_read(
17912 data: *mut MfClassicData,
17913 block_num: u8,
17914 block_data: *mut MfClassicBlock,
17915 );
17916}
17917unsafe extern "C" {
17918 pub fn mf_classic_is_sector_read(data: *const MfClassicData, sector_num: u8) -> bool;
17919}
17920unsafe extern "C" {
17921 pub fn mf_classic_get_read_sectors_and_keys(
17922 data: *const MfClassicData,
17923 sectors_read: *mut u8,
17924 keys_found: *mut u8,
17925 );
17926}
17927unsafe extern "C" {
17928 pub fn mf_classic_is_card_read(data: *const MfClassicData) -> bool;
17929}
17930unsafe extern "C" {
17931 pub fn mf_classic_is_value_block(sec_tr: *mut MfClassicSectorTrailer, block_num: u8) -> bool;
17932}
17933unsafe extern "C" {
17934 pub fn mf_classic_is_allowed_access_data_block(
17935 sec_tr: *mut MfClassicSectorTrailer,
17936 block_num: u8,
17937 key_type: MfClassicKeyType,
17938 action: MfClassicAction,
17939 ) -> bool;
17940}
17941unsafe extern "C" {
17942 pub fn mf_classic_is_allowed_access(
17943 data: *mut MfClassicData,
17944 block_num: u8,
17945 key_type: MfClassicKeyType,
17946 action: MfClassicAction,
17947 ) -> bool;
17948}
17949#[repr(C)]
17950#[derive(Debug, Copy, Clone)]
17951pub struct Crypto1 {
17952 pub odd: u32,
17953 pub even: u32,
17954}
17955#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17956const _: () = {
17957 ["Size of Crypto1"][::core::mem::size_of::<Crypto1>() - 8usize];
17958 ["Alignment of Crypto1"][::core::mem::align_of::<Crypto1>() - 4usize];
17959 ["Offset of field: Crypto1::odd"][::core::mem::offset_of!(Crypto1, odd) - 0usize];
17960 ["Offset of field: Crypto1::even"][::core::mem::offset_of!(Crypto1, even) - 4usize];
17961};
17962unsafe extern "C" {
17963 pub fn crypto1_alloc() -> *mut Crypto1;
17964}
17965unsafe extern "C" {
17966 pub fn crypto1_free(instance: *mut Crypto1);
17967}
17968unsafe extern "C" {
17969 pub fn crypto1_reset(crypto1: *mut Crypto1);
17970}
17971unsafe extern "C" {
17972 pub fn crypto1_init(crypto1: *mut Crypto1, key: u64);
17973}
17974unsafe extern "C" {
17975 pub fn crypto1_bit(crypto1: *mut Crypto1, in_: u8, is_encrypted: core::ffi::c_int) -> u8;
17976}
17977unsafe extern "C" {
17978 pub fn crypto1_byte(crypto1: *mut Crypto1, in_: u8, is_encrypted: core::ffi::c_int) -> u8;
17979}
17980unsafe extern "C" {
17981 pub fn crypto1_word(crypto1: *mut Crypto1, in_: u32, is_encrypted: core::ffi::c_int) -> u32;
17982}
17983unsafe extern "C" {
17984 pub fn crypto1_decrypt(crypto: *mut Crypto1, buff: *const BitBuffer, out: *mut BitBuffer);
17985}
17986unsafe extern "C" {
17987 pub fn crypto1_encrypt(
17988 crypto: *mut Crypto1,
17989 keystream: *mut u8,
17990 buff: *const BitBuffer,
17991 out: *mut BitBuffer,
17992 );
17993}
17994unsafe extern "C" {
17995 pub fn crypto1_encrypt_reader_nonce(
17996 crypto: *mut Crypto1,
17997 key: u64,
17998 cuid: u32,
17999 nt: *mut u8,
18000 nr: *mut u8,
18001 out: *mut BitBuffer,
18002 is_nested: bool,
18003 );
18004}
18005unsafe extern "C" {
18006 pub fn crypto1_lfsr_rollback_word(crypto1: *mut Crypto1, in_: u32, fb: core::ffi::c_int)
18007 -> u32;
18008}
18009unsafe extern "C" {
18010 pub fn crypto1_nonce_matches_encrypted_parity_bits(nt: u32, ks: u32, nt_par_enc: u8) -> bool;
18011}
18012unsafe extern "C" {
18013 pub fn crypto1_is_weak_prng_nonce(nonce: u32) -> bool;
18014}
18015unsafe extern "C" {
18016 pub fn crypto1_decrypt_nt_enc(cuid: u32, nt_enc: u32, known_key: MfClassicKey) -> u32;
18017}
18018unsafe extern "C" {
18019 pub fn crypto1_prng_successor(x: u32, n: u32) -> u32;
18020}
18021unsafe extern "C" {
18022 pub fn felica_crc_append(buf: *mut BitBuffer);
18023}
18024unsafe extern "C" {
18025 pub fn felica_crc_check(buf: *const BitBuffer) -> bool;
18026}
18027unsafe extern "C" {
18028 pub fn felica_crc_trim(buf: *mut BitBuffer);
18029}
18030pub const Iso13239CrcTypeDefault: Iso13239CrcType = Iso13239CrcType(0);
18031pub const Iso13239CrcTypePicopass: Iso13239CrcType = Iso13239CrcType(1);
18032#[repr(transparent)]
18033#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18034pub struct Iso13239CrcType(pub core::ffi::c_uchar);
18035unsafe extern "C" {
18036 pub fn iso13239_crc_append(type_: Iso13239CrcType, buf: *mut BitBuffer);
18037}
18038unsafe extern "C" {
18039 pub fn iso13239_crc_check(type_: Iso13239CrcType, buf: *const BitBuffer) -> bool;
18040}
18041unsafe extern "C" {
18042 pub fn iso13239_crc_trim(buf: *mut BitBuffer);
18043}
18044pub const Iso14443CrcTypeA: Iso14443CrcType = Iso14443CrcType(0);
18045pub const Iso14443CrcTypeB: Iso14443CrcType = Iso14443CrcType(1);
18046#[repr(transparent)]
18047#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18048pub struct Iso14443CrcType(pub core::ffi::c_uchar);
18049unsafe extern "C" {
18050 pub fn iso14443_crc_append(type_: Iso14443CrcType, buf: *mut BitBuffer);
18051}
18052unsafe extern "C" {
18053 pub fn iso14443_crc_check(type_: Iso14443CrcType, buf: *const BitBuffer) -> bool;
18054}
18055unsafe extern "C" {
18056 pub fn iso14443_crc_trim(buf: *mut BitBuffer);
18057}
18058pub const NfcProtocolIso14443_3a: NfcProtocol = NfcProtocol(0);
18059pub const NfcProtocolIso14443_3b: NfcProtocol = NfcProtocol(1);
18060pub const NfcProtocolIso14443_4a: NfcProtocol = NfcProtocol(2);
18061pub const NfcProtocolIso14443_4b: NfcProtocol = NfcProtocol(3);
18062pub const NfcProtocolIso15693_3: NfcProtocol = NfcProtocol(4);
18063pub const NfcProtocolFelica: NfcProtocol = NfcProtocol(5);
18064pub const NfcProtocolMfUltralight: NfcProtocol = NfcProtocol(6);
18065pub const NfcProtocolMfClassic: NfcProtocol = NfcProtocol(7);
18066pub const NfcProtocolMfPlus: NfcProtocol = NfcProtocol(8);
18067pub const NfcProtocolMfDesfire: NfcProtocol = NfcProtocol(9);
18068pub const NfcProtocolSlix: NfcProtocol = NfcProtocol(10);
18069pub const NfcProtocolSt25tb: NfcProtocol = NfcProtocol(11);
18070#[doc = "< Special value representing the number of available protocols."]
18071pub const NfcProtocolNum: NfcProtocol = NfcProtocol(12);
18072#[doc = "< Special value representing an invalid state."]
18073pub const NfcProtocolInvalid: NfcProtocol = NfcProtocol(13);
18074#[repr(transparent)]
18075#[doc = "Enumeration of all available NFC protocols.\n\n When implementing a new protocol, add its identifier before the\n NfcProtocolNum entry."]
18076#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18077pub struct NfcProtocol(pub core::ffi::c_uchar);
18078unsafe extern "C" {
18079 #[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."]
18080 pub fn nfc_protocol_get_parent(protocol: NfcProtocol) -> NfcProtocol;
18081}
18082unsafe extern "C" {
18083 #[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."]
18084 pub fn nfc_protocol_has_parent(protocol: NfcProtocol, parent_protocol: NfcProtocol) -> bool;
18085}
18086#[repr(C)]
18087#[derive(Debug, Copy, Clone)]
18088pub struct NfcDevice {
18089 _unused: [u8; 0],
18090}
18091#[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."]
18092pub type NfcLoadingCallback =
18093 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void, state: bool)>;
18094unsafe extern "C" {
18095 #[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."]
18096 pub fn nfc_device_alloc() -> *mut NfcDevice;
18097}
18098unsafe extern "C" {
18099 #[doc = "Delete an NfcDevice instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18100 pub fn nfc_device_free(instance: *mut NfcDevice);
18101}
18102unsafe extern "C" {
18103 #[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."]
18104 pub fn nfc_device_clear(instance: *mut NfcDevice);
18105}
18106unsafe extern "C" {
18107 #[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."]
18108 pub fn nfc_device_reset(instance: *mut NfcDevice);
18109}
18110unsafe extern "C" {
18111 #[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."]
18112 pub fn nfc_device_get_protocol(instance: *const NfcDevice) -> NfcProtocol;
18113}
18114unsafe extern "C" {
18115 #[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."]
18116 pub fn nfc_device_get_data(
18117 instance: *const NfcDevice,
18118 protocol: NfcProtocol,
18119 ) -> *const NfcDeviceData;
18120}
18121unsafe extern "C" {
18122 #[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."]
18123 pub fn nfc_device_get_protocol_name(protocol: NfcProtocol) -> *const core::ffi::c_char;
18124}
18125unsafe extern "C" {
18126 #[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."]
18127 pub fn nfc_device_get_name(
18128 instance: *const NfcDevice,
18129 name_type: NfcDeviceNameType,
18130 ) -> *const core::ffi::c_char;
18131}
18132unsafe extern "C" {
18133 #[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."]
18134 pub fn nfc_device_get_uid(instance: *const NfcDevice, uid_len: *mut usize) -> *const u8;
18135}
18136unsafe extern "C" {
18137 #[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."]
18138 pub fn nfc_device_set_uid(instance: *mut NfcDevice, uid: *const u8, uid_len: usize) -> bool;
18139}
18140unsafe extern "C" {
18141 #[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."]
18142 pub fn nfc_device_set_data(
18143 instance: *mut NfcDevice,
18144 protocol: NfcProtocol,
18145 protocol_data: *const NfcDeviceData,
18146 );
18147}
18148unsafe extern "C" {
18149 #[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."]
18150 pub fn nfc_device_copy_data(
18151 instance: *const NfcDevice,
18152 protocol: NfcProtocol,
18153 protocol_data: *mut NfcDeviceData,
18154 );
18155}
18156unsafe extern "C" {
18157 #[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."]
18158 pub fn nfc_device_is_equal_data(
18159 instance: *const NfcDevice,
18160 protocol: NfcProtocol,
18161 protocol_data: *const NfcDeviceData,
18162 ) -> bool;
18163}
18164unsafe extern "C" {
18165 #[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."]
18166 pub fn nfc_device_is_equal(instance: *const NfcDevice, other: *const NfcDevice) -> bool;
18167}
18168unsafe extern "C" {
18169 #[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)."]
18170 pub fn nfc_device_set_loading_callback(
18171 instance: *mut NfcDevice,
18172 callback: NfcLoadingCallback,
18173 context: *mut core::ffi::c_void,
18174 );
18175}
18176unsafe extern "C" {
18177 #[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."]
18178 pub fn nfc_device_save(instance: *mut NfcDevice, path: *const core::ffi::c_char) -> bool;
18179}
18180unsafe extern "C" {
18181 #[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."]
18182 pub fn nfc_device_load(instance: *mut NfcDevice, path: *const core::ffi::c_char) -> bool;
18183}
18184pub const NfcDataGeneratorTypeMfUltralight: NfcDataGeneratorType = NfcDataGeneratorType(0);
18185pub const NfcDataGeneratorTypeMfUltralightEV1_11: NfcDataGeneratorType = NfcDataGeneratorType(1);
18186pub const NfcDataGeneratorTypeMfUltralightEV1_H11: NfcDataGeneratorType = NfcDataGeneratorType(2);
18187pub const NfcDataGeneratorTypeMfUltralightEV1_21: NfcDataGeneratorType = NfcDataGeneratorType(3);
18188pub const NfcDataGeneratorTypeMfUltralightEV1_H21: NfcDataGeneratorType = NfcDataGeneratorType(4);
18189pub const NfcDataGeneratorTypeNTAG203: NfcDataGeneratorType = NfcDataGeneratorType(5);
18190pub const NfcDataGeneratorTypeNTAG213: NfcDataGeneratorType = NfcDataGeneratorType(6);
18191pub const NfcDataGeneratorTypeNTAG215: NfcDataGeneratorType = NfcDataGeneratorType(7);
18192pub const NfcDataGeneratorTypeNTAG216: NfcDataGeneratorType = NfcDataGeneratorType(8);
18193pub const NfcDataGeneratorTypeNTAGI2C1k: NfcDataGeneratorType = NfcDataGeneratorType(9);
18194pub const NfcDataGeneratorTypeNTAGI2C2k: NfcDataGeneratorType = NfcDataGeneratorType(10);
18195pub const NfcDataGeneratorTypeNTAGI2CPlus1k: NfcDataGeneratorType = NfcDataGeneratorType(11);
18196pub const NfcDataGeneratorTypeNTAGI2CPlus2k: NfcDataGeneratorType = NfcDataGeneratorType(12);
18197pub const NfcDataGeneratorTypeMfClassicMini: NfcDataGeneratorType = NfcDataGeneratorType(13);
18198pub const NfcDataGeneratorTypeMfClassic1k_4b: NfcDataGeneratorType = NfcDataGeneratorType(14);
18199pub const NfcDataGeneratorTypeMfClassic1k_7b: NfcDataGeneratorType = NfcDataGeneratorType(15);
18200pub const NfcDataGeneratorTypeMfClassic4k_4b: NfcDataGeneratorType = NfcDataGeneratorType(16);
18201pub const NfcDataGeneratorTypeMfClassic4k_7b: NfcDataGeneratorType = NfcDataGeneratorType(17);
18202pub const NfcDataGeneratorTypeNum: NfcDataGeneratorType = NfcDataGeneratorType(18);
18203#[repr(transparent)]
18204#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18205pub struct NfcDataGeneratorType(pub core::ffi::c_uchar);
18206unsafe extern "C" {
18207 pub fn nfc_data_generator_get_name(type_: NfcDataGeneratorType) -> *const core::ffi::c_char;
18208}
18209unsafe extern "C" {
18210 pub fn nfc_data_generator_fill_data(type_: NfcDataGeneratorType, nfc_device: *mut NfcDevice);
18211}
18212unsafe extern "C" {
18213 pub fn nfc_util_even_parity8(data: u8) -> u8;
18214}
18215unsafe extern "C" {
18216 pub fn nfc_util_even_parity32(data: u32) -> u8;
18217}
18218unsafe extern "C" {
18219 pub fn nfc_util_odd_parity8(data: u8) -> u8;
18220}
18221unsafe extern "C" {
18222 pub fn nfc_util_odd_parity(src: *const u8, dst: *mut u8, len: u8);
18223}
18224#[repr(C)]
18225#[derive(Debug, Copy, Clone)]
18226pub struct Nfc {
18227 _unused: [u8; 0],
18228}
18229#[doc = "< User code explicitly aborted the current operation."]
18230pub const NfcEventTypeUserAbort: NfcEventType = NfcEventType(0);
18231#[doc = "< Reader's field was detected by the NFC hardware."]
18232pub const NfcEventTypeFieldOn: NfcEventType = NfcEventType(1);
18233#[doc = "< Reader's field was lost."]
18234pub const NfcEventTypeFieldOff: NfcEventType = NfcEventType(2);
18235#[doc = "< Data transmission has started."]
18236pub const NfcEventTypeTxStart: NfcEventType = NfcEventType(3);
18237#[doc = "< Data transmission has ended."]
18238pub const NfcEventTypeTxEnd: NfcEventType = NfcEventType(4);
18239#[doc = "< Data reception has started."]
18240pub const NfcEventTypeRxStart: NfcEventType = NfcEventType(5);
18241#[doc = "< Data reception has ended."]
18242pub const NfcEventTypeRxEnd: NfcEventType = NfcEventType(6);
18243#[doc = "< The listener has been activated by the reader."]
18244pub const NfcEventTypeListenerActivated: NfcEventType = NfcEventType(7);
18245#[doc = "< The card has been activated by the poller."]
18246pub const NfcEventTypePollerReady: NfcEventType = NfcEventType(8);
18247#[repr(transparent)]
18248#[doc = "Enumeration of possible Nfc event types.\n\n Not all technologies implement all events (this is due to hardware limitations)."]
18249#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18250pub struct NfcEventType(pub core::ffi::c_uchar);
18251#[doc = "Nfc event data structure."]
18252#[repr(C)]
18253#[derive(Debug, Copy, Clone)]
18254pub struct NfcEventData {
18255 #[doc = "< Pointer to the received data buffer."]
18256 pub buffer: *mut BitBuffer,
18257}
18258#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18259const _: () = {
18260 ["Size of NfcEventData"][::core::mem::size_of::<NfcEventData>() - 4usize];
18261 ["Alignment of NfcEventData"][::core::mem::align_of::<NfcEventData>() - 4usize];
18262 ["Offset of field: NfcEventData::buffer"]
18263 [::core::mem::offset_of!(NfcEventData, buffer) - 0usize];
18264};
18265#[doc = "Nfc event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
18266#[repr(C)]
18267#[derive(Debug, Copy, Clone)]
18268pub struct NfcEvent {
18269 #[doc = "< Type of the emitted event."]
18270 pub type_: NfcEventType,
18271 #[doc = "< Event-specific data."]
18272 pub data: NfcEventData,
18273}
18274#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18275const _: () = {
18276 ["Size of NfcEvent"][::core::mem::size_of::<NfcEvent>() - 8usize];
18277 ["Alignment of NfcEvent"][::core::mem::align_of::<NfcEvent>() - 4usize];
18278 ["Offset of field: NfcEvent::type_"][::core::mem::offset_of!(NfcEvent, type_) - 0usize];
18279 ["Offset of field: NfcEvent::data"][::core::mem::offset_of!(NfcEvent, data) - 4usize];
18280};
18281#[doc = "< Continue operation normally."]
18282pub const NfcCommandContinue: NfcCommand = NfcCommand(0);
18283#[doc = "< Reset the current state."]
18284pub const NfcCommandReset: NfcCommand = NfcCommand(1);
18285#[doc = "< Stop the current operation."]
18286pub const NfcCommandStop: NfcCommand = NfcCommand(2);
18287#[doc = "< Switch Nfc hardware to low-power mode."]
18288pub const NfcCommandSleep: NfcCommand = NfcCommand(3);
18289#[repr(transparent)]
18290#[doc = "Enumeration of possible Nfc commands.\n\n The event callback must return one of these to determine the next action."]
18291#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18292pub struct NfcCommand(pub core::ffi::c_uchar);
18293#[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."]
18294pub type NfcEventCallback = ::core::option::Option<
18295 unsafe extern "C" fn(event: NfcEvent, context: *mut core::ffi::c_void) -> NfcCommand,
18296>;
18297#[doc = "< Configure the Nfc instance as a poller."]
18298pub const NfcModePoller: NfcMode = NfcMode(0);
18299#[doc = "< Configure the Nfc instance as a listener."]
18300pub const NfcModeListener: NfcMode = NfcMode(1);
18301#[doc = "< Operating mode count. Internal use."]
18302pub const NfcModeNum: NfcMode = NfcMode(2);
18303#[repr(transparent)]
18304#[doc = "Enumeration of possible operating modes.\n\n Not all technologies implement the listener operating mode."]
18305#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18306pub struct NfcMode(pub core::ffi::c_uchar);
18307#[doc = "< Configure the Nfc instance to use the ISO14443-3A technology."]
18308pub const NfcTechIso14443a: NfcTech = NfcTech(0);
18309#[doc = "< Configure the Nfc instance to use the ISO14443-3B technology."]
18310pub const NfcTechIso14443b: NfcTech = NfcTech(1);
18311#[doc = "< Configure the Nfc instance to use the ISO15693 technology."]
18312pub const NfcTechIso15693: NfcTech = NfcTech(2);
18313#[doc = "< Configure the Nfc instance to use the FeliCa technology."]
18314pub const NfcTechFelica: NfcTech = NfcTech(3);
18315#[doc = "< Technologies count. Internal use."]
18316pub const NfcTechNum: NfcTech = NfcTech(4);
18317#[repr(transparent)]
18318#[doc = "Enumeration of available technologies."]
18319#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18320pub struct NfcTech(pub core::ffi::c_uchar);
18321#[doc = "< No error has occurred."]
18322pub const NfcErrorNone: NfcError = NfcError(0);
18323#[doc = "< An unknown error has occured on the lower level."]
18324pub const NfcErrorInternal: NfcError = NfcError(1);
18325#[doc = "< Operation is taking too long (e.g. card does not respond)."]
18326pub const NfcErrorTimeout: NfcError = NfcError(2);
18327#[doc = "< An incomplete data frame has been received."]
18328pub const NfcErrorIncompleteFrame: NfcError = NfcError(3);
18329#[doc = "< Data has not been parsed due to wrong/unknown format."]
18330pub const NfcErrorDataFormat: NfcError = NfcError(4);
18331#[repr(transparent)]
18332#[doc = "Enumeration of possible Nfc error codes."]
18333#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18334pub struct NfcError(pub core::ffi::c_uchar);
18335unsafe extern "C" {
18336 #[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."]
18337 pub fn nfc_alloc() -> *mut Nfc;
18338}
18339unsafe extern "C" {
18340 #[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."]
18341 pub fn nfc_free(instance: *mut Nfc);
18342}
18343unsafe extern "C" {
18344 #[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."]
18345 pub fn nfc_config(instance: *mut Nfc, mode: NfcMode, tech: NfcTech);
18346}
18347unsafe extern "C" {
18348 #[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."]
18349 pub fn nfc_set_fdt_poll_fc(instance: *mut Nfc, fdt_poll_fc: u32);
18350}
18351unsafe extern "C" {
18352 #[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."]
18353 pub fn nfc_set_fdt_listen_fc(instance: *mut Nfc, fdt_listen_fc: u32);
18354}
18355unsafe extern "C" {
18356 #[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."]
18357 pub fn nfc_set_mask_receive_time_fc(instance: *mut Nfc, mask_rx_time_fc: u32);
18358}
18359unsafe extern "C" {
18360 #[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."]
18361 pub fn nfc_set_fdt_poll_poll_us(instance: *mut Nfc, fdt_poll_poll_us: u32);
18362}
18363unsafe extern "C" {
18364 #[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."]
18365 pub fn nfc_set_guard_time_us(instance: *mut Nfc, guard_time_us: u32);
18366}
18367unsafe extern "C" {
18368 #[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)."]
18369 pub fn nfc_start(
18370 instance: *mut Nfc,
18371 callback: NfcEventCallback,
18372 context: *mut core::ffi::c_void,
18373 );
18374}
18375unsafe extern "C" {
18376 #[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."]
18377 pub fn nfc_stop(instance: *mut Nfc);
18378}
18379unsafe extern "C" {
18380 #[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."]
18381 pub fn nfc_poller_trx(
18382 instance: *mut Nfc,
18383 tx_buffer: *const BitBuffer,
18384 rx_buffer: *mut BitBuffer,
18385 fwt: u32,
18386 ) -> NfcError;
18387}
18388unsafe extern "C" {
18389 #[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."]
18390 pub fn nfc_listener_tx(instance: *mut Nfc, tx_buffer: *const BitBuffer) -> NfcError;
18391}
18392pub const NfcIso14443aShortFrameSensReq: NfcIso14443aShortFrame = NfcIso14443aShortFrame(0);
18393pub const NfcIso14443aShortFrameAllReqa: NfcIso14443aShortFrame = NfcIso14443aShortFrame(1);
18394#[repr(transparent)]
18395#[doc = "Enumeration of possible ISO14443-3A short frame types."]
18396#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18397pub struct NfcIso14443aShortFrame(pub core::ffi::c_uchar);
18398unsafe extern "C" {
18399 #[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."]
18400 pub fn nfc_iso14443a_poller_trx_short_frame(
18401 instance: *mut Nfc,
18402 frame: NfcIso14443aShortFrame,
18403 rx_buffer: *mut BitBuffer,
18404 fwt: u32,
18405 ) -> NfcError;
18406}
18407unsafe extern "C" {
18408 #[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."]
18409 pub fn nfc_iso14443a_poller_trx_sdd_frame(
18410 instance: *mut Nfc,
18411 tx_buffer: *const BitBuffer,
18412 rx_buffer: *mut BitBuffer,
18413 fwt: u32,
18414 ) -> NfcError;
18415}
18416unsafe extern "C" {
18417 #[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."]
18418 pub fn nfc_iso14443a_poller_trx_custom_parity(
18419 instance: *mut Nfc,
18420 tx_buffer: *const BitBuffer,
18421 rx_buffer: *mut BitBuffer,
18422 fwt: u32,
18423 ) -> NfcError;
18424}
18425unsafe extern "C" {
18426 #[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."]
18427 pub fn nfc_iso14443a_listener_tx_custom_parity(
18428 instance: *mut Nfc,
18429 tx_buffer: *const BitBuffer,
18430 ) -> NfcError;
18431}
18432unsafe extern "C" {
18433 #[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."]
18434 pub fn nfc_iso14443a_listener_set_col_res_data(
18435 instance: *mut Nfc,
18436 uid: *mut u8,
18437 uid_len: u8,
18438 atqa: *mut u8,
18439 sak: u8,
18440 ) -> NfcError;
18441}
18442unsafe extern "C" {
18443 #[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."]
18444 pub fn nfc_felica_listener_set_sensf_res_data(
18445 instance: *mut Nfc,
18446 idm: *const u8,
18447 idm_len: u8,
18448 pmm: *const u8,
18449 pmm_len: u8,
18450 sys_code: u16,
18451 ) -> NfcError;
18452}
18453unsafe extern "C" {
18454 #[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."]
18455 pub fn nfc_iso15693_listener_tx_sof(instance: *mut Nfc) -> NfcError;
18456}
18457unsafe extern "C" {
18458 #[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)."]
18459 pub fn nfc_felica_listener_timer_anticol_start(instance: *mut Nfc, target_time_slot: u8);
18460}
18461unsafe extern "C" {
18462 #[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."]
18463 pub fn nfc_felica_listener_timer_anticol_stop(instance: *mut Nfc);
18464}
18465#[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."]
18466pub type NfcGenericInstance = core::ffi::c_void;
18467#[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."]
18468pub type NfcGenericEventData = core::ffi::c_void;
18469#[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."]
18470#[repr(C)]
18471#[derive(Debug, Copy, Clone)]
18472pub struct NfcGenericEvent {
18473 #[doc = "< Protocol identifier of the instance that produced the event."]
18474 pub protocol: NfcProtocol,
18475 #[doc = "< Pointer to the protocol-specific instance that produced the event."]
18476 pub instance: *mut NfcGenericInstance,
18477 #[doc = "< Pointer to the protocol-specific event."]
18478 pub event_data: *mut NfcGenericEventData,
18479}
18480#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18481const _: () = {
18482 ["Size of NfcGenericEvent"][::core::mem::size_of::<NfcGenericEvent>() - 12usize];
18483 ["Alignment of NfcGenericEvent"][::core::mem::align_of::<NfcGenericEvent>() - 4usize];
18484 ["Offset of field: NfcGenericEvent::protocol"]
18485 [::core::mem::offset_of!(NfcGenericEvent, protocol) - 0usize];
18486 ["Offset of field: NfcGenericEvent::instance"]
18487 [::core::mem::offset_of!(NfcGenericEvent, instance) - 4usize];
18488 ["Offset of field: NfcGenericEvent::event_data"]
18489 [::core::mem::offset_of!(NfcGenericEvent, event_data) - 8usize];
18490};
18491#[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."]
18492pub type NfcGenericCallback = ::core::option::Option<
18493 unsafe extern "C" fn(event: NfcGenericEvent, context: *mut core::ffi::c_void) -> NfcCommand,
18494>;
18495#[repr(C)]
18496#[derive(Debug, Copy, Clone)]
18497pub struct NfcListener {
18498 _unused: [u8; 0],
18499}
18500unsafe extern "C" {
18501 #[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`]"]
18502 pub fn nfc_listener_alloc(
18503 nfc: *mut Nfc,
18504 protocol: NfcProtocol,
18505 data: *const NfcDeviceData,
18506 ) -> *mut NfcListener;
18507}
18508unsafe extern "C" {
18509 #[doc = "Delete an NfcListener instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18510 pub fn nfc_listener_free(instance: *mut NfcListener);
18511}
18512unsafe extern "C" {
18513 #[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)."]
18514 pub fn nfc_listener_start(
18515 instance: *mut NfcListener,
18516 callback: NfcGenericCallback,
18517 context: *mut core::ffi::c_void,
18518 );
18519}
18520unsafe extern "C" {
18521 #[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."]
18522 pub fn nfc_listener_stop(instance: *mut NfcListener);
18523}
18524unsafe extern "C" {
18525 #[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."]
18526 pub fn nfc_listener_get_protocol(instance: *const NfcListener) -> NfcProtocol;
18527}
18528unsafe extern "C" {
18529 #[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."]
18530 pub fn nfc_listener_get_data(
18531 instance: *const NfcListener,
18532 protocol: NfcProtocol,
18533 ) -> *const NfcDeviceData;
18534}
18535#[repr(C)]
18536#[derive(Debug, Copy, Clone)]
18537pub struct NfcPoller {
18538 _unused: [u8; 0],
18539}
18540#[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."]
18541#[repr(C)]
18542#[derive(Debug, Copy, Clone)]
18543pub struct NfcGenericEventEx {
18544 #[doc = "< Pointer to the protocol poller."]
18545 pub poller: *mut NfcGenericInstance,
18546 #[doc = "< Pointer to the protocol's parent poller event data."]
18547 pub parent_event_data: *mut NfcGenericEventData,
18548}
18549#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18550const _: () = {
18551 ["Size of NfcGenericEventEx"][::core::mem::size_of::<NfcGenericEventEx>() - 8usize];
18552 ["Alignment of NfcGenericEventEx"][::core::mem::align_of::<NfcGenericEventEx>() - 4usize];
18553 ["Offset of field: NfcGenericEventEx::poller"]
18554 [::core::mem::offset_of!(NfcGenericEventEx, poller) - 0usize];
18555 ["Offset of field: NfcGenericEventEx::parent_event_data"]
18556 [::core::mem::offset_of!(NfcGenericEventEx, parent_event_data) - 4usize];
18557};
18558#[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."]
18559pub type NfcGenericCallbackEx = ::core::option::Option<
18560 unsafe extern "C" fn(event: NfcGenericEventEx, context: *mut core::ffi::c_void) -> NfcCommand,
18561>;
18562unsafe extern "C" {
18563 #[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`]"]
18564 pub fn nfc_poller_alloc(nfc: *mut Nfc, protocol: NfcProtocol) -> *mut NfcPoller;
18565}
18566unsafe extern "C" {
18567 #[doc = "Delete an NfcPoller instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18568 pub fn nfc_poller_free(instance: *mut NfcPoller);
18569}
18570unsafe extern "C" {
18571 #[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)."]
18572 pub fn nfc_poller_start(
18573 instance: *mut NfcPoller,
18574 callback: NfcGenericCallback,
18575 context: *mut core::ffi::c_void,
18576 );
18577}
18578unsafe extern "C" {
18579 #[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)."]
18580 pub fn nfc_poller_start_ex(
18581 instance: *mut NfcPoller,
18582 callback: NfcGenericCallbackEx,
18583 context: *mut core::ffi::c_void,
18584 );
18585}
18586unsafe extern "C" {
18587 #[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."]
18588 pub fn nfc_poller_stop(instance: *mut NfcPoller);
18589}
18590unsafe extern "C" {
18591 #[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."]
18592 pub fn nfc_poller_detect(instance: *mut NfcPoller) -> bool;
18593}
18594unsafe extern "C" {
18595 #[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."]
18596 pub fn nfc_poller_get_protocol(instance: *const NfcPoller) -> NfcProtocol;
18597}
18598unsafe extern "C" {
18599 #[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."]
18600 pub fn nfc_poller_get_data(instance: *const NfcPoller) -> *const NfcDeviceData;
18601}
18602#[repr(C)]
18603#[derive(Debug, Copy, Clone)]
18604pub struct NfcScanner {
18605 _unused: [u8; 0],
18606}
18607#[doc = "< One or more protocols have been detected."]
18608pub const NfcScannerEventTypeDetected: NfcScannerEventType = NfcScannerEventType(0);
18609#[repr(transparent)]
18610#[doc = "Event type passed to the user callback."]
18611#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18612pub struct NfcScannerEventType(pub core::ffi::c_uchar);
18613#[doc = "Event data passed to the user callback."]
18614#[repr(C)]
18615#[derive(Debug, Copy, Clone)]
18616pub struct NfcScannerEventData {
18617 #[doc = "< Number of detected protocols (one or more)."]
18618 pub protocol_num: usize,
18619 #[doc = "< Pointer to the array of detected protocol identifiers."]
18620 pub protocols: *mut NfcProtocol,
18621}
18622#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18623const _: () = {
18624 ["Size of NfcScannerEventData"][::core::mem::size_of::<NfcScannerEventData>() - 8usize];
18625 ["Alignment of NfcScannerEventData"][::core::mem::align_of::<NfcScannerEventData>() - 4usize];
18626 ["Offset of field: NfcScannerEventData::protocol_num"]
18627 [::core::mem::offset_of!(NfcScannerEventData, protocol_num) - 0usize];
18628 ["Offset of field: NfcScannerEventData::protocols"]
18629 [::core::mem::offset_of!(NfcScannerEventData, protocols) - 4usize];
18630};
18631#[doc = "Event passed to the user callback."]
18632#[repr(C)]
18633#[derive(Debug, Copy, Clone)]
18634pub struct NfcScannerEvent {
18635 #[doc = "< Type of event. Determines how the data must be handled."]
18636 pub type_: NfcScannerEventType,
18637 #[doc = "< Event-specific data. Handled accordingly to the even type."]
18638 pub data: NfcScannerEventData,
18639}
18640#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18641const _: () = {
18642 ["Size of NfcScannerEvent"][::core::mem::size_of::<NfcScannerEvent>() - 12usize];
18643 ["Alignment of NfcScannerEvent"][::core::mem::align_of::<NfcScannerEvent>() - 4usize];
18644 ["Offset of field: NfcScannerEvent::type_"]
18645 [::core::mem::offset_of!(NfcScannerEvent, type_) - 0usize];
18646 ["Offset of field: NfcScannerEvent::data"]
18647 [::core::mem::offset_of!(NfcScannerEvent, data) - 4usize];
18648};
18649#[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."]
18650pub type NfcScannerCallback = ::core::option::Option<
18651 unsafe extern "C" fn(event: NfcScannerEvent, context: *mut core::ffi::c_void),
18652>;
18653unsafe extern "C" {
18654 #[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`]"]
18655 pub fn nfc_scanner_alloc(nfc: *mut Nfc) -> *mut NfcScanner;
18656}
18657unsafe extern "C" {
18658 #[doc = "Delete an NfcScanner instance.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be deleted."]
18659 pub fn nfc_scanner_free(instance: *mut NfcScanner);
18660}
18661unsafe extern "C" {
18662 #[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)."]
18663 pub fn nfc_scanner_start(
18664 instance: *mut NfcScanner,
18665 callback: NfcScannerCallback,
18666 context: *mut core::ffi::c_void,
18667 );
18668}
18669unsafe extern "C" {
18670 #[doc = "Stop an NfcScanner.\n\n # Arguments\n\n* `instance` (direction in, out) - pointer to the instance to be stopped."]
18671 pub fn nfc_scanner_stop(instance: *mut NfcScanner);
18672}
18673#[repr(C)]
18674#[derive(Debug, Copy, Clone)]
18675pub struct SimpleArray {
18676 _unused: [u8; 0],
18677}
18678pub type SimpleArrayData = core::ffi::c_void;
18679pub type SimpleArrayElement = core::ffi::c_void;
18680pub type SimpleArrayInit =
18681 ::core::option::Option<unsafe extern "C" fn(elem: *mut SimpleArrayElement)>;
18682pub type SimpleArrayReset =
18683 ::core::option::Option<unsafe extern "C" fn(elem: *mut SimpleArrayElement)>;
18684pub type SimpleArrayCopy = ::core::option::Option<
18685 unsafe extern "C" fn(elem: *mut SimpleArrayElement, other: *const SimpleArrayElement),
18686>;
18687#[doc = "Simple Array configuration structure. Defined per type."]
18688#[repr(C)]
18689#[derive(Debug, Copy, Clone)]
18690pub struct SimpleArrayConfig {
18691 #[doc = "< Initialisation (in-place constructor) method."]
18692 pub init: SimpleArrayInit,
18693 #[doc = "< Reset (custom destructor) method."]
18694 pub reset: SimpleArrayReset,
18695 #[doc = "< Copy (custom copy-constructor) method."]
18696 pub copy: SimpleArrayCopy,
18697 pub type_size: usize,
18698}
18699#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18700const _: () = {
18701 ["Size of SimpleArrayConfig"][::core::mem::size_of::<SimpleArrayConfig>() - 16usize];
18702 ["Alignment of SimpleArrayConfig"][::core::mem::align_of::<SimpleArrayConfig>() - 4usize];
18703 ["Offset of field: SimpleArrayConfig::init"]
18704 [::core::mem::offset_of!(SimpleArrayConfig, init) - 0usize];
18705 ["Offset of field: SimpleArrayConfig::reset"]
18706 [::core::mem::offset_of!(SimpleArrayConfig, reset) - 4usize];
18707 ["Offset of field: SimpleArrayConfig::copy"]
18708 [::core::mem::offset_of!(SimpleArrayConfig, copy) - 8usize];
18709 ["Offset of field: SimpleArrayConfig::type_size"]
18710 [::core::mem::offset_of!(SimpleArrayConfig, type_size) - 12usize];
18711};
18712unsafe extern "C" {
18713 #[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"]
18714 pub fn simple_array_alloc(config: *const SimpleArrayConfig) -> *mut SimpleArray;
18715}
18716unsafe extern "C" {
18717 #[doc = "Free a SimpleArray instance and release its contents.\n\n # Arguments\n\n* `[in]` - instance Pointer to the SimpleArray instance to be freed"]
18718 pub fn simple_array_free(instance: *mut SimpleArray);
18719}
18720unsafe extern "C" {
18721 #[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"]
18722 pub fn simple_array_init(instance: *mut SimpleArray, count: u32);
18723}
18724unsafe extern "C" {
18725 #[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"]
18726 pub fn simple_array_reset(instance: *mut SimpleArray);
18727}
18728unsafe extern "C" {
18729 #[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"]
18730 pub fn simple_array_copy(instance: *mut SimpleArray, other: *const SimpleArray);
18731}
18732unsafe extern "C" {
18733 #[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"]
18734 pub fn simple_array_is_equal(instance: *const SimpleArray, other: *const SimpleArray) -> bool;
18735}
18736unsafe extern "C" {
18737 #[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"]
18738 pub fn simple_array_get_count(instance: *const SimpleArray) -> u32;
18739}
18740unsafe extern "C" {
18741 #[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"]
18742 pub fn simple_array_get(instance: *mut SimpleArray, index: u32) -> *mut SimpleArrayElement;
18743}
18744unsafe extern "C" {
18745 #[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"]
18746 pub fn simple_array_cget(instance: *const SimpleArray, index: u32)
18747 -> *const SimpleArrayElement;
18748}
18749unsafe extern "C" {
18750 #[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"]
18751 pub fn simple_array_get_data(instance: *mut SimpleArray) -> *mut SimpleArrayData;
18752}
18753unsafe extern "C" {
18754 #[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"]
18755 pub fn simple_array_cget_data(instance: *const SimpleArray) -> *const SimpleArrayData;
18756}
18757unsafe extern "C" {
18758 pub static simple_array_config_uint8_t: SimpleArrayConfig;
18759}
18760pub const FelicaErrorNone: FelicaError = FelicaError(0);
18761pub const FelicaErrorNotPresent: FelicaError = FelicaError(1);
18762pub const FelicaErrorColResFailed: FelicaError = FelicaError(2);
18763pub const FelicaErrorBufferOverflow: FelicaError = FelicaError(3);
18764pub const FelicaErrorCommunication: FelicaError = FelicaError(4);
18765pub const FelicaErrorFieldOff: FelicaError = FelicaError(5);
18766pub const FelicaErrorWrongCrc: FelicaError = FelicaError(6);
18767pub const FelicaErrorProtocol: FelicaError = FelicaError(7);
18768pub const FelicaErrorTimeout: FelicaError = FelicaError(8);
18769pub const FelicaErrorFeatureUnsupported: FelicaError = FelicaError(9);
18770#[repr(transparent)]
18771#[doc = "Type of possible Felica errors"]
18772#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18773pub struct FelicaError(pub core::ffi::c_uchar);
18774pub const FelicaUnknown: FelicaWorkflowType = FelicaWorkflowType(0);
18775pub const FelicaStandard: FelicaWorkflowType = FelicaWorkflowType(1);
18776pub const FelicaLite: FelicaWorkflowType = FelicaWorkflowType(2);
18777#[repr(transparent)]
18778#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18779pub struct FelicaWorkflowType(pub core::ffi::c_uchar);
18780#[repr(C)]
18781#[derive(Debug, Copy, Clone)]
18782pub struct FelicaBlockData {
18783 pub data: [u8; 16usize],
18784}
18785#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18786const _: () = {
18787 ["Size of FelicaBlockData"][::core::mem::size_of::<FelicaBlockData>() - 16usize];
18788 ["Alignment of FelicaBlockData"][::core::mem::align_of::<FelicaBlockData>() - 1usize];
18789 ["Offset of field: FelicaBlockData::data"]
18790 [::core::mem::offset_of!(FelicaBlockData, data) - 0usize];
18791};
18792#[doc = "Separate type for card key block. Used in authentication process"]
18793#[repr(C)]
18794#[derive(Debug, Copy, Clone)]
18795pub struct FelicaCardKey {
18796 pub data: [u8; 16usize],
18797}
18798#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18799const _: () = {
18800 ["Size of FelicaCardKey"][::core::mem::size_of::<FelicaCardKey>() - 16usize];
18801 ["Alignment of FelicaCardKey"][::core::mem::align_of::<FelicaCardKey>() - 1usize];
18802 ["Offset of field: FelicaCardKey::data"][::core::mem::offset_of!(FelicaCardKey, data) - 0usize];
18803};
18804#[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"]
18805#[repr(C)]
18806#[derive(Debug, Copy, Clone)]
18807pub struct FelicaAuthenticationStatus {
18808 pub _bitfield_align_1: [u8; 0],
18809 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
18810}
18811#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18812const _: () = {
18813 ["Size of FelicaAuthenticationStatus"]
18814 [::core::mem::size_of::<FelicaAuthenticationStatus>() - 1usize];
18815 ["Alignment of FelicaAuthenticationStatus"]
18816 [::core::mem::align_of::<FelicaAuthenticationStatus>() - 1usize];
18817};
18818impl FelicaAuthenticationStatus {
18819 #[inline]
18820 pub fn internal(&self) -> bool {
18821 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
18822 }
18823 #[inline]
18824 pub fn set_internal(&mut self, val: bool) {
18825 unsafe {
18826 let val: u8 = ::core::mem::transmute(val);
18827 self._bitfield_1.set(0usize, 1u8, val as u64)
18828 }
18829 }
18830 #[inline]
18831 pub unsafe fn internal_raw(this: *const Self) -> bool {
18832 unsafe {
18833 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
18834 ::core::ptr::addr_of!((*this)._bitfield_1),
18835 0usize,
18836 1u8,
18837 ) as u8)
18838 }
18839 }
18840 #[inline]
18841 pub unsafe fn set_internal_raw(this: *mut Self, val: bool) {
18842 unsafe {
18843 let val: u8 = ::core::mem::transmute(val);
18844 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
18845 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
18846 0usize,
18847 1u8,
18848 val as u64,
18849 )
18850 }
18851 }
18852 #[inline]
18853 pub fn external(&self) -> bool {
18854 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
18855 }
18856 #[inline]
18857 pub fn set_external(&mut self, val: bool) {
18858 unsafe {
18859 let val: u8 = ::core::mem::transmute(val);
18860 self._bitfield_1.set(1usize, 1u8, val as u64)
18861 }
18862 }
18863 #[inline]
18864 pub unsafe fn external_raw(this: *const Self) -> bool {
18865 unsafe {
18866 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
18867 ::core::ptr::addr_of!((*this)._bitfield_1),
18868 1usize,
18869 1u8,
18870 ) as u8)
18871 }
18872 }
18873 #[inline]
18874 pub unsafe fn set_external_raw(this: *mut Self, val: bool) {
18875 unsafe {
18876 let val: u8 = ::core::mem::transmute(val);
18877 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
18878 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
18879 1usize,
18880 1u8,
18881 val as u64,
18882 )
18883 }
18884 }
18885 #[inline]
18886 pub fn new_bitfield_1(internal: bool, external: bool) -> __BindgenBitfieldUnit<[u8; 1usize]> {
18887 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
18888 __bindgen_bitfield_unit.set(0usize, 1u8, {
18889 let internal: u8 = unsafe { ::core::mem::transmute(internal) };
18890 internal as u64
18891 });
18892 __bindgen_bitfield_unit.set(1usize, 1u8, {
18893 let external: u8 = unsafe { ::core::mem::transmute(external) };
18894 external as u64
18895 });
18896 __bindgen_bitfield_unit
18897 }
18898}
18899#[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."]
18900#[repr(C)]
18901#[derive(Debug, Copy, Clone)]
18902pub struct FelicaAuthenticationContext {
18903 #[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"]
18904 pub skip_auth: bool,
18905 #[doc = "< User must fill this field with known card key in order to pass auth"]
18906 pub card_key: FelicaCardKey,
18907 #[doc = "< Authentication status"]
18908 pub auth_status: FelicaAuthenticationStatus,
18909}
18910#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18911const _: () = {
18912 ["Size of FelicaAuthenticationContext"]
18913 [::core::mem::size_of::<FelicaAuthenticationContext>() - 18usize];
18914 ["Alignment of FelicaAuthenticationContext"]
18915 [::core::mem::align_of::<FelicaAuthenticationContext>() - 1usize];
18916 ["Offset of field: FelicaAuthenticationContext::skip_auth"]
18917 [::core::mem::offset_of!(FelicaAuthenticationContext, skip_auth) - 0usize];
18918 ["Offset of field: FelicaAuthenticationContext::card_key"]
18919 [::core::mem::offset_of!(FelicaAuthenticationContext, card_key) - 1usize];
18920 ["Offset of field: FelicaAuthenticationContext::auth_status"]
18921 [::core::mem::offset_of!(FelicaAuthenticationContext, auth_status) - 17usize];
18922};
18923#[doc = "Stucture for holding Felica session key which is calculated from rc and ck."]
18924#[repr(C)]
18925#[derive(Debug, Copy, Clone)]
18926pub struct FelicaSessionKey {
18927 pub data: [u8; 16usize],
18928}
18929#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18930const _: () = {
18931 ["Size of FelicaSessionKey"][::core::mem::size_of::<FelicaSessionKey>() - 16usize];
18932 ["Alignment of FelicaSessionKey"][::core::mem::align_of::<FelicaSessionKey>() - 1usize];
18933 ["Offset of field: FelicaSessionKey::data"]
18934 [::core::mem::offset_of!(FelicaSessionKey, data) - 0usize];
18935};
18936#[doc = "Structure used to hold authentication related fields."]
18937#[repr(C)]
18938#[derive(Debug, Copy, Clone)]
18939pub struct FelicaAuthentication {
18940 #[doc = "< Context for mbedtls des functions."]
18941 pub des_context: mbedtls_des3_context,
18942 #[doc = "< Calculated session key."]
18943 pub session_key: FelicaSessionKey,
18944 #[doc = "< Public auth context provided to upper levels."]
18945 pub context: FelicaAuthenticationContext,
18946}
18947#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18948const _: () = {
18949 ["Size of FelicaAuthentication"][::core::mem::size_of::<FelicaAuthentication>() - 420usize];
18950 ["Alignment of FelicaAuthentication"][::core::mem::align_of::<FelicaAuthentication>() - 4usize];
18951 ["Offset of field: FelicaAuthentication::des_context"]
18952 [::core::mem::offset_of!(FelicaAuthentication, des_context) - 0usize];
18953 ["Offset of field: FelicaAuthentication::session_key"]
18954 [::core::mem::offset_of!(FelicaAuthentication, session_key) - 384usize];
18955 ["Offset of field: FelicaAuthentication::context"]
18956 [::core::mem::offset_of!(FelicaAuthentication, context) - 400usize];
18957};
18958#[doc = "Felica ID block"]
18959#[repr(C)]
18960#[derive(Debug, Copy, Clone)]
18961pub struct FelicaIDm {
18962 pub data: [u8; 8usize],
18963}
18964#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18965const _: () = {
18966 ["Size of FelicaIDm"][::core::mem::size_of::<FelicaIDm>() - 8usize];
18967 ["Alignment of FelicaIDm"][::core::mem::align_of::<FelicaIDm>() - 1usize];
18968 ["Offset of field: FelicaIDm::data"][::core::mem::offset_of!(FelicaIDm, data) - 0usize];
18969};
18970#[doc = "Felica PMm block"]
18971#[repr(C)]
18972#[derive(Debug, Copy, Clone)]
18973pub struct FelicaPMm {
18974 pub data: [u8; 8usize],
18975}
18976#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18977const _: () = {
18978 ["Size of FelicaPMm"][::core::mem::size_of::<FelicaPMm>() - 8usize];
18979 ["Alignment of FelicaPMm"][::core::mem::align_of::<FelicaPMm>() - 1usize];
18980 ["Offset of field: FelicaPMm::data"][::core::mem::offset_of!(FelicaPMm, data) - 0usize];
18981};
18982#[doc = "Felica block with status flags indicating last operation with it.\n See Felica manual for more details on status codes."]
18983#[repr(C)]
18984#[derive(Debug, Copy, Clone)]
18985pub struct FelicaBlock {
18986 #[doc = "< Status flag 1, equals to 0 when success"]
18987 pub SF1: u8,
18988 #[doc = "< Status flag 2, equals to 0 when success"]
18989 pub SF2: u8,
18990 #[doc = "< Block data"]
18991 pub data: [u8; 16usize],
18992}
18993#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18994const _: () = {
18995 ["Size of FelicaBlock"][::core::mem::size_of::<FelicaBlock>() - 18usize];
18996 ["Alignment of FelicaBlock"][::core::mem::align_of::<FelicaBlock>() - 1usize];
18997 ["Offset of field: FelicaBlock::SF1"][::core::mem::offset_of!(FelicaBlock, SF1) - 0usize];
18998 ["Offset of field: FelicaBlock::SF2"][::core::mem::offset_of!(FelicaBlock, SF2) - 1usize];
18999 ["Offset of field: FelicaBlock::data"][::core::mem::offset_of!(FelicaBlock, data) - 2usize];
19000};
19001#[doc = "Felica filesystem structure"]
19002#[repr(C)]
19003#[derive(Debug, Copy, Clone)]
19004pub struct FelicaFileSystem {
19005 pub spad: [FelicaBlock; 14usize],
19006 pub reg: FelicaBlock,
19007 pub rc: FelicaBlock,
19008 pub mac: FelicaBlock,
19009 pub id: FelicaBlock,
19010 pub d_id: FelicaBlock,
19011 pub ser_c: FelicaBlock,
19012 pub sys_c: FelicaBlock,
19013 pub ckv: FelicaBlock,
19014 pub ck: FelicaBlock,
19015 pub mc: FelicaBlock,
19016 pub wcnt: FelicaBlock,
19017 pub mac_a: FelicaBlock,
19018 pub state: FelicaBlock,
19019 pub crc_check: FelicaBlock,
19020}
19021#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19022const _: () = {
19023 ["Size of FelicaFileSystem"][::core::mem::size_of::<FelicaFileSystem>() - 504usize];
19024 ["Alignment of FelicaFileSystem"][::core::mem::align_of::<FelicaFileSystem>() - 1usize];
19025 ["Offset of field: FelicaFileSystem::spad"]
19026 [::core::mem::offset_of!(FelicaFileSystem, spad) - 0usize];
19027 ["Offset of field: FelicaFileSystem::reg"]
19028 [::core::mem::offset_of!(FelicaFileSystem, reg) - 252usize];
19029 ["Offset of field: FelicaFileSystem::rc"]
19030 [::core::mem::offset_of!(FelicaFileSystem, rc) - 270usize];
19031 ["Offset of field: FelicaFileSystem::mac"]
19032 [::core::mem::offset_of!(FelicaFileSystem, mac) - 288usize];
19033 ["Offset of field: FelicaFileSystem::id"]
19034 [::core::mem::offset_of!(FelicaFileSystem, id) - 306usize];
19035 ["Offset of field: FelicaFileSystem::d_id"]
19036 [::core::mem::offset_of!(FelicaFileSystem, d_id) - 324usize];
19037 ["Offset of field: FelicaFileSystem::ser_c"]
19038 [::core::mem::offset_of!(FelicaFileSystem, ser_c) - 342usize];
19039 ["Offset of field: FelicaFileSystem::sys_c"]
19040 [::core::mem::offset_of!(FelicaFileSystem, sys_c) - 360usize];
19041 ["Offset of field: FelicaFileSystem::ckv"]
19042 [::core::mem::offset_of!(FelicaFileSystem, ckv) - 378usize];
19043 ["Offset of field: FelicaFileSystem::ck"]
19044 [::core::mem::offset_of!(FelicaFileSystem, ck) - 396usize];
19045 ["Offset of field: FelicaFileSystem::mc"]
19046 [::core::mem::offset_of!(FelicaFileSystem, mc) - 414usize];
19047 ["Offset of field: FelicaFileSystem::wcnt"]
19048 [::core::mem::offset_of!(FelicaFileSystem, wcnt) - 432usize];
19049 ["Offset of field: FelicaFileSystem::mac_a"]
19050 [::core::mem::offset_of!(FelicaFileSystem, mac_a) - 450usize];
19051 ["Offset of field: FelicaFileSystem::state"]
19052 [::core::mem::offset_of!(FelicaFileSystem, state) - 468usize];
19053 ["Offset of field: FelicaFileSystem::crc_check"]
19054 [::core::mem::offset_of!(FelicaFileSystem, crc_check) - 486usize];
19055};
19056#[doc = "Union which represents filesystem in junction with plain data dump"]
19057#[repr(C)]
19058#[derive(Copy, Clone)]
19059pub union FelicaFSUnion {
19060 pub fs: FelicaFileSystem,
19061 pub dump: [u8; 504usize],
19062}
19063#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19064const _: () = {
19065 ["Size of FelicaFSUnion"][::core::mem::size_of::<FelicaFSUnion>() - 504usize];
19066 ["Alignment of FelicaFSUnion"][::core::mem::align_of::<FelicaFSUnion>() - 1usize];
19067 ["Offset of field: FelicaFSUnion::fs"][::core::mem::offset_of!(FelicaFSUnion, fs) - 0usize];
19068 ["Offset of field: FelicaFSUnion::dump"][::core::mem::offset_of!(FelicaFSUnion, dump) - 0usize];
19069};
19070#[repr(C)]
19071#[derive(Debug, Copy, Clone)]
19072pub struct FelicaService {
19073 pub code: u16,
19074 pub attr: u8,
19075}
19076#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19077const _: () = {
19078 ["Size of FelicaService"][::core::mem::size_of::<FelicaService>() - 4usize];
19079 ["Alignment of FelicaService"][::core::mem::align_of::<FelicaService>() - 2usize];
19080 ["Offset of field: FelicaService::code"][::core::mem::offset_of!(FelicaService, code) - 0usize];
19081 ["Offset of field: FelicaService::attr"][::core::mem::offset_of!(FelicaService, attr) - 2usize];
19082};
19083#[repr(C)]
19084#[derive(Debug, Copy, Clone)]
19085pub struct FelicaArea {
19086 pub code: u16,
19087 pub first_idx: u16,
19088 pub last_idx: u16,
19089}
19090#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19091const _: () = {
19092 ["Size of FelicaArea"][::core::mem::size_of::<FelicaArea>() - 6usize];
19093 ["Alignment of FelicaArea"][::core::mem::align_of::<FelicaArea>() - 2usize];
19094 ["Offset of field: FelicaArea::code"][::core::mem::offset_of!(FelicaArea, code) - 0usize];
19095 ["Offset of field: FelicaArea::first_idx"]
19096 [::core::mem::offset_of!(FelicaArea, first_idx) - 2usize];
19097 ["Offset of field: FelicaArea::last_idx"]
19098 [::core::mem::offset_of!(FelicaArea, last_idx) - 4usize];
19099};
19100#[repr(C)]
19101#[derive(Debug, Copy, Clone)]
19102pub struct FelicaPublicBlock {
19103 pub block: FelicaBlock,
19104 pub service_code: u16,
19105 pub block_idx: u8,
19106}
19107#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19108const _: () = {
19109 ["Size of FelicaPublicBlock"][::core::mem::size_of::<FelicaPublicBlock>() - 22usize];
19110 ["Alignment of FelicaPublicBlock"][::core::mem::align_of::<FelicaPublicBlock>() - 2usize];
19111 ["Offset of field: FelicaPublicBlock::block"]
19112 [::core::mem::offset_of!(FelicaPublicBlock, block) - 0usize];
19113 ["Offset of field: FelicaPublicBlock::service_code"]
19114 [::core::mem::offset_of!(FelicaPublicBlock, service_code) - 18usize];
19115 ["Offset of field: FelicaPublicBlock::block_idx"]
19116 [::core::mem::offset_of!(FelicaPublicBlock, block_idx) - 20usize];
19117};
19118#[repr(C)]
19119#[derive(Debug, Copy, Clone)]
19120pub struct FelicaSystem {
19121 pub system_code_idx: u8,
19122 pub system_code: u16,
19123 pub services: *mut SimpleArray,
19124 pub areas: *mut SimpleArray,
19125 pub public_blocks: *mut SimpleArray,
19126}
19127#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19128const _: () = {
19129 ["Size of FelicaSystem"][::core::mem::size_of::<FelicaSystem>() - 16usize];
19130 ["Alignment of FelicaSystem"][::core::mem::align_of::<FelicaSystem>() - 4usize];
19131 ["Offset of field: FelicaSystem::system_code_idx"]
19132 [::core::mem::offset_of!(FelicaSystem, system_code_idx) - 0usize];
19133 ["Offset of field: FelicaSystem::system_code"]
19134 [::core::mem::offset_of!(FelicaSystem, system_code) - 2usize];
19135 ["Offset of field: FelicaSystem::services"]
19136 [::core::mem::offset_of!(FelicaSystem, services) - 4usize];
19137 ["Offset of field: FelicaSystem::areas"][::core::mem::offset_of!(FelicaSystem, areas) - 8usize];
19138 ["Offset of field: FelicaSystem::public_blocks"]
19139 [::core::mem::offset_of!(FelicaSystem, public_blocks) - 12usize];
19140};
19141#[doc = "Structure used to store Felica data and additional values about reading"]
19142#[repr(C)]
19143#[derive(Copy, Clone)]
19144pub struct FelicaData {
19145 pub idm: FelicaIDm,
19146 pub pmm: FelicaPMm,
19147 pub blocks_total: u8,
19148 pub blocks_read: u8,
19149 pub data: FelicaFSUnion,
19150 pub systems: *mut SimpleArray,
19151 pub workflow_type: FelicaWorkflowType,
19152}
19153#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19154const _: () = {
19155 ["Size of FelicaData"][::core::mem::size_of::<FelicaData>() - 532usize];
19156 ["Alignment of FelicaData"][::core::mem::align_of::<FelicaData>() - 4usize];
19157 ["Offset of field: FelicaData::idm"][::core::mem::offset_of!(FelicaData, idm) - 0usize];
19158 ["Offset of field: FelicaData::pmm"][::core::mem::offset_of!(FelicaData, pmm) - 8usize];
19159 ["Offset of field: FelicaData::blocks_total"]
19160 [::core::mem::offset_of!(FelicaData, blocks_total) - 16usize];
19161 ["Offset of field: FelicaData::blocks_read"]
19162 [::core::mem::offset_of!(FelicaData, blocks_read) - 17usize];
19163 ["Offset of field: FelicaData::data"][::core::mem::offset_of!(FelicaData, data) - 18usize];
19164 ["Offset of field: FelicaData::systems"]
19165 [::core::mem::offset_of!(FelicaData, systems) - 524usize];
19166 ["Offset of field: FelicaData::workflow_type"]
19167 [::core::mem::offset_of!(FelicaData, workflow_type) - 528usize];
19168};
19169#[repr(C, packed)]
19170#[derive(Debug, Copy, Clone)]
19171pub struct FelicaCommandHeader {
19172 pub code: u8,
19173 pub idm: FelicaIDm,
19174 pub service_num: u8,
19175 pub service_code: u16,
19176 pub block_count: u8,
19177}
19178#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19179const _: () = {
19180 ["Size of FelicaCommandHeader"][::core::mem::size_of::<FelicaCommandHeader>() - 13usize];
19181 ["Alignment of FelicaCommandHeader"][::core::mem::align_of::<FelicaCommandHeader>() - 1usize];
19182 ["Offset of field: FelicaCommandHeader::code"]
19183 [::core::mem::offset_of!(FelicaCommandHeader, code) - 0usize];
19184 ["Offset of field: FelicaCommandHeader::idm"]
19185 [::core::mem::offset_of!(FelicaCommandHeader, idm) - 1usize];
19186 ["Offset of field: FelicaCommandHeader::service_num"]
19187 [::core::mem::offset_of!(FelicaCommandHeader, service_num) - 9usize];
19188 ["Offset of field: FelicaCommandHeader::service_code"]
19189 [::core::mem::offset_of!(FelicaCommandHeader, service_code) - 10usize];
19190 ["Offset of field: FelicaCommandHeader::block_count"]
19191 [::core::mem::offset_of!(FelicaCommandHeader, block_count) - 12usize];
19192};
19193#[repr(C)]
19194#[derive(Debug, Copy, Clone)]
19195pub struct FelicaCommandResponseHeader {
19196 pub length: u8,
19197 pub response_code: u8,
19198 pub idm: FelicaIDm,
19199 pub SF1: u8,
19200 pub SF2: u8,
19201}
19202#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19203const _: () = {
19204 ["Size of FelicaCommandResponseHeader"]
19205 [::core::mem::size_of::<FelicaCommandResponseHeader>() - 12usize];
19206 ["Alignment of FelicaCommandResponseHeader"]
19207 [::core::mem::align_of::<FelicaCommandResponseHeader>() - 1usize];
19208 ["Offset of field: FelicaCommandResponseHeader::length"]
19209 [::core::mem::offset_of!(FelicaCommandResponseHeader, length) - 0usize];
19210 ["Offset of field: FelicaCommandResponseHeader::response_code"]
19211 [::core::mem::offset_of!(FelicaCommandResponseHeader, response_code) - 1usize];
19212 ["Offset of field: FelicaCommandResponseHeader::idm"]
19213 [::core::mem::offset_of!(FelicaCommandResponseHeader, idm) - 2usize];
19214 ["Offset of field: FelicaCommandResponseHeader::SF1"]
19215 [::core::mem::offset_of!(FelicaCommandResponseHeader, SF1) - 10usize];
19216 ["Offset of field: FelicaCommandResponseHeader::SF2"]
19217 [::core::mem::offset_of!(FelicaCommandResponseHeader, SF2) - 11usize];
19218};
19219#[repr(C)]
19220#[derive(Debug, Copy, Clone)]
19221pub struct FelicaCommandHeaderRaw {
19222 pub length: u8,
19223 pub command: u8,
19224 pub idm: FelicaIDm,
19225}
19226#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19227const _: () = {
19228 ["Size of FelicaCommandHeaderRaw"][::core::mem::size_of::<FelicaCommandHeaderRaw>() - 10usize];
19229 ["Alignment of FelicaCommandHeaderRaw"]
19230 [::core::mem::align_of::<FelicaCommandHeaderRaw>() - 1usize];
19231 ["Offset of field: FelicaCommandHeaderRaw::length"]
19232 [::core::mem::offset_of!(FelicaCommandHeaderRaw, length) - 0usize];
19233 ["Offset of field: FelicaCommandHeaderRaw::command"]
19234 [::core::mem::offset_of!(FelicaCommandHeaderRaw, command) - 1usize];
19235 ["Offset of field: FelicaCommandHeaderRaw::idm"]
19236 [::core::mem::offset_of!(FelicaCommandHeaderRaw, idm) - 2usize];
19237};
19238#[repr(C)]
19239#[derive(Debug, Copy, Clone)]
19240pub struct FelicaBlockListElement {
19241 pub _bitfield_align_1: [u8; 0],
19242 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
19243 pub block_number: u8,
19244}
19245#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19246const _: () = {
19247 ["Size of FelicaBlockListElement"][::core::mem::size_of::<FelicaBlockListElement>() - 2usize];
19248 ["Alignment of FelicaBlockListElement"]
19249 [::core::mem::align_of::<FelicaBlockListElement>() - 1usize];
19250 ["Offset of field: FelicaBlockListElement::block_number"]
19251 [::core::mem::offset_of!(FelicaBlockListElement, block_number) - 1usize];
19252};
19253impl FelicaBlockListElement {
19254 #[inline]
19255 pub fn service_code(&self) -> u8 {
19256 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
19257 }
19258 #[inline]
19259 pub fn set_service_code(&mut self, val: u8) {
19260 unsafe {
19261 let val: u8 = ::core::mem::transmute(val);
19262 self._bitfield_1.set(0usize, 4u8, val as u64)
19263 }
19264 }
19265 #[inline]
19266 pub unsafe fn service_code_raw(this: *const Self) -> u8 {
19267 unsafe {
19268 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
19269 ::core::ptr::addr_of!((*this)._bitfield_1),
19270 0usize,
19271 4u8,
19272 ) as u8)
19273 }
19274 }
19275 #[inline]
19276 pub unsafe fn set_service_code_raw(this: *mut Self, val: u8) {
19277 unsafe {
19278 let val: u8 = ::core::mem::transmute(val);
19279 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
19280 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
19281 0usize,
19282 4u8,
19283 val as u64,
19284 )
19285 }
19286 }
19287 #[inline]
19288 pub fn access_mode(&self) -> u8 {
19289 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) }
19290 }
19291 #[inline]
19292 pub fn set_access_mode(&mut self, val: u8) {
19293 unsafe {
19294 let val: u8 = ::core::mem::transmute(val);
19295 self._bitfield_1.set(4usize, 3u8, val as u64)
19296 }
19297 }
19298 #[inline]
19299 pub unsafe fn access_mode_raw(this: *const Self) -> u8 {
19300 unsafe {
19301 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
19302 ::core::ptr::addr_of!((*this)._bitfield_1),
19303 4usize,
19304 3u8,
19305 ) as u8)
19306 }
19307 }
19308 #[inline]
19309 pub unsafe fn set_access_mode_raw(this: *mut Self, val: u8) {
19310 unsafe {
19311 let val: u8 = ::core::mem::transmute(val);
19312 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
19313 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
19314 4usize,
19315 3u8,
19316 val as u64,
19317 )
19318 }
19319 }
19320 #[inline]
19321 pub fn length(&self) -> u8 {
19322 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
19323 }
19324 #[inline]
19325 pub fn set_length(&mut self, val: u8) {
19326 unsafe {
19327 let val: u8 = ::core::mem::transmute(val);
19328 self._bitfield_1.set(7usize, 1u8, val as u64)
19329 }
19330 }
19331 #[inline]
19332 pub unsafe fn length_raw(this: *const Self) -> u8 {
19333 unsafe {
19334 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
19335 ::core::ptr::addr_of!((*this)._bitfield_1),
19336 7usize,
19337 1u8,
19338 ) as u8)
19339 }
19340 }
19341 #[inline]
19342 pub unsafe fn set_length_raw(this: *mut Self, val: u8) {
19343 unsafe {
19344 let val: u8 = ::core::mem::transmute(val);
19345 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
19346 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
19347 7usize,
19348 1u8,
19349 val as u64,
19350 )
19351 }
19352 }
19353 #[inline]
19354 pub fn new_bitfield_1(
19355 service_code: u8,
19356 access_mode: u8,
19357 length: u8,
19358 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
19359 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
19360 __bindgen_bitfield_unit.set(0usize, 4u8, {
19361 let service_code: u8 = unsafe { ::core::mem::transmute(service_code) };
19362 service_code as u64
19363 });
19364 __bindgen_bitfield_unit.set(4usize, 3u8, {
19365 let access_mode: u8 = unsafe { ::core::mem::transmute(access_mode) };
19366 access_mode as u64
19367 });
19368 __bindgen_bitfield_unit.set(7usize, 1u8, {
19369 let length: u8 = unsafe { ::core::mem::transmute(length) };
19370 length as u64
19371 });
19372 __bindgen_bitfield_unit
19373 }
19374}
19375#[repr(C)]
19376#[derive(Debug)]
19377pub struct FelicaPollerReadCommandResponse {
19378 pub length: u8,
19379 pub response_code: u8,
19380 pub idm: FelicaIDm,
19381 pub SF1: u8,
19382 pub SF2: u8,
19383 pub block_count: u8,
19384 pub data: __IncompleteArrayField<u8>,
19385}
19386#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19387const _: () = {
19388 ["Size of FelicaPollerReadCommandResponse"]
19389 [::core::mem::size_of::<FelicaPollerReadCommandResponse>() - 13usize];
19390 ["Alignment of FelicaPollerReadCommandResponse"]
19391 [::core::mem::align_of::<FelicaPollerReadCommandResponse>() - 1usize];
19392 ["Offset of field: FelicaPollerReadCommandResponse::length"]
19393 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, length) - 0usize];
19394 ["Offset of field: FelicaPollerReadCommandResponse::response_code"]
19395 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, response_code) - 1usize];
19396 ["Offset of field: FelicaPollerReadCommandResponse::idm"]
19397 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, idm) - 2usize];
19398 ["Offset of field: FelicaPollerReadCommandResponse::SF1"]
19399 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, SF1) - 10usize];
19400 ["Offset of field: FelicaPollerReadCommandResponse::SF2"]
19401 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, SF2) - 11usize];
19402 ["Offset of field: FelicaPollerReadCommandResponse::block_count"]
19403 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, block_count) - 12usize];
19404 ["Offset of field: FelicaPollerReadCommandResponse::data"]
19405 [::core::mem::offset_of!(FelicaPollerReadCommandResponse, data) - 13usize];
19406};
19407#[repr(C)]
19408#[derive(Debug)]
19409pub struct FelicaListenerReadCommandResponse {
19410 pub header: FelicaCommandResponseHeader,
19411 pub block_count: u8,
19412 pub data: __IncompleteArrayField<u8>,
19413}
19414#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19415const _: () = {
19416 ["Size of FelicaListenerReadCommandResponse"]
19417 [::core::mem::size_of::<FelicaListenerReadCommandResponse>() - 13usize];
19418 ["Alignment of FelicaListenerReadCommandResponse"]
19419 [::core::mem::align_of::<FelicaListenerReadCommandResponse>() - 1usize];
19420 ["Offset of field: FelicaListenerReadCommandResponse::header"]
19421 [::core::mem::offset_of!(FelicaListenerReadCommandResponse, header) - 0usize];
19422 ["Offset of field: FelicaListenerReadCommandResponse::block_count"]
19423 [::core::mem::offset_of!(FelicaListenerReadCommandResponse, block_count) - 12usize];
19424 ["Offset of field: FelicaListenerReadCommandResponse::data"]
19425 [::core::mem::offset_of!(FelicaListenerReadCommandResponse, data) - 13usize];
19426};
19427#[repr(C)]
19428#[derive(Debug)]
19429pub struct FelicaListServiceCommandResponse {
19430 pub header: FelicaCommandHeaderRaw,
19431 pub data: __IncompleteArrayField<u8>,
19432}
19433#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19434const _: () = {
19435 ["Size of FelicaListServiceCommandResponse"]
19436 [::core::mem::size_of::<FelicaListServiceCommandResponse>() - 10usize];
19437 ["Alignment of FelicaListServiceCommandResponse"]
19438 [::core::mem::align_of::<FelicaListServiceCommandResponse>() - 1usize];
19439 ["Offset of field: FelicaListServiceCommandResponse::header"]
19440 [::core::mem::offset_of!(FelicaListServiceCommandResponse, header) - 0usize];
19441 ["Offset of field: FelicaListServiceCommandResponse::data"]
19442 [::core::mem::offset_of!(FelicaListServiceCommandResponse, data) - 10usize];
19443};
19444#[repr(C)]
19445#[derive(Debug)]
19446pub struct FelicaListSystemCodeCommandResponse {
19447 pub header: FelicaCommandHeaderRaw,
19448 pub system_count: u8,
19449 pub system_code: __IncompleteArrayField<u8>,
19450}
19451#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19452const _: () = {
19453 ["Size of FelicaListSystemCodeCommandResponse"]
19454 [::core::mem::size_of::<FelicaListSystemCodeCommandResponse>() - 11usize];
19455 ["Alignment of FelicaListSystemCodeCommandResponse"]
19456 [::core::mem::align_of::<FelicaListSystemCodeCommandResponse>() - 1usize];
19457 ["Offset of field: FelicaListSystemCodeCommandResponse::header"]
19458 [::core::mem::offset_of!(FelicaListSystemCodeCommandResponse, header) - 0usize];
19459 ["Offset of field: FelicaListSystemCodeCommandResponse::system_count"]
19460 [::core::mem::offset_of!(FelicaListSystemCodeCommandResponse, system_count) - 10usize];
19461 ["Offset of field: FelicaListSystemCodeCommandResponse::system_code"]
19462 [::core::mem::offset_of!(FelicaListSystemCodeCommandResponse, system_code) - 11usize];
19463};
19464pub type FelicaListenerWriteCommandResponse = FelicaCommandResponseHeader;
19465pub type FelicaPollerWriteCommandResponse = FelicaCommandResponseHeader;
19466unsafe extern "C" {
19467 pub fn felica_alloc() -> *mut FelicaData;
19468}
19469unsafe extern "C" {
19470 pub fn felica_free(data: *mut FelicaData);
19471}
19472unsafe extern "C" {
19473 pub fn felica_reset(data: *mut FelicaData);
19474}
19475unsafe extern "C" {
19476 pub fn felica_copy(data: *mut FelicaData, other: *const FelicaData);
19477}
19478unsafe extern "C" {
19479 pub fn felica_verify(data: *mut FelicaData, device_type: *const FuriString) -> bool;
19480}
19481unsafe extern "C" {
19482 pub fn felica_load(data: *mut FelicaData, ff: *mut FlipperFormat, version: u32) -> bool;
19483}
19484unsafe extern "C" {
19485 pub fn felica_save(data: *const FelicaData, ff: *mut FlipperFormat) -> bool;
19486}
19487unsafe extern "C" {
19488 pub fn felica_is_equal(data: *const FelicaData, other: *const FelicaData) -> bool;
19489}
19490unsafe extern "C" {
19491 pub fn felica_get_device_name(
19492 data: *const FelicaData,
19493 name_type: NfcDeviceNameType,
19494 ) -> *const core::ffi::c_char;
19495}
19496unsafe extern "C" {
19497 pub fn felica_get_uid(data: *const FelicaData, uid_len: *mut usize) -> *const u8;
19498}
19499unsafe extern "C" {
19500 pub fn felica_set_uid(data: *mut FelicaData, uid: *const u8, uid_len: usize) -> bool;
19501}
19502unsafe extern "C" {
19503 pub fn felica_get_base_data(data: *const FelicaData) -> *mut FelicaData;
19504}
19505unsafe extern "C" {
19506 pub fn felica_calculate_session_key(
19507 ctx: *mut mbedtls_des3_context,
19508 ck: *const u8,
19509 rc: *const u8,
19510 out: *mut u8,
19511 );
19512}
19513unsafe extern "C" {
19514 pub fn felica_check_mac(
19515 ctx: *mut mbedtls_des3_context,
19516 session_key: *const u8,
19517 rc: *const u8,
19518 blocks: *const u8,
19519 block_count: u8,
19520 data: *mut u8,
19521 ) -> bool;
19522}
19523unsafe extern "C" {
19524 pub fn felica_calculate_mac_read(
19525 ctx: *mut mbedtls_des3_context,
19526 session_key: *const u8,
19527 rc: *const u8,
19528 blocks: *const u8,
19529 block_count: u8,
19530 data: *const u8,
19531 mac: *mut u8,
19532 );
19533}
19534unsafe extern "C" {
19535 pub fn felica_calculate_mac_write(
19536 ctx: *mut mbedtls_des3_context,
19537 session_key: *const u8,
19538 rc: *const u8,
19539 wcnt: *const u8,
19540 data: *const u8,
19541 mac: *mut u8,
19542 );
19543}
19544unsafe extern "C" {
19545 pub fn felica_write_directory_tree(system: *const FelicaSystem, str_: *mut FuriString);
19546}
19547unsafe extern "C" {
19548 pub fn felica_get_workflow_type(data: *mut FelicaData);
19549}
19550unsafe extern "C" {
19551 pub fn felica_get_ic_name(data: *const FelicaData, ic_name: *mut FuriString);
19552}
19553unsafe extern "C" {
19554 pub fn felica_service_get_attribute_string(
19555 service: *const FelicaService,
19556 str_: *mut FuriString,
19557 );
19558}
19559#[repr(C)]
19560#[derive(Debug, Copy, Clone)]
19561pub struct FelicaListener {
19562 _unused: [u8; 0],
19563}
19564#[repr(C)]
19565#[derive(Debug, Copy, Clone)]
19566pub struct FelicaPoller {
19567 _unused: [u8; 0],
19568}
19569#[doc = "< An error occured during activation procedure."]
19570pub const FelicaPollerEventTypeError: FelicaPollerEventType = FelicaPollerEventType(0);
19571#[doc = "< The card was activated and fully read by the poller."]
19572pub const FelicaPollerEventTypeReady: FelicaPollerEventType = FelicaPollerEventType(1);
19573#[doc = "< The card was activated and partly read by the poller."]
19574pub const FelicaPollerEventTypeIncomplete: FelicaPollerEventType = FelicaPollerEventType(2);
19575#[doc = "< Authentication context was requested by poller."]
19576pub const FelicaPollerEventTypeRequestAuthContext: FelicaPollerEventType = FelicaPollerEventType(3);
19577#[repr(transparent)]
19578#[doc = "Enumeration of possible Felica poller event types."]
19579#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19580pub struct FelicaPollerEventType(pub core::ffi::c_uchar);
19581#[doc = "Felica poller event data."]
19582#[repr(C)]
19583#[derive(Copy, Clone)]
19584pub union FelicaPollerEventData {
19585 #[doc = "< Error code indicating card activation fail reason."]
19586 pub error: FelicaError,
19587 #[doc = "< Authentication context to be filled by user."]
19588 pub auth_context: *mut FelicaAuthenticationContext,
19589}
19590#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19591const _: () = {
19592 ["Size of FelicaPollerEventData"][::core::mem::size_of::<FelicaPollerEventData>() - 4usize];
19593 ["Alignment of FelicaPollerEventData"]
19594 [::core::mem::align_of::<FelicaPollerEventData>() - 4usize];
19595 ["Offset of field: FelicaPollerEventData::error"]
19596 [::core::mem::offset_of!(FelicaPollerEventData, error) - 0usize];
19597 ["Offset of field: FelicaPollerEventData::auth_context"]
19598 [::core::mem::offset_of!(FelicaPollerEventData, auth_context) - 0usize];
19599};
19600#[doc = "FelicaPoller poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
19601#[repr(C)]
19602#[derive(Debug, Copy, Clone)]
19603pub struct FelicaPollerEvent {
19604 #[doc = "< Type of emmitted event."]
19605 pub type_: FelicaPollerEventType,
19606 #[doc = "< Pointer to event specific data."]
19607 pub data: *mut FelicaPollerEventData,
19608}
19609#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19610const _: () = {
19611 ["Size of FelicaPollerEvent"][::core::mem::size_of::<FelicaPollerEvent>() - 8usize];
19612 ["Alignment of FelicaPollerEvent"][::core::mem::align_of::<FelicaPollerEvent>() - 4usize];
19613 ["Offset of field: FelicaPollerEvent::type_"]
19614 [::core::mem::offset_of!(FelicaPollerEvent, type_) - 0usize];
19615 ["Offset of field: FelicaPollerEvent::data"]
19616 [::core::mem::offset_of!(FelicaPollerEvent, data) - 4usize];
19617};
19618unsafe extern "C" {
19619 #[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."]
19620 pub fn felica_poller_activate(
19621 instance: *mut FelicaPoller,
19622 data: *mut FelicaData,
19623 ) -> FelicaError;
19624}
19625unsafe extern "C" {
19626 #[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."]
19627 pub fn felica_poller_read_blocks(
19628 instance: *mut FelicaPoller,
19629 block_count: u8,
19630 block_numbers: *const u8,
19631 service_code: u16,
19632 response_ptr: *mut *mut FelicaPollerReadCommandResponse,
19633 ) -> FelicaError;
19634}
19635unsafe extern "C" {
19636 pub fn felica_poller_sync_read(
19637 nfc: *mut Nfc,
19638 data: *mut FelicaData,
19639 card_key: *const FelicaCardKey,
19640 ) -> FelicaError;
19641}
19642#[repr(C)]
19643#[derive(Debug, Copy, Clone)]
19644pub struct Iso14443_3aListener {
19645 _unused: [u8; 0],
19646}
19647pub const Iso14443_3aListenerEventTypeFieldOff: Iso14443_3aListenerEventType =
19648 Iso14443_3aListenerEventType(0);
19649pub const Iso14443_3aListenerEventTypeHalted: Iso14443_3aListenerEventType =
19650 Iso14443_3aListenerEventType(1);
19651pub const Iso14443_3aListenerEventTypeReceivedStandardFrame: Iso14443_3aListenerEventType =
19652 Iso14443_3aListenerEventType(2);
19653pub const Iso14443_3aListenerEventTypeReceivedData: Iso14443_3aListenerEventType =
19654 Iso14443_3aListenerEventType(3);
19655#[repr(transparent)]
19656#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19657pub struct Iso14443_3aListenerEventType(pub core::ffi::c_uchar);
19658#[repr(C)]
19659#[derive(Debug, Copy, Clone)]
19660pub struct Iso14443_3aListenerEventData {
19661 pub buffer: *mut BitBuffer,
19662}
19663#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19664const _: () = {
19665 ["Size of Iso14443_3aListenerEventData"]
19666 [::core::mem::size_of::<Iso14443_3aListenerEventData>() - 4usize];
19667 ["Alignment of Iso14443_3aListenerEventData"]
19668 [::core::mem::align_of::<Iso14443_3aListenerEventData>() - 4usize];
19669 ["Offset of field: Iso14443_3aListenerEventData::buffer"]
19670 [::core::mem::offset_of!(Iso14443_3aListenerEventData, buffer) - 0usize];
19671};
19672#[repr(C)]
19673#[derive(Debug, Copy, Clone)]
19674pub struct Iso14443_3aListenerEvent {
19675 pub type_: Iso14443_3aListenerEventType,
19676 pub data: *mut Iso14443_3aListenerEventData,
19677}
19678#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19679const _: () = {
19680 ["Size of Iso14443_3aListenerEvent"]
19681 [::core::mem::size_of::<Iso14443_3aListenerEvent>() - 8usize];
19682 ["Alignment of Iso14443_3aListenerEvent"]
19683 [::core::mem::align_of::<Iso14443_3aListenerEvent>() - 4usize];
19684 ["Offset of field: Iso14443_3aListenerEvent::type_"]
19685 [::core::mem::offset_of!(Iso14443_3aListenerEvent, type_) - 0usize];
19686 ["Offset of field: Iso14443_3aListenerEvent::data"]
19687 [::core::mem::offset_of!(Iso14443_3aListenerEvent, data) - 4usize];
19688};
19689#[repr(C)]
19690#[derive(Debug, Copy, Clone)]
19691pub struct Iso14443_3aPoller {
19692 _unused: [u8; 0],
19693}
19694#[doc = "< An error occured during activation procedure."]
19695pub const Iso14443_3aPollerEventTypeError: Iso14443_3aPollerEventType =
19696 Iso14443_3aPollerEventType(0);
19697#[doc = "< The card was activated by the poller."]
19698pub const Iso14443_3aPollerEventTypeReady: Iso14443_3aPollerEventType =
19699 Iso14443_3aPollerEventType(1);
19700#[repr(transparent)]
19701#[doc = "Enumeration of possible Iso14443_3a poller event types."]
19702#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19703pub struct Iso14443_3aPollerEventType(pub core::ffi::c_uchar);
19704#[doc = "Iso14443_3a poller event data."]
19705#[repr(C)]
19706#[derive(Copy, Clone)]
19707pub union Iso14443_3aPollerEventData {
19708 #[doc = "< Error code indicating card activation fail reason."]
19709 pub error: Iso14443_3aError,
19710}
19711#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19712const _: () = {
19713 ["Size of Iso14443_3aPollerEventData"]
19714 [::core::mem::size_of::<Iso14443_3aPollerEventData>() - 1usize];
19715 ["Alignment of Iso14443_3aPollerEventData"]
19716 [::core::mem::align_of::<Iso14443_3aPollerEventData>() - 1usize];
19717 ["Offset of field: Iso14443_3aPollerEventData::error"]
19718 [::core::mem::offset_of!(Iso14443_3aPollerEventData, error) - 0usize];
19719};
19720#[doc = "Iso14443_3a poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
19721#[repr(C)]
19722#[derive(Debug, Copy, Clone)]
19723pub struct Iso14443_3aPollerEvent {
19724 #[doc = "< Type of emmitted event."]
19725 pub type_: Iso14443_3aPollerEventType,
19726 #[doc = "< Pointer to event specific data."]
19727 pub data: *mut Iso14443_3aPollerEventData,
19728}
19729#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19730const _: () = {
19731 ["Size of Iso14443_3aPollerEvent"][::core::mem::size_of::<Iso14443_3aPollerEvent>() - 8usize];
19732 ["Alignment of Iso14443_3aPollerEvent"]
19733 [::core::mem::align_of::<Iso14443_3aPollerEvent>() - 4usize];
19734 ["Offset of field: Iso14443_3aPollerEvent::type_"]
19735 [::core::mem::offset_of!(Iso14443_3aPollerEvent, type_) - 0usize];
19736 ["Offset of field: Iso14443_3aPollerEvent::data"]
19737 [::core::mem::offset_of!(Iso14443_3aPollerEvent, data) - 4usize];
19738};
19739unsafe extern "C" {
19740 #[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."]
19741 pub fn iso14443_3a_poller_txrx(
19742 instance: *mut Iso14443_3aPoller,
19743 tx_buffer: *const BitBuffer,
19744 rx_buffer: *mut BitBuffer,
19745 fwt: u32,
19746 ) -> Iso14443_3aError;
19747}
19748unsafe extern "C" {
19749 #[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."]
19750 pub fn iso14443_3a_poller_send_standard_frame(
19751 instance: *mut Iso14443_3aPoller,
19752 tx_buffer: *const BitBuffer,
19753 rx_buffer: *mut BitBuffer,
19754 fwt: u32,
19755 ) -> Iso14443_3aError;
19756}
19757unsafe extern "C" {
19758 #[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."]
19759 pub fn iso14443_3a_poller_txrx_custom_parity(
19760 instance: *mut Iso14443_3aPoller,
19761 tx_buffer: *const BitBuffer,
19762 rx_buffer: *mut BitBuffer,
19763 fwt: u32,
19764 ) -> Iso14443_3aError;
19765}
19766unsafe extern "C" {
19767 #[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."]
19768 pub fn iso14443_3a_poller_check_presence(instance: *mut Iso14443_3aPoller) -> Iso14443_3aError;
19769}
19770unsafe extern "C" {
19771 #[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."]
19772 pub fn iso14443_3a_poller_activate(
19773 instance: *mut Iso14443_3aPoller,
19774 iso14443_3a_data: *mut Iso14443_3aData,
19775 ) -> Iso14443_3aError;
19776}
19777unsafe extern "C" {
19778 #[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."]
19779 pub fn iso14443_3a_poller_halt(instance: *mut Iso14443_3aPoller) -> Iso14443_3aError;
19780}
19781unsafe extern "C" {
19782 pub fn iso14443_3a_poller_sync_read(
19783 nfc: *mut Nfc,
19784 iso14443_3a_data: *mut Iso14443_3aData,
19785 ) -> Iso14443_3aError;
19786}
19787pub const Iso14443_3bErrorNone: Iso14443_3bError = Iso14443_3bError(0);
19788pub const Iso14443_3bErrorNotPresent: Iso14443_3bError = Iso14443_3bError(1);
19789pub const Iso14443_3bErrorColResFailed: Iso14443_3bError = Iso14443_3bError(2);
19790pub const Iso14443_3bErrorBufferOverflow: Iso14443_3bError = Iso14443_3bError(3);
19791pub const Iso14443_3bErrorCommunication: Iso14443_3bError = Iso14443_3bError(4);
19792pub const Iso14443_3bErrorFieldOff: Iso14443_3bError = Iso14443_3bError(5);
19793pub const Iso14443_3bErrorWrongCrc: Iso14443_3bError = Iso14443_3bError(6);
19794pub const Iso14443_3bErrorTimeout: Iso14443_3bError = Iso14443_3bError(7);
19795#[repr(transparent)]
19796#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19797pub struct Iso14443_3bError(pub core::ffi::c_uchar);
19798pub const Iso14443_3bBitRateBoth106Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(0);
19799pub const Iso14443_3bBitRatePiccToPcd212Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(1);
19800pub const Iso14443_3bBitRatePiccToPcd424Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(2);
19801pub const Iso14443_3bBitRatePiccToPcd848Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(3);
19802pub const Iso14443_3bBitRatePcdToPicc212Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(4);
19803pub const Iso14443_3bBitRatePcdToPicc424Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(5);
19804pub const Iso14443_3bBitRatePcdToPicc848Kbit: Iso14443_3bBitRate = Iso14443_3bBitRate(6);
19805#[repr(transparent)]
19806#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19807pub struct Iso14443_3bBitRate(pub core::ffi::c_uchar);
19808pub const Iso14443_3bFrameOptionNad: Iso14443_3bFrameOption = Iso14443_3bFrameOption(0);
19809pub const Iso14443_3bFrameOptionCid: Iso14443_3bFrameOption = Iso14443_3bFrameOption(1);
19810#[repr(transparent)]
19811#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19812pub struct Iso14443_3bFrameOption(pub core::ffi::c_uchar);
19813#[repr(C)]
19814#[derive(Debug, Copy, Clone)]
19815pub struct Iso14443_3bData {
19816 _unused: [u8; 0],
19817}
19818unsafe extern "C" {
19819 pub fn iso14443_3b_alloc() -> *mut Iso14443_3bData;
19820}
19821unsafe extern "C" {
19822 pub fn iso14443_3b_free(data: *mut Iso14443_3bData);
19823}
19824unsafe extern "C" {
19825 pub fn iso14443_3b_reset(data: *mut Iso14443_3bData);
19826}
19827unsafe extern "C" {
19828 pub fn iso14443_3b_copy(data: *mut Iso14443_3bData, other: *const Iso14443_3bData);
19829}
19830unsafe extern "C" {
19831 pub fn iso14443_3b_verify(data: *mut Iso14443_3bData, device_type: *const FuriString) -> bool;
19832}
19833unsafe extern "C" {
19834 pub fn iso14443_3b_load(
19835 data: *mut Iso14443_3bData,
19836 ff: *mut FlipperFormat,
19837 version: u32,
19838 ) -> bool;
19839}
19840unsafe extern "C" {
19841 pub fn iso14443_3b_save(data: *const Iso14443_3bData, ff: *mut FlipperFormat) -> bool;
19842}
19843unsafe extern "C" {
19844 pub fn iso14443_3b_is_equal(
19845 data: *const Iso14443_3bData,
19846 other: *const Iso14443_3bData,
19847 ) -> bool;
19848}
19849unsafe extern "C" {
19850 pub fn iso14443_3b_get_device_name(
19851 data: *const Iso14443_3bData,
19852 name_type: NfcDeviceNameType,
19853 ) -> *const core::ffi::c_char;
19854}
19855unsafe extern "C" {
19856 pub fn iso14443_3b_get_uid(data: *const Iso14443_3bData, uid_len: *mut usize) -> *const u8;
19857}
19858unsafe extern "C" {
19859 pub fn iso14443_3b_set_uid(data: *mut Iso14443_3bData, uid: *const u8, uid_len: usize) -> bool;
19860}
19861unsafe extern "C" {
19862 pub fn iso14443_3b_get_base_data(data: *const Iso14443_3bData) -> *mut Iso14443_3bData;
19863}
19864unsafe extern "C" {
19865 pub fn iso14443_3b_supports_iso14443_4(data: *const Iso14443_3bData) -> bool;
19866}
19867unsafe extern "C" {
19868 pub fn iso14443_3b_supports_bit_rate(
19869 data: *const Iso14443_3bData,
19870 bit_rate: Iso14443_3bBitRate,
19871 ) -> bool;
19872}
19873unsafe extern "C" {
19874 pub fn iso14443_3b_supports_frame_option(
19875 data: *const Iso14443_3bData,
19876 option: Iso14443_3bFrameOption,
19877 ) -> bool;
19878}
19879unsafe extern "C" {
19880 pub fn iso14443_3b_get_application_data(
19881 data: *const Iso14443_3bData,
19882 data_size: *mut usize,
19883 ) -> *const u8;
19884}
19885unsafe extern "C" {
19886 pub fn iso14443_3b_get_frame_size_max(data: *const Iso14443_3bData) -> u16;
19887}
19888unsafe extern "C" {
19889 pub fn iso14443_3b_get_fwt_fc_max(data: *const Iso14443_3bData) -> u32;
19890}
19891#[repr(C)]
19892#[derive(Debug, Copy, Clone)]
19893pub struct Iso14443_3bPoller {
19894 _unused: [u8; 0],
19895}
19896#[doc = "< An error occured during activation procedure."]
19897pub const Iso14443_3bPollerEventTypeError: Iso14443_3bPollerEventType =
19898 Iso14443_3bPollerEventType(0);
19899#[doc = "< The card was activated by the poller."]
19900pub const Iso14443_3bPollerEventTypeReady: Iso14443_3bPollerEventType =
19901 Iso14443_3bPollerEventType(1);
19902#[repr(transparent)]
19903#[doc = "Enumeration of possible Iso14443_3b poller event types."]
19904#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19905pub struct Iso14443_3bPollerEventType(pub core::ffi::c_uchar);
19906#[doc = "Iso14443_3b poller event data."]
19907#[repr(C)]
19908#[derive(Copy, Clone)]
19909pub union Iso14443_3bPollerEventData {
19910 #[doc = "< Error code indicating card activation fail reason."]
19911 pub error: Iso14443_3bError,
19912}
19913#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19914const _: () = {
19915 ["Size of Iso14443_3bPollerEventData"]
19916 [::core::mem::size_of::<Iso14443_3bPollerEventData>() - 1usize];
19917 ["Alignment of Iso14443_3bPollerEventData"]
19918 [::core::mem::align_of::<Iso14443_3bPollerEventData>() - 1usize];
19919 ["Offset of field: Iso14443_3bPollerEventData::error"]
19920 [::core::mem::offset_of!(Iso14443_3bPollerEventData, error) - 0usize];
19921};
19922#[doc = "Iso14443_3b poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
19923#[repr(C)]
19924#[derive(Debug, Copy, Clone)]
19925pub struct Iso14443_3bPollerEvent {
19926 #[doc = "< Type of emmitted event."]
19927 pub type_: Iso14443_3bPollerEventType,
19928 #[doc = "< Pointer to event specific data."]
19929 pub data: *mut Iso14443_3bPollerEventData,
19930}
19931#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19932const _: () = {
19933 ["Size of Iso14443_3bPollerEvent"][::core::mem::size_of::<Iso14443_3bPollerEvent>() - 8usize];
19934 ["Alignment of Iso14443_3bPollerEvent"]
19935 [::core::mem::align_of::<Iso14443_3bPollerEvent>() - 4usize];
19936 ["Offset of field: Iso14443_3bPollerEvent::type_"]
19937 [::core::mem::offset_of!(Iso14443_3bPollerEvent, type_) - 0usize];
19938 ["Offset of field: Iso14443_3bPollerEvent::data"]
19939 [::core::mem::offset_of!(Iso14443_3bPollerEvent, data) - 4usize];
19940};
19941unsafe extern "C" {
19942 #[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."]
19943 pub fn iso14443_3b_poller_send_frame(
19944 instance: *mut Iso14443_3bPoller,
19945 tx_buffer: *const BitBuffer,
19946 rx_buffer: *mut BitBuffer,
19947 ) -> Iso14443_3bError;
19948}
19949unsafe extern "C" {
19950 #[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."]
19951 pub fn iso14443_3b_poller_activate(
19952 instance: *mut Iso14443_3bPoller,
19953 data: *mut Iso14443_3bData,
19954 ) -> Iso14443_3bError;
19955}
19956unsafe extern "C" {
19957 #[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."]
19958 pub fn iso14443_3b_poller_halt(instance: *mut Iso14443_3bPoller) -> Iso14443_3bError;
19959}
19960pub const Iso14443_4aErrorNone: Iso14443_4aError = Iso14443_4aError(0);
19961pub const Iso14443_4aErrorNotPresent: Iso14443_4aError = Iso14443_4aError(1);
19962pub const Iso14443_4aErrorProtocol: Iso14443_4aError = Iso14443_4aError(2);
19963pub const Iso14443_4aErrorTimeout: Iso14443_4aError = Iso14443_4aError(3);
19964#[repr(transparent)]
19965#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19966pub struct Iso14443_4aError(pub core::ffi::c_uchar);
19967pub const Iso14443_4aBitRateBoth106Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(0);
19968pub const Iso14443_4aBitRatePiccToPcd212Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(1);
19969pub const Iso14443_4aBitRatePiccToPcd424Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(2);
19970pub const Iso14443_4aBitRatePiccToPcd848Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(3);
19971pub const Iso14443_4aBitRatePcdToPicc212Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(4);
19972pub const Iso14443_4aBitRatePcdToPicc424Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(5);
19973pub const Iso14443_4aBitRatePcdToPicc848Kbit: Iso14443_4aBitRate = Iso14443_4aBitRate(6);
19974#[repr(transparent)]
19975#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19976pub struct Iso14443_4aBitRate(pub core::ffi::c_uchar);
19977pub const Iso14443_4aFrameOptionNad: Iso14443_4aFrameOption = Iso14443_4aFrameOption(0);
19978pub const Iso14443_4aFrameOptionCid: Iso14443_4aFrameOption = Iso14443_4aFrameOption(1);
19979#[repr(transparent)]
19980#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19981pub struct Iso14443_4aFrameOption(pub core::ffi::c_uchar);
19982#[repr(C)]
19983#[derive(Debug, Copy, Clone)]
19984pub struct Iso14443_4aAtsData {
19985 pub tl: u8,
19986 pub t0: u8,
19987 pub ta_1: u8,
19988 pub tb_1: u8,
19989 pub tc_1: u8,
19990 pub t1_tk: *mut SimpleArray,
19991}
19992#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19993const _: () = {
19994 ["Size of Iso14443_4aAtsData"][::core::mem::size_of::<Iso14443_4aAtsData>() - 12usize];
19995 ["Alignment of Iso14443_4aAtsData"][::core::mem::align_of::<Iso14443_4aAtsData>() - 4usize];
19996 ["Offset of field: Iso14443_4aAtsData::tl"]
19997 [::core::mem::offset_of!(Iso14443_4aAtsData, tl) - 0usize];
19998 ["Offset of field: Iso14443_4aAtsData::t0"]
19999 [::core::mem::offset_of!(Iso14443_4aAtsData, t0) - 1usize];
20000 ["Offset of field: Iso14443_4aAtsData::ta_1"]
20001 [::core::mem::offset_of!(Iso14443_4aAtsData, ta_1) - 2usize];
20002 ["Offset of field: Iso14443_4aAtsData::tb_1"]
20003 [::core::mem::offset_of!(Iso14443_4aAtsData, tb_1) - 3usize];
20004 ["Offset of field: Iso14443_4aAtsData::tc_1"]
20005 [::core::mem::offset_of!(Iso14443_4aAtsData, tc_1) - 4usize];
20006 ["Offset of field: Iso14443_4aAtsData::t1_tk"]
20007 [::core::mem::offset_of!(Iso14443_4aAtsData, t1_tk) - 8usize];
20008};
20009#[repr(C)]
20010#[derive(Debug, Copy, Clone)]
20011pub struct Iso14443_4aData {
20012 pub iso14443_3a_data: *mut Iso14443_3aData,
20013 pub ats_data: Iso14443_4aAtsData,
20014}
20015#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20016const _: () = {
20017 ["Size of Iso14443_4aData"][::core::mem::size_of::<Iso14443_4aData>() - 16usize];
20018 ["Alignment of Iso14443_4aData"][::core::mem::align_of::<Iso14443_4aData>() - 4usize];
20019 ["Offset of field: Iso14443_4aData::iso14443_3a_data"]
20020 [::core::mem::offset_of!(Iso14443_4aData, iso14443_3a_data) - 0usize];
20021 ["Offset of field: Iso14443_4aData::ats_data"]
20022 [::core::mem::offset_of!(Iso14443_4aData, ats_data) - 4usize];
20023};
20024unsafe extern "C" {
20025 pub fn iso14443_4a_alloc() -> *mut Iso14443_4aData;
20026}
20027unsafe extern "C" {
20028 pub fn iso14443_4a_free(data: *mut Iso14443_4aData);
20029}
20030unsafe extern "C" {
20031 pub fn iso14443_4a_reset(data: *mut Iso14443_4aData);
20032}
20033unsafe extern "C" {
20034 pub fn iso14443_4a_copy(data: *mut Iso14443_4aData, other: *const Iso14443_4aData);
20035}
20036unsafe extern "C" {
20037 pub fn iso14443_4a_verify(data: *mut Iso14443_4aData, device_type: *const FuriString) -> bool;
20038}
20039unsafe extern "C" {
20040 pub fn iso14443_4a_load(
20041 data: *mut Iso14443_4aData,
20042 ff: *mut FlipperFormat,
20043 version: u32,
20044 ) -> bool;
20045}
20046unsafe extern "C" {
20047 pub fn iso14443_4a_save(data: *const Iso14443_4aData, ff: *mut FlipperFormat) -> bool;
20048}
20049unsafe extern "C" {
20050 pub fn iso14443_4a_is_equal(
20051 data: *const Iso14443_4aData,
20052 other: *const Iso14443_4aData,
20053 ) -> bool;
20054}
20055unsafe extern "C" {
20056 pub fn iso14443_4a_get_device_name(
20057 data: *const Iso14443_4aData,
20058 name_type: NfcDeviceNameType,
20059 ) -> *const core::ffi::c_char;
20060}
20061unsafe extern "C" {
20062 pub fn iso14443_4a_get_uid(data: *const Iso14443_4aData, uid_len: *mut usize) -> *const u8;
20063}
20064unsafe extern "C" {
20065 pub fn iso14443_4a_set_uid(data: *mut Iso14443_4aData, uid: *const u8, uid_len: usize) -> bool;
20066}
20067unsafe extern "C" {
20068 pub fn iso14443_4a_get_base_data(data: *const Iso14443_4aData) -> *mut Iso14443_3aData;
20069}
20070unsafe extern "C" {
20071 pub fn iso14443_4a_get_frame_size_max(data: *const Iso14443_4aData) -> u16;
20072}
20073unsafe extern "C" {
20074 pub fn iso14443_4a_get_fwt_fc_max(data: *const Iso14443_4aData) -> u32;
20075}
20076unsafe extern "C" {
20077 pub fn iso14443_4a_get_historical_bytes(
20078 data: *const Iso14443_4aData,
20079 count: *mut u32,
20080 ) -> *const u8;
20081}
20082unsafe extern "C" {
20083 pub fn iso14443_4a_supports_bit_rate(
20084 data: *const Iso14443_4aData,
20085 bit_rate: Iso14443_4aBitRate,
20086 ) -> bool;
20087}
20088unsafe extern "C" {
20089 pub fn iso14443_4a_supports_frame_option(
20090 data: *const Iso14443_4aData,
20091 option: Iso14443_4aFrameOption,
20092 ) -> bool;
20093}
20094#[repr(C)]
20095#[derive(Debug, Copy, Clone)]
20096pub struct Iso14443_4aListener {
20097 _unused: [u8; 0],
20098}
20099pub const Iso14443_4aListenerEventTypeHalted: Iso14443_4aListenerEventType =
20100 Iso14443_4aListenerEventType(0);
20101pub const Iso14443_4aListenerEventTypeFieldOff: Iso14443_4aListenerEventType =
20102 Iso14443_4aListenerEventType(1);
20103pub const Iso14443_4aListenerEventTypeReceivedData: Iso14443_4aListenerEventType =
20104 Iso14443_4aListenerEventType(2);
20105#[repr(transparent)]
20106#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20107pub struct Iso14443_4aListenerEventType(pub core::ffi::c_uchar);
20108#[repr(C)]
20109#[derive(Debug, Copy, Clone)]
20110pub struct Iso14443_4aListenerEventData {
20111 pub buffer: *mut BitBuffer,
20112}
20113#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20114const _: () = {
20115 ["Size of Iso14443_4aListenerEventData"]
20116 [::core::mem::size_of::<Iso14443_4aListenerEventData>() - 4usize];
20117 ["Alignment of Iso14443_4aListenerEventData"]
20118 [::core::mem::align_of::<Iso14443_4aListenerEventData>() - 4usize];
20119 ["Offset of field: Iso14443_4aListenerEventData::buffer"]
20120 [::core::mem::offset_of!(Iso14443_4aListenerEventData, buffer) - 0usize];
20121};
20122#[repr(C)]
20123#[derive(Debug, Copy, Clone)]
20124pub struct Iso14443_4aListenerEvent {
20125 pub type_: Iso14443_4aListenerEventType,
20126 pub data: *mut Iso14443_4aListenerEventData,
20127}
20128#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20129const _: () = {
20130 ["Size of Iso14443_4aListenerEvent"]
20131 [::core::mem::size_of::<Iso14443_4aListenerEvent>() - 8usize];
20132 ["Alignment of Iso14443_4aListenerEvent"]
20133 [::core::mem::align_of::<Iso14443_4aListenerEvent>() - 4usize];
20134 ["Offset of field: Iso14443_4aListenerEvent::type_"]
20135 [::core::mem::offset_of!(Iso14443_4aListenerEvent, type_) - 0usize];
20136 ["Offset of field: Iso14443_4aListenerEvent::data"]
20137 [::core::mem::offset_of!(Iso14443_4aListenerEvent, data) - 4usize];
20138};
20139#[repr(C)]
20140#[derive(Debug, Copy, Clone)]
20141pub struct Iso14443_4aPoller {
20142 _unused: [u8; 0],
20143}
20144#[doc = "< An error occured during activation procedure."]
20145pub const Iso14443_4aPollerEventTypeError: Iso14443_4aPollerEventType =
20146 Iso14443_4aPollerEventType(0);
20147#[doc = "< The card was activated by the poller."]
20148pub const Iso14443_4aPollerEventTypeReady: Iso14443_4aPollerEventType =
20149 Iso14443_4aPollerEventType(1);
20150#[repr(transparent)]
20151#[doc = "Enumeration of possible Iso14443_4a poller event types."]
20152#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20153pub struct Iso14443_4aPollerEventType(pub core::ffi::c_uchar);
20154#[doc = "Iso14443_4a poller event data."]
20155#[repr(C)]
20156#[derive(Copy, Clone)]
20157pub union Iso14443_4aPollerEventData {
20158 #[doc = "< Error code indicating card activation fail reason."]
20159 pub error: Iso14443_4aError,
20160}
20161#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20162const _: () = {
20163 ["Size of Iso14443_4aPollerEventData"]
20164 [::core::mem::size_of::<Iso14443_4aPollerEventData>() - 1usize];
20165 ["Alignment of Iso14443_4aPollerEventData"]
20166 [::core::mem::align_of::<Iso14443_4aPollerEventData>() - 1usize];
20167 ["Offset of field: Iso14443_4aPollerEventData::error"]
20168 [::core::mem::offset_of!(Iso14443_4aPollerEventData, error) - 0usize];
20169};
20170#[doc = "Iso14443_4a poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
20171#[repr(C)]
20172#[derive(Debug, Copy, Clone)]
20173pub struct Iso14443_4aPollerEvent {
20174 #[doc = "< Type of emmitted event."]
20175 pub type_: Iso14443_4aPollerEventType,
20176 #[doc = "< Pointer to event specific data."]
20177 pub data: *mut Iso14443_4aPollerEventData,
20178}
20179#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20180const _: () = {
20181 ["Size of Iso14443_4aPollerEvent"][::core::mem::size_of::<Iso14443_4aPollerEvent>() - 8usize];
20182 ["Alignment of Iso14443_4aPollerEvent"]
20183 [::core::mem::align_of::<Iso14443_4aPollerEvent>() - 4usize];
20184 ["Offset of field: Iso14443_4aPollerEvent::type_"]
20185 [::core::mem::offset_of!(Iso14443_4aPollerEvent, type_) - 0usize];
20186 ["Offset of field: Iso14443_4aPollerEvent::data"]
20187 [::core::mem::offset_of!(Iso14443_4aPollerEvent, data) - 4usize];
20188};
20189unsafe extern "C" {
20190 #[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."]
20191 pub fn iso14443_4a_poller_send_block(
20192 instance: *mut Iso14443_4aPoller,
20193 tx_buffer: *const BitBuffer,
20194 rx_buffer: *mut BitBuffer,
20195 ) -> Iso14443_4aError;
20196}
20197unsafe extern "C" {
20198 #[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."]
20199 pub fn iso14443_4a_poller_send_chain_block(
20200 instance: *mut Iso14443_4aPoller,
20201 tx_buffer: *const BitBuffer,
20202 rx_buffer: *mut BitBuffer,
20203 ) -> Iso14443_4aError;
20204}
20205unsafe extern "C" {
20206 #[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."]
20207 pub fn iso14443_4a_poller_send_receive_ready_block(
20208 instance: *mut Iso14443_4aPoller,
20209 acknowledged: bool,
20210 tx_buffer: *const BitBuffer,
20211 rx_buffer: *mut BitBuffer,
20212 ) -> Iso14443_4aError;
20213}
20214unsafe extern "C" {
20215 #[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."]
20216 pub fn iso14443_4a_poller_send_supervisory_block(
20217 instance: *mut Iso14443_4aPoller,
20218 deselect: bool,
20219 tx_buffer: *const BitBuffer,
20220 rx_buffer: *mut BitBuffer,
20221 ) -> Iso14443_4aError;
20222}
20223unsafe extern "C" {
20224 #[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."]
20225 pub fn iso14443_4a_poller_halt(instance: *mut Iso14443_4aPoller) -> Iso14443_4aError;
20226}
20227unsafe extern "C" {
20228 #[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."]
20229 pub fn iso14443_4a_poller_read_ats(
20230 instance: *mut Iso14443_4aPoller,
20231 data: *mut Iso14443_4aAtsData,
20232 ) -> Iso14443_4aError;
20233}
20234pub const Iso14443_4bErrorNone: Iso14443_4bError = Iso14443_4bError(0);
20235pub const Iso14443_4bErrorNotPresent: Iso14443_4bError = Iso14443_4bError(1);
20236pub const Iso14443_4bErrorProtocol: Iso14443_4bError = Iso14443_4bError(2);
20237pub const Iso14443_4bErrorTimeout: Iso14443_4bError = Iso14443_4bError(3);
20238#[repr(transparent)]
20239#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20240pub struct Iso14443_4bError(pub core::ffi::c_uchar);
20241#[repr(C)]
20242#[derive(Debug, Copy, Clone)]
20243pub struct Iso14443_4bData {
20244 _unused: [u8; 0],
20245}
20246unsafe extern "C" {
20247 pub fn iso14443_4b_alloc() -> *mut Iso14443_4bData;
20248}
20249unsafe extern "C" {
20250 pub fn iso14443_4b_free(data: *mut Iso14443_4bData);
20251}
20252unsafe extern "C" {
20253 pub fn iso14443_4b_reset(data: *mut Iso14443_4bData);
20254}
20255unsafe extern "C" {
20256 pub fn iso14443_4b_copy(data: *mut Iso14443_4bData, other: *const Iso14443_4bData);
20257}
20258unsafe extern "C" {
20259 pub fn iso14443_4b_verify(data: *mut Iso14443_4bData, device_type: *const FuriString) -> bool;
20260}
20261unsafe extern "C" {
20262 pub fn iso14443_4b_load(
20263 data: *mut Iso14443_4bData,
20264 ff: *mut FlipperFormat,
20265 version: u32,
20266 ) -> bool;
20267}
20268unsafe extern "C" {
20269 pub fn iso14443_4b_save(data: *const Iso14443_4bData, ff: *mut FlipperFormat) -> bool;
20270}
20271unsafe extern "C" {
20272 pub fn iso14443_4b_is_equal(
20273 data: *const Iso14443_4bData,
20274 other: *const Iso14443_4bData,
20275 ) -> bool;
20276}
20277unsafe extern "C" {
20278 pub fn iso14443_4b_get_device_name(
20279 data: *const Iso14443_4bData,
20280 name_type: NfcDeviceNameType,
20281 ) -> *const core::ffi::c_char;
20282}
20283unsafe extern "C" {
20284 pub fn iso14443_4b_get_uid(data: *const Iso14443_4bData, uid_len: *mut usize) -> *const u8;
20285}
20286unsafe extern "C" {
20287 pub fn iso14443_4b_set_uid(data: *mut Iso14443_4bData, uid: *const u8, uid_len: usize) -> bool;
20288}
20289unsafe extern "C" {
20290 pub fn iso14443_4b_get_base_data(data: *const Iso14443_4bData) -> *mut Iso14443_3bData;
20291}
20292#[repr(C)]
20293#[derive(Debug, Copy, Clone)]
20294pub struct Iso14443_4bPoller {
20295 _unused: [u8; 0],
20296}
20297#[doc = "< An error occured during activation procedure."]
20298pub const Iso14443_4bPollerEventTypeError: Iso14443_4bPollerEventType =
20299 Iso14443_4bPollerEventType(0);
20300#[doc = "< The card was activated by the poller."]
20301pub const Iso14443_4bPollerEventTypeReady: Iso14443_4bPollerEventType =
20302 Iso14443_4bPollerEventType(1);
20303#[repr(transparent)]
20304#[doc = "Enumeration of possible Iso14443_4b poller event types."]
20305#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20306pub struct Iso14443_4bPollerEventType(pub core::ffi::c_uchar);
20307#[doc = "Iso14443_4b poller event data."]
20308#[repr(C)]
20309#[derive(Copy, Clone)]
20310pub union Iso14443_4bPollerEventData {
20311 #[doc = "< Error code indicating card activation fail reason."]
20312 pub error: Iso14443_4bError,
20313}
20314#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20315const _: () = {
20316 ["Size of Iso14443_4bPollerEventData"]
20317 [::core::mem::size_of::<Iso14443_4bPollerEventData>() - 1usize];
20318 ["Alignment of Iso14443_4bPollerEventData"]
20319 [::core::mem::align_of::<Iso14443_4bPollerEventData>() - 1usize];
20320 ["Offset of field: Iso14443_4bPollerEventData::error"]
20321 [::core::mem::offset_of!(Iso14443_4bPollerEventData, error) - 0usize];
20322};
20323#[doc = "Iso14443_4b poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
20324#[repr(C)]
20325#[derive(Debug, Copy, Clone)]
20326pub struct Iso14443_4bPollerEvent {
20327 #[doc = "< Type of emmitted event."]
20328 pub type_: Iso14443_4bPollerEventType,
20329 #[doc = "< Pointer to event specific data."]
20330 pub data: *mut Iso14443_4bPollerEventData,
20331}
20332#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20333const _: () = {
20334 ["Size of Iso14443_4bPollerEvent"][::core::mem::size_of::<Iso14443_4bPollerEvent>() - 8usize];
20335 ["Alignment of Iso14443_4bPollerEvent"]
20336 [::core::mem::align_of::<Iso14443_4bPollerEvent>() - 4usize];
20337 ["Offset of field: Iso14443_4bPollerEvent::type_"]
20338 [::core::mem::offset_of!(Iso14443_4bPollerEvent, type_) - 0usize];
20339 ["Offset of field: Iso14443_4bPollerEvent::data"]
20340 [::core::mem::offset_of!(Iso14443_4bPollerEvent, data) - 4usize];
20341};
20342unsafe extern "C" {
20343 #[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."]
20344 pub fn iso14443_4b_poller_send_block(
20345 instance: *mut Iso14443_4bPoller,
20346 tx_buffer: *const BitBuffer,
20347 rx_buffer: *mut BitBuffer,
20348 ) -> Iso14443_4bError;
20349}
20350unsafe extern "C" {
20351 #[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."]
20352 pub fn iso14443_4b_poller_halt(instance: *mut Iso14443_4bPoller) -> Iso14443_4bError;
20353}
20354pub const Iso15693_3ErrorNone: Iso15693_3Error = Iso15693_3Error(0);
20355pub const Iso15693_3ErrorNotPresent: Iso15693_3Error = Iso15693_3Error(1);
20356pub const Iso15693_3ErrorBufferEmpty: Iso15693_3Error = Iso15693_3Error(2);
20357pub const Iso15693_3ErrorBufferOverflow: Iso15693_3Error = Iso15693_3Error(3);
20358pub const Iso15693_3ErrorFieldOff: Iso15693_3Error = Iso15693_3Error(4);
20359pub const Iso15693_3ErrorWrongCrc: Iso15693_3Error = Iso15693_3Error(5);
20360pub const Iso15693_3ErrorTimeout: Iso15693_3Error = Iso15693_3Error(6);
20361pub const Iso15693_3ErrorFormat: Iso15693_3Error = Iso15693_3Error(7);
20362pub const Iso15693_3ErrorIgnore: Iso15693_3Error = Iso15693_3Error(8);
20363pub const Iso15693_3ErrorNotSupported: Iso15693_3Error = Iso15693_3Error(9);
20364pub const Iso15693_3ErrorUidMismatch: Iso15693_3Error = Iso15693_3Error(10);
20365pub const Iso15693_3ErrorFullyHandled: Iso15693_3Error = Iso15693_3Error(11);
20366pub const Iso15693_3ErrorUnexpectedResponse: Iso15693_3Error = Iso15693_3Error(12);
20367pub const Iso15693_3ErrorInternal: Iso15693_3Error = Iso15693_3Error(13);
20368pub const Iso15693_3ErrorCustom: Iso15693_3Error = Iso15693_3Error(14);
20369pub const Iso15693_3ErrorUnknown: Iso15693_3Error = Iso15693_3Error(15);
20370#[repr(transparent)]
20371#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20372pub struct Iso15693_3Error(pub core::ffi::c_uchar);
20373#[repr(C)]
20374#[derive(Debug, Copy, Clone)]
20375pub struct Iso15693_3SystemInfo {
20376 pub flags: u8,
20377 pub dsfid: u8,
20378 pub afi: u8,
20379 pub ic_ref: u8,
20380 pub block_count: u16,
20381 pub block_size: u8,
20382}
20383#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20384const _: () = {
20385 ["Size of Iso15693_3SystemInfo"][::core::mem::size_of::<Iso15693_3SystemInfo>() - 8usize];
20386 ["Alignment of Iso15693_3SystemInfo"][::core::mem::align_of::<Iso15693_3SystemInfo>() - 2usize];
20387 ["Offset of field: Iso15693_3SystemInfo::flags"]
20388 [::core::mem::offset_of!(Iso15693_3SystemInfo, flags) - 0usize];
20389 ["Offset of field: Iso15693_3SystemInfo::dsfid"]
20390 [::core::mem::offset_of!(Iso15693_3SystemInfo, dsfid) - 1usize];
20391 ["Offset of field: Iso15693_3SystemInfo::afi"]
20392 [::core::mem::offset_of!(Iso15693_3SystemInfo, afi) - 2usize];
20393 ["Offset of field: Iso15693_3SystemInfo::ic_ref"]
20394 [::core::mem::offset_of!(Iso15693_3SystemInfo, ic_ref) - 3usize];
20395 ["Offset of field: Iso15693_3SystemInfo::block_count"]
20396 [::core::mem::offset_of!(Iso15693_3SystemInfo, block_count) - 4usize];
20397 ["Offset of field: Iso15693_3SystemInfo::block_size"]
20398 [::core::mem::offset_of!(Iso15693_3SystemInfo, block_size) - 6usize];
20399};
20400#[repr(C)]
20401#[derive(Debug, Copy, Clone)]
20402pub struct Iso15693_3LockBits {
20403 pub dsfid: bool,
20404 pub afi: bool,
20405}
20406#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20407const _: () = {
20408 ["Size of Iso15693_3LockBits"][::core::mem::size_of::<Iso15693_3LockBits>() - 2usize];
20409 ["Alignment of Iso15693_3LockBits"][::core::mem::align_of::<Iso15693_3LockBits>() - 1usize];
20410 ["Offset of field: Iso15693_3LockBits::dsfid"]
20411 [::core::mem::offset_of!(Iso15693_3LockBits, dsfid) - 0usize];
20412 ["Offset of field: Iso15693_3LockBits::afi"]
20413 [::core::mem::offset_of!(Iso15693_3LockBits, afi) - 1usize];
20414};
20415#[repr(C)]
20416#[derive(Debug, Copy, Clone)]
20417pub struct Iso15693_3Settings {
20418 pub lock_bits: Iso15693_3LockBits,
20419}
20420#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20421const _: () = {
20422 ["Size of Iso15693_3Settings"][::core::mem::size_of::<Iso15693_3Settings>() - 2usize];
20423 ["Alignment of Iso15693_3Settings"][::core::mem::align_of::<Iso15693_3Settings>() - 1usize];
20424 ["Offset of field: Iso15693_3Settings::lock_bits"]
20425 [::core::mem::offset_of!(Iso15693_3Settings, lock_bits) - 0usize];
20426};
20427#[repr(C)]
20428#[derive(Debug, Copy, Clone)]
20429pub struct Iso15693_3Data {
20430 pub uid: [u8; 8usize],
20431 pub system_info: Iso15693_3SystemInfo,
20432 pub settings: Iso15693_3Settings,
20433 pub block_data: *mut SimpleArray,
20434 pub block_security: *mut SimpleArray,
20435}
20436#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20437const _: () = {
20438 ["Size of Iso15693_3Data"][::core::mem::size_of::<Iso15693_3Data>() - 28usize];
20439 ["Alignment of Iso15693_3Data"][::core::mem::align_of::<Iso15693_3Data>() - 4usize];
20440 ["Offset of field: Iso15693_3Data::uid"][::core::mem::offset_of!(Iso15693_3Data, uid) - 0usize];
20441 ["Offset of field: Iso15693_3Data::system_info"]
20442 [::core::mem::offset_of!(Iso15693_3Data, system_info) - 8usize];
20443 ["Offset of field: Iso15693_3Data::settings"]
20444 [::core::mem::offset_of!(Iso15693_3Data, settings) - 16usize];
20445 ["Offset of field: Iso15693_3Data::block_data"]
20446 [::core::mem::offset_of!(Iso15693_3Data, block_data) - 20usize];
20447 ["Offset of field: Iso15693_3Data::block_security"]
20448 [::core::mem::offset_of!(Iso15693_3Data, block_security) - 24usize];
20449};
20450unsafe extern "C" {
20451 pub fn iso15693_3_alloc() -> *mut Iso15693_3Data;
20452}
20453unsafe extern "C" {
20454 pub fn iso15693_3_free(data: *mut Iso15693_3Data);
20455}
20456unsafe extern "C" {
20457 pub fn iso15693_3_reset(data: *mut Iso15693_3Data);
20458}
20459unsafe extern "C" {
20460 pub fn iso15693_3_copy(data: *mut Iso15693_3Data, other: *const Iso15693_3Data);
20461}
20462unsafe extern "C" {
20463 pub fn iso15693_3_verify(data: *mut Iso15693_3Data, device_type: *const FuriString) -> bool;
20464}
20465unsafe extern "C" {
20466 pub fn iso15693_3_load(data: *mut Iso15693_3Data, ff: *mut FlipperFormat, version: u32)
20467 -> bool;
20468}
20469unsafe extern "C" {
20470 pub fn iso15693_3_save(data: *const Iso15693_3Data, ff: *mut FlipperFormat) -> bool;
20471}
20472unsafe extern "C" {
20473 pub fn iso15693_3_is_equal(data: *const Iso15693_3Data, other: *const Iso15693_3Data) -> bool;
20474}
20475unsafe extern "C" {
20476 pub fn iso15693_3_get_device_name(
20477 data: *const Iso15693_3Data,
20478 name_type: NfcDeviceNameType,
20479 ) -> *const core::ffi::c_char;
20480}
20481unsafe extern "C" {
20482 pub fn iso15693_3_get_uid(data: *const Iso15693_3Data, uid_len: *mut usize) -> *const u8;
20483}
20484unsafe extern "C" {
20485 pub fn iso15693_3_set_uid(data: *mut Iso15693_3Data, uid: *const u8, uid_len: usize) -> bool;
20486}
20487unsafe extern "C" {
20488 pub fn iso15693_3_get_base_data(data: *const Iso15693_3Data) -> *mut Iso15693_3Data;
20489}
20490unsafe extern "C" {
20491 pub fn iso15693_3_is_block_locked(data: *const Iso15693_3Data, block_index: u8) -> bool;
20492}
20493unsafe extern "C" {
20494 pub fn iso15693_3_get_manufacturer_id(data: *const Iso15693_3Data) -> u8;
20495}
20496unsafe extern "C" {
20497 pub fn iso15693_3_get_block_count(data: *const Iso15693_3Data) -> u16;
20498}
20499unsafe extern "C" {
20500 pub fn iso15693_3_get_block_size(data: *const Iso15693_3Data) -> u8;
20501}
20502unsafe extern "C" {
20503 pub fn iso15693_3_get_block_data(data: *const Iso15693_3Data, block_index: u8) -> *const u8;
20504}
20505#[repr(C)]
20506#[derive(Debug, Copy, Clone)]
20507pub struct Iso15693_3Poller {
20508 _unused: [u8; 0],
20509}
20510#[doc = "< An error occured during activation procedure."]
20511pub const Iso15693_3PollerEventTypeError: Iso15693_3PollerEventType = Iso15693_3PollerEventType(0);
20512#[doc = "< The card was activated by the poller."]
20513pub const Iso15693_3PollerEventTypeReady: Iso15693_3PollerEventType = Iso15693_3PollerEventType(1);
20514#[repr(transparent)]
20515#[doc = "Enumeration of possible Iso15693_3 poller event types."]
20516#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20517pub struct Iso15693_3PollerEventType(pub core::ffi::c_uchar);
20518#[doc = "Iso15693_3 poller event data."]
20519#[repr(C)]
20520#[derive(Copy, Clone)]
20521pub union Iso15693_3PollerEventData {
20522 #[doc = "< Error code indicating card activation fail reason."]
20523 pub error: Iso15693_3Error,
20524}
20525#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20526const _: () = {
20527 ["Size of Iso15693_3PollerEventData"]
20528 [::core::mem::size_of::<Iso15693_3PollerEventData>() - 1usize];
20529 ["Alignment of Iso15693_3PollerEventData"]
20530 [::core::mem::align_of::<Iso15693_3PollerEventData>() - 1usize];
20531 ["Offset of field: Iso15693_3PollerEventData::error"]
20532 [::core::mem::offset_of!(Iso15693_3PollerEventData, error) - 0usize];
20533};
20534#[doc = "Iso15693_3 poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
20535#[repr(C)]
20536#[derive(Debug, Copy, Clone)]
20537pub struct Iso15693_3PollerEvent {
20538 #[doc = "< Type of emmitted event."]
20539 pub type_: Iso15693_3PollerEventType,
20540 #[doc = "< Pointer to event specific data."]
20541 pub data: *mut Iso15693_3PollerEventData,
20542}
20543#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20544const _: () = {
20545 ["Size of Iso15693_3PollerEvent"][::core::mem::size_of::<Iso15693_3PollerEvent>() - 8usize];
20546 ["Alignment of Iso15693_3PollerEvent"]
20547 [::core::mem::align_of::<Iso15693_3PollerEvent>() - 4usize];
20548 ["Offset of field: Iso15693_3PollerEvent::type_"]
20549 [::core::mem::offset_of!(Iso15693_3PollerEvent, type_) - 0usize];
20550 ["Offset of field: Iso15693_3PollerEvent::data"]
20551 [::core::mem::offset_of!(Iso15693_3PollerEvent, data) - 4usize];
20552};
20553unsafe extern "C" {
20554 #[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."]
20555 pub fn iso15693_3_poller_send_frame(
20556 instance: *mut Iso15693_3Poller,
20557 tx_buffer: *const BitBuffer,
20558 rx_buffer: *mut BitBuffer,
20559 fwt: u32,
20560 ) -> Iso15693_3Error;
20561}
20562unsafe extern "C" {
20563 #[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."]
20564 pub fn iso15693_3_poller_activate(
20565 instance: *mut Iso15693_3Poller,
20566 data: *mut Iso15693_3Data,
20567 ) -> Iso15693_3Error;
20568}
20569unsafe extern "C" {
20570 #[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."]
20571 pub fn iso15693_3_poller_inventory(
20572 instance: *mut Iso15693_3Poller,
20573 uid: *mut u8,
20574 ) -> Iso15693_3Error;
20575}
20576unsafe extern "C" {
20577 #[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."]
20578 pub fn iso15693_3_poller_get_system_info(
20579 instance: *mut Iso15693_3Poller,
20580 data: *mut Iso15693_3SystemInfo,
20581 ) -> Iso15693_3Error;
20582}
20583unsafe extern "C" {
20584 #[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."]
20585 pub fn iso15693_3_poller_read_block(
20586 instance: *mut Iso15693_3Poller,
20587 data: *mut u8,
20588 block_number: u8,
20589 block_size: u8,
20590 ) -> Iso15693_3Error;
20591}
20592unsafe extern "C" {
20593 #[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."]
20594 pub fn iso15693_3_poller_read_blocks(
20595 instance: *mut Iso15693_3Poller,
20596 data: *mut u8,
20597 block_count: u16,
20598 block_size: u8,
20599 ) -> Iso15693_3Error;
20600}
20601unsafe extern "C" {
20602 #[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."]
20603 pub fn iso15693_3_poller_get_blocks_security(
20604 instance: *mut Iso15693_3Poller,
20605 data: *mut u8,
20606 block_count: u16,
20607 ) -> Iso15693_3Error;
20608}
20609#[repr(C)]
20610#[derive(Debug, Copy, Clone)]
20611pub struct MfClassicListener {
20612 _unused: [u8; 0],
20613}
20614pub const MfClassicListenerEventTypeAuthContextPartCollected: MfClassicListenerEventType =
20615 MfClassicListenerEventType(0);
20616pub const MfClassicListenerEventTypeAuthContextFullCollected: MfClassicListenerEventType =
20617 MfClassicListenerEventType(1);
20618#[repr(transparent)]
20619#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20620pub struct MfClassicListenerEventType(pub core::ffi::c_uchar);
20621#[repr(C)]
20622#[derive(Copy, Clone)]
20623pub union MfClassicListenerEventData {
20624 pub auth_context: MfClassicAuthContext,
20625}
20626#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20627const _: () = {
20628 ["Size of MfClassicListenerEventData"]
20629 [::core::mem::size_of::<MfClassicListenerEventData>() - 24usize];
20630 ["Alignment of MfClassicListenerEventData"]
20631 [::core::mem::align_of::<MfClassicListenerEventData>() - 1usize];
20632 ["Offset of field: MfClassicListenerEventData::auth_context"]
20633 [::core::mem::offset_of!(MfClassicListenerEventData, auth_context) - 0usize];
20634};
20635#[repr(C)]
20636#[derive(Debug, Copy, Clone)]
20637pub struct MfClassicListenerEvent {
20638 pub type_: MfClassicListenerEventType,
20639 pub data: *mut MfClassicListenerEventData,
20640}
20641#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20642const _: () = {
20643 ["Size of MfClassicListenerEvent"][::core::mem::size_of::<MfClassicListenerEvent>() - 8usize];
20644 ["Alignment of MfClassicListenerEvent"]
20645 [::core::mem::align_of::<MfClassicListenerEvent>() - 4usize];
20646 ["Offset of field: MfClassicListenerEvent::type_"]
20647 [::core::mem::offset_of!(MfClassicListenerEvent, type_) - 0usize];
20648 ["Offset of field: MfClassicListenerEvent::data"]
20649 [::core::mem::offset_of!(MfClassicListenerEvent, data) - 4usize];
20650};
20651#[repr(C)]
20652#[derive(Debug, Copy, Clone)]
20653pub struct MfClassicPoller {
20654 _unused: [u8; 0],
20655}
20656#[doc = "< Poller requests to fill the mode."]
20657pub const MfClassicPollerEventTypeRequestMode: MfClassicPollerEventType =
20658 MfClassicPollerEventType(0);
20659#[doc = "< Poller requests data to read sector."]
20660pub const MfClassicPollerEventTypeRequestReadSector: MfClassicPollerEventType =
20661 MfClassicPollerEventType(1);
20662#[doc = "< Poller requests sector trailer for writing block."]
20663pub const MfClassicPollerEventTypeRequestSectorTrailer: MfClassicPollerEventType =
20664 MfClassicPollerEventType(2);
20665#[doc = "< Poller requests data to write block."]
20666pub const MfClassicPollerEventTypeRequestWriteBlock: MfClassicPollerEventType =
20667 MfClassicPollerEventType(3);
20668#[doc = "< Poller requests key for sector authentication."]
20669pub const MfClassicPollerEventTypeRequestKey: MfClassicPollerEventType =
20670 MfClassicPollerEventType(4);
20671#[doc = "< Poller switches to next sector during dictionary attack."]
20672pub const MfClassicPollerEventTypeNextSector: MfClassicPollerEventType =
20673 MfClassicPollerEventType(5);
20674#[doc = "< Poller updates data."]
20675pub const MfClassicPollerEventTypeDataUpdate: MfClassicPollerEventType =
20676 MfClassicPollerEventType(6);
20677#[doc = "< Poller found key A."]
20678pub const MfClassicPollerEventTypeFoundKeyA: MfClassicPollerEventType = MfClassicPollerEventType(7);
20679#[doc = "< Poller found key B."]
20680pub const MfClassicPollerEventTypeFoundKeyB: MfClassicPollerEventType = MfClassicPollerEventType(8);
20681#[doc = "< Poller starts key attack."]
20682pub const MfClassicPollerEventTypeKeyAttackStart: MfClassicPollerEventType =
20683 MfClassicPollerEventType(9);
20684#[doc = "< Poller stops key attack."]
20685pub const MfClassicPollerEventTypeKeyAttackStop: MfClassicPollerEventType =
20686 MfClassicPollerEventType(10);
20687#[doc = "< Poller switches to next sector during key attack."]
20688pub const MfClassicPollerEventTypeKeyAttackNextSector: MfClassicPollerEventType =
20689 MfClassicPollerEventType(11);
20690#[doc = "< Poller detected card."]
20691pub const MfClassicPollerEventTypeCardDetected: MfClassicPollerEventType =
20692 MfClassicPollerEventType(12);
20693#[doc = "< Poller lost card."]
20694pub const MfClassicPollerEventTypeCardLost: MfClassicPollerEventType = MfClassicPollerEventType(13);
20695#[doc = "< Poller succeeded."]
20696pub const MfClassicPollerEventTypeSuccess: MfClassicPollerEventType = MfClassicPollerEventType(14);
20697#[doc = "< Poller failed."]
20698pub const MfClassicPollerEventTypeFail: MfClassicPollerEventType = MfClassicPollerEventType(15);
20699#[repr(transparent)]
20700#[doc = "Enumeration of possible MfClassic poller event types."]
20701#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20702pub struct MfClassicPollerEventType(pub core::ffi::c_uchar);
20703#[doc = "< Poller reading mode."]
20704pub const MfClassicPollerModeRead: MfClassicPollerMode = MfClassicPollerMode(0);
20705#[doc = "< Poller writing mode."]
20706pub const MfClassicPollerModeWrite: MfClassicPollerMode = MfClassicPollerMode(1);
20707#[doc = "< Poller dictionary attack mode."]
20708pub const MfClassicPollerModeDictAttackStandard: MfClassicPollerMode = MfClassicPollerMode(2);
20709#[doc = "< Poller CUID dictionary attack mode."]
20710pub const MfClassicPollerModeDictAttackCUID: MfClassicPollerMode = MfClassicPollerMode(3);
20711#[doc = "< Poller enhanced dictionary attack mode."]
20712pub const MfClassicPollerModeDictAttackEnhanced: MfClassicPollerMode = MfClassicPollerMode(4);
20713#[repr(transparent)]
20714#[doc = "MfClassic poller mode."]
20715#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20716pub struct MfClassicPollerMode(pub core::ffi::c_uchar);
20717#[doc = "< No nested attack has taken place yet."]
20718pub const MfClassicNestedPhaseNone: MfClassicNestedPhase = MfClassicNestedPhase(0);
20719#[doc = "< Analyze nonces produced by the PRNG to determine if they fit a weak PRNG"]
20720pub const MfClassicNestedPhaseAnalyzePRNG: MfClassicNestedPhase = MfClassicNestedPhase(1);
20721#[doc = "< Search keys which match the expected PRNG properties and parity for collected nonces"]
20722pub const MfClassicNestedPhaseDictAttack: MfClassicNestedPhase = MfClassicNestedPhase(2);
20723#[doc = "< Verify candidate keys by authenticating to the sector with the key"]
20724pub const MfClassicNestedPhaseDictAttackVerify: MfClassicNestedPhase = MfClassicNestedPhase(3);
20725#[doc = "< Resume nested dictionary attack from the last tested (invalid) key"]
20726pub const MfClassicNestedPhaseDictAttackResume: MfClassicNestedPhase = MfClassicNestedPhase(4);
20727#[doc = "< Perform necessary calculations to recover the plaintext nonce during later collection phase (weak PRNG tags only)"]
20728pub const MfClassicNestedPhaseCalibrate: MfClassicNestedPhase = MfClassicNestedPhase(5);
20729#[doc = "< Collect the next plaintext static encrypted nonce for backdoor static encrypted nonce nested attack"]
20730pub const MfClassicNestedPhaseRecalibrate: MfClassicNestedPhase = MfClassicNestedPhase(6);
20731#[doc = "< Log nonces collected during nested authentication for key recovery"]
20732pub const MfClassicNestedPhaseCollectNtEnc: MfClassicNestedPhase = MfClassicNestedPhase(7);
20733#[doc = "< Nested attack has finished"]
20734pub const MfClassicNestedPhaseFinished: MfClassicNestedPhase = MfClassicNestedPhase(8);
20735#[repr(transparent)]
20736#[doc = "MfClassic poller nested attack phase."]
20737#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20738pub struct MfClassicNestedPhase(pub core::ffi::c_uchar);
20739pub const MfClassicPrngTypeUnknown: MfClassicPrngType = MfClassicPrngType(0);
20740pub const MfClassicPrngTypeNoTag: MfClassicPrngType = MfClassicPrngType(1);
20741pub const MfClassicPrngTypeWeak: MfClassicPrngType = MfClassicPrngType(2);
20742pub const MfClassicPrngTypeHard: MfClassicPrngType = MfClassicPrngType(3);
20743#[repr(transparent)]
20744#[doc = "MfClassic pseudorandom number generator (PRNG) type."]
20745#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20746pub struct MfClassicPrngType(pub core::ffi::c_uchar);
20747pub const MfClassicBackdoorUnknown: MfClassicBackdoor = MfClassicBackdoor(0);
20748pub const MfClassicBackdoorNone: MfClassicBackdoor = MfClassicBackdoor(1);
20749pub const MfClassicBackdoorAuth1: MfClassicBackdoor = MfClassicBackdoor(2);
20750pub const MfClassicBackdoorAuth2: MfClassicBackdoor = MfClassicBackdoor(3);
20751pub const MfClassicBackdoorAuth3: MfClassicBackdoor = MfClassicBackdoor(4);
20752#[repr(transparent)]
20753#[doc = "MfClassic authentication backdoor type."]
20754#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20755pub struct MfClassicBackdoor(pub core::ffi::c_uchar);
20756#[doc = "MfClassic poller request mode event data.\n\n This instance of this structure must be filled on MfClassicPollerEventTypeRequestMode event."]
20757#[repr(C)]
20758#[derive(Debug, Copy, Clone)]
20759pub struct MfClassicPollerEventDataRequestMode {
20760 #[doc = "< Mode to be used by poller."]
20761 pub mode: MfClassicPollerMode,
20762 #[doc = "< Data to be used by poller."]
20763 pub data: *const MfClassicData,
20764}
20765#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20766const _: () = {
20767 ["Size of MfClassicPollerEventDataRequestMode"]
20768 [::core::mem::size_of::<MfClassicPollerEventDataRequestMode>() - 8usize];
20769 ["Alignment of MfClassicPollerEventDataRequestMode"]
20770 [::core::mem::align_of::<MfClassicPollerEventDataRequestMode>() - 4usize];
20771 ["Offset of field: MfClassicPollerEventDataRequestMode::mode"]
20772 [::core::mem::offset_of!(MfClassicPollerEventDataRequestMode, mode) - 0usize];
20773 ["Offset of field: MfClassicPollerEventDataRequestMode::data"]
20774 [::core::mem::offset_of!(MfClassicPollerEventDataRequestMode, data) - 4usize];
20775};
20776#[doc = "MfClassic poller next sector event data.\n\n The instance of this structure is filled by poller and passed with\n MfClassicPollerEventTypeNextSector event."]
20777#[repr(C)]
20778#[derive(Debug, Copy, Clone)]
20779pub struct MfClassicPollerEventDataDictAttackNextSector {
20780 #[doc = "< Current sector number."]
20781 pub current_sector: u8,
20782}
20783#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20784const _: () = {
20785 ["Size of MfClassicPollerEventDataDictAttackNextSector"]
20786 [::core::mem::size_of::<MfClassicPollerEventDataDictAttackNextSector>() - 1usize];
20787 ["Alignment of MfClassicPollerEventDataDictAttackNextSector"]
20788 [::core::mem::align_of::<MfClassicPollerEventDataDictAttackNextSector>() - 1usize];
20789 ["Offset of field: MfClassicPollerEventDataDictAttackNextSector::current_sector"][::core::mem::offset_of!(
20790 MfClassicPollerEventDataDictAttackNextSector,
20791 current_sector
20792 ) - 0usize];
20793};
20794#[doc = "MfClassic poller update event data.\n\n The instance of this structure is filled by poller and passed with\n MfClassicPollerEventTypeDataUpdate event."]
20795#[repr(C)]
20796#[derive(Debug, Copy, Clone)]
20797pub struct MfClassicPollerEventDataUpdate {
20798 #[doc = "< Number of sectors read."]
20799 pub sectors_read: u8,
20800 #[doc = "< Number of keys found."]
20801 pub keys_found: u8,
20802 #[doc = "< Current sector number."]
20803 pub current_sector: u8,
20804 #[doc = "< Nested attack phase."]
20805 pub nested_phase: MfClassicNestedPhase,
20806 #[doc = "< PRNG (weak or hard)."]
20807 pub prng_type: MfClassicPrngType,
20808 #[doc = "< Backdoor type."]
20809 pub backdoor: MfClassicBackdoor,
20810 #[doc = "< Target key for nested attack."]
20811 pub nested_target_key: u16,
20812 #[doc = "< Number of unique most significant bytes seen during Hardnested attack."]
20813 pub msb_count: u16,
20814}
20815#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20816const _: () = {
20817 ["Size of MfClassicPollerEventDataUpdate"]
20818 [::core::mem::size_of::<MfClassicPollerEventDataUpdate>() - 10usize];
20819 ["Alignment of MfClassicPollerEventDataUpdate"]
20820 [::core::mem::align_of::<MfClassicPollerEventDataUpdate>() - 2usize];
20821 ["Offset of field: MfClassicPollerEventDataUpdate::sectors_read"]
20822 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, sectors_read) - 0usize];
20823 ["Offset of field: MfClassicPollerEventDataUpdate::keys_found"]
20824 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, keys_found) - 1usize];
20825 ["Offset of field: MfClassicPollerEventDataUpdate::current_sector"]
20826 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, current_sector) - 2usize];
20827 ["Offset of field: MfClassicPollerEventDataUpdate::nested_phase"]
20828 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, nested_phase) - 3usize];
20829 ["Offset of field: MfClassicPollerEventDataUpdate::prng_type"]
20830 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, prng_type) - 4usize];
20831 ["Offset of field: MfClassicPollerEventDataUpdate::backdoor"]
20832 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, backdoor) - 5usize];
20833 ["Offset of field: MfClassicPollerEventDataUpdate::nested_target_key"]
20834 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, nested_target_key) - 6usize];
20835 ["Offset of field: MfClassicPollerEventDataUpdate::msb_count"]
20836 [::core::mem::offset_of!(MfClassicPollerEventDataUpdate, msb_count) - 8usize];
20837};
20838#[doc = "MfClassic poller key request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestKey event."]
20839#[repr(C)]
20840#[derive(Debug, Copy, Clone)]
20841pub struct MfClassicPollerEventDataKeyRequest {
20842 #[doc = "< Key to be used by poller."]
20843 pub key: MfClassicKey,
20844 #[doc = "< Key type (A or B) for CUID dict attack mode."]
20845 pub key_type: MfClassicKeyType,
20846 #[doc = "< Flag indicating if key is provided."]
20847 pub key_provided: bool,
20848}
20849#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20850const _: () = {
20851 ["Size of MfClassicPollerEventDataKeyRequest"]
20852 [::core::mem::size_of::<MfClassicPollerEventDataKeyRequest>() - 8usize];
20853 ["Alignment of MfClassicPollerEventDataKeyRequest"]
20854 [::core::mem::align_of::<MfClassicPollerEventDataKeyRequest>() - 1usize];
20855 ["Offset of field: MfClassicPollerEventDataKeyRequest::key"]
20856 [::core::mem::offset_of!(MfClassicPollerEventDataKeyRequest, key) - 0usize];
20857 ["Offset of field: MfClassicPollerEventDataKeyRequest::key_type"]
20858 [::core::mem::offset_of!(MfClassicPollerEventDataKeyRequest, key_type) - 6usize];
20859 ["Offset of field: MfClassicPollerEventDataKeyRequest::key_provided"]
20860 [::core::mem::offset_of!(MfClassicPollerEventDataKeyRequest, key_provided) - 7usize];
20861};
20862#[doc = "MfClassic poller read sector request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestReadSector event."]
20863#[repr(C)]
20864#[derive(Debug, Copy, Clone)]
20865pub struct MfClassicPollerEventDataReadSectorRequest {
20866 #[doc = "< Sector number to be read."]
20867 pub sector_num: u8,
20868 #[doc = "< Key to be used by poller."]
20869 pub key: MfClassicKey,
20870 #[doc = "< Key type to be used by poller."]
20871 pub key_type: MfClassicKeyType,
20872 #[doc = "< Flag indicating if key is provided."]
20873 pub key_provided: bool,
20874}
20875#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20876const _: () = {
20877 ["Size of MfClassicPollerEventDataReadSectorRequest"]
20878 [::core::mem::size_of::<MfClassicPollerEventDataReadSectorRequest>() - 9usize];
20879 ["Alignment of MfClassicPollerEventDataReadSectorRequest"]
20880 [::core::mem::align_of::<MfClassicPollerEventDataReadSectorRequest>() - 1usize];
20881 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::sector_num"]
20882 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, sector_num) - 0usize];
20883 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::key"]
20884 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, key) - 1usize];
20885 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::key_type"]
20886 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, key_type) - 7usize];
20887 ["Offset of field: MfClassicPollerEventDataReadSectorRequest::key_provided"]
20888 [::core::mem::offset_of!(MfClassicPollerEventDataReadSectorRequest, key_provided) - 8usize];
20889};
20890#[doc = "MfClassic poller sector trailer request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestSectorTrailer event."]
20891#[repr(C)]
20892#[derive(Debug, Copy, Clone)]
20893pub struct MfClassicPollerEventDataSectorTrailerRequest {
20894 #[doc = "< Sector number to be read."]
20895 pub sector_num: u8,
20896 #[doc = "< Sector trailer to be used by poller."]
20897 pub sector_trailer: MfClassicBlock,
20898 #[doc = "< Flag indicating if sector trailer is provided."]
20899 pub sector_trailer_provided: bool,
20900}
20901#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20902const _: () = {
20903 ["Size of MfClassicPollerEventDataSectorTrailerRequest"]
20904 [::core::mem::size_of::<MfClassicPollerEventDataSectorTrailerRequest>() - 18usize];
20905 ["Alignment of MfClassicPollerEventDataSectorTrailerRequest"]
20906 [::core::mem::align_of::<MfClassicPollerEventDataSectorTrailerRequest>() - 1usize];
20907 ["Offset of field: MfClassicPollerEventDataSectorTrailerRequest::sector_num"][::core::mem::offset_of!(
20908 MfClassicPollerEventDataSectorTrailerRequest,
20909 sector_num
20910 ) - 0usize];
20911 ["Offset of field: MfClassicPollerEventDataSectorTrailerRequest::sector_trailer"][::core::mem::offset_of!(
20912 MfClassicPollerEventDataSectorTrailerRequest,
20913 sector_trailer
20914 ) - 1usize];
20915 ["Offset of field: MfClassicPollerEventDataSectorTrailerRequest::sector_trailer_provided"][::core::mem::offset_of!(
20916 MfClassicPollerEventDataSectorTrailerRequest,
20917 sector_trailer_provided
20918 )
20919 - 17usize];
20920};
20921#[doc = "MfClassic poller write block request event data.\n\n The instance of this structure must be filled on MfClassicPollerEventTypeRequestWriteBlock event."]
20922#[repr(C)]
20923#[derive(Debug, Copy, Clone)]
20924pub struct MfClassicPollerEventDataWriteBlockRequest {
20925 #[doc = "< Block number to be written."]
20926 pub block_num: u8,
20927 #[doc = "< Block to be written."]
20928 pub write_block: MfClassicBlock,
20929 #[doc = "< Flag indicating if block is provided."]
20930 pub write_block_provided: bool,
20931}
20932#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20933const _: () = {
20934 ["Size of MfClassicPollerEventDataWriteBlockRequest"]
20935 [::core::mem::size_of::<MfClassicPollerEventDataWriteBlockRequest>() - 18usize];
20936 ["Alignment of MfClassicPollerEventDataWriteBlockRequest"]
20937 [::core::mem::align_of::<MfClassicPollerEventDataWriteBlockRequest>() - 1usize];
20938 ["Offset of field: MfClassicPollerEventDataWriteBlockRequest::block_num"]
20939 [::core::mem::offset_of!(MfClassicPollerEventDataWriteBlockRequest, block_num) - 0usize];
20940 ["Offset of field: MfClassicPollerEventDataWriteBlockRequest::write_block"]
20941 [::core::mem::offset_of!(MfClassicPollerEventDataWriteBlockRequest, write_block) - 1usize];
20942 ["Offset of field: MfClassicPollerEventDataWriteBlockRequest::write_block_provided"][::core::mem::offset_of!(
20943 MfClassicPollerEventDataWriteBlockRequest,
20944 write_block_provided
20945 )
20946 - 17usize];
20947};
20948#[doc = "MfClassic poller key attack event data.\n\n The instance of this structure is filled by poller and passed with\n MfClassicPollerEventTypeKeyAttackNextSector event."]
20949#[repr(C)]
20950#[derive(Debug, Copy, Clone)]
20951pub struct MfClassicPollerEventKeyAttackData {
20952 #[doc = "< Current sector number."]
20953 pub current_sector: u8,
20954}
20955#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20956const _: () = {
20957 ["Size of MfClassicPollerEventKeyAttackData"]
20958 [::core::mem::size_of::<MfClassicPollerEventKeyAttackData>() - 1usize];
20959 ["Alignment of MfClassicPollerEventKeyAttackData"]
20960 [::core::mem::align_of::<MfClassicPollerEventKeyAttackData>() - 1usize];
20961 ["Offset of field: MfClassicPollerEventKeyAttackData::current_sector"]
20962 [::core::mem::offset_of!(MfClassicPollerEventKeyAttackData, current_sector) - 0usize];
20963};
20964#[doc = "MfClassic poller event data."]
20965#[repr(C)]
20966#[derive(Copy, Clone)]
20967pub union MfClassicPollerEventData {
20968 #[doc = "< Error code on MfClassicPollerEventTypeFail event."]
20969 pub error: MfClassicError,
20970 #[doc = "< Poller mode context."]
20971 pub poller_mode: MfClassicPollerEventDataRequestMode,
20972 #[doc = "< Next sector context."]
20973 pub next_sector_data: MfClassicPollerEventDataDictAttackNextSector,
20974 #[doc = "< Key request context."]
20975 pub key_request_data: MfClassicPollerEventDataKeyRequest,
20976 #[doc = "< Data update context."]
20977 pub data_update: MfClassicPollerEventDataUpdate,
20978 #[doc = "< Read sector request context."]
20979 pub read_sector_request_data: MfClassicPollerEventDataReadSectorRequest,
20980 #[doc = "< Key attack context."]
20981 pub key_attack_data: MfClassicPollerEventKeyAttackData,
20982 #[doc = "< Sector trailer request context."]
20983 pub sec_tr_data: MfClassicPollerEventDataSectorTrailerRequest,
20984 #[doc = "< Write block request context."]
20985 pub write_block_data: MfClassicPollerEventDataWriteBlockRequest,
20986}
20987#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20988const _: () = {
20989 ["Size of MfClassicPollerEventData"]
20990 [::core::mem::size_of::<MfClassicPollerEventData>() - 20usize];
20991 ["Alignment of MfClassicPollerEventData"]
20992 [::core::mem::align_of::<MfClassicPollerEventData>() - 4usize];
20993 ["Offset of field: MfClassicPollerEventData::error"]
20994 [::core::mem::offset_of!(MfClassicPollerEventData, error) - 0usize];
20995 ["Offset of field: MfClassicPollerEventData::poller_mode"]
20996 [::core::mem::offset_of!(MfClassicPollerEventData, poller_mode) - 0usize];
20997 ["Offset of field: MfClassicPollerEventData::next_sector_data"]
20998 [::core::mem::offset_of!(MfClassicPollerEventData, next_sector_data) - 0usize];
20999 ["Offset of field: MfClassicPollerEventData::key_request_data"]
21000 [::core::mem::offset_of!(MfClassicPollerEventData, key_request_data) - 0usize];
21001 ["Offset of field: MfClassicPollerEventData::data_update"]
21002 [::core::mem::offset_of!(MfClassicPollerEventData, data_update) - 0usize];
21003 ["Offset of field: MfClassicPollerEventData::read_sector_request_data"]
21004 [::core::mem::offset_of!(MfClassicPollerEventData, read_sector_request_data) - 0usize];
21005 ["Offset of field: MfClassicPollerEventData::key_attack_data"]
21006 [::core::mem::offset_of!(MfClassicPollerEventData, key_attack_data) - 0usize];
21007 ["Offset of field: MfClassicPollerEventData::sec_tr_data"]
21008 [::core::mem::offset_of!(MfClassicPollerEventData, sec_tr_data) - 0usize];
21009 ["Offset of field: MfClassicPollerEventData::write_block_data"]
21010 [::core::mem::offset_of!(MfClassicPollerEventData, write_block_data) - 0usize];
21011};
21012#[doc = "MfClassic poller event.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
21013#[repr(C)]
21014#[derive(Debug, Copy, Clone)]
21015pub struct MfClassicPollerEvent {
21016 #[doc = "< Event type."]
21017 pub type_: MfClassicPollerEventType,
21018 #[doc = "< Pointer to event specific data."]
21019 pub data: *mut MfClassicPollerEventData,
21020}
21021#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21022const _: () = {
21023 ["Size of MfClassicPollerEvent"][::core::mem::size_of::<MfClassicPollerEvent>() - 8usize];
21024 ["Alignment of MfClassicPollerEvent"][::core::mem::align_of::<MfClassicPollerEvent>() - 4usize];
21025 ["Offset of field: MfClassicPollerEvent::type_"]
21026 [::core::mem::offset_of!(MfClassicPollerEvent, type_) - 0usize];
21027 ["Offset of field: MfClassicPollerEvent::data"]
21028 [::core::mem::offset_of!(MfClassicPollerEvent, data) - 4usize];
21029};
21030unsafe extern "C" {
21031 #[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."]
21032 pub fn mf_classic_poller_get_nt(
21033 instance: *mut MfClassicPoller,
21034 block_num: u8,
21035 key_type: MfClassicKeyType,
21036 nt: *mut MfClassicNt,
21037 backdoor_auth: bool,
21038 ) -> MfClassicError;
21039}
21040unsafe extern "C" {
21041 #[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."]
21042 pub fn mf_classic_poller_get_nt_nested(
21043 instance: *mut MfClassicPoller,
21044 block_num: u8,
21045 key_type: MfClassicKeyType,
21046 nt: *mut MfClassicNt,
21047 backdoor_auth: bool,
21048 ) -> MfClassicError;
21049}
21050unsafe extern "C" {
21051 #[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."]
21052 pub fn mf_classic_poller_auth(
21053 instance: *mut MfClassicPoller,
21054 block_num: u8,
21055 key: *mut MfClassicKey,
21056 key_type: MfClassicKeyType,
21057 data: *mut MfClassicAuthContext,
21058 backdoor_auth: bool,
21059 ) -> MfClassicError;
21060}
21061unsafe extern "C" {
21062 #[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."]
21063 pub fn mf_classic_poller_auth_nested(
21064 instance: *mut MfClassicPoller,
21065 block_num: u8,
21066 key: *mut MfClassicKey,
21067 key_type: MfClassicKeyType,
21068 data: *mut MfClassicAuthContext,
21069 backdoor_auth: bool,
21070 early_ret: bool,
21071 ) -> MfClassicError;
21072}
21073unsafe extern "C" {
21074 #[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."]
21075 pub fn mf_classic_poller_halt(instance: *mut MfClassicPoller) -> MfClassicError;
21076}
21077unsafe extern "C" {
21078 #[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."]
21079 pub fn mf_classic_poller_read_block(
21080 instance: *mut MfClassicPoller,
21081 block_num: u8,
21082 data: *mut MfClassicBlock,
21083 ) -> MfClassicError;
21084}
21085unsafe extern "C" {
21086 #[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."]
21087 pub fn mf_classic_poller_write_block(
21088 instance: *mut MfClassicPoller,
21089 block_num: u8,
21090 data: *mut MfClassicBlock,
21091 ) -> MfClassicError;
21092}
21093unsafe extern "C" {
21094 #[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."]
21095 pub fn mf_classic_poller_value_cmd(
21096 instance: *mut MfClassicPoller,
21097 block_num: u8,
21098 cmd: MfClassicValueCommand,
21099 data: i32,
21100 ) -> MfClassicError;
21101}
21102unsafe extern "C" {
21103 #[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."]
21104 pub fn mf_classic_poller_value_transfer(
21105 instance: *mut MfClassicPoller,
21106 block_num: u8,
21107 ) -> MfClassicError;
21108}
21109unsafe extern "C" {
21110 #[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."]
21111 pub fn mf_classic_poller_send_standard_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 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."]
21120 pub fn mf_classic_poller_send_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 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."]
21129 pub fn mf_classic_poller_send_custom_parity_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 #[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."]
21138 pub fn mf_classic_poller_send_encrypted_frame(
21139 instance: *mut MfClassicPoller,
21140 tx_buffer: *const BitBuffer,
21141 rx_buffer: *mut BitBuffer,
21142 fwt_fc: u32,
21143 ) -> MfClassicError;
21144}
21145unsafe extern "C" {
21146 pub fn mf_classic_poller_sync_collect_nt(
21147 nfc: *mut Nfc,
21148 block_num: u8,
21149 key_type: MfClassicKeyType,
21150 nt: *mut MfClassicNt,
21151 ) -> MfClassicError;
21152}
21153unsafe extern "C" {
21154 pub fn mf_classic_poller_sync_auth(
21155 nfc: *mut Nfc,
21156 block_num: u8,
21157 key: *mut MfClassicKey,
21158 key_type: MfClassicKeyType,
21159 data: *mut MfClassicAuthContext,
21160 ) -> MfClassicError;
21161}
21162unsafe extern "C" {
21163 pub fn mf_classic_poller_sync_read_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_write_block(
21173 nfc: *mut Nfc,
21174 block_num: u8,
21175 key: *mut MfClassicKey,
21176 key_type: MfClassicKeyType,
21177 data: *mut MfClassicBlock,
21178 ) -> MfClassicError;
21179}
21180unsafe extern "C" {
21181 pub fn mf_classic_poller_sync_read_value(
21182 nfc: *mut Nfc,
21183 block_num: u8,
21184 key: *mut MfClassicKey,
21185 key_type: MfClassicKeyType,
21186 value: *mut i32,
21187 ) -> MfClassicError;
21188}
21189unsafe extern "C" {
21190 pub fn mf_classic_poller_sync_change_value(
21191 nfc: *mut Nfc,
21192 block_num: u8,
21193 key: *mut MfClassicKey,
21194 key_type: MfClassicKeyType,
21195 data: i32,
21196 new_value: *mut i32,
21197 ) -> MfClassicError;
21198}
21199unsafe extern "C" {
21200 pub fn mf_classic_poller_sync_detect_type(
21201 nfc: *mut Nfc,
21202 type_: *mut MfClassicType,
21203 ) -> MfClassicError;
21204}
21205unsafe extern "C" {
21206 pub fn mf_classic_poller_sync_read(
21207 nfc: *mut Nfc,
21208 keys: *const MfClassicDeviceKeys,
21209 data: *mut MfClassicData,
21210 ) -> MfClassicError;
21211}
21212pub const MfDesfireTypeMF3ICD40: MfDesfireType = MfDesfireType(0);
21213pub const MfDesfireTypeEV1: MfDesfireType = MfDesfireType(1);
21214pub const MfDesfireTypeEV2: MfDesfireType = MfDesfireType(2);
21215pub const MfDesfireTypeEV2XL: MfDesfireType = MfDesfireType(3);
21216pub const MfDesfireTypeEV3: MfDesfireType = MfDesfireType(4);
21217pub const MfDesfireTypeUnknown: MfDesfireType = MfDesfireType(5);
21218pub const MfDesfireTypeNum: MfDesfireType = MfDesfireType(6);
21219#[repr(transparent)]
21220#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21221pub struct MfDesfireType(pub core::ffi::c_uchar);
21222pub const MfDesfireSize2k: MfDesfireSize = MfDesfireSize(0);
21223pub const MfDesfireSize4k: MfDesfireSize = MfDesfireSize(1);
21224pub const MfDesfireSize8k: MfDesfireSize = MfDesfireSize(2);
21225pub const MfDesfireSize16k: MfDesfireSize = MfDesfireSize(3);
21226pub const MfDesfireSize32k: MfDesfireSize = MfDesfireSize(4);
21227pub const MfDesfireSizeUnknown: MfDesfireSize = MfDesfireSize(5);
21228pub const MfDesfireSizeNum: MfDesfireSize = MfDesfireSize(6);
21229#[repr(transparent)]
21230#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21231pub struct MfDesfireSize(pub core::ffi::c_uchar);
21232#[repr(C)]
21233#[derive(Debug, Copy, Clone)]
21234pub struct MfDesfireVersion {
21235 pub hw_vendor: u8,
21236 pub hw_type: u8,
21237 pub hw_subtype: u8,
21238 pub hw_major: u8,
21239 pub hw_minor: u8,
21240 pub hw_storage: u8,
21241 pub hw_proto: u8,
21242 pub sw_vendor: u8,
21243 pub sw_type: u8,
21244 pub sw_subtype: u8,
21245 pub sw_major: u8,
21246 pub sw_minor: u8,
21247 pub sw_storage: u8,
21248 pub sw_proto: u8,
21249 pub uid: [u8; 7usize],
21250 pub batch: [u8; 5usize],
21251 pub prod_week: u8,
21252 pub prod_year: u8,
21253}
21254#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21255const _: () = {
21256 ["Size of MfDesfireVersion"][::core::mem::size_of::<MfDesfireVersion>() - 28usize];
21257 ["Alignment of MfDesfireVersion"][::core::mem::align_of::<MfDesfireVersion>() - 1usize];
21258 ["Offset of field: MfDesfireVersion::hw_vendor"]
21259 [::core::mem::offset_of!(MfDesfireVersion, hw_vendor) - 0usize];
21260 ["Offset of field: MfDesfireVersion::hw_type"]
21261 [::core::mem::offset_of!(MfDesfireVersion, hw_type) - 1usize];
21262 ["Offset of field: MfDesfireVersion::hw_subtype"]
21263 [::core::mem::offset_of!(MfDesfireVersion, hw_subtype) - 2usize];
21264 ["Offset of field: MfDesfireVersion::hw_major"]
21265 [::core::mem::offset_of!(MfDesfireVersion, hw_major) - 3usize];
21266 ["Offset of field: MfDesfireVersion::hw_minor"]
21267 [::core::mem::offset_of!(MfDesfireVersion, hw_minor) - 4usize];
21268 ["Offset of field: MfDesfireVersion::hw_storage"]
21269 [::core::mem::offset_of!(MfDesfireVersion, hw_storage) - 5usize];
21270 ["Offset of field: MfDesfireVersion::hw_proto"]
21271 [::core::mem::offset_of!(MfDesfireVersion, hw_proto) - 6usize];
21272 ["Offset of field: MfDesfireVersion::sw_vendor"]
21273 [::core::mem::offset_of!(MfDesfireVersion, sw_vendor) - 7usize];
21274 ["Offset of field: MfDesfireVersion::sw_type"]
21275 [::core::mem::offset_of!(MfDesfireVersion, sw_type) - 8usize];
21276 ["Offset of field: MfDesfireVersion::sw_subtype"]
21277 [::core::mem::offset_of!(MfDesfireVersion, sw_subtype) - 9usize];
21278 ["Offset of field: MfDesfireVersion::sw_major"]
21279 [::core::mem::offset_of!(MfDesfireVersion, sw_major) - 10usize];
21280 ["Offset of field: MfDesfireVersion::sw_minor"]
21281 [::core::mem::offset_of!(MfDesfireVersion, sw_minor) - 11usize];
21282 ["Offset of field: MfDesfireVersion::sw_storage"]
21283 [::core::mem::offset_of!(MfDesfireVersion, sw_storage) - 12usize];
21284 ["Offset of field: MfDesfireVersion::sw_proto"]
21285 [::core::mem::offset_of!(MfDesfireVersion, sw_proto) - 13usize];
21286 ["Offset of field: MfDesfireVersion::uid"]
21287 [::core::mem::offset_of!(MfDesfireVersion, uid) - 14usize];
21288 ["Offset of field: MfDesfireVersion::batch"]
21289 [::core::mem::offset_of!(MfDesfireVersion, batch) - 21usize];
21290 ["Offset of field: MfDesfireVersion::prod_week"]
21291 [::core::mem::offset_of!(MfDesfireVersion, prod_week) - 26usize];
21292 ["Offset of field: MfDesfireVersion::prod_year"]
21293 [::core::mem::offset_of!(MfDesfireVersion, prod_year) - 27usize];
21294};
21295#[repr(C)]
21296#[derive(Debug, Copy, Clone)]
21297pub struct MfDesfireFreeMemory {
21298 pub bytes_free: u32,
21299 pub is_present: bool,
21300}
21301#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21302const _: () = {
21303 ["Size of MfDesfireFreeMemory"][::core::mem::size_of::<MfDesfireFreeMemory>() - 8usize];
21304 ["Alignment of MfDesfireFreeMemory"][::core::mem::align_of::<MfDesfireFreeMemory>() - 4usize];
21305 ["Offset of field: MfDesfireFreeMemory::bytes_free"]
21306 [::core::mem::offset_of!(MfDesfireFreeMemory, bytes_free) - 0usize];
21307 ["Offset of field: MfDesfireFreeMemory::is_present"]
21308 [::core::mem::offset_of!(MfDesfireFreeMemory, is_present) - 4usize];
21309};
21310#[repr(C)]
21311#[derive(Debug, Copy, Clone)]
21312pub struct MfDesfireKeySettings {
21313 pub is_master_key_changeable: bool,
21314 pub is_free_directory_list: bool,
21315 pub is_free_create_delete: bool,
21316 pub is_config_changeable: bool,
21317 pub change_key_id: u8,
21318 pub max_keys: u8,
21319 pub flags: u8,
21320}
21321#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21322const _: () = {
21323 ["Size of MfDesfireKeySettings"][::core::mem::size_of::<MfDesfireKeySettings>() - 7usize];
21324 ["Alignment of MfDesfireKeySettings"][::core::mem::align_of::<MfDesfireKeySettings>() - 1usize];
21325 ["Offset of field: MfDesfireKeySettings::is_master_key_changeable"]
21326 [::core::mem::offset_of!(MfDesfireKeySettings, is_master_key_changeable) - 0usize];
21327 ["Offset of field: MfDesfireKeySettings::is_free_directory_list"]
21328 [::core::mem::offset_of!(MfDesfireKeySettings, is_free_directory_list) - 1usize];
21329 ["Offset of field: MfDesfireKeySettings::is_free_create_delete"]
21330 [::core::mem::offset_of!(MfDesfireKeySettings, is_free_create_delete) - 2usize];
21331 ["Offset of field: MfDesfireKeySettings::is_config_changeable"]
21332 [::core::mem::offset_of!(MfDesfireKeySettings, is_config_changeable) - 3usize];
21333 ["Offset of field: MfDesfireKeySettings::change_key_id"]
21334 [::core::mem::offset_of!(MfDesfireKeySettings, change_key_id) - 4usize];
21335 ["Offset of field: MfDesfireKeySettings::max_keys"]
21336 [::core::mem::offset_of!(MfDesfireKeySettings, max_keys) - 5usize];
21337 ["Offset of field: MfDesfireKeySettings::flags"]
21338 [::core::mem::offset_of!(MfDesfireKeySettings, flags) - 6usize];
21339};
21340pub type MfDesfireKeyVersion = u8;
21341pub const MfDesfireFileTypeStandard: MfDesfireFileType = MfDesfireFileType(0);
21342pub const MfDesfireFileTypeBackup: MfDesfireFileType = MfDesfireFileType(1);
21343pub const MfDesfireFileTypeValue: MfDesfireFileType = MfDesfireFileType(2);
21344pub const MfDesfireFileTypeLinearRecord: MfDesfireFileType = MfDesfireFileType(3);
21345pub const MfDesfireFileTypeCyclicRecord: MfDesfireFileType = MfDesfireFileType(4);
21346pub const MfDesfireFileTypeTransactionMac: MfDesfireFileType = MfDesfireFileType(5);
21347#[repr(transparent)]
21348#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21349pub struct MfDesfireFileType(pub core::ffi::c_uchar);
21350pub const MfDesfireFileCommunicationSettingsPlaintext: MfDesfireFileCommunicationSettings =
21351 MfDesfireFileCommunicationSettings(0);
21352pub const MfDesfireFileCommunicationSettingsAuthenticated: MfDesfireFileCommunicationSettings =
21353 MfDesfireFileCommunicationSettings(1);
21354pub const MfDesfireFileCommunicationSettingsEnciphered: MfDesfireFileCommunicationSettings =
21355 MfDesfireFileCommunicationSettings(3);
21356#[repr(transparent)]
21357#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21358pub struct MfDesfireFileCommunicationSettings(pub core::ffi::c_uchar);
21359pub type MfDesfireFileId = u8;
21360pub type MfDesfireFileAccessRights = u16;
21361#[repr(C)]
21362#[derive(Copy, Clone)]
21363pub struct MfDesfireFileSettings {
21364 pub type_: MfDesfireFileType,
21365 pub comm: MfDesfireFileCommunicationSettings,
21366 pub access_rights: [MfDesfireFileAccessRights; 14usize],
21367 pub access_rights_len: u8,
21368 pub __bindgen_anon_1: MfDesfireFileSettings__bindgen_ty_1,
21369}
21370#[repr(C)]
21371#[derive(Copy, Clone)]
21372pub union MfDesfireFileSettings__bindgen_ty_1 {
21373 pub data: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1,
21374 pub value: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21375 pub record: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3,
21376 pub transaction_mac: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21377}
21378#[repr(C)]
21379#[derive(Debug, Copy, Clone)]
21380pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1 {
21381 pub size: u32,
21382}
21383#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21384const _: () = {
21385 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1"]
21386 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1>() - 4usize];
21387 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1"]
21388 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1>() - 4usize];
21389 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1::size"]
21390 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_1, size) - 0usize];
21391};
21392#[repr(C)]
21393#[derive(Debug, Copy, Clone)]
21394pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2 {
21395 pub lo_limit: u32,
21396 pub hi_limit: u32,
21397 pub limited_credit_value: u32,
21398 pub limited_credit_enabled: bool,
21399}
21400#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21401const _: () = {
21402 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2"]
21403 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2>() - 16usize];
21404 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2"]
21405 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2>() - 4usize];
21406 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::lo_limit"][::core::mem::offset_of!(
21407 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21408 lo_limit
21409 ) - 0usize];
21410 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::hi_limit"][::core::mem::offset_of!(
21411 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21412 hi_limit
21413 ) - 4usize];
21414 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::limited_credit_value"][::core::mem::offset_of!(
21415 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21416 limited_credit_value
21417 )
21418 - 8usize];
21419 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2::limited_credit_enabled"]
21420 [::core::mem::offset_of!(
21421 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_2,
21422 limited_credit_enabled
21423 ) - 12usize];
21424};
21425#[repr(C)]
21426#[derive(Debug, Copy, Clone)]
21427pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3 {
21428 pub size: u32,
21429 pub max: u32,
21430 pub cur: u32,
21431}
21432#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21433const _: () = {
21434 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3"]
21435 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3>() - 12usize];
21436 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3"]
21437 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3>() - 4usize];
21438 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3::size"]
21439 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3, size) - 0usize];
21440 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3::max"]
21441 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3, max) - 4usize];
21442 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3::cur"]
21443 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_3, cur) - 8usize];
21444};
21445#[repr(C)]
21446#[derive(Debug, Copy, Clone)]
21447pub struct MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4 {
21448 pub key_option: u8,
21449 pub key_version: u8,
21450 pub counter_limit: u32,
21451}
21452#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21453const _: () = {
21454 ["Size of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4"]
21455 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4>() - 8usize];
21456 ["Alignment of MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4"]
21457 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4>() - 4usize];
21458 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4::key_option"][::core::mem::offset_of!(
21459 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21460 key_option
21461 ) - 0usize];
21462 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4::key_version"][::core::mem::offset_of!(
21463 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21464 key_version
21465 ) - 1usize];
21466 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4::counter_limit"][::core::mem::offset_of!(
21467 MfDesfireFileSettings__bindgen_ty_1__bindgen_ty_4,
21468 counter_limit
21469 )
21470 - 4usize];
21471};
21472#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21473const _: () = {
21474 ["Size of MfDesfireFileSettings__bindgen_ty_1"]
21475 [::core::mem::size_of::<MfDesfireFileSettings__bindgen_ty_1>() - 16usize];
21476 ["Alignment of MfDesfireFileSettings__bindgen_ty_1"]
21477 [::core::mem::align_of::<MfDesfireFileSettings__bindgen_ty_1>() - 4usize];
21478 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::data"]
21479 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, data) - 0usize];
21480 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::value"]
21481 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, value) - 0usize];
21482 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::record"]
21483 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, record) - 0usize];
21484 ["Offset of field: MfDesfireFileSettings__bindgen_ty_1::transaction_mac"]
21485 [::core::mem::offset_of!(MfDesfireFileSettings__bindgen_ty_1, transaction_mac) - 0usize];
21486};
21487#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21488const _: () = {
21489 ["Size of MfDesfireFileSettings"][::core::mem::size_of::<MfDesfireFileSettings>() - 48usize];
21490 ["Alignment of MfDesfireFileSettings"]
21491 [::core::mem::align_of::<MfDesfireFileSettings>() - 4usize];
21492 ["Offset of field: MfDesfireFileSettings::type_"]
21493 [::core::mem::offset_of!(MfDesfireFileSettings, type_) - 0usize];
21494 ["Offset of field: MfDesfireFileSettings::comm"]
21495 [::core::mem::offset_of!(MfDesfireFileSettings, comm) - 1usize];
21496 ["Offset of field: MfDesfireFileSettings::access_rights"]
21497 [::core::mem::offset_of!(MfDesfireFileSettings, access_rights) - 2usize];
21498 ["Offset of field: MfDesfireFileSettings::access_rights_len"]
21499 [::core::mem::offset_of!(MfDesfireFileSettings, access_rights_len) - 30usize];
21500};
21501#[repr(C)]
21502#[derive(Debug, Copy, Clone)]
21503pub struct MfDesfireFileData {
21504 pub data: *mut SimpleArray,
21505}
21506#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21507const _: () = {
21508 ["Size of MfDesfireFileData"][::core::mem::size_of::<MfDesfireFileData>() - 4usize];
21509 ["Alignment of MfDesfireFileData"][::core::mem::align_of::<MfDesfireFileData>() - 4usize];
21510 ["Offset of field: MfDesfireFileData::data"]
21511 [::core::mem::offset_of!(MfDesfireFileData, data) - 0usize];
21512};
21513#[repr(C)]
21514#[derive(Debug, Copy, Clone)]
21515pub struct MfDesfireApplicationId {
21516 pub data: [u8; 3usize],
21517}
21518#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21519const _: () = {
21520 ["Size of MfDesfireApplicationId"][::core::mem::size_of::<MfDesfireApplicationId>() - 3usize];
21521 ["Alignment of MfDesfireApplicationId"]
21522 [::core::mem::align_of::<MfDesfireApplicationId>() - 1usize];
21523 ["Offset of field: MfDesfireApplicationId::data"]
21524 [::core::mem::offset_of!(MfDesfireApplicationId, data) - 0usize];
21525};
21526#[repr(C)]
21527#[derive(Debug, Copy, Clone)]
21528pub struct MfDesfireApplication {
21529 pub key_settings: MfDesfireKeySettings,
21530 pub key_versions: *mut SimpleArray,
21531 pub file_ids: *mut SimpleArray,
21532 pub file_settings: *mut SimpleArray,
21533 pub file_data: *mut SimpleArray,
21534}
21535#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21536const _: () = {
21537 ["Size of MfDesfireApplication"][::core::mem::size_of::<MfDesfireApplication>() - 24usize];
21538 ["Alignment of MfDesfireApplication"][::core::mem::align_of::<MfDesfireApplication>() - 4usize];
21539 ["Offset of field: MfDesfireApplication::key_settings"]
21540 [::core::mem::offset_of!(MfDesfireApplication, key_settings) - 0usize];
21541 ["Offset of field: MfDesfireApplication::key_versions"]
21542 [::core::mem::offset_of!(MfDesfireApplication, key_versions) - 8usize];
21543 ["Offset of field: MfDesfireApplication::file_ids"]
21544 [::core::mem::offset_of!(MfDesfireApplication, file_ids) - 12usize];
21545 ["Offset of field: MfDesfireApplication::file_settings"]
21546 [::core::mem::offset_of!(MfDesfireApplication, file_settings) - 16usize];
21547 ["Offset of field: MfDesfireApplication::file_data"]
21548 [::core::mem::offset_of!(MfDesfireApplication, file_data) - 20usize];
21549};
21550pub const MfDesfireErrorNone: MfDesfireError = MfDesfireError(0);
21551pub const MfDesfireErrorNotPresent: MfDesfireError = MfDesfireError(1);
21552pub const MfDesfireErrorProtocol: MfDesfireError = MfDesfireError(2);
21553pub const MfDesfireErrorTimeout: MfDesfireError = MfDesfireError(3);
21554pub const MfDesfireErrorAuthentication: MfDesfireError = MfDesfireError(4);
21555pub const MfDesfireErrorCommandNotSupported: MfDesfireError = MfDesfireError(5);
21556#[repr(transparent)]
21557#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21558pub struct MfDesfireError(pub core::ffi::c_uchar);
21559#[repr(C)]
21560#[derive(Debug, Copy, Clone)]
21561pub struct MfDesfireData {
21562 pub iso14443_4a_data: *mut Iso14443_4aData,
21563 pub version: MfDesfireVersion,
21564 pub free_memory: MfDesfireFreeMemory,
21565 pub master_key_settings: MfDesfireKeySettings,
21566 pub master_key_versions: *mut SimpleArray,
21567 pub application_ids: *mut SimpleArray,
21568 pub applications: *mut SimpleArray,
21569 pub device_name: *mut FuriString,
21570}
21571#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21572const _: () = {
21573 ["Size of MfDesfireData"][::core::mem::size_of::<MfDesfireData>() - 64usize];
21574 ["Alignment of MfDesfireData"][::core::mem::align_of::<MfDesfireData>() - 4usize];
21575 ["Offset of field: MfDesfireData::iso14443_4a_data"]
21576 [::core::mem::offset_of!(MfDesfireData, iso14443_4a_data) - 0usize];
21577 ["Offset of field: MfDesfireData::version"]
21578 [::core::mem::offset_of!(MfDesfireData, version) - 4usize];
21579 ["Offset of field: MfDesfireData::free_memory"]
21580 [::core::mem::offset_of!(MfDesfireData, free_memory) - 32usize];
21581 ["Offset of field: MfDesfireData::master_key_settings"]
21582 [::core::mem::offset_of!(MfDesfireData, master_key_settings) - 40usize];
21583 ["Offset of field: MfDesfireData::master_key_versions"]
21584 [::core::mem::offset_of!(MfDesfireData, master_key_versions) - 48usize];
21585 ["Offset of field: MfDesfireData::application_ids"]
21586 [::core::mem::offset_of!(MfDesfireData, application_ids) - 52usize];
21587 ["Offset of field: MfDesfireData::applications"]
21588 [::core::mem::offset_of!(MfDesfireData, applications) - 56usize];
21589 ["Offset of field: MfDesfireData::device_name"]
21590 [::core::mem::offset_of!(MfDesfireData, device_name) - 60usize];
21591};
21592unsafe extern "C" {
21593 pub fn mf_desfire_alloc() -> *mut MfDesfireData;
21594}
21595unsafe extern "C" {
21596 pub fn mf_desfire_free(data: *mut MfDesfireData);
21597}
21598unsafe extern "C" {
21599 pub fn mf_desfire_reset(data: *mut MfDesfireData);
21600}
21601unsafe extern "C" {
21602 pub fn mf_desfire_copy(data: *mut MfDesfireData, other: *const MfDesfireData);
21603}
21604unsafe extern "C" {
21605 pub fn mf_desfire_verify(data: *mut MfDesfireData, device_type: *const FuriString) -> bool;
21606}
21607unsafe extern "C" {
21608 pub fn mf_desfire_load(data: *mut MfDesfireData, ff: *mut FlipperFormat, version: u32) -> bool;
21609}
21610unsafe extern "C" {
21611 pub fn mf_desfire_save(data: *const MfDesfireData, ff: *mut FlipperFormat) -> bool;
21612}
21613unsafe extern "C" {
21614 pub fn mf_desfire_is_equal(data: *const MfDesfireData, other: *const MfDesfireData) -> bool;
21615}
21616unsafe extern "C" {
21617 pub fn mf_desfire_get_device_name(
21618 data: *const MfDesfireData,
21619 name_type: NfcDeviceNameType,
21620 ) -> *const core::ffi::c_char;
21621}
21622unsafe extern "C" {
21623 pub fn mf_desfire_get_uid(data: *const MfDesfireData, uid_len: *mut usize) -> *const u8;
21624}
21625unsafe extern "C" {
21626 pub fn mf_desfire_set_uid(data: *mut MfDesfireData, uid: *const u8, uid_len: usize) -> bool;
21627}
21628unsafe extern "C" {
21629 pub fn mf_desfire_get_base_data(data: *const MfDesfireData) -> *mut Iso14443_4aData;
21630}
21631unsafe extern "C" {
21632 pub fn mf_desfire_get_application(
21633 data: *const MfDesfireData,
21634 app_id: *const MfDesfireApplicationId,
21635 ) -> *const MfDesfireApplication;
21636}
21637unsafe extern "C" {
21638 pub fn mf_desfire_get_file_settings(
21639 data: *const MfDesfireApplication,
21640 file_id: *const MfDesfireFileId,
21641 ) -> *const MfDesfireFileSettings;
21642}
21643unsafe extern "C" {
21644 pub fn mf_desfire_get_file_data(
21645 data: *const MfDesfireApplication,
21646 file_id: *const MfDesfireFileId,
21647 ) -> *const MfDesfireFileData;
21648}
21649#[repr(C)]
21650#[derive(Debug, Copy, Clone)]
21651pub struct MfDesfirePoller {
21652 _unused: [u8; 0],
21653}
21654#[doc = "< Card was read successfully."]
21655pub const MfDesfirePollerEventTypeReadSuccess: MfDesfirePollerEventType =
21656 MfDesfirePollerEventType(0);
21657#[doc = "< Poller failed to read card."]
21658pub const MfDesfirePollerEventTypeReadFailed: MfDesfirePollerEventType =
21659 MfDesfirePollerEventType(1);
21660#[repr(transparent)]
21661#[doc = "Enumeration of possible MfDesfire poller event types."]
21662#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21663pub struct MfDesfirePollerEventType(pub core::ffi::c_uchar);
21664#[doc = "MfDesfire poller event data."]
21665#[repr(C)]
21666#[derive(Copy, Clone)]
21667pub union MfDesfirePollerEventData {
21668 #[doc = "< Error code indicating card reading fail reason."]
21669 pub error: MfDesfireError,
21670}
21671#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21672const _: () = {
21673 ["Size of MfDesfirePollerEventData"]
21674 [::core::mem::size_of::<MfDesfirePollerEventData>() - 1usize];
21675 ["Alignment of MfDesfirePollerEventData"]
21676 [::core::mem::align_of::<MfDesfirePollerEventData>() - 1usize];
21677 ["Offset of field: MfDesfirePollerEventData::error"]
21678 [::core::mem::offset_of!(MfDesfirePollerEventData, error) - 0usize];
21679};
21680#[doc = "MfDesfire poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
21681#[repr(C)]
21682#[derive(Debug, Copy, Clone)]
21683pub struct MfDesfirePollerEvent {
21684 #[doc = "< Type of emmitted event."]
21685 pub type_: MfDesfirePollerEventType,
21686 #[doc = "< Pointer to event specific data."]
21687 pub data: *mut MfDesfirePollerEventData,
21688}
21689#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21690const _: () = {
21691 ["Size of MfDesfirePollerEvent"][::core::mem::size_of::<MfDesfirePollerEvent>() - 8usize];
21692 ["Alignment of MfDesfirePollerEvent"][::core::mem::align_of::<MfDesfirePollerEvent>() - 4usize];
21693 ["Offset of field: MfDesfirePollerEvent::type_"]
21694 [::core::mem::offset_of!(MfDesfirePollerEvent, type_) - 0usize];
21695 ["Offset of field: MfDesfirePollerEvent::data"]
21696 [::core::mem::offset_of!(MfDesfirePollerEvent, data) - 4usize];
21697};
21698unsafe extern "C" {
21699 #[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."]
21700 pub fn mf_desfire_send_chunks(
21701 instance: *mut MfDesfirePoller,
21702 tx_buffer: *const BitBuffer,
21703 rx_buffer: *mut BitBuffer,
21704 ) -> MfDesfireError;
21705}
21706unsafe extern "C" {
21707 #[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."]
21708 pub fn mf_desfire_poller_read_version(
21709 instance: *mut MfDesfirePoller,
21710 data: *mut MfDesfireVersion,
21711 ) -> MfDesfireError;
21712}
21713unsafe extern "C" {
21714 #[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."]
21715 pub fn mf_desfire_poller_read_free_memory(
21716 instance: *mut MfDesfirePoller,
21717 data: *mut MfDesfireFreeMemory,
21718 ) -> MfDesfireError;
21719}
21720unsafe extern "C" {
21721 #[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."]
21722 pub fn mf_desfire_poller_read_key_settings(
21723 instance: *mut MfDesfirePoller,
21724 data: *mut MfDesfireKeySettings,
21725 ) -> MfDesfireError;
21726}
21727unsafe extern "C" {
21728 #[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."]
21729 pub fn mf_desfire_poller_read_key_version(
21730 instance: *mut MfDesfirePoller,
21731 key_num: u8,
21732 data: *mut MfDesfireKeyVersion,
21733 ) -> MfDesfireError;
21734}
21735unsafe extern "C" {
21736 #[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."]
21737 pub fn mf_desfire_poller_read_key_versions(
21738 instance: *mut MfDesfirePoller,
21739 data: *mut SimpleArray,
21740 count: u32,
21741 ) -> MfDesfireError;
21742}
21743unsafe extern "C" {
21744 #[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."]
21745 pub fn mf_desfire_poller_read_application_ids(
21746 instance: *mut MfDesfirePoller,
21747 data: *mut SimpleArray,
21748 ) -> MfDesfireError;
21749}
21750unsafe extern "C" {
21751 #[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."]
21752 pub fn mf_desfire_poller_select_application(
21753 instance: *mut MfDesfirePoller,
21754 id: *const MfDesfireApplicationId,
21755 ) -> MfDesfireError;
21756}
21757unsafe extern "C" {
21758 #[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."]
21759 pub fn mf_desfire_poller_read_file_ids(
21760 instance: *mut MfDesfirePoller,
21761 data: *mut SimpleArray,
21762 ) -> MfDesfireError;
21763}
21764unsafe extern "C" {
21765 #[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."]
21766 pub fn mf_desfire_poller_read_file_settings(
21767 instance: *mut MfDesfirePoller,
21768 id: MfDesfireFileId,
21769 data: *mut MfDesfireFileSettings,
21770 ) -> MfDesfireError;
21771}
21772unsafe extern "C" {
21773 #[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."]
21774 pub fn mf_desfire_poller_read_file_settings_multi(
21775 instance: *mut MfDesfirePoller,
21776 file_ids: *const SimpleArray,
21777 data: *mut SimpleArray,
21778 ) -> MfDesfireError;
21779}
21780unsafe extern "C" {
21781 #[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."]
21782 pub fn mf_desfire_poller_read_file_data(
21783 instance: *mut MfDesfirePoller,
21784 id: MfDesfireFileId,
21785 offset: u32,
21786 size: usize,
21787 data: *mut MfDesfireFileData,
21788 ) -> MfDesfireError;
21789}
21790unsafe extern "C" {
21791 #[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."]
21792 pub fn mf_desfire_poller_read_file_value(
21793 instance: *mut MfDesfirePoller,
21794 id: MfDesfireFileId,
21795 data: *mut MfDesfireFileData,
21796 ) -> MfDesfireError;
21797}
21798unsafe extern "C" {
21799 #[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."]
21800 pub fn mf_desfire_poller_read_file_records(
21801 instance: *mut MfDesfirePoller,
21802 id: MfDesfireFileId,
21803 offset: u32,
21804 size: usize,
21805 data: *mut MfDesfireFileData,
21806 ) -> MfDesfireError;
21807}
21808unsafe extern "C" {
21809 #[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."]
21810 pub fn mf_desfire_poller_read_file_data_multi(
21811 instance: *mut MfDesfirePoller,
21812 file_ids: *const SimpleArray,
21813 file_settings: *const SimpleArray,
21814 data: *mut SimpleArray,
21815 ) -> MfDesfireError;
21816}
21817unsafe extern "C" {
21818 #[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."]
21819 pub fn mf_desfire_poller_read_application(
21820 instance: *mut MfDesfirePoller,
21821 data: *mut MfDesfireApplication,
21822 ) -> MfDesfireError;
21823}
21824unsafe extern "C" {
21825 #[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."]
21826 pub fn mf_desfire_poller_read_applications(
21827 instance: *mut MfDesfirePoller,
21828 app_ids: *const SimpleArray,
21829 data: *mut SimpleArray,
21830 ) -> MfDesfireError;
21831}
21832pub const MfPlusErrorNone: MfPlusError = MfPlusError(0);
21833pub const MfPlusErrorUnknown: MfPlusError = MfPlusError(1);
21834pub const MfPlusErrorNotPresent: MfPlusError = MfPlusError(2);
21835pub const MfPlusErrorProtocol: MfPlusError = MfPlusError(3);
21836pub const MfPlusErrorAuth: MfPlusError = MfPlusError(4);
21837pub const MfPlusErrorPartialRead: MfPlusError = MfPlusError(5);
21838pub const MfPlusErrorTimeout: MfPlusError = MfPlusError(6);
21839#[repr(transparent)]
21840#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21841pub struct MfPlusError(pub core::ffi::c_uchar);
21842pub const MfPlusTypePlus: MfPlusType = MfPlusType(0);
21843pub const MfPlusTypeEV1: MfPlusType = MfPlusType(1);
21844pub const MfPlusTypeEV2: MfPlusType = MfPlusType(2);
21845pub const MfPlusTypeS: MfPlusType = MfPlusType(3);
21846pub const MfPlusTypeSE: MfPlusType = MfPlusType(4);
21847pub const MfPlusTypeX: MfPlusType = MfPlusType(5);
21848pub const MfPlusTypeUnknown: MfPlusType = MfPlusType(6);
21849pub const MfPlusTypeNum: MfPlusType = MfPlusType(7);
21850#[repr(transparent)]
21851#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21852pub struct MfPlusType(pub core::ffi::c_uchar);
21853pub const MfPlusSize1K: MfPlusSize = MfPlusSize(0);
21854pub const MfPlusSize2K: MfPlusSize = MfPlusSize(1);
21855pub const MfPlusSize4K: MfPlusSize = MfPlusSize(2);
21856pub const MfPlusSizeUnknown: MfPlusSize = MfPlusSize(3);
21857pub const MfPlusSizeNum: MfPlusSize = MfPlusSize(4);
21858#[repr(transparent)]
21859#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21860pub struct MfPlusSize(pub core::ffi::c_uchar);
21861pub const MfPlusSecurityLevel0: MfPlusSecurityLevel = MfPlusSecurityLevel(0);
21862pub const MfPlusSecurityLevel1: MfPlusSecurityLevel = MfPlusSecurityLevel(1);
21863pub const MfPlusSecurityLevel2: MfPlusSecurityLevel = MfPlusSecurityLevel(2);
21864pub const MfPlusSecurityLevel3: MfPlusSecurityLevel = MfPlusSecurityLevel(3);
21865pub const MfPlusSecurityLevelUnknown: MfPlusSecurityLevel = MfPlusSecurityLevel(4);
21866pub const MfPlusSecurityLevelNum: MfPlusSecurityLevel = MfPlusSecurityLevel(5);
21867#[repr(transparent)]
21868#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21869pub struct MfPlusSecurityLevel(pub core::ffi::c_uchar);
21870#[repr(C)]
21871#[derive(Debug, Copy, Clone)]
21872pub struct MfPlusVersion {
21873 pub hw_vendor: u8,
21874 pub hw_type: u8,
21875 pub hw_subtype: u8,
21876 pub hw_major: u8,
21877 pub hw_minor: u8,
21878 pub hw_storage: u8,
21879 pub hw_proto: u8,
21880 pub sw_vendor: u8,
21881 pub sw_type: u8,
21882 pub sw_subtype: u8,
21883 pub sw_major: u8,
21884 pub sw_minor: u8,
21885 pub sw_storage: u8,
21886 pub sw_proto: u8,
21887 pub uid: [u8; 7usize],
21888 pub batch: [u8; 5usize],
21889 pub prod_week: u8,
21890 pub prod_year: u8,
21891}
21892#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21893const _: () = {
21894 ["Size of MfPlusVersion"][::core::mem::size_of::<MfPlusVersion>() - 28usize];
21895 ["Alignment of MfPlusVersion"][::core::mem::align_of::<MfPlusVersion>() - 1usize];
21896 ["Offset of field: MfPlusVersion::hw_vendor"]
21897 [::core::mem::offset_of!(MfPlusVersion, hw_vendor) - 0usize];
21898 ["Offset of field: MfPlusVersion::hw_type"]
21899 [::core::mem::offset_of!(MfPlusVersion, hw_type) - 1usize];
21900 ["Offset of field: MfPlusVersion::hw_subtype"]
21901 [::core::mem::offset_of!(MfPlusVersion, hw_subtype) - 2usize];
21902 ["Offset of field: MfPlusVersion::hw_major"]
21903 [::core::mem::offset_of!(MfPlusVersion, hw_major) - 3usize];
21904 ["Offset of field: MfPlusVersion::hw_minor"]
21905 [::core::mem::offset_of!(MfPlusVersion, hw_minor) - 4usize];
21906 ["Offset of field: MfPlusVersion::hw_storage"]
21907 [::core::mem::offset_of!(MfPlusVersion, hw_storage) - 5usize];
21908 ["Offset of field: MfPlusVersion::hw_proto"]
21909 [::core::mem::offset_of!(MfPlusVersion, hw_proto) - 6usize];
21910 ["Offset of field: MfPlusVersion::sw_vendor"]
21911 [::core::mem::offset_of!(MfPlusVersion, sw_vendor) - 7usize];
21912 ["Offset of field: MfPlusVersion::sw_type"]
21913 [::core::mem::offset_of!(MfPlusVersion, sw_type) - 8usize];
21914 ["Offset of field: MfPlusVersion::sw_subtype"]
21915 [::core::mem::offset_of!(MfPlusVersion, sw_subtype) - 9usize];
21916 ["Offset of field: MfPlusVersion::sw_major"]
21917 [::core::mem::offset_of!(MfPlusVersion, sw_major) - 10usize];
21918 ["Offset of field: MfPlusVersion::sw_minor"]
21919 [::core::mem::offset_of!(MfPlusVersion, sw_minor) - 11usize];
21920 ["Offset of field: MfPlusVersion::sw_storage"]
21921 [::core::mem::offset_of!(MfPlusVersion, sw_storage) - 12usize];
21922 ["Offset of field: MfPlusVersion::sw_proto"]
21923 [::core::mem::offset_of!(MfPlusVersion, sw_proto) - 13usize];
21924 ["Offset of field: MfPlusVersion::uid"][::core::mem::offset_of!(MfPlusVersion, uid) - 14usize];
21925 ["Offset of field: MfPlusVersion::batch"]
21926 [::core::mem::offset_of!(MfPlusVersion, batch) - 21usize];
21927 ["Offset of field: MfPlusVersion::prod_week"]
21928 [::core::mem::offset_of!(MfPlusVersion, prod_week) - 26usize];
21929 ["Offset of field: MfPlusVersion::prod_year"]
21930 [::core::mem::offset_of!(MfPlusVersion, prod_year) - 27usize];
21931};
21932#[repr(C)]
21933#[derive(Debug, Copy, Clone)]
21934pub struct MfPlusData {
21935 pub iso14443_4a_data: *mut Iso14443_4aData,
21936 pub version: MfPlusVersion,
21937 pub type_: MfPlusType,
21938 pub size: MfPlusSize,
21939 pub security_level: MfPlusSecurityLevel,
21940 pub device_name: *mut FuriString,
21941}
21942#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21943const _: () = {
21944 ["Size of MfPlusData"][::core::mem::size_of::<MfPlusData>() - 40usize];
21945 ["Alignment of MfPlusData"][::core::mem::align_of::<MfPlusData>() - 4usize];
21946 ["Offset of field: MfPlusData::iso14443_4a_data"]
21947 [::core::mem::offset_of!(MfPlusData, iso14443_4a_data) - 0usize];
21948 ["Offset of field: MfPlusData::version"][::core::mem::offset_of!(MfPlusData, version) - 4usize];
21949 ["Offset of field: MfPlusData::type_"][::core::mem::offset_of!(MfPlusData, type_) - 32usize];
21950 ["Offset of field: MfPlusData::size"][::core::mem::offset_of!(MfPlusData, size) - 33usize];
21951 ["Offset of field: MfPlusData::security_level"]
21952 [::core::mem::offset_of!(MfPlusData, security_level) - 34usize];
21953 ["Offset of field: MfPlusData::device_name"]
21954 [::core::mem::offset_of!(MfPlusData, device_name) - 36usize];
21955};
21956unsafe extern "C" {
21957 pub fn mf_plus_alloc() -> *mut MfPlusData;
21958}
21959unsafe extern "C" {
21960 pub fn mf_plus_free(data: *mut MfPlusData);
21961}
21962unsafe extern "C" {
21963 pub fn mf_plus_reset(data: *mut MfPlusData);
21964}
21965unsafe extern "C" {
21966 pub fn mf_plus_copy(data: *mut MfPlusData, other: *const MfPlusData);
21967}
21968unsafe extern "C" {
21969 pub fn mf_plus_verify(data: *mut MfPlusData, device_type: *const FuriString) -> bool;
21970}
21971unsafe extern "C" {
21972 pub fn mf_plus_load(data: *mut MfPlusData, ff: *mut FlipperFormat, version: u32) -> bool;
21973}
21974unsafe extern "C" {
21975 pub fn mf_plus_save(data: *const MfPlusData, ff: *mut FlipperFormat) -> bool;
21976}
21977unsafe extern "C" {
21978 pub fn mf_plus_is_equal(data: *const MfPlusData, other: *const MfPlusData) -> bool;
21979}
21980unsafe extern "C" {
21981 pub fn mf_plus_get_device_name(
21982 data: *const MfPlusData,
21983 name_type: NfcDeviceNameType,
21984 ) -> *const core::ffi::c_char;
21985}
21986unsafe extern "C" {
21987 pub fn mf_plus_get_uid(data: *const MfPlusData, uid_len: *mut usize) -> *const u8;
21988}
21989unsafe extern "C" {
21990 pub fn mf_plus_set_uid(data: *mut MfPlusData, uid: *const u8, uid_len: usize) -> bool;
21991}
21992unsafe extern "C" {
21993 pub fn mf_plus_get_base_data(data: *const MfPlusData) -> *mut Iso14443_4aData;
21994}
21995#[repr(C)]
21996#[derive(Debug, Copy, Clone)]
21997pub struct MfPlusPoller {
21998 _unused: [u8; 0],
21999}
22000#[doc = "< Card was read successfully."]
22001pub const MfPlusPollerEventTypeReadSuccess: MfPlusPollerEventType = MfPlusPollerEventType(0);
22002#[doc = "< Poller failed to read the card."]
22003pub const MfPlusPollerEventTypeReadFailed: MfPlusPollerEventType = MfPlusPollerEventType(1);
22004#[repr(transparent)]
22005#[doc = "Enumeration of possible MfPlus poller event types."]
22006#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22007pub struct MfPlusPollerEventType(pub core::ffi::c_uchar);
22008#[doc = "MIFARE Plus poller event data."]
22009#[repr(C)]
22010#[derive(Copy, Clone)]
22011pub union MfPlusPollerEventData {
22012 #[doc = "< Error code indicating card reading fail reason."]
22013 pub error: MfPlusError,
22014}
22015#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22016const _: () = {
22017 ["Size of MfPlusPollerEventData"][::core::mem::size_of::<MfPlusPollerEventData>() - 1usize];
22018 ["Alignment of MfPlusPollerEventData"]
22019 [::core::mem::align_of::<MfPlusPollerEventData>() - 1usize];
22020 ["Offset of field: MfPlusPollerEventData::error"]
22021 [::core::mem::offset_of!(MfPlusPollerEventData, error) - 0usize];
22022};
22023#[doc = "MIFARE Plus poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
22024#[repr(C)]
22025#[derive(Debug, Copy, Clone)]
22026pub struct MfPlusPollerEvent {
22027 #[doc = "< Type of emitted event."]
22028 pub type_: MfPlusPollerEventType,
22029 #[doc = "< Pointer to event specific data."]
22030 pub data: *mut MfPlusPollerEventData,
22031}
22032#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22033const _: () = {
22034 ["Size of MfPlusPollerEvent"][::core::mem::size_of::<MfPlusPollerEvent>() - 8usize];
22035 ["Alignment of MfPlusPollerEvent"][::core::mem::align_of::<MfPlusPollerEvent>() - 4usize];
22036 ["Offset of field: MfPlusPollerEvent::type_"]
22037 [::core::mem::offset_of!(MfPlusPollerEvent, type_) - 0usize];
22038 ["Offset of field: MfPlusPollerEvent::data"]
22039 [::core::mem::offset_of!(MfPlusPollerEvent, data) - 4usize];
22040};
22041unsafe extern "C" {
22042 #[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."]
22043 pub fn mf_plus_poller_read_version(
22044 instance: *mut MfPlusPoller,
22045 data: *mut MfPlusVersion,
22046 ) -> MfPlusError;
22047}
22048pub const MfUltralightErrorNone: MfUltralightError = MfUltralightError(0);
22049pub const MfUltralightErrorNotPresent: MfUltralightError = MfUltralightError(1);
22050pub const MfUltralightErrorProtocol: MfUltralightError = MfUltralightError(2);
22051pub const MfUltralightErrorAuth: MfUltralightError = MfUltralightError(3);
22052pub const MfUltralightErrorTimeout: MfUltralightError = MfUltralightError(4);
22053#[repr(transparent)]
22054#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22055pub struct MfUltralightError(pub core::ffi::c_uchar);
22056pub const MfUltralightTypeOrigin: MfUltralightType = MfUltralightType(0);
22057pub const MfUltralightTypeNTAG203: MfUltralightType = MfUltralightType(1);
22058pub const MfUltralightTypeMfulC: MfUltralightType = MfUltralightType(2);
22059pub const MfUltralightTypeUL11: MfUltralightType = MfUltralightType(3);
22060pub const MfUltralightTypeUL21: MfUltralightType = MfUltralightType(4);
22061pub const MfUltralightTypeNTAG213: MfUltralightType = MfUltralightType(5);
22062pub const MfUltralightTypeNTAG215: MfUltralightType = MfUltralightType(6);
22063pub const MfUltralightTypeNTAG216: MfUltralightType = MfUltralightType(7);
22064pub const MfUltralightTypeNTAGI2C1K: MfUltralightType = MfUltralightType(8);
22065pub const MfUltralightTypeNTAGI2C2K: MfUltralightType = MfUltralightType(9);
22066pub const MfUltralightTypeNTAGI2CPlus1K: MfUltralightType = MfUltralightType(10);
22067pub const MfUltralightTypeNTAGI2CPlus2K: MfUltralightType = MfUltralightType(11);
22068pub const MfUltralightTypeNum: MfUltralightType = MfUltralightType(12);
22069#[repr(transparent)]
22070#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22071pub struct MfUltralightType(pub core::ffi::c_uchar);
22072pub const MfUltralightFeatureSupportReadVersion: MfUltralightFeatureSupport =
22073 MfUltralightFeatureSupport(1);
22074pub const MfUltralightFeatureSupportReadSignature: MfUltralightFeatureSupport =
22075 MfUltralightFeatureSupport(2);
22076pub const MfUltralightFeatureSupportReadCounter: MfUltralightFeatureSupport =
22077 MfUltralightFeatureSupport(4);
22078pub const MfUltralightFeatureSupportCheckTearingFlag: MfUltralightFeatureSupport =
22079 MfUltralightFeatureSupport(8);
22080pub const MfUltralightFeatureSupportFastRead: MfUltralightFeatureSupport =
22081 MfUltralightFeatureSupport(16);
22082pub const MfUltralightFeatureSupportIncCounter: MfUltralightFeatureSupport =
22083 MfUltralightFeatureSupport(32);
22084pub const MfUltralightFeatureSupportFastWrite: MfUltralightFeatureSupport =
22085 MfUltralightFeatureSupport(64);
22086pub const MfUltralightFeatureSupportCompatibleWrite: MfUltralightFeatureSupport =
22087 MfUltralightFeatureSupport(128);
22088pub const MfUltralightFeatureSupportPasswordAuth: MfUltralightFeatureSupport =
22089 MfUltralightFeatureSupport(256);
22090pub const MfUltralightFeatureSupportVcsl: MfUltralightFeatureSupport =
22091 MfUltralightFeatureSupport(512);
22092pub const MfUltralightFeatureSupportSectorSelect: MfUltralightFeatureSupport =
22093 MfUltralightFeatureSupport(1024);
22094pub const MfUltralightFeatureSupportSingleCounter: MfUltralightFeatureSupport =
22095 MfUltralightFeatureSupport(2048);
22096pub const MfUltralightFeatureSupportAsciiMirror: MfUltralightFeatureSupport =
22097 MfUltralightFeatureSupport(4096);
22098pub const MfUltralightFeatureSupportCounterInMemory: MfUltralightFeatureSupport =
22099 MfUltralightFeatureSupport(8192);
22100pub const MfUltralightFeatureSupportDynamicLock: MfUltralightFeatureSupport =
22101 MfUltralightFeatureSupport(16384);
22102pub const MfUltralightFeatureSupportAuthenticate: MfUltralightFeatureSupport =
22103 MfUltralightFeatureSupport(32768);
22104#[repr(transparent)]
22105#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22106pub struct MfUltralightFeatureSupport(pub core::ffi::c_ushort);
22107#[repr(C)]
22108#[derive(Debug, Copy, Clone)]
22109pub struct MfUltralightPage {
22110 pub data: [u8; 4usize],
22111}
22112#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22113const _: () = {
22114 ["Size of MfUltralightPage"][::core::mem::size_of::<MfUltralightPage>() - 4usize];
22115 ["Alignment of MfUltralightPage"][::core::mem::align_of::<MfUltralightPage>() - 1usize];
22116 ["Offset of field: MfUltralightPage::data"]
22117 [::core::mem::offset_of!(MfUltralightPage, data) - 0usize];
22118};
22119#[repr(C)]
22120#[derive(Debug, Copy, Clone)]
22121pub struct MfUltralightPageReadCommandData {
22122 pub page: [MfUltralightPage; 4usize],
22123}
22124#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22125const _: () = {
22126 ["Size of MfUltralightPageReadCommandData"]
22127 [::core::mem::size_of::<MfUltralightPageReadCommandData>() - 16usize];
22128 ["Alignment of MfUltralightPageReadCommandData"]
22129 [::core::mem::align_of::<MfUltralightPageReadCommandData>() - 1usize];
22130 ["Offset of field: MfUltralightPageReadCommandData::page"]
22131 [::core::mem::offset_of!(MfUltralightPageReadCommandData, page) - 0usize];
22132};
22133#[repr(C)]
22134#[derive(Debug, Copy, Clone)]
22135pub struct MfUltralightVersion {
22136 pub header: u8,
22137 pub vendor_id: u8,
22138 pub prod_type: u8,
22139 pub prod_subtype: u8,
22140 pub prod_ver_major: u8,
22141 pub prod_ver_minor: u8,
22142 pub storage_size: u8,
22143 pub protocol_type: u8,
22144}
22145#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22146const _: () = {
22147 ["Size of MfUltralightVersion"][::core::mem::size_of::<MfUltralightVersion>() - 8usize];
22148 ["Alignment of MfUltralightVersion"][::core::mem::align_of::<MfUltralightVersion>() - 1usize];
22149 ["Offset of field: MfUltralightVersion::header"]
22150 [::core::mem::offset_of!(MfUltralightVersion, header) - 0usize];
22151 ["Offset of field: MfUltralightVersion::vendor_id"]
22152 [::core::mem::offset_of!(MfUltralightVersion, vendor_id) - 1usize];
22153 ["Offset of field: MfUltralightVersion::prod_type"]
22154 [::core::mem::offset_of!(MfUltralightVersion, prod_type) - 2usize];
22155 ["Offset of field: MfUltralightVersion::prod_subtype"]
22156 [::core::mem::offset_of!(MfUltralightVersion, prod_subtype) - 3usize];
22157 ["Offset of field: MfUltralightVersion::prod_ver_major"]
22158 [::core::mem::offset_of!(MfUltralightVersion, prod_ver_major) - 4usize];
22159 ["Offset of field: MfUltralightVersion::prod_ver_minor"]
22160 [::core::mem::offset_of!(MfUltralightVersion, prod_ver_minor) - 5usize];
22161 ["Offset of field: MfUltralightVersion::storage_size"]
22162 [::core::mem::offset_of!(MfUltralightVersion, storage_size) - 6usize];
22163 ["Offset of field: MfUltralightVersion::protocol_type"]
22164 [::core::mem::offset_of!(MfUltralightVersion, protocol_type) - 7usize];
22165};
22166#[repr(C)]
22167#[derive(Debug, Copy, Clone)]
22168pub struct MfUltralightSignature {
22169 pub data: [u8; 32usize],
22170}
22171#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22172const _: () = {
22173 ["Size of MfUltralightSignature"][::core::mem::size_of::<MfUltralightSignature>() - 32usize];
22174 ["Alignment of MfUltralightSignature"]
22175 [::core::mem::align_of::<MfUltralightSignature>() - 1usize];
22176 ["Offset of field: MfUltralightSignature::data"]
22177 [::core::mem::offset_of!(MfUltralightSignature, data) - 0usize];
22178};
22179#[repr(C)]
22180#[derive(Copy, Clone)]
22181pub union MfUltralightCounter {
22182 pub counter: u32,
22183 pub data: [u8; 3usize],
22184}
22185#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22186const _: () = {
22187 ["Size of MfUltralightCounter"][::core::mem::size_of::<MfUltralightCounter>() - 4usize];
22188 ["Alignment of MfUltralightCounter"][::core::mem::align_of::<MfUltralightCounter>() - 4usize];
22189 ["Offset of field: MfUltralightCounter::counter"]
22190 [::core::mem::offset_of!(MfUltralightCounter, counter) - 0usize];
22191 ["Offset of field: MfUltralightCounter::data"]
22192 [::core::mem::offset_of!(MfUltralightCounter, data) - 0usize];
22193};
22194#[repr(C)]
22195#[derive(Debug, Copy, Clone)]
22196pub struct MfUltralightTearingFlag {
22197 pub data: u8,
22198}
22199#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22200const _: () = {
22201 ["Size of MfUltralightTearingFlag"][::core::mem::size_of::<MfUltralightTearingFlag>() - 1usize];
22202 ["Alignment of MfUltralightTearingFlag"]
22203 [::core::mem::align_of::<MfUltralightTearingFlag>() - 1usize];
22204 ["Offset of field: MfUltralightTearingFlag::data"]
22205 [::core::mem::offset_of!(MfUltralightTearingFlag, data) - 0usize];
22206};
22207#[repr(C)]
22208#[derive(Debug, Copy, Clone)]
22209pub struct MfUltralightAuthPassword {
22210 pub data: [u8; 4usize],
22211}
22212#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22213const _: () = {
22214 ["Size of MfUltralightAuthPassword"]
22215 [::core::mem::size_of::<MfUltralightAuthPassword>() - 4usize];
22216 ["Alignment of MfUltralightAuthPassword"]
22217 [::core::mem::align_of::<MfUltralightAuthPassword>() - 1usize];
22218 ["Offset of field: MfUltralightAuthPassword::data"]
22219 [::core::mem::offset_of!(MfUltralightAuthPassword, data) - 0usize];
22220};
22221#[repr(C)]
22222#[derive(Debug, Copy, Clone)]
22223pub struct MfUltralightC3DesAuthKey {
22224 pub data: [u8; 16usize],
22225}
22226#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22227const _: () = {
22228 ["Size of MfUltralightC3DesAuthKey"]
22229 [::core::mem::size_of::<MfUltralightC3DesAuthKey>() - 16usize];
22230 ["Alignment of MfUltralightC3DesAuthKey"]
22231 [::core::mem::align_of::<MfUltralightC3DesAuthKey>() - 1usize];
22232 ["Offset of field: MfUltralightC3DesAuthKey::data"]
22233 [::core::mem::offset_of!(MfUltralightC3DesAuthKey, data) - 0usize];
22234};
22235#[repr(C)]
22236#[derive(Debug, Copy, Clone)]
22237pub struct MfUltralightAuthPack {
22238 pub data: [u8; 2usize],
22239}
22240#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22241const _: () = {
22242 ["Size of MfUltralightAuthPack"][::core::mem::size_of::<MfUltralightAuthPack>() - 2usize];
22243 ["Alignment of MfUltralightAuthPack"][::core::mem::align_of::<MfUltralightAuthPack>() - 1usize];
22244 ["Offset of field: MfUltralightAuthPack::data"]
22245 [::core::mem::offset_of!(MfUltralightAuthPack, data) - 0usize];
22246};
22247pub const MfUltralightMirrorNone: MfUltralightMirrorConf = MfUltralightMirrorConf(0);
22248pub const MfUltralightMirrorUid: MfUltralightMirrorConf = MfUltralightMirrorConf(1);
22249pub const MfUltralightMirrorCounter: MfUltralightMirrorConf = MfUltralightMirrorConf(2);
22250pub const MfUltralightMirrorUidCounter: MfUltralightMirrorConf = MfUltralightMirrorConf(3);
22251#[repr(transparent)]
22252#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22253pub struct MfUltralightMirrorConf(pub core::ffi::c_uchar);
22254#[repr(C, packed)]
22255#[derive(Copy, Clone)]
22256pub struct MfUltralightConfigPages {
22257 pub mirror: MfUltralightConfigPages__bindgen_ty_1,
22258 pub rfui1: u8,
22259 pub mirror_page: u8,
22260 pub auth0: u8,
22261 pub access: MfUltralightConfigPages__bindgen_ty_2,
22262 pub vctid: u8,
22263 pub rfui2: [u8; 2usize],
22264 pub password: MfUltralightAuthPassword,
22265 pub pack: MfUltralightAuthPack,
22266 pub rfui3: [u8; 2usize],
22267}
22268#[repr(C)]
22269#[derive(Copy, Clone)]
22270pub union MfUltralightConfigPages__bindgen_ty_1 {
22271 pub value: u8,
22272 pub __bindgen_anon_1: MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1,
22273}
22274#[repr(C)]
22275#[derive(Debug, Copy, Clone)]
22276pub struct MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1 {
22277 pub _bitfield_align_1: [u8; 0],
22278 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
22279}
22280#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22281const _: () = {
22282 ["Size of MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1"]
22283 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1>() - 1usize];
22284 ["Alignment of MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1"]
22285 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1>() - 1usize];
22286};
22287impl MfUltralightConfigPages__bindgen_ty_1__bindgen_ty_1 {
22288 #[inline]
22289 pub fn rfui1(&self) -> u8 {
22290 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
22291 }
22292 #[inline]
22293 pub fn set_rfui1(&mut self, val: u8) {
22294 unsafe {
22295 let val: u8 = ::core::mem::transmute(val);
22296 self._bitfield_1.set(0usize, 2u8, val as u64)
22297 }
22298 }
22299 #[inline]
22300 pub unsafe fn rfui1_raw(this: *const Self) -> u8 {
22301 unsafe {
22302 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22303 ::core::ptr::addr_of!((*this)._bitfield_1),
22304 0usize,
22305 2u8,
22306 ) as u8)
22307 }
22308 }
22309 #[inline]
22310 pub unsafe fn set_rfui1_raw(this: *mut Self, val: u8) {
22311 unsafe {
22312 let val: u8 = ::core::mem::transmute(val);
22313 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22314 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22315 0usize,
22316 2u8,
22317 val as u64,
22318 )
22319 }
22320 }
22321 #[inline]
22322 pub fn strg_mod_en(&self) -> bool {
22323 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
22324 }
22325 #[inline]
22326 pub fn set_strg_mod_en(&mut self, val: bool) {
22327 unsafe {
22328 let val: u8 = ::core::mem::transmute(val);
22329 self._bitfield_1.set(2usize, 1u8, val as u64)
22330 }
22331 }
22332 #[inline]
22333 pub unsafe fn strg_mod_en_raw(this: *const Self) -> bool {
22334 unsafe {
22335 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22336 ::core::ptr::addr_of!((*this)._bitfield_1),
22337 2usize,
22338 1u8,
22339 ) as u8)
22340 }
22341 }
22342 #[inline]
22343 pub unsafe fn set_strg_mod_en_raw(this: *mut Self, val: bool) {
22344 unsafe {
22345 let val: u8 = ::core::mem::transmute(val);
22346 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22347 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22348 2usize,
22349 1u8,
22350 val as u64,
22351 )
22352 }
22353 }
22354 #[inline]
22355 pub fn rfui2(&self) -> bool {
22356 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
22357 }
22358 #[inline]
22359 pub fn set_rfui2(&mut self, val: bool) {
22360 unsafe {
22361 let val: u8 = ::core::mem::transmute(val);
22362 self._bitfield_1.set(3usize, 1u8, val as u64)
22363 }
22364 }
22365 #[inline]
22366 pub unsafe fn rfui2_raw(this: *const Self) -> bool {
22367 unsafe {
22368 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22369 ::core::ptr::addr_of!((*this)._bitfield_1),
22370 3usize,
22371 1u8,
22372 ) as u8)
22373 }
22374 }
22375 #[inline]
22376 pub unsafe fn set_rfui2_raw(this: *mut Self, val: bool) {
22377 unsafe {
22378 let val: u8 = ::core::mem::transmute(val);
22379 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22380 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22381 3usize,
22382 1u8,
22383 val as u64,
22384 )
22385 }
22386 }
22387 #[inline]
22388 pub fn mirror_byte(&self) -> u8 {
22389 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) }
22390 }
22391 #[inline]
22392 pub fn set_mirror_byte(&mut self, val: u8) {
22393 unsafe {
22394 let val: u8 = ::core::mem::transmute(val);
22395 self._bitfield_1.set(4usize, 2u8, val as u64)
22396 }
22397 }
22398 #[inline]
22399 pub unsafe fn mirror_byte_raw(this: *const Self) -> u8 {
22400 unsafe {
22401 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22402 ::core::ptr::addr_of!((*this)._bitfield_1),
22403 4usize,
22404 2u8,
22405 ) as u8)
22406 }
22407 }
22408 #[inline]
22409 pub unsafe fn set_mirror_byte_raw(this: *mut Self, val: u8) {
22410 unsafe {
22411 let val: u8 = ::core::mem::transmute(val);
22412 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22413 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22414 4usize,
22415 2u8,
22416 val as u64,
22417 )
22418 }
22419 }
22420 #[inline]
22421 pub fn mirror_conf(&self) -> MfUltralightMirrorConf {
22422 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u8) }
22423 }
22424 #[inline]
22425 pub fn set_mirror_conf(&mut self, val: MfUltralightMirrorConf) {
22426 unsafe {
22427 let val: u8 = ::core::mem::transmute(val);
22428 self._bitfield_1.set(6usize, 2u8, val as u64)
22429 }
22430 }
22431 #[inline]
22432 pub unsafe fn mirror_conf_raw(this: *const Self) -> MfUltralightMirrorConf {
22433 unsafe {
22434 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22435 ::core::ptr::addr_of!((*this)._bitfield_1),
22436 6usize,
22437 2u8,
22438 ) as u8)
22439 }
22440 }
22441 #[inline]
22442 pub unsafe fn set_mirror_conf_raw(this: *mut Self, val: MfUltralightMirrorConf) {
22443 unsafe {
22444 let val: u8 = ::core::mem::transmute(val);
22445 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22446 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22447 6usize,
22448 2u8,
22449 val as u64,
22450 )
22451 }
22452 }
22453 #[inline]
22454 pub fn new_bitfield_1(
22455 rfui1: u8,
22456 strg_mod_en: bool,
22457 rfui2: bool,
22458 mirror_byte: u8,
22459 mirror_conf: MfUltralightMirrorConf,
22460 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
22461 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
22462 __bindgen_bitfield_unit.set(0usize, 2u8, {
22463 let rfui1: u8 = unsafe { ::core::mem::transmute(rfui1) };
22464 rfui1 as u64
22465 });
22466 __bindgen_bitfield_unit.set(2usize, 1u8, {
22467 let strg_mod_en: u8 = unsafe { ::core::mem::transmute(strg_mod_en) };
22468 strg_mod_en as u64
22469 });
22470 __bindgen_bitfield_unit.set(3usize, 1u8, {
22471 let rfui2: u8 = unsafe { ::core::mem::transmute(rfui2) };
22472 rfui2 as u64
22473 });
22474 __bindgen_bitfield_unit.set(4usize, 2u8, {
22475 let mirror_byte: u8 = unsafe { ::core::mem::transmute(mirror_byte) };
22476 mirror_byte as u64
22477 });
22478 __bindgen_bitfield_unit.set(6usize, 2u8, {
22479 let mirror_conf: u8 = unsafe { ::core::mem::transmute(mirror_conf) };
22480 mirror_conf as u64
22481 });
22482 __bindgen_bitfield_unit
22483 }
22484}
22485#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22486const _: () = {
22487 ["Size of MfUltralightConfigPages__bindgen_ty_1"]
22488 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_1>() - 1usize];
22489 ["Alignment of MfUltralightConfigPages__bindgen_ty_1"]
22490 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_1>() - 1usize];
22491 ["Offset of field: MfUltralightConfigPages__bindgen_ty_1::value"]
22492 [::core::mem::offset_of!(MfUltralightConfigPages__bindgen_ty_1, value) - 0usize];
22493};
22494#[repr(C)]
22495#[derive(Copy, Clone)]
22496pub union MfUltralightConfigPages__bindgen_ty_2 {
22497 pub value: u8,
22498 pub __bindgen_anon_1: MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1,
22499}
22500#[repr(C)]
22501#[derive(Debug, Copy, Clone)]
22502pub struct MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1 {
22503 pub _bitfield_align_1: [u8; 0],
22504 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
22505}
22506#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22507const _: () = {
22508 ["Size of MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1"]
22509 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1>() - 1usize];
22510 ["Alignment of MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1"]
22511 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1>() - 1usize];
22512};
22513impl MfUltralightConfigPages__bindgen_ty_2__bindgen_ty_1 {
22514 #[inline]
22515 pub fn authlim(&self) -> u8 {
22516 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) }
22517 }
22518 #[inline]
22519 pub fn set_authlim(&mut self, val: u8) {
22520 unsafe {
22521 let val: u8 = ::core::mem::transmute(val);
22522 self._bitfield_1.set(0usize, 3u8, val as u64)
22523 }
22524 }
22525 #[inline]
22526 pub unsafe fn authlim_raw(this: *const Self) -> u8 {
22527 unsafe {
22528 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22529 ::core::ptr::addr_of!((*this)._bitfield_1),
22530 0usize,
22531 3u8,
22532 ) as u8)
22533 }
22534 }
22535 #[inline]
22536 pub unsafe fn set_authlim_raw(this: *mut Self, val: u8) {
22537 unsafe {
22538 let val: u8 = ::core::mem::transmute(val);
22539 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22540 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22541 0usize,
22542 3u8,
22543 val as u64,
22544 )
22545 }
22546 }
22547 #[inline]
22548 pub fn nfc_cnt_pwd_prot(&self) -> bool {
22549 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
22550 }
22551 #[inline]
22552 pub fn set_nfc_cnt_pwd_prot(&mut self, val: bool) {
22553 unsafe {
22554 let val: u8 = ::core::mem::transmute(val);
22555 self._bitfield_1.set(3usize, 1u8, val as u64)
22556 }
22557 }
22558 #[inline]
22559 pub unsafe fn nfc_cnt_pwd_prot_raw(this: *const Self) -> bool {
22560 unsafe {
22561 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22562 ::core::ptr::addr_of!((*this)._bitfield_1),
22563 3usize,
22564 1u8,
22565 ) as u8)
22566 }
22567 }
22568 #[inline]
22569 pub unsafe fn set_nfc_cnt_pwd_prot_raw(this: *mut Self, val: bool) {
22570 unsafe {
22571 let val: u8 = ::core::mem::transmute(val);
22572 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22573 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22574 3usize,
22575 1u8,
22576 val as u64,
22577 )
22578 }
22579 }
22580 #[inline]
22581 pub fn nfc_cnt_en(&self) -> bool {
22582 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
22583 }
22584 #[inline]
22585 pub fn set_nfc_cnt_en(&mut self, val: bool) {
22586 unsafe {
22587 let val: u8 = ::core::mem::transmute(val);
22588 self._bitfield_1.set(4usize, 1u8, val as u64)
22589 }
22590 }
22591 #[inline]
22592 pub unsafe fn nfc_cnt_en_raw(this: *const Self) -> bool {
22593 unsafe {
22594 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22595 ::core::ptr::addr_of!((*this)._bitfield_1),
22596 4usize,
22597 1u8,
22598 ) as u8)
22599 }
22600 }
22601 #[inline]
22602 pub unsafe fn set_nfc_cnt_en_raw(this: *mut Self, val: bool) {
22603 unsafe {
22604 let val: u8 = ::core::mem::transmute(val);
22605 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22606 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22607 4usize,
22608 1u8,
22609 val as u64,
22610 )
22611 }
22612 }
22613 #[inline]
22614 pub fn nfc_dis_sec1(&self) -> bool {
22615 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) }
22616 }
22617 #[inline]
22618 pub fn set_nfc_dis_sec1(&mut self, val: bool) {
22619 unsafe {
22620 let val: u8 = ::core::mem::transmute(val);
22621 self._bitfield_1.set(5usize, 1u8, val as u64)
22622 }
22623 }
22624 #[inline]
22625 pub unsafe fn nfc_dis_sec1_raw(this: *const Self) -> bool {
22626 unsafe {
22627 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22628 ::core::ptr::addr_of!((*this)._bitfield_1),
22629 5usize,
22630 1u8,
22631 ) as u8)
22632 }
22633 }
22634 #[inline]
22635 pub unsafe fn set_nfc_dis_sec1_raw(this: *mut Self, val: bool) {
22636 unsafe {
22637 let val: u8 = ::core::mem::transmute(val);
22638 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22639 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22640 5usize,
22641 1u8,
22642 val as u64,
22643 )
22644 }
22645 }
22646 #[inline]
22647 pub fn cfglck(&self) -> bool {
22648 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u8) }
22649 }
22650 #[inline]
22651 pub fn set_cfglck(&mut self, val: bool) {
22652 unsafe {
22653 let val: u8 = ::core::mem::transmute(val);
22654 self._bitfield_1.set(6usize, 1u8, val as u64)
22655 }
22656 }
22657 #[inline]
22658 pub unsafe fn cfglck_raw(this: *const Self) -> bool {
22659 unsafe {
22660 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22661 ::core::ptr::addr_of!((*this)._bitfield_1),
22662 6usize,
22663 1u8,
22664 ) as u8)
22665 }
22666 }
22667 #[inline]
22668 pub unsafe fn set_cfglck_raw(this: *mut Self, val: bool) {
22669 unsafe {
22670 let val: u8 = ::core::mem::transmute(val);
22671 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22672 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22673 6usize,
22674 1u8,
22675 val as u64,
22676 )
22677 }
22678 }
22679 #[inline]
22680 pub fn prot(&self) -> bool {
22681 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
22682 }
22683 #[inline]
22684 pub fn set_prot(&mut self, val: bool) {
22685 unsafe {
22686 let val: u8 = ::core::mem::transmute(val);
22687 self._bitfield_1.set(7usize, 1u8, val as u64)
22688 }
22689 }
22690 #[inline]
22691 pub unsafe fn prot_raw(this: *const Self) -> bool {
22692 unsafe {
22693 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
22694 ::core::ptr::addr_of!((*this)._bitfield_1),
22695 7usize,
22696 1u8,
22697 ) as u8)
22698 }
22699 }
22700 #[inline]
22701 pub unsafe fn set_prot_raw(this: *mut Self, val: bool) {
22702 unsafe {
22703 let val: u8 = ::core::mem::transmute(val);
22704 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
22705 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
22706 7usize,
22707 1u8,
22708 val as u64,
22709 )
22710 }
22711 }
22712 #[inline]
22713 pub fn new_bitfield_1(
22714 authlim: u8,
22715 nfc_cnt_pwd_prot: bool,
22716 nfc_cnt_en: bool,
22717 nfc_dis_sec1: bool,
22718 cfglck: bool,
22719 prot: bool,
22720 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
22721 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
22722 __bindgen_bitfield_unit.set(0usize, 3u8, {
22723 let authlim: u8 = unsafe { ::core::mem::transmute(authlim) };
22724 authlim as u64
22725 });
22726 __bindgen_bitfield_unit.set(3usize, 1u8, {
22727 let nfc_cnt_pwd_prot: u8 = unsafe { ::core::mem::transmute(nfc_cnt_pwd_prot) };
22728 nfc_cnt_pwd_prot as u64
22729 });
22730 __bindgen_bitfield_unit.set(4usize, 1u8, {
22731 let nfc_cnt_en: u8 = unsafe { ::core::mem::transmute(nfc_cnt_en) };
22732 nfc_cnt_en as u64
22733 });
22734 __bindgen_bitfield_unit.set(5usize, 1u8, {
22735 let nfc_dis_sec1: u8 = unsafe { ::core::mem::transmute(nfc_dis_sec1) };
22736 nfc_dis_sec1 as u64
22737 });
22738 __bindgen_bitfield_unit.set(6usize, 1u8, {
22739 let cfglck: u8 = unsafe { ::core::mem::transmute(cfglck) };
22740 cfglck as u64
22741 });
22742 __bindgen_bitfield_unit.set(7usize, 1u8, {
22743 let prot: u8 = unsafe { ::core::mem::transmute(prot) };
22744 prot as u64
22745 });
22746 __bindgen_bitfield_unit
22747 }
22748}
22749#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22750const _: () = {
22751 ["Size of MfUltralightConfigPages__bindgen_ty_2"]
22752 [::core::mem::size_of::<MfUltralightConfigPages__bindgen_ty_2>() - 1usize];
22753 ["Alignment of MfUltralightConfigPages__bindgen_ty_2"]
22754 [::core::mem::align_of::<MfUltralightConfigPages__bindgen_ty_2>() - 1usize];
22755 ["Offset of field: MfUltralightConfigPages__bindgen_ty_2::value"]
22756 [::core::mem::offset_of!(MfUltralightConfigPages__bindgen_ty_2, value) - 0usize];
22757};
22758#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22759const _: () = {
22760 ["Size of MfUltralightConfigPages"]
22761 [::core::mem::size_of::<MfUltralightConfigPages>() - 16usize];
22762 ["Alignment of MfUltralightConfigPages"]
22763 [::core::mem::align_of::<MfUltralightConfigPages>() - 1usize];
22764 ["Offset of field: MfUltralightConfigPages::mirror"]
22765 [::core::mem::offset_of!(MfUltralightConfigPages, mirror) - 0usize];
22766 ["Offset of field: MfUltralightConfigPages::rfui1"]
22767 [::core::mem::offset_of!(MfUltralightConfigPages, rfui1) - 1usize];
22768 ["Offset of field: MfUltralightConfigPages::mirror_page"]
22769 [::core::mem::offset_of!(MfUltralightConfigPages, mirror_page) - 2usize];
22770 ["Offset of field: MfUltralightConfigPages::auth0"]
22771 [::core::mem::offset_of!(MfUltralightConfigPages, auth0) - 3usize];
22772 ["Offset of field: MfUltralightConfigPages::access"]
22773 [::core::mem::offset_of!(MfUltralightConfigPages, access) - 4usize];
22774 ["Offset of field: MfUltralightConfigPages::vctid"]
22775 [::core::mem::offset_of!(MfUltralightConfigPages, vctid) - 5usize];
22776 ["Offset of field: MfUltralightConfigPages::rfui2"]
22777 [::core::mem::offset_of!(MfUltralightConfigPages, rfui2) - 6usize];
22778 ["Offset of field: MfUltralightConfigPages::password"]
22779 [::core::mem::offset_of!(MfUltralightConfigPages, password) - 8usize];
22780 ["Offset of field: MfUltralightConfigPages::pack"]
22781 [::core::mem::offset_of!(MfUltralightConfigPages, pack) - 12usize];
22782 ["Offset of field: MfUltralightConfigPages::rfui3"]
22783 [::core::mem::offset_of!(MfUltralightConfigPages, rfui3) - 14usize];
22784};
22785#[repr(C)]
22786#[derive(Copy, Clone)]
22787pub struct MfUltralightData {
22788 pub iso14443_3a_data: *mut Iso14443_3aData,
22789 pub type_: MfUltralightType,
22790 pub version: MfUltralightVersion,
22791 pub signature: MfUltralightSignature,
22792 pub counter: [MfUltralightCounter; 3usize],
22793 pub tearing_flag: [MfUltralightTearingFlag; 3usize],
22794 pub page: [MfUltralightPage; 510usize],
22795 pub pages_read: u16,
22796 pub pages_total: u16,
22797 pub auth_attempts: u32,
22798}
22799#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22800const _: () = {
22801 ["Size of MfUltralightData"][::core::mem::size_of::<MfUltralightData>() - 2112usize];
22802 ["Alignment of MfUltralightData"][::core::mem::align_of::<MfUltralightData>() - 4usize];
22803 ["Offset of field: MfUltralightData::iso14443_3a_data"]
22804 [::core::mem::offset_of!(MfUltralightData, iso14443_3a_data) - 0usize];
22805 ["Offset of field: MfUltralightData::type_"]
22806 [::core::mem::offset_of!(MfUltralightData, type_) - 4usize];
22807 ["Offset of field: MfUltralightData::version"]
22808 [::core::mem::offset_of!(MfUltralightData, version) - 5usize];
22809 ["Offset of field: MfUltralightData::signature"]
22810 [::core::mem::offset_of!(MfUltralightData, signature) - 13usize];
22811 ["Offset of field: MfUltralightData::counter"]
22812 [::core::mem::offset_of!(MfUltralightData, counter) - 48usize];
22813 ["Offset of field: MfUltralightData::tearing_flag"]
22814 [::core::mem::offset_of!(MfUltralightData, tearing_flag) - 60usize];
22815 ["Offset of field: MfUltralightData::page"]
22816 [::core::mem::offset_of!(MfUltralightData, page) - 63usize];
22817 ["Offset of field: MfUltralightData::pages_read"]
22818 [::core::mem::offset_of!(MfUltralightData, pages_read) - 2104usize];
22819 ["Offset of field: MfUltralightData::pages_total"]
22820 [::core::mem::offset_of!(MfUltralightData, pages_total) - 2106usize];
22821 ["Offset of field: MfUltralightData::auth_attempts"]
22822 [::core::mem::offset_of!(MfUltralightData, auth_attempts) - 2108usize];
22823};
22824unsafe extern "C" {
22825 pub fn mf_ultralight_alloc() -> *mut MfUltralightData;
22826}
22827unsafe extern "C" {
22828 pub fn mf_ultralight_free(data: *mut MfUltralightData);
22829}
22830unsafe extern "C" {
22831 pub fn mf_ultralight_reset(data: *mut MfUltralightData);
22832}
22833unsafe extern "C" {
22834 pub fn mf_ultralight_copy(data: *mut MfUltralightData, other: *const MfUltralightData);
22835}
22836unsafe extern "C" {
22837 pub fn mf_ultralight_verify(
22838 data: *mut MfUltralightData,
22839 device_type: *const FuriString,
22840 ) -> bool;
22841}
22842unsafe extern "C" {
22843 pub fn mf_ultralight_load(
22844 data: *mut MfUltralightData,
22845 ff: *mut FlipperFormat,
22846 version: u32,
22847 ) -> bool;
22848}
22849unsafe extern "C" {
22850 pub fn mf_ultralight_save(data: *const MfUltralightData, ff: *mut FlipperFormat) -> bool;
22851}
22852unsafe extern "C" {
22853 pub fn mf_ultralight_is_equal(
22854 data: *const MfUltralightData,
22855 other: *const MfUltralightData,
22856 ) -> bool;
22857}
22858unsafe extern "C" {
22859 pub fn mf_ultralight_get_device_name(
22860 data: *const MfUltralightData,
22861 name_type: NfcDeviceNameType,
22862 ) -> *const core::ffi::c_char;
22863}
22864unsafe extern "C" {
22865 pub fn mf_ultralight_get_uid(data: *const MfUltralightData, uid_len: *mut usize) -> *const u8;
22866}
22867unsafe extern "C" {
22868 pub fn mf_ultralight_set_uid(
22869 data: *mut MfUltralightData,
22870 uid: *const u8,
22871 uid_len: usize,
22872 ) -> bool;
22873}
22874unsafe extern "C" {
22875 pub fn mf_ultralight_get_base_data(data: *const MfUltralightData) -> *mut Iso14443_3aData;
22876}
22877unsafe extern "C" {
22878 pub fn mf_ultralight_get_type_by_version(version: *mut MfUltralightVersion)
22879 -> MfUltralightType;
22880}
22881unsafe extern "C" {
22882 pub fn mf_ultralight_get_pages_total(type_: MfUltralightType) -> u16;
22883}
22884unsafe extern "C" {
22885 pub fn mf_ultralight_get_feature_support_set(type_: MfUltralightType) -> u32;
22886}
22887unsafe extern "C" {
22888 pub fn mf_ultralight_get_config_page_num(type_: MfUltralightType) -> u16;
22889}
22890unsafe extern "C" {
22891 pub fn mf_ultralight_get_write_end_page(type_: MfUltralightType) -> u8;
22892}
22893unsafe extern "C" {
22894 pub fn mf_ultralight_get_pwd_page_num(type_: MfUltralightType) -> u8;
22895}
22896unsafe extern "C" {
22897 pub fn mf_ultralight_is_page_pwd_or_pack(type_: MfUltralightType, page_num: u16) -> bool;
22898}
22899unsafe extern "C" {
22900 pub fn mf_ultralight_support_feature(feature_set: u32, features_to_check: u32) -> bool;
22901}
22902unsafe extern "C" {
22903 pub fn mf_ultralight_get_config_page(
22904 data: *const MfUltralightData,
22905 config: *mut *mut MfUltralightConfigPages,
22906 ) -> bool;
22907}
22908unsafe extern "C" {
22909 pub fn mf_ultralight_is_all_data_read(data: *const MfUltralightData) -> bool;
22910}
22911unsafe extern "C" {
22912 pub fn mf_ultralight_detect_protocol(iso14443_3a_data: *const Iso14443_3aData) -> bool;
22913}
22914unsafe extern "C" {
22915 pub fn mf_ultralight_is_counter_configured(data: *const MfUltralightData) -> bool;
22916}
22917unsafe extern "C" {
22918 pub fn mf_ultralight_3des_shift_data(arr: *mut u8);
22919}
22920unsafe extern "C" {
22921 pub fn mf_ultralight_3des_key_valid(data: *const MfUltralightData) -> bool;
22922}
22923unsafe extern "C" {
22924 pub fn mf_ultralight_3des_get_key(data: *const MfUltralightData) -> *const u8;
22925}
22926unsafe extern "C" {
22927 pub fn mf_ultralight_3des_encrypt(
22928 ctx: *mut mbedtls_des3_context,
22929 ck: *const u8,
22930 iv: *const u8,
22931 input: *const u8,
22932 length: u8,
22933 out: *mut u8,
22934 );
22935}
22936unsafe extern "C" {
22937 pub fn mf_ultralight_3des_decrypt(
22938 ctx: *mut mbedtls_des3_context,
22939 ck: *const u8,
22940 iv: *const u8,
22941 input: *const u8,
22942 length: u8,
22943 out: *mut u8,
22944 );
22945}
22946#[repr(C)]
22947#[derive(Debug, Copy, Clone)]
22948pub struct MfUltralightListener {
22949 _unused: [u8; 0],
22950}
22951pub const MfUltralightListenerEventTypeAuth: MfUltralightListenerEventType =
22952 MfUltralightListenerEventType(0);
22953#[repr(transparent)]
22954#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
22955pub struct MfUltralightListenerEventType(pub core::ffi::c_uchar);
22956#[repr(C)]
22957#[derive(Copy, Clone)]
22958pub struct MfUltralightListenerEventData {
22959 pub __bindgen_anon_1: MfUltralightListenerEventData__bindgen_ty_1,
22960}
22961#[repr(C)]
22962#[derive(Copy, Clone)]
22963pub union MfUltralightListenerEventData__bindgen_ty_1 {
22964 pub password: MfUltralightAuthPassword,
22965}
22966#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22967const _: () = {
22968 ["Size of MfUltralightListenerEventData__bindgen_ty_1"]
22969 [::core::mem::size_of::<MfUltralightListenerEventData__bindgen_ty_1>() - 4usize];
22970 ["Alignment of MfUltralightListenerEventData__bindgen_ty_1"]
22971 [::core::mem::align_of::<MfUltralightListenerEventData__bindgen_ty_1>() - 1usize];
22972 ["Offset of field: MfUltralightListenerEventData__bindgen_ty_1::password"]
22973 [::core::mem::offset_of!(MfUltralightListenerEventData__bindgen_ty_1, password) - 0usize];
22974};
22975#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22976const _: () = {
22977 ["Size of MfUltralightListenerEventData"]
22978 [::core::mem::size_of::<MfUltralightListenerEventData>() - 4usize];
22979 ["Alignment of MfUltralightListenerEventData"]
22980 [::core::mem::align_of::<MfUltralightListenerEventData>() - 1usize];
22981};
22982#[repr(C)]
22983#[derive(Debug, Copy, Clone)]
22984pub struct MfUltralightListenerEvent {
22985 pub type_: MfUltralightListenerEventType,
22986 pub data: *mut MfUltralightListenerEventData,
22987}
22988#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22989const _: () = {
22990 ["Size of MfUltralightListenerEvent"]
22991 [::core::mem::size_of::<MfUltralightListenerEvent>() - 8usize];
22992 ["Alignment of MfUltralightListenerEvent"]
22993 [::core::mem::align_of::<MfUltralightListenerEvent>() - 4usize];
22994 ["Offset of field: MfUltralightListenerEvent::type_"]
22995 [::core::mem::offset_of!(MfUltralightListenerEvent, type_) - 0usize];
22996 ["Offset of field: MfUltralightListenerEvent::data"]
22997 [::core::mem::offset_of!(MfUltralightListenerEvent, data) - 4usize];
22998};
22999#[repr(C)]
23000#[derive(Debug, Copy, Clone)]
23001pub struct MfUltralightPoller {
23002 _unused: [u8; 0],
23003}
23004#[doc = "< Poller requests for operating mode."]
23005pub const MfUltralightPollerEventTypeRequestMode: MfUltralightPollerEventType =
23006 MfUltralightPollerEventType(0);
23007#[doc = "< Poller requests to fill authentication context."]
23008pub const MfUltralightPollerEventTypeAuthRequest: MfUltralightPollerEventType =
23009 MfUltralightPollerEventType(1);
23010#[doc = "< Authentication succeeded."]
23011pub const MfUltralightPollerEventTypeAuthSuccess: MfUltralightPollerEventType =
23012 MfUltralightPollerEventType(2);
23013#[doc = "< Authentication failed."]
23014pub const MfUltralightPollerEventTypeAuthFailed: MfUltralightPollerEventType =
23015 MfUltralightPollerEventType(3);
23016#[doc = "< Poller read card successfully."]
23017pub const MfUltralightPollerEventTypeReadSuccess: MfUltralightPollerEventType =
23018 MfUltralightPollerEventType(4);
23019#[doc = "< Poller failed to read card."]
23020pub const MfUltralightPollerEventTypeReadFailed: MfUltralightPollerEventType =
23021 MfUltralightPollerEventType(5);
23022#[doc = "< Poller request card data for write operation."]
23023pub const MfUltralightPollerEventTypeRequestWriteData: MfUltralightPollerEventType =
23024 MfUltralightPollerEventType(6);
23025#[doc = "< Type of card for writing differs from presented one."]
23026pub const MfUltralightPollerEventTypeCardMismatch: MfUltralightPollerEventType =
23027 MfUltralightPollerEventType(7);
23028#[doc = "< Presented card is locked by password, AUTH0 or lock bytes."]
23029pub const MfUltralightPollerEventTypeCardLocked: MfUltralightPollerEventType =
23030 MfUltralightPollerEventType(8);
23031#[doc = "< Poller wrote card successfully."]
23032pub const MfUltralightPollerEventTypeWriteSuccess: MfUltralightPollerEventType =
23033 MfUltralightPollerEventType(9);
23034#[doc = "< Poller failed to write card."]
23035pub const MfUltralightPollerEventTypeWriteFail: MfUltralightPollerEventType =
23036 MfUltralightPollerEventType(10);
23037#[doc = "< Poller requests key for dict attack."]
23038pub const MfUltralightPollerEventTypeRequestKey: MfUltralightPollerEventType =
23039 MfUltralightPollerEventType(11);
23040#[repr(transparent)]
23041#[doc = "Enumeration of possible MfUltralight poller event types."]
23042#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23043pub struct MfUltralightPollerEventType(pub core::ffi::c_uchar);
23044#[doc = "< Poller will only read card. It's a default mode."]
23045pub const MfUltralightPollerModeRead: MfUltralightPollerMode = MfUltralightPollerMode(0);
23046#[doc = "< Poller will write already saved card to another presented card."]
23047pub const MfUltralightPollerModeWrite: MfUltralightPollerMode = MfUltralightPollerMode(1);
23048#[doc = "< Poller will perform dictionary attack against card."]
23049pub const MfUltralightPollerModeDictAttack: MfUltralightPollerMode = MfUltralightPollerMode(2);
23050#[repr(transparent)]
23051#[doc = "Enumeration of possible MfUltralight poller operating modes."]
23052#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23053pub struct MfUltralightPollerMode(pub core::ffi::c_uchar);
23054#[doc = "MfUltralight poller authentication context."]
23055#[repr(C)]
23056#[derive(Debug, Copy, Clone)]
23057pub struct MfUltralightPollerAuthContext {
23058 #[doc = "< Password to be used for authentication."]
23059 pub password: MfUltralightAuthPassword,
23060 #[doc = "< 3DES key to be used for authentication."]
23061 pub tdes_key: MfUltralightC3DesAuthKey,
23062 #[doc = "< Pack received on successful authentication."]
23063 pub pack: MfUltralightAuthPack,
23064 #[doc = "< Set to true if authentication succeeded, false otherwise."]
23065 pub auth_success: bool,
23066 #[doc = "< Set to true if authentication should be skipped, false otherwise."]
23067 pub skip_auth: bool,
23068}
23069#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23070const _: () = {
23071 ["Size of MfUltralightPollerAuthContext"]
23072 [::core::mem::size_of::<MfUltralightPollerAuthContext>() - 24usize];
23073 ["Alignment of MfUltralightPollerAuthContext"]
23074 [::core::mem::align_of::<MfUltralightPollerAuthContext>() - 1usize];
23075 ["Offset of field: MfUltralightPollerAuthContext::password"]
23076 [::core::mem::offset_of!(MfUltralightPollerAuthContext, password) - 0usize];
23077 ["Offset of field: MfUltralightPollerAuthContext::tdes_key"]
23078 [::core::mem::offset_of!(MfUltralightPollerAuthContext, tdes_key) - 4usize];
23079 ["Offset of field: MfUltralightPollerAuthContext::pack"]
23080 [::core::mem::offset_of!(MfUltralightPollerAuthContext, pack) - 20usize];
23081 ["Offset of field: MfUltralightPollerAuthContext::auth_success"]
23082 [::core::mem::offset_of!(MfUltralightPollerAuthContext, auth_success) - 22usize];
23083 ["Offset of field: MfUltralightPollerAuthContext::skip_auth"]
23084 [::core::mem::offset_of!(MfUltralightPollerAuthContext, skip_auth) - 23usize];
23085};
23086#[doc = "MfUltralight poller key request data."]
23087#[repr(C)]
23088#[derive(Debug, Copy, Clone)]
23089pub struct MfUltralightPollerKeyRequestData {
23090 #[doc = "< Key to try."]
23091 pub key: MfUltralightC3DesAuthKey,
23092 #[doc = "< Set to true if key was provided, false to stop attack."]
23093 pub key_provided: bool,
23094}
23095#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23096const _: () = {
23097 ["Size of MfUltralightPollerKeyRequestData"]
23098 [::core::mem::size_of::<MfUltralightPollerKeyRequestData>() - 17usize];
23099 ["Alignment of MfUltralightPollerKeyRequestData"]
23100 [::core::mem::align_of::<MfUltralightPollerKeyRequestData>() - 1usize];
23101 ["Offset of field: MfUltralightPollerKeyRequestData::key"]
23102 [::core::mem::offset_of!(MfUltralightPollerKeyRequestData, key) - 0usize];
23103 ["Offset of field: MfUltralightPollerKeyRequestData::key_provided"]
23104 [::core::mem::offset_of!(MfUltralightPollerKeyRequestData, key_provided) - 16usize];
23105};
23106#[doc = "MfUltralight poller event data."]
23107#[repr(C)]
23108#[derive(Copy, Clone)]
23109pub union MfUltralightPollerEventData {
23110 #[doc = "< Authentication context."]
23111 pub auth_context: MfUltralightPollerAuthContext,
23112 #[doc = "< Error code indicating reading fail reason."]
23113 pub error: MfUltralightError,
23114 #[doc = "< Data to be written to card."]
23115 pub write_data: *const MfUltralightData,
23116 #[doc = "< Mode to operate in."]
23117 pub poller_mode: MfUltralightPollerMode,
23118 #[doc = "< Key request data."]
23119 pub key_request_data: MfUltralightPollerKeyRequestData,
23120}
23121#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23122const _: () = {
23123 ["Size of MfUltralightPollerEventData"]
23124 [::core::mem::size_of::<MfUltralightPollerEventData>() - 24usize];
23125 ["Alignment of MfUltralightPollerEventData"]
23126 [::core::mem::align_of::<MfUltralightPollerEventData>() - 4usize];
23127 ["Offset of field: MfUltralightPollerEventData::auth_context"]
23128 [::core::mem::offset_of!(MfUltralightPollerEventData, auth_context) - 0usize];
23129 ["Offset of field: MfUltralightPollerEventData::error"]
23130 [::core::mem::offset_of!(MfUltralightPollerEventData, error) - 0usize];
23131 ["Offset of field: MfUltralightPollerEventData::write_data"]
23132 [::core::mem::offset_of!(MfUltralightPollerEventData, write_data) - 0usize];
23133 ["Offset of field: MfUltralightPollerEventData::poller_mode"]
23134 [::core::mem::offset_of!(MfUltralightPollerEventData, poller_mode) - 0usize];
23135 ["Offset of field: MfUltralightPollerEventData::key_request_data"]
23136 [::core::mem::offset_of!(MfUltralightPollerEventData, key_request_data) - 0usize];
23137};
23138#[doc = "MfUltralight poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
23139#[repr(C)]
23140#[derive(Debug, Copy, Clone)]
23141pub struct MfUltralightPollerEvent {
23142 #[doc = "< Type of emitted event."]
23143 pub type_: MfUltralightPollerEventType,
23144 #[doc = "< Pointer to event specific data."]
23145 pub data: *mut MfUltralightPollerEventData,
23146}
23147#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23148const _: () = {
23149 ["Size of MfUltralightPollerEvent"][::core::mem::size_of::<MfUltralightPollerEvent>() - 8usize];
23150 ["Alignment of MfUltralightPollerEvent"]
23151 [::core::mem::align_of::<MfUltralightPollerEvent>() - 4usize];
23152 ["Offset of field: MfUltralightPollerEvent::type_"]
23153 [::core::mem::offset_of!(MfUltralightPollerEvent, type_) - 0usize];
23154 ["Offset of field: MfUltralightPollerEvent::data"]
23155 [::core::mem::offset_of!(MfUltralightPollerEvent, data) - 4usize];
23156};
23157unsafe extern "C" {
23158 #[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."]
23159 pub fn mf_ultralight_poller_auth_pwd(
23160 instance: *mut MfUltralightPoller,
23161 data: *mut MfUltralightPollerAuthContext,
23162 ) -> MfUltralightError;
23163}
23164unsafe extern "C" {
23165 #[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."]
23166 pub fn mf_ultralight_poller_authenticate_start(
23167 instance: *mut MfUltralightPoller,
23168 RndA: *const u8,
23169 output: *mut u8,
23170 ) -> MfUltralightError;
23171}
23172unsafe extern "C" {
23173 #[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."]
23174 pub fn mf_ultralight_poller_authenticate_end(
23175 instance: *mut MfUltralightPoller,
23176 RndB: *const u8,
23177 request: *const u8,
23178 response: *mut u8,
23179 ) -> MfUltralightError;
23180}
23181unsafe extern "C" {
23182 #[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."]
23183 pub fn mf_ultralight_poller_read_page(
23184 instance: *mut MfUltralightPoller,
23185 start_page: u8,
23186 data: *mut MfUltralightPageReadCommandData,
23187 ) -> MfUltralightError;
23188}
23189unsafe extern "C" {
23190 #[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."]
23191 pub fn mf_ultralight_poller_read_page_from_sector(
23192 instance: *mut MfUltralightPoller,
23193 sector: u8,
23194 tag: u8,
23195 data: *mut MfUltralightPageReadCommandData,
23196 ) -> MfUltralightError;
23197}
23198unsafe extern "C" {
23199 #[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."]
23200 pub fn mf_ultralight_poller_write_page(
23201 instance: *mut MfUltralightPoller,
23202 page: u8,
23203 data: *const MfUltralightPage,
23204 ) -> MfUltralightError;
23205}
23206unsafe extern "C" {
23207 #[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."]
23208 pub fn mf_ultralight_poller_read_version(
23209 instance: *mut MfUltralightPoller,
23210 data: *mut MfUltralightVersion,
23211 ) -> MfUltralightError;
23212}
23213unsafe extern "C" {
23214 #[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."]
23215 pub fn mf_ultralight_poller_read_signature(
23216 instance: *mut MfUltralightPoller,
23217 data: *mut MfUltralightSignature,
23218 ) -> MfUltralightError;
23219}
23220unsafe extern "C" {
23221 #[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."]
23222 pub fn mf_ultralight_poller_read_counter(
23223 instance: *mut MfUltralightPoller,
23224 counter_num: u8,
23225 data: *mut MfUltralightCounter,
23226 ) -> MfUltralightError;
23227}
23228unsafe extern "C" {
23229 #[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."]
23230 pub fn mf_ultralight_poller_read_tearing_flag(
23231 instance: *mut MfUltralightPoller,
23232 tearing_falg_num: u8,
23233 data: *mut MfUltralightTearingFlag,
23234 ) -> MfUltralightError;
23235}
23236unsafe extern "C" {
23237 pub fn mf_ultralight_poller_sync_read_page(
23238 nfc: *mut Nfc,
23239 page: u16,
23240 data: *mut MfUltralightPage,
23241 ) -> MfUltralightError;
23242}
23243unsafe extern "C" {
23244 pub fn mf_ultralight_poller_sync_write_page(
23245 nfc: *mut Nfc,
23246 page: u16,
23247 data: *mut MfUltralightPage,
23248 ) -> MfUltralightError;
23249}
23250unsafe extern "C" {
23251 pub fn mf_ultralight_poller_sync_read_version(
23252 nfc: *mut Nfc,
23253 data: *mut MfUltralightVersion,
23254 ) -> MfUltralightError;
23255}
23256unsafe extern "C" {
23257 pub fn mf_ultralight_poller_sync_read_signature(
23258 nfc: *mut Nfc,
23259 data: *mut MfUltralightSignature,
23260 ) -> MfUltralightError;
23261}
23262unsafe extern "C" {
23263 pub fn mf_ultralight_poller_sync_read_counter(
23264 nfc: *mut Nfc,
23265 counter_num: u8,
23266 data: *mut MfUltralightCounter,
23267 ) -> MfUltralightError;
23268}
23269unsafe extern "C" {
23270 pub fn mf_ultralight_poller_sync_read_tearing_flag(
23271 nfc: *mut Nfc,
23272 flag_num: u8,
23273 data: *mut MfUltralightTearingFlag,
23274 ) -> MfUltralightError;
23275}
23276unsafe extern "C" {
23277 pub fn mf_ultralight_poller_sync_read_card(
23278 nfc: *mut Nfc,
23279 data: *mut MfUltralightData,
23280 auth_context: *const MfUltralightPollerAuthContext,
23281 ) -> MfUltralightError;
23282}
23283pub type SlixTypeFeatures = u32;
23284pub const SlixErrorNone: SlixError = SlixError(0);
23285pub const SlixErrorTimeout: SlixError = SlixError(1);
23286pub const SlixErrorFormat: SlixError = SlixError(2);
23287pub const SlixErrorNotSupported: SlixError = SlixError(3);
23288pub const SlixErrorInternal: SlixError = SlixError(4);
23289pub const SlixErrorWrongPassword: SlixError = SlixError(5);
23290pub const SlixErrorUidMismatch: SlixError = SlixError(6);
23291pub const SlixErrorUnknown: SlixError = SlixError(7);
23292#[repr(transparent)]
23293#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23294pub struct SlixError(pub core::ffi::c_uchar);
23295pub const SlixTypeSlix: SlixType = SlixType(0);
23296pub const SlixTypeSlixS: SlixType = SlixType(1);
23297pub const SlixTypeSlixL: SlixType = SlixType(2);
23298pub const SlixTypeSlix2: SlixType = SlixType(3);
23299pub const SlixTypeCount: SlixType = SlixType(4);
23300pub const SlixTypeUnknown: SlixType = SlixType(5);
23301#[repr(transparent)]
23302#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23303pub struct SlixType(pub core::ffi::c_uchar);
23304pub const SlixPasswordTypeRead: SlixPasswordType = SlixPasswordType(0);
23305pub const SlixPasswordTypeWrite: SlixPasswordType = SlixPasswordType(1);
23306pub const SlixPasswordTypePrivacy: SlixPasswordType = SlixPasswordType(2);
23307pub const SlixPasswordTypeDestroy: SlixPasswordType = SlixPasswordType(3);
23308pub const SlixPasswordTypeEasAfi: SlixPasswordType = SlixPasswordType(4);
23309pub const SlixPasswordTypeCount: SlixPasswordType = SlixPasswordType(5);
23310#[repr(transparent)]
23311#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23312pub struct SlixPasswordType(pub core::ffi::c_uchar);
23313pub type SlixPassword = u32;
23314pub type SlixSignature = [u8; 32usize];
23315pub type SlixPrivacy = bool;
23316pub type SlixRandomNumber = u16;
23317#[repr(C)]
23318#[derive(Debug, Copy, Clone)]
23319pub struct SlixProtection {
23320 pub pointer: u8,
23321 pub condition: u8,
23322}
23323#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23324const _: () = {
23325 ["Size of SlixProtection"][::core::mem::size_of::<SlixProtection>() - 2usize];
23326 ["Alignment of SlixProtection"][::core::mem::align_of::<SlixProtection>() - 1usize];
23327 ["Offset of field: SlixProtection::pointer"]
23328 [::core::mem::offset_of!(SlixProtection, pointer) - 0usize];
23329 ["Offset of field: SlixProtection::condition"]
23330 [::core::mem::offset_of!(SlixProtection, condition) - 1usize];
23331};
23332#[repr(C)]
23333#[derive(Debug, Copy, Clone)]
23334pub struct SlixLockBits {
23335 pub eas: bool,
23336 pub ppl: bool,
23337}
23338#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23339const _: () = {
23340 ["Size of SlixLockBits"][::core::mem::size_of::<SlixLockBits>() - 2usize];
23341 ["Alignment of SlixLockBits"][::core::mem::align_of::<SlixLockBits>() - 1usize];
23342 ["Offset of field: SlixLockBits::eas"][::core::mem::offset_of!(SlixLockBits, eas) - 0usize];
23343 ["Offset of field: SlixLockBits::ppl"][::core::mem::offset_of!(SlixLockBits, ppl) - 1usize];
23344};
23345#[repr(C)]
23346#[derive(Debug, Copy, Clone)]
23347pub struct SlixSystemInfo {
23348 pub protection: SlixProtection,
23349 pub lock_bits: SlixLockBits,
23350}
23351#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23352const _: () = {
23353 ["Size of SlixSystemInfo"][::core::mem::size_of::<SlixSystemInfo>() - 4usize];
23354 ["Alignment of SlixSystemInfo"][::core::mem::align_of::<SlixSystemInfo>() - 1usize];
23355 ["Offset of field: SlixSystemInfo::protection"]
23356 [::core::mem::offset_of!(SlixSystemInfo, protection) - 0usize];
23357 ["Offset of field: SlixSystemInfo::lock_bits"]
23358 [::core::mem::offset_of!(SlixSystemInfo, lock_bits) - 2usize];
23359};
23360pub const SlixCapabilitiesDefault: SlixCapabilities = SlixCapabilities(0);
23361pub const SlixCapabilitiesAcceptAllPasswords: SlixCapabilities = SlixCapabilities(1);
23362pub const SlixCapabilitiesCount: SlixCapabilities = SlixCapabilities(2);
23363#[repr(transparent)]
23364#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23365pub struct SlixCapabilities(pub core::ffi::c_uchar);
23366#[repr(C)]
23367#[derive(Debug, Copy, Clone)]
23368pub struct SlixData {
23369 pub iso15693_3_data: *mut Iso15693_3Data,
23370 pub system_info: SlixSystemInfo,
23371 pub signature: SlixSignature,
23372 pub passwords: [SlixPassword; 5usize],
23373 pub privacy: SlixPrivacy,
23374 pub capabilities: SlixCapabilities,
23375}
23376#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23377const _: () = {
23378 ["Size of SlixData"][::core::mem::size_of::<SlixData>() - 64usize];
23379 ["Alignment of SlixData"][::core::mem::align_of::<SlixData>() - 4usize];
23380 ["Offset of field: SlixData::iso15693_3_data"]
23381 [::core::mem::offset_of!(SlixData, iso15693_3_data) - 0usize];
23382 ["Offset of field: SlixData::system_info"]
23383 [::core::mem::offset_of!(SlixData, system_info) - 4usize];
23384 ["Offset of field: SlixData::signature"][::core::mem::offset_of!(SlixData, signature) - 8usize];
23385 ["Offset of field: SlixData::passwords"]
23386 [::core::mem::offset_of!(SlixData, passwords) - 40usize];
23387 ["Offset of field: SlixData::privacy"][::core::mem::offset_of!(SlixData, privacy) - 60usize];
23388 ["Offset of field: SlixData::capabilities"]
23389 [::core::mem::offset_of!(SlixData, capabilities) - 61usize];
23390};
23391unsafe extern "C" {
23392 pub fn slix_alloc() -> *mut SlixData;
23393}
23394unsafe extern "C" {
23395 pub fn slix_free(data: *mut SlixData);
23396}
23397unsafe extern "C" {
23398 pub fn slix_reset(data: *mut SlixData);
23399}
23400unsafe extern "C" {
23401 pub fn slix_copy(data: *mut SlixData, other: *const SlixData);
23402}
23403unsafe extern "C" {
23404 pub fn slix_verify(data: *mut SlixData, device_type: *const FuriString) -> bool;
23405}
23406unsafe extern "C" {
23407 pub fn slix_load(data: *mut SlixData, ff: *mut FlipperFormat, version: u32) -> bool;
23408}
23409unsafe extern "C" {
23410 pub fn slix_save(data: *const SlixData, ff: *mut FlipperFormat) -> bool;
23411}
23412unsafe extern "C" {
23413 pub fn slix_is_equal(data: *const SlixData, other: *const SlixData) -> bool;
23414}
23415unsafe extern "C" {
23416 pub fn slix_get_device_name(
23417 data: *const SlixData,
23418 name_type: NfcDeviceNameType,
23419 ) -> *const core::ffi::c_char;
23420}
23421unsafe extern "C" {
23422 pub fn slix_get_uid(data: *const SlixData, uid_len: *mut usize) -> *const u8;
23423}
23424unsafe extern "C" {
23425 pub fn slix_set_uid(data: *mut SlixData, uid: *const u8, uid_len: usize) -> bool;
23426}
23427unsafe extern "C" {
23428 pub fn slix_get_base_data(data: *const SlixData) -> *const Iso15693_3Data;
23429}
23430unsafe extern "C" {
23431 pub fn slix_get_type(data: *const SlixData) -> SlixType;
23432}
23433unsafe extern "C" {
23434 pub fn slix_get_password(
23435 data: *const SlixData,
23436 password_type: SlixPasswordType,
23437 ) -> SlixPassword;
23438}
23439unsafe extern "C" {
23440 pub fn slix_get_counter(data: *const SlixData) -> u16;
23441}
23442unsafe extern "C" {
23443 pub fn slix_is_privacy_mode(data: *const SlixData) -> bool;
23444}
23445unsafe extern "C" {
23446 pub fn slix_is_block_protected(
23447 data: *const SlixData,
23448 password_type: SlixPasswordType,
23449 block_num: u8,
23450 ) -> bool;
23451}
23452unsafe extern "C" {
23453 pub fn slix_is_counter_increment_protected(data: *const SlixData) -> bool;
23454}
23455unsafe extern "C" {
23456 pub fn slix_type_has_features(slix_type: SlixType, features: SlixTypeFeatures) -> bool;
23457}
23458unsafe extern "C" {
23459 pub fn slix_type_supports_password(
23460 slix_type: SlixType,
23461 password_type: SlixPasswordType,
23462 ) -> bool;
23463}
23464#[repr(C)]
23465#[derive(Debug, Copy, Clone)]
23466pub struct SlixPoller {
23467 _unused: [u8; 0],
23468}
23469#[doc = "< An error occured while reading card."]
23470pub const SlixPollerEventTypeError: SlixPollerEventType = SlixPollerEventType(0);
23471#[doc = "< Poller requests password to disable privacy mode."]
23472pub const SlixPollerEventTypePrivacyUnlockRequest: SlixPollerEventType = SlixPollerEventType(1);
23473#[doc = "< The card was successfully read by the poller."]
23474pub const SlixPollerEventTypeReady: SlixPollerEventType = SlixPollerEventType(2);
23475#[repr(transparent)]
23476#[doc = "Enumeration of possible Slix poller event types."]
23477#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23478pub struct SlixPollerEventType(pub core::ffi::c_uchar);
23479#[doc = "Slix poller privacy unlock context data."]
23480#[repr(C)]
23481#[derive(Debug, Copy, Clone)]
23482pub struct SlixPollerEventDataPrivacyUnlockContext {
23483 #[doc = "< Privacy password."]
23484 pub password: SlixPassword,
23485 #[doc = "< Filed to indicate that password was set or not."]
23486 pub password_set: bool,
23487}
23488#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23489const _: () = {
23490 ["Size of SlixPollerEventDataPrivacyUnlockContext"]
23491 [::core::mem::size_of::<SlixPollerEventDataPrivacyUnlockContext>() - 8usize];
23492 ["Alignment of SlixPollerEventDataPrivacyUnlockContext"]
23493 [::core::mem::align_of::<SlixPollerEventDataPrivacyUnlockContext>() - 4usize];
23494 ["Offset of field: SlixPollerEventDataPrivacyUnlockContext::password"]
23495 [::core::mem::offset_of!(SlixPollerEventDataPrivacyUnlockContext, password) - 0usize];
23496 ["Offset of field: SlixPollerEventDataPrivacyUnlockContext::password_set"]
23497 [::core::mem::offset_of!(SlixPollerEventDataPrivacyUnlockContext, password_set) - 4usize];
23498};
23499#[doc = "Slixs poller event data."]
23500#[repr(C)]
23501#[derive(Copy, Clone)]
23502pub union SlixPollerEventData {
23503 #[doc = "< Error code indicating card reaing fail reason."]
23504 pub error: SlixError,
23505 #[doc = "< Privacy unlock event context."]
23506 pub privacy_password: SlixPollerEventDataPrivacyUnlockContext,
23507}
23508#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23509const _: () = {
23510 ["Size of SlixPollerEventData"][::core::mem::size_of::<SlixPollerEventData>() - 8usize];
23511 ["Alignment of SlixPollerEventData"][::core::mem::align_of::<SlixPollerEventData>() - 4usize];
23512 ["Offset of field: SlixPollerEventData::error"]
23513 [::core::mem::offset_of!(SlixPollerEventData, error) - 0usize];
23514 ["Offset of field: SlixPollerEventData::privacy_password"]
23515 [::core::mem::offset_of!(SlixPollerEventData, privacy_password) - 0usize];
23516};
23517#[doc = "Slix poller event structure.\n\n Upon emission of an event, an instance of this struct will be passed to the callback."]
23518#[repr(C)]
23519#[derive(Debug, Copy, Clone)]
23520pub struct SlixPollerEvent {
23521 #[doc = "< Type of emmitted event."]
23522 pub type_: SlixPollerEventType,
23523 #[doc = "< Pointer to event specific data."]
23524 pub data: *mut SlixPollerEventData,
23525}
23526#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23527const _: () = {
23528 ["Size of SlixPollerEvent"][::core::mem::size_of::<SlixPollerEvent>() - 8usize];
23529 ["Alignment of SlixPollerEvent"][::core::mem::align_of::<SlixPollerEvent>() - 4usize];
23530 ["Offset of field: SlixPollerEvent::type_"]
23531 [::core::mem::offset_of!(SlixPollerEvent, type_) - 0usize];
23532 ["Offset of field: SlixPollerEvent::data"]
23533 [::core::mem::offset_of!(SlixPollerEvent, data) - 4usize];
23534};
23535unsafe extern "C" {
23536 #[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."]
23537 pub fn slix_poller_send_frame(
23538 instance: *mut SlixPoller,
23539 tx_data: *const BitBuffer,
23540 rx_data: *mut BitBuffer,
23541 fwt: u32,
23542 ) -> SlixError;
23543}
23544unsafe extern "C" {
23545 #[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."]
23546 pub fn slix_poller_get_nxp_system_info(
23547 instance: *mut SlixPoller,
23548 data: *mut SlixSystemInfo,
23549 ) -> SlixError;
23550}
23551unsafe extern "C" {
23552 #[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."]
23553 pub fn slix_poller_read_signature(
23554 instance: *mut SlixPoller,
23555 data: *mut SlixSignature,
23556 ) -> SlixError;
23557}
23558unsafe extern "C" {
23559 #[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."]
23560 pub fn slix_poller_get_random_number(
23561 instance: *mut SlixPoller,
23562 data: *mut SlixRandomNumber,
23563 ) -> SlixError;
23564}
23565unsafe extern "C" {
23566 #[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."]
23567 pub fn slix_poller_set_password(
23568 instance: *mut SlixPoller,
23569 type_: SlixPasswordType,
23570 password: SlixPassword,
23571 random_number: SlixRandomNumber,
23572 ) -> SlixError;
23573}
23574pub const St25tbErrorNone: St25tbError = St25tbError(0);
23575pub const St25tbErrorNotPresent: St25tbError = St25tbError(1);
23576pub const St25tbErrorColResFailed: St25tbError = St25tbError(2);
23577pub const St25tbErrorBufferOverflow: St25tbError = St25tbError(3);
23578pub const St25tbErrorCommunication: St25tbError = St25tbError(4);
23579pub const St25tbErrorFieldOff: St25tbError = St25tbError(5);
23580pub const St25tbErrorWrongCrc: St25tbError = St25tbError(6);
23581pub const St25tbErrorTimeout: St25tbError = St25tbError(7);
23582pub const St25tbErrorWriteFailed: St25tbError = St25tbError(8);
23583#[repr(transparent)]
23584#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23585pub struct St25tbError(pub core::ffi::c_uchar);
23586pub const St25tbType512At: St25tbType = St25tbType(0);
23587pub const St25tbType512Ac: St25tbType = St25tbType(1);
23588pub const St25tbTypeX512: St25tbType = St25tbType(2);
23589pub const St25tbType02k: St25tbType = St25tbType(3);
23590pub const St25tbType04k: St25tbType = St25tbType(4);
23591pub const St25tbTypeX4k: St25tbType = St25tbType(5);
23592pub const St25tbTypeNum: St25tbType = St25tbType(6);
23593#[repr(transparent)]
23594#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23595pub struct St25tbType(pub core::ffi::c_uchar);
23596#[repr(C)]
23597#[derive(Debug, Copy, Clone)]
23598pub struct St25tbData {
23599 pub uid: [u8; 8usize],
23600 pub type_: St25tbType,
23601 pub blocks: [u32; 128usize],
23602 pub system_otp_block: u32,
23603}
23604#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23605const _: () = {
23606 ["Size of St25tbData"][::core::mem::size_of::<St25tbData>() - 528usize];
23607 ["Alignment of St25tbData"][::core::mem::align_of::<St25tbData>() - 4usize];
23608 ["Offset of field: St25tbData::uid"][::core::mem::offset_of!(St25tbData, uid) - 0usize];
23609 ["Offset of field: St25tbData::type_"][::core::mem::offset_of!(St25tbData, type_) - 8usize];
23610 ["Offset of field: St25tbData::blocks"][::core::mem::offset_of!(St25tbData, blocks) - 12usize];
23611 ["Offset of field: St25tbData::system_otp_block"]
23612 [::core::mem::offset_of!(St25tbData, system_otp_block) - 524usize];
23613};
23614unsafe extern "C" {
23615 pub fn st25tb_alloc() -> *mut St25tbData;
23616}
23617unsafe extern "C" {
23618 pub fn st25tb_free(data: *mut St25tbData);
23619}
23620unsafe extern "C" {
23621 pub fn st25tb_reset(data: *mut St25tbData);
23622}
23623unsafe extern "C" {
23624 pub fn st25tb_copy(data: *mut St25tbData, other: *const St25tbData);
23625}
23626unsafe extern "C" {
23627 pub fn st25tb_verify(data: *mut St25tbData, device_type: *const FuriString) -> bool;
23628}
23629unsafe extern "C" {
23630 pub fn st25tb_load(data: *mut St25tbData, ff: *mut FlipperFormat, version: u32) -> bool;
23631}
23632unsafe extern "C" {
23633 pub fn st25tb_save(data: *const St25tbData, ff: *mut FlipperFormat) -> bool;
23634}
23635unsafe extern "C" {
23636 pub fn st25tb_is_equal(data: *const St25tbData, other: *const St25tbData) -> bool;
23637}
23638unsafe extern "C" {
23639 pub fn st25tb_get_block_count(type_: St25tbType) -> u8;
23640}
23641unsafe extern "C" {
23642 pub fn st25tb_get_device_name(
23643 data: *const St25tbData,
23644 name_type: NfcDeviceNameType,
23645 ) -> *const core::ffi::c_char;
23646}
23647unsafe extern "C" {
23648 pub fn st25tb_get_uid(data: *const St25tbData, uid_len: *mut usize) -> *const u8;
23649}
23650unsafe extern "C" {
23651 pub fn st25tb_set_uid(data: *mut St25tbData, uid: *const u8, uid_len: usize) -> bool;
23652}
23653unsafe extern "C" {
23654 pub fn st25tb_get_base_data(data: *const St25tbData) -> *mut St25tbData;
23655}
23656unsafe extern "C" {
23657 pub fn st25tb_get_type_from_uid(uid: *const u8) -> St25tbType;
23658}
23659#[repr(C)]
23660#[derive(Debug, Copy, Clone)]
23661pub struct St25tbPoller {
23662 _unused: [u8; 0],
23663}
23664pub const St25tbPollerEventTypeReady: St25tbPollerEventType = St25tbPollerEventType(0);
23665pub const St25tbPollerEventTypeRequestMode: St25tbPollerEventType = St25tbPollerEventType(1);
23666pub const St25tbPollerEventTypeFailure: St25tbPollerEventType = St25tbPollerEventType(2);
23667pub const St25tbPollerEventTypeSuccess: St25tbPollerEventType = St25tbPollerEventType(3);
23668#[repr(transparent)]
23669#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23670pub struct St25tbPollerEventType(pub core::ffi::c_uchar);
23671#[repr(C)]
23672#[derive(Debug, Copy, Clone)]
23673pub struct St25tbPollerReadyData {
23674 pub type_: St25tbType,
23675}
23676#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23677const _: () = {
23678 ["Size of St25tbPollerReadyData"][::core::mem::size_of::<St25tbPollerReadyData>() - 1usize];
23679 ["Alignment of St25tbPollerReadyData"]
23680 [::core::mem::align_of::<St25tbPollerReadyData>() - 1usize];
23681 ["Offset of field: St25tbPollerReadyData::type_"]
23682 [::core::mem::offset_of!(St25tbPollerReadyData, type_) - 0usize];
23683};
23684pub const St25tbPollerModeRead: St25tbPollerMode = St25tbPollerMode(0);
23685pub const St25tbPollerModeWrite: St25tbPollerMode = St25tbPollerMode(1);
23686pub const St25tbPollerModeNum: St25tbPollerMode = St25tbPollerMode(2);
23687#[repr(transparent)]
23688#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23689pub struct St25tbPollerMode(pub core::ffi::c_uchar);
23690#[repr(C)]
23691#[derive(Debug, Copy, Clone)]
23692pub struct St25tbPollerEventDataModeRequestWriteParams {
23693 pub block_number: u8,
23694 pub block_data: u32,
23695}
23696#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23697const _: () = {
23698 ["Size of St25tbPollerEventDataModeRequestWriteParams"]
23699 [::core::mem::size_of::<St25tbPollerEventDataModeRequestWriteParams>() - 8usize];
23700 ["Alignment of St25tbPollerEventDataModeRequestWriteParams"]
23701 [::core::mem::align_of::<St25tbPollerEventDataModeRequestWriteParams>() - 4usize];
23702 ["Offset of field: St25tbPollerEventDataModeRequestWriteParams::block_number"][::core::mem::offset_of!(
23703 St25tbPollerEventDataModeRequestWriteParams,
23704 block_number
23705 ) - 0usize];
23706 ["Offset of field: St25tbPollerEventDataModeRequestWriteParams::block_data"]
23707 [::core::mem::offset_of!(St25tbPollerEventDataModeRequestWriteParams, block_data) - 4usize];
23708};
23709#[repr(C)]
23710#[derive(Copy, Clone)]
23711pub union St25tbPollerEventDataModeRequestParams {
23712 pub write_params: St25tbPollerEventDataModeRequestWriteParams,
23713}
23714#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23715const _: () = {
23716 ["Size of St25tbPollerEventDataModeRequestParams"]
23717 [::core::mem::size_of::<St25tbPollerEventDataModeRequestParams>() - 8usize];
23718 ["Alignment of St25tbPollerEventDataModeRequestParams"]
23719 [::core::mem::align_of::<St25tbPollerEventDataModeRequestParams>() - 4usize];
23720 ["Offset of field: St25tbPollerEventDataModeRequestParams::write_params"]
23721 [::core::mem::offset_of!(St25tbPollerEventDataModeRequestParams, write_params) - 0usize];
23722};
23723#[repr(C)]
23724#[derive(Copy, Clone)]
23725pub struct St25tbPollerEventDataModeRequest {
23726 pub mode: St25tbPollerMode,
23727 pub params: St25tbPollerEventDataModeRequestParams,
23728}
23729#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23730const _: () = {
23731 ["Size of St25tbPollerEventDataModeRequest"]
23732 [::core::mem::size_of::<St25tbPollerEventDataModeRequest>() - 12usize];
23733 ["Alignment of St25tbPollerEventDataModeRequest"]
23734 [::core::mem::align_of::<St25tbPollerEventDataModeRequest>() - 4usize];
23735 ["Offset of field: St25tbPollerEventDataModeRequest::mode"]
23736 [::core::mem::offset_of!(St25tbPollerEventDataModeRequest, mode) - 0usize];
23737 ["Offset of field: St25tbPollerEventDataModeRequest::params"]
23738 [::core::mem::offset_of!(St25tbPollerEventDataModeRequest, params) - 4usize];
23739};
23740#[repr(C)]
23741#[derive(Copy, Clone)]
23742pub union St25tbPollerEventData {
23743 pub ready: St25tbPollerReadyData,
23744 pub mode_request: St25tbPollerEventDataModeRequest,
23745 pub error: St25tbError,
23746}
23747#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23748const _: () = {
23749 ["Size of St25tbPollerEventData"][::core::mem::size_of::<St25tbPollerEventData>() - 12usize];
23750 ["Alignment of St25tbPollerEventData"]
23751 [::core::mem::align_of::<St25tbPollerEventData>() - 4usize];
23752 ["Offset of field: St25tbPollerEventData::ready"]
23753 [::core::mem::offset_of!(St25tbPollerEventData, ready) - 0usize];
23754 ["Offset of field: St25tbPollerEventData::mode_request"]
23755 [::core::mem::offset_of!(St25tbPollerEventData, mode_request) - 0usize];
23756 ["Offset of field: St25tbPollerEventData::error"]
23757 [::core::mem::offset_of!(St25tbPollerEventData, error) - 0usize];
23758};
23759#[repr(C)]
23760#[derive(Debug, Copy, Clone)]
23761pub struct St25tbPollerEvent {
23762 pub type_: St25tbPollerEventType,
23763 pub data: *mut St25tbPollerEventData,
23764}
23765#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23766const _: () = {
23767 ["Size of St25tbPollerEvent"][::core::mem::size_of::<St25tbPollerEvent>() - 8usize];
23768 ["Alignment of St25tbPollerEvent"][::core::mem::align_of::<St25tbPollerEvent>() - 4usize];
23769 ["Offset of field: St25tbPollerEvent::type_"]
23770 [::core::mem::offset_of!(St25tbPollerEvent, type_) - 0usize];
23771 ["Offset of field: St25tbPollerEvent::data"]
23772 [::core::mem::offset_of!(St25tbPollerEvent, data) - 4usize];
23773};
23774unsafe extern "C" {
23775 pub fn st25tb_poller_send_frame(
23776 instance: *mut St25tbPoller,
23777 tx_buffer: *const BitBuffer,
23778 rx_buffer: *mut BitBuffer,
23779 fwt: u32,
23780 ) -> St25tbError;
23781}
23782unsafe extern "C" {
23783 pub fn st25tb_poller_initiate(instance: *mut St25tbPoller, chip_id_ptr: *mut u8)
23784 -> St25tbError;
23785}
23786unsafe extern "C" {
23787 pub fn st25tb_poller_select(instance: *mut St25tbPoller, chip_id_ptr: *mut u8) -> St25tbError;
23788}
23789unsafe extern "C" {
23790 pub fn st25tb_poller_get_uid(instance: *mut St25tbPoller, uid: *mut u8) -> St25tbError;
23791}
23792unsafe extern "C" {
23793 pub fn st25tb_poller_read_block(
23794 instance: *mut St25tbPoller,
23795 block: *mut u32,
23796 block_number: u8,
23797 ) -> St25tbError;
23798}
23799unsafe extern "C" {
23800 pub fn st25tb_poller_write_block(
23801 instance: *mut St25tbPoller,
23802 block: u32,
23803 block_number: u8,
23804 ) -> St25tbError;
23805}
23806unsafe extern "C" {
23807 pub fn st25tb_poller_halt(instance: *mut St25tbPoller) -> St25tbError;
23808}
23809unsafe extern "C" {
23810 pub fn st25tb_poller_sync_read_block(
23811 nfc: *mut Nfc,
23812 block_num: u8,
23813 block: *mut u32,
23814 ) -> St25tbError;
23815}
23816unsafe extern "C" {
23817 pub fn st25tb_poller_sync_write_block(nfc: *mut Nfc, block_num: u8, block: u32) -> St25tbError;
23818}
23819unsafe extern "C" {
23820 pub fn st25tb_poller_sync_detect_type(nfc: *mut Nfc, type_: *mut St25tbType) -> St25tbError;
23821}
23822unsafe extern "C" {
23823 pub fn st25tb_poller_sync_read(nfc: *mut Nfc, data: *mut St25tbData) -> St25tbError;
23824}
23825unsafe extern "C" {
23826 pub fn maxim_crc8(data: *const u8, data_size: u8, crc_init: u8) -> u8;
23827}
23828#[doc = "< Search for alarmed device"]
23829pub const OneWireHostSearchModeConditional: OneWireHostSearchMode = OneWireHostSearchMode(0);
23830#[doc = "< Search for all devices"]
23831pub const OneWireHostSearchModeNormal: OneWireHostSearchMode = OneWireHostSearchMode(1);
23832#[repr(transparent)]
23833#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23834pub struct OneWireHostSearchMode(pub core::ffi::c_uchar);
23835#[repr(C)]
23836#[derive(Debug, Copy, Clone)]
23837pub struct OneWireHost {
23838 _unused: [u8; 0],
23839}
23840unsafe extern "C" {
23841 #[doc = "Allocate OneWireHost instance\n # Arguments\n\n* `[in]` - gpio_pin connection pin\n # Returns\n\npointer to OneWireHost instance"]
23842 pub fn onewire_host_alloc(gpio_pin: *const GpioPin) -> *mut OneWireHost;
23843}
23844unsafe extern "C" {
23845 #[doc = "Destroy OneWireHost instance, free resources\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23846 pub fn onewire_host_free(host: *mut OneWireHost);
23847}
23848unsafe extern "C" {
23849 #[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"]
23850 pub fn onewire_host_reset(host: *mut OneWireHost) -> bool;
23851}
23852unsafe extern "C" {
23853 #[doc = "Read one bit\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n # Returns\n\nreceived bit value"]
23854 pub fn onewire_host_read_bit(host: *mut OneWireHost) -> bool;
23855}
23856unsafe extern "C" {
23857 #[doc = "Read one byte\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n # Returns\n\nreceived byte value"]
23858 pub fn onewire_host_read(host: *mut OneWireHost) -> u8;
23859}
23860unsafe extern "C" {
23861 #[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"]
23862 pub fn onewire_host_read_bytes(host: *mut OneWireHost, buffer: *mut u8, count: u16);
23863}
23864unsafe extern "C" {
23865 #[doc = "Write one bit\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `value` - bit value to write"]
23866 pub fn onewire_host_write_bit(host: *mut OneWireHost, value: bool);
23867}
23868unsafe extern "C" {
23869 #[doc = "Write one byte\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance\n * `value` - byte value to write"]
23870 pub fn onewire_host_write(host: *mut OneWireHost, value: u8);
23871}
23872unsafe extern "C" {
23873 #[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"]
23874 pub fn onewire_host_write_bytes(host: *mut OneWireHost, buffer: *const u8, count: u16);
23875}
23876unsafe extern "C" {
23877 #[doc = "Start working with the bus\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23878 pub fn onewire_host_start(host: *mut OneWireHost);
23879}
23880unsafe extern "C" {
23881 #[doc = "Stop working with the bus\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23882 pub fn onewire_host_stop(host: *mut OneWireHost);
23883}
23884unsafe extern "C" {
23885 #[doc = "Reset previous search results\n # Arguments\n\n* `[in]` - host pointer to OneWireHost instance"]
23886 pub fn onewire_host_reset_search(host: *mut OneWireHost);
23887}
23888unsafe extern "C" {
23889 #[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"]
23890 pub fn onewire_host_target_search(host: *mut OneWireHost, family_code: u8);
23891}
23892unsafe extern "C" {
23893 #[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"]
23894 pub fn onewire_host_search(
23895 host: *mut OneWireHost,
23896 new_addr: *mut u8,
23897 mode: OneWireHostSearchMode,
23898 ) -> bool;
23899}
23900unsafe extern "C" {
23901 #[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"]
23902 pub fn onewire_host_set_overdrive(host: *mut OneWireHost, set: bool);
23903}
23904unsafe extern "C" {
23905 pub fn onewire_host_set_timings_default(host: *mut OneWireHost);
23906}
23907unsafe extern "C" {
23908 pub fn onewire_host_set_timings_tm01x(host: *mut OneWireHost);
23909}
23910#[repr(C)]
23911#[derive(Debug, Copy, Clone)]
23912pub struct OneWireDevice {
23913 _unused: [u8; 0],
23914}
23915#[repr(C)]
23916#[derive(Debug, Copy, Clone)]
23917pub struct OneWireSlave {
23918 _unused: [u8; 0],
23919}
23920pub type OneWireSlaveResetCallback = ::core::option::Option<
23921 unsafe extern "C" fn(is_short: bool, context: *mut core::ffi::c_void) -> bool,
23922>;
23923pub type OneWireSlaveCommandCallback = ::core::option::Option<
23924 unsafe extern "C" fn(command: u8, context: *mut core::ffi::c_void) -> bool,
23925>;
23926pub type OneWireSlaveResultCallback =
23927 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
23928unsafe extern "C" {
23929 #[doc = "Allocate OneWireSlave instance\n # Arguments\n\n* `[in]` - gpio_pin connection pin\n # Returns\n\npointer to OneWireSlave instance"]
23930 pub fn onewire_slave_alloc(gpio_pin: *const GpioPin) -> *mut OneWireSlave;
23931}
23932unsafe extern "C" {
23933 #[doc = "Destroy OneWireSlave instance, free resources\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance"]
23934 pub fn onewire_slave_free(bus: *mut OneWireSlave);
23935}
23936unsafe extern "C" {
23937 #[doc = "Start working with the bus\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance"]
23938 pub fn onewire_slave_start(bus: *mut OneWireSlave);
23939}
23940unsafe extern "C" {
23941 #[doc = "Stop working with the bus\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance"]
23942 pub fn onewire_slave_stop(bus: *mut OneWireSlave);
23943}
23944unsafe extern "C" {
23945 #[doc = "Receive one bit\n # Arguments\n\n* `[in]` - bus pointer to OneWireSlave instance\n # Returns\n\nreceived bit value"]
23946 pub fn onewire_slave_receive_bit(bus: *mut OneWireSlave) -> bool;
23947}
23948unsafe extern "C" {
23949 #[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"]
23950 pub fn onewire_slave_send_bit(bus: *mut OneWireSlave, value: bool) -> bool;
23951}
23952unsafe extern "C" {
23953 #[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"]
23954 pub fn onewire_slave_send(bus: *mut OneWireSlave, data: *const u8, data_size: usize) -> bool;
23955}
23956unsafe extern "C" {
23957 #[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"]
23958 pub fn onewire_slave_receive(bus: *mut OneWireSlave, data: *mut u8, data_size: usize) -> bool;
23959}
23960unsafe extern "C" {
23961 #[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"]
23962 pub fn onewire_slave_set_overdrive(bus: *mut OneWireSlave, set: bool);
23963}
23964unsafe extern "C" {
23965 #[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"]
23966 pub fn onewire_slave_set_reset_callback(
23967 bus: *mut OneWireSlave,
23968 callback: OneWireSlaveResetCallback,
23969 context: *mut core::ffi::c_void,
23970 );
23971}
23972unsafe extern "C" {
23973 #[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"]
23974 pub fn onewire_slave_set_command_callback(
23975 bus: *mut OneWireSlave,
23976 callback: OneWireSlaveCommandCallback,
23977 context: *mut core::ffi::c_void,
23978 );
23979}
23980unsafe extern "C" {
23981 #[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"]
23982 pub fn onewire_slave_set_result_callback(
23983 bus: *mut OneWireSlave,
23984 result_cb: OneWireSlaveResultCallback,
23985 context: *mut core::ffi::c_void,
23986 );
23987}
23988unsafe extern "C" {
23989 pub fn __wrap_printf(format: *const core::ffi::c_char, ...) -> core::ffi::c_int;
23990}
23991unsafe extern "C" {
23992 pub fn __wrap_vsnprintf(
23993 str_: *mut core::ffi::c_char,
23994 size: usize,
23995 format: *const core::ffi::c_char,
23996 args: va_list,
23997 ) -> core::ffi::c_int;
23998}
23999unsafe extern "C" {
24000 pub fn __wrap_puts(str_: *const core::ffi::c_char) -> core::ffi::c_int;
24001}
24002unsafe extern "C" {
24003 pub fn __wrap_putchar(ch: core::ffi::c_int) -> core::ffi::c_int;
24004}
24005unsafe extern "C" {
24006 pub fn __wrap_putc(ch: core::ffi::c_int, stream: *mut FILE) -> core::ffi::c_int;
24007}
24008unsafe extern "C" {
24009 pub fn __wrap_snprintf(
24010 str_: *mut core::ffi::c_char,
24011 size: usize,
24012 format: *const core::ffi::c_char,
24013 ...
24014 ) -> core::ffi::c_int;
24015}
24016unsafe extern "C" {
24017 pub fn __wrap_fflush(stream: *mut FILE) -> core::ffi::c_int;
24018}
24019unsafe extern "C" {
24020 pub fn __wrap_fgetc(stream: *mut FILE) -> core::ffi::c_int;
24021}
24022unsafe extern "C" {
24023 pub fn __wrap_getc(stream: *mut FILE) -> core::ffi::c_int;
24024}
24025unsafe extern "C" {
24026 pub fn __wrap_getchar() -> core::ffi::c_int;
24027}
24028unsafe extern "C" {
24029 pub fn __wrap_fgets(
24030 str_: *mut core::ffi::c_char,
24031 n: usize,
24032 stream: *mut FILE,
24033 ) -> *mut core::ffi::c_char;
24034}
24035unsafe extern "C" {
24036 pub fn __wrap_ungetc(ch: core::ffi::c_int, stream: *mut FILE) -> core::ffi::c_int;
24037}
24038unsafe extern "C" {
24039 pub fn __wrap___assert(
24040 file: *const core::ffi::c_char,
24041 line: core::ffi::c_int,
24042 e: *const core::ffi::c_char,
24043 ) -> !;
24044}
24045unsafe extern "C" {
24046 pub fn __wrap___assert_func(
24047 file: *const core::ffi::c_char,
24048 line: core::ffi::c_int,
24049 func: *const core::ffi::c_char,
24050 e: *const core::ffi::c_char,
24051 ) -> !;
24052}
24053pub const SignalReaderEventTypeHalfBufferFilled: SignalReaderEventType = SignalReaderEventType(0);
24054pub const SignalReaderEventTypeFullBufferFilled: SignalReaderEventType = SignalReaderEventType(1);
24055#[repr(transparent)]
24056#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24057pub struct SignalReaderEventType(pub core::ffi::c_uchar);
24058#[repr(C)]
24059#[derive(Debug, Copy, Clone)]
24060pub struct SignalReaderEventData {
24061 pub data: *mut u8,
24062 pub len: usize,
24063}
24064#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24065const _: () = {
24066 ["Size of SignalReaderEventData"][::core::mem::size_of::<SignalReaderEventData>() - 8usize];
24067 ["Alignment of SignalReaderEventData"]
24068 [::core::mem::align_of::<SignalReaderEventData>() - 4usize];
24069 ["Offset of field: SignalReaderEventData::data"]
24070 [::core::mem::offset_of!(SignalReaderEventData, data) - 0usize];
24071 ["Offset of field: SignalReaderEventData::len"]
24072 [::core::mem::offset_of!(SignalReaderEventData, len) - 4usize];
24073};
24074#[repr(C)]
24075#[derive(Debug, Copy, Clone)]
24076pub struct SignalReaderEvent {
24077 pub type_: SignalReaderEventType,
24078 pub data: *mut SignalReaderEventData,
24079}
24080#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24081const _: () = {
24082 ["Size of SignalReaderEvent"][::core::mem::size_of::<SignalReaderEvent>() - 8usize];
24083 ["Alignment of SignalReaderEvent"][::core::mem::align_of::<SignalReaderEvent>() - 4usize];
24084 ["Offset of field: SignalReaderEvent::type_"]
24085 [::core::mem::offset_of!(SignalReaderEvent, type_) - 0usize];
24086 ["Offset of field: SignalReaderEvent::data"]
24087 [::core::mem::offset_of!(SignalReaderEvent, data) - 4usize];
24088};
24089pub const SignalReaderTimeUnit64Mhz: SignalReaderTimeUnit = SignalReaderTimeUnit(0);
24090#[repr(transparent)]
24091#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24092pub struct SignalReaderTimeUnit(pub core::ffi::c_uchar);
24093pub const SignalReaderPolarityNormal: SignalReaderPolarity = SignalReaderPolarity(0);
24094pub const SignalReaderPolarityInverted: SignalReaderPolarity = SignalReaderPolarity(1);
24095#[repr(transparent)]
24096#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24097pub struct SignalReaderPolarity(pub core::ffi::c_uchar);
24098pub const SignalReaderTriggerNone: SignalReaderTrigger = SignalReaderTrigger(0);
24099pub const SignalReaderTriggerRisingFallingEdge: SignalReaderTrigger = SignalReaderTrigger(1);
24100#[repr(transparent)]
24101#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24102pub struct SignalReaderTrigger(pub core::ffi::c_uchar);
24103pub type SignalReaderCallback = ::core::option::Option<
24104 unsafe extern "C" fn(event: SignalReaderEvent, context: *mut core::ffi::c_void),
24105>;
24106#[repr(C)]
24107#[derive(Debug, Copy, Clone)]
24108pub struct SignalReader {
24109 _unused: [u8; 0],
24110}
24111unsafe extern "C" {
24112 pub fn signal_reader_alloc(gpio_pin: *const GpioPin, size: u32) -> *mut SignalReader;
24113}
24114unsafe extern "C" {
24115 pub fn signal_reader_free(instance: *mut SignalReader);
24116}
24117unsafe extern "C" {
24118 pub fn signal_reader_set_pull(instance: *mut SignalReader, pull: GpioPull);
24119}
24120unsafe extern "C" {
24121 pub fn signal_reader_set_polarity(instance: *mut SignalReader, polarity: SignalReaderPolarity);
24122}
24123unsafe extern "C" {
24124 pub fn signal_reader_set_sample_rate(
24125 instance: *mut SignalReader,
24126 time_unit: SignalReaderTimeUnit,
24127 time: u32,
24128 );
24129}
24130unsafe extern "C" {
24131 pub fn signal_reader_set_trigger(instance: *mut SignalReader, trigger: SignalReaderTrigger);
24132}
24133unsafe extern "C" {
24134 pub fn signal_reader_start(
24135 instance: *mut SignalReader,
24136 callback: SignalReaderCallback,
24137 context: *mut core::ffi::c_void,
24138 );
24139}
24140unsafe extern "C" {
24141 pub fn signal_reader_stop(instance: *mut SignalReader);
24142}
24143#[doc = "Structure definition of some features of COMP instance."]
24144#[repr(C)]
24145#[derive(Debug, Copy, Clone)]
24146pub struct LL_COMP_InitTypeDef {
24147 #[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()."]
24148 pub PowerMode: u32,
24149 #[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()."]
24150 pub InputPlus: u32,
24151 #[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()."]
24152 pub InputMinus: u32,
24153 #[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()."]
24154 pub InputHysteresis: u32,
24155 #[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()."]
24156 pub OutputPolarity: u32,
24157 #[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()."]
24158 pub OutputBlankingSource: u32,
24159}
24160#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24161const _: () = {
24162 ["Size of LL_COMP_InitTypeDef"][::core::mem::size_of::<LL_COMP_InitTypeDef>() - 24usize];
24163 ["Alignment of LL_COMP_InitTypeDef"][::core::mem::align_of::<LL_COMP_InitTypeDef>() - 4usize];
24164 ["Offset of field: LL_COMP_InitTypeDef::PowerMode"]
24165 [::core::mem::offset_of!(LL_COMP_InitTypeDef, PowerMode) - 0usize];
24166 ["Offset of field: LL_COMP_InitTypeDef::InputPlus"]
24167 [::core::mem::offset_of!(LL_COMP_InitTypeDef, InputPlus) - 4usize];
24168 ["Offset of field: LL_COMP_InitTypeDef::InputMinus"]
24169 [::core::mem::offset_of!(LL_COMP_InitTypeDef, InputMinus) - 8usize];
24170 ["Offset of field: LL_COMP_InitTypeDef::InputHysteresis"]
24171 [::core::mem::offset_of!(LL_COMP_InitTypeDef, InputHysteresis) - 12usize];
24172 ["Offset of field: LL_COMP_InitTypeDef::OutputPolarity"]
24173 [::core::mem::offset_of!(LL_COMP_InitTypeDef, OutputPolarity) - 16usize];
24174 ["Offset of field: LL_COMP_InitTypeDef::OutputBlankingSource"]
24175 [::core::mem::offset_of!(LL_COMP_InitTypeDef, OutputBlankingSource) - 20usize];
24176};
24177unsafe extern "C" {
24178 pub fn LL_COMP_Init(
24179 COMPx: *mut COMP_TypeDef,
24180 COMP_InitStruct: *const LL_COMP_InitTypeDef,
24181 ) -> ErrorStatus;
24182}
24183#[doc = "DMA_LL_ES_INIT DMA Exported Init structure\n # "]
24184#[repr(C)]
24185#[derive(Debug, Copy, Clone)]
24186pub struct LL_DMA_InitTypeDef {
24187 #[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."]
24188 pub PeriphOrM2MSrcAddress: u32,
24189 #[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."]
24190 pub MemoryOrM2MDstAddress: u32,
24191 #[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()."]
24192 pub Direction: u32,
24193 #[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()."]
24194 pub Mode: u32,
24195 #[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()."]
24196 pub PeriphOrM2MSrcIncMode: u32,
24197 #[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()."]
24198 pub MemoryOrM2MDstIncMode: u32,
24199 #[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()."]
24200 pub PeriphOrM2MSrcDataSize: u32,
24201 #[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()."]
24202 pub MemoryOrM2MDstDataSize: u32,
24203 #[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()."]
24204 pub NbData: u32,
24205 #[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()."]
24206 pub PeriphRequest: u32,
24207 #[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()."]
24208 pub Priority: u32,
24209}
24210#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24211const _: () = {
24212 ["Size of LL_DMA_InitTypeDef"][::core::mem::size_of::<LL_DMA_InitTypeDef>() - 44usize];
24213 ["Alignment of LL_DMA_InitTypeDef"][::core::mem::align_of::<LL_DMA_InitTypeDef>() - 4usize];
24214 ["Offset of field: LL_DMA_InitTypeDef::PeriphOrM2MSrcAddress"]
24215 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphOrM2MSrcAddress) - 0usize];
24216 ["Offset of field: LL_DMA_InitTypeDef::MemoryOrM2MDstAddress"]
24217 [::core::mem::offset_of!(LL_DMA_InitTypeDef, MemoryOrM2MDstAddress) - 4usize];
24218 ["Offset of field: LL_DMA_InitTypeDef::Direction"]
24219 [::core::mem::offset_of!(LL_DMA_InitTypeDef, Direction) - 8usize];
24220 ["Offset of field: LL_DMA_InitTypeDef::Mode"]
24221 [::core::mem::offset_of!(LL_DMA_InitTypeDef, Mode) - 12usize];
24222 ["Offset of field: LL_DMA_InitTypeDef::PeriphOrM2MSrcIncMode"]
24223 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphOrM2MSrcIncMode) - 16usize];
24224 ["Offset of field: LL_DMA_InitTypeDef::MemoryOrM2MDstIncMode"]
24225 [::core::mem::offset_of!(LL_DMA_InitTypeDef, MemoryOrM2MDstIncMode) - 20usize];
24226 ["Offset of field: LL_DMA_InitTypeDef::PeriphOrM2MSrcDataSize"]
24227 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphOrM2MSrcDataSize) - 24usize];
24228 ["Offset of field: LL_DMA_InitTypeDef::MemoryOrM2MDstDataSize"]
24229 [::core::mem::offset_of!(LL_DMA_InitTypeDef, MemoryOrM2MDstDataSize) - 28usize];
24230 ["Offset of field: LL_DMA_InitTypeDef::NbData"]
24231 [::core::mem::offset_of!(LL_DMA_InitTypeDef, NbData) - 32usize];
24232 ["Offset of field: LL_DMA_InitTypeDef::PeriphRequest"]
24233 [::core::mem::offset_of!(LL_DMA_InitTypeDef, PeriphRequest) - 36usize];
24234 ["Offset of field: LL_DMA_InitTypeDef::Priority"]
24235 [::core::mem::offset_of!(LL_DMA_InitTypeDef, Priority) - 40usize];
24236};
24237unsafe extern "C" {
24238 #[doc = "DMA_LL_EF_Init Initialization and de-initialization functions\n # "]
24239 pub fn LL_DMA_Init(
24240 DMAx: *mut DMA_TypeDef,
24241 Channel: u32,
24242 DMA_InitStruct: *mut LL_DMA_InitTypeDef,
24243 ) -> ErrorStatus;
24244}
24245unsafe extern "C" {
24246 pub fn LL_DMA_DeInit(DMAx: *mut DMA_TypeDef, Channel: u32) -> ErrorStatus;
24247}
24248#[doc = "LPTIM Init structure definition"]
24249#[repr(C)]
24250#[derive(Debug, Copy, Clone)]
24251pub struct LL_LPTIM_InitTypeDef {
24252 #[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()."]
24253 pub ClockSource: u32,
24254 #[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()."]
24255 pub Prescaler: u32,
24256 #[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()."]
24257 pub Waveform: u32,
24258 #[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()."]
24259 pub Polarity: u32,
24260}
24261#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24262const _: () = {
24263 ["Size of LL_LPTIM_InitTypeDef"][::core::mem::size_of::<LL_LPTIM_InitTypeDef>() - 16usize];
24264 ["Alignment of LL_LPTIM_InitTypeDef"][::core::mem::align_of::<LL_LPTIM_InitTypeDef>() - 4usize];
24265 ["Offset of field: LL_LPTIM_InitTypeDef::ClockSource"]
24266 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, ClockSource) - 0usize];
24267 ["Offset of field: LL_LPTIM_InitTypeDef::Prescaler"]
24268 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, Prescaler) - 4usize];
24269 ["Offset of field: LL_LPTIM_InitTypeDef::Waveform"]
24270 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, Waveform) - 8usize];
24271 ["Offset of field: LL_LPTIM_InitTypeDef::Polarity"]
24272 [::core::mem::offset_of!(LL_LPTIM_InitTypeDef, Polarity) - 12usize];
24273};
24274unsafe extern "C" {
24275 #[doc = "LPTIM_LL_EF_Init Initialisation and deinitialisation functions\n # "]
24276 pub fn LL_LPTIM_DeInit(LPTIMx: *mut LPTIM_TypeDef) -> ErrorStatus;
24277}
24278unsafe extern "C" {
24279 pub fn LL_LPTIM_Init(
24280 LPTIMx: *mut LPTIM_TypeDef,
24281 LPTIM_InitStruct: *const LL_LPTIM_InitTypeDef,
24282 ) -> ErrorStatus;
24283}
24284#[doc = "LL LPUART Init Structure definition"]
24285#[repr(C)]
24286#[derive(Debug, Copy, Clone)]
24287pub struct LL_LPUART_InitTypeDef {
24288 #[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()."]
24289 pub PrescalerValue: u32,
24290 #[doc = "< This field defines expected LPUART communication baud rate.\n\nThis feature can be modified afterwards using unitary\nfunction LL_LPUART_SetBaudRate()."]
24291 pub BaudRate: u32,
24292 #[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()."]
24293 pub DataWidth: u32,
24294 #[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()."]
24295 pub StopBits: u32,
24296 #[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()."]
24297 pub Parity: u32,
24298 #[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()."]
24299 pub TransferDirection: u32,
24300 #[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()."]
24301 pub HardwareFlowControl: u32,
24302}
24303#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24304const _: () = {
24305 ["Size of LL_LPUART_InitTypeDef"][::core::mem::size_of::<LL_LPUART_InitTypeDef>() - 28usize];
24306 ["Alignment of LL_LPUART_InitTypeDef"]
24307 [::core::mem::align_of::<LL_LPUART_InitTypeDef>() - 4usize];
24308 ["Offset of field: LL_LPUART_InitTypeDef::PrescalerValue"]
24309 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, PrescalerValue) - 0usize];
24310 ["Offset of field: LL_LPUART_InitTypeDef::BaudRate"]
24311 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, BaudRate) - 4usize];
24312 ["Offset of field: LL_LPUART_InitTypeDef::DataWidth"]
24313 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, DataWidth) - 8usize];
24314 ["Offset of field: LL_LPUART_InitTypeDef::StopBits"]
24315 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, StopBits) - 12usize];
24316 ["Offset of field: LL_LPUART_InitTypeDef::Parity"]
24317 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, Parity) - 16usize];
24318 ["Offset of field: LL_LPUART_InitTypeDef::TransferDirection"]
24319 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, TransferDirection) - 20usize];
24320 ["Offset of field: LL_LPUART_InitTypeDef::HardwareFlowControl"]
24321 [::core::mem::offset_of!(LL_LPUART_InitTypeDef, HardwareFlowControl) - 24usize];
24322};
24323unsafe extern "C" {
24324 pub fn LL_LPUART_Init(
24325 LPUARTx: *mut USART_TypeDef,
24326 LPUART_InitStruct: *const LL_LPUART_InitTypeDef,
24327 ) -> ErrorStatus;
24328}
24329#[doc = "RTC Init structures definition"]
24330#[repr(C)]
24331#[derive(Debug, Copy, Clone)]
24332pub struct LL_RTC_InitTypeDef {
24333 #[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()."]
24334 pub HourFormat: u32,
24335 #[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()."]
24336 pub AsynchPrescaler: u32,
24337 #[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()."]
24338 pub SynchPrescaler: u32,
24339}
24340#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24341const _: () = {
24342 ["Size of LL_RTC_InitTypeDef"][::core::mem::size_of::<LL_RTC_InitTypeDef>() - 12usize];
24343 ["Alignment of LL_RTC_InitTypeDef"][::core::mem::align_of::<LL_RTC_InitTypeDef>() - 4usize];
24344 ["Offset of field: LL_RTC_InitTypeDef::HourFormat"]
24345 [::core::mem::offset_of!(LL_RTC_InitTypeDef, HourFormat) - 0usize];
24346 ["Offset of field: LL_RTC_InitTypeDef::AsynchPrescaler"]
24347 [::core::mem::offset_of!(LL_RTC_InitTypeDef, AsynchPrescaler) - 4usize];
24348 ["Offset of field: LL_RTC_InitTypeDef::SynchPrescaler"]
24349 [::core::mem::offset_of!(LL_RTC_InitTypeDef, SynchPrescaler) - 8usize];
24350};
24351unsafe extern "C" {
24352 pub fn LL_RTC_Init(
24353 RTCx: *mut RTC_TypeDef,
24354 RTC_InitStruct: *mut LL_RTC_InitTypeDef,
24355 ) -> ErrorStatus;
24356}
24357unsafe extern "C" {
24358 pub fn LL_RTC_EnterInitMode(RTCx: *mut RTC_TypeDef) -> ErrorStatus;
24359}
24360#[doc = "LL USART Init Structure definition"]
24361#[repr(C)]
24362#[derive(Debug, Copy, Clone)]
24363pub struct LL_USART_InitTypeDef {
24364 #[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()."]
24365 pub PrescalerValue: u32,
24366 #[doc = "< This field defines expected Usart communication baud rate.\n\nThis feature can be modified afterwards using unitary\nfunction LL_USART_SetBaudRate()."]
24367 pub BaudRate: u32,
24368 #[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()."]
24369 pub DataWidth: u32,
24370 #[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()."]
24371 pub StopBits: u32,
24372 #[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()."]
24373 pub Parity: u32,
24374 #[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()."]
24375 pub TransferDirection: u32,
24376 #[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()."]
24377 pub HardwareFlowControl: u32,
24378 #[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()."]
24379 pub OverSampling: u32,
24380}
24381#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24382const _: () = {
24383 ["Size of LL_USART_InitTypeDef"][::core::mem::size_of::<LL_USART_InitTypeDef>() - 32usize];
24384 ["Alignment of LL_USART_InitTypeDef"][::core::mem::align_of::<LL_USART_InitTypeDef>() - 4usize];
24385 ["Offset of field: LL_USART_InitTypeDef::PrescalerValue"]
24386 [::core::mem::offset_of!(LL_USART_InitTypeDef, PrescalerValue) - 0usize];
24387 ["Offset of field: LL_USART_InitTypeDef::BaudRate"]
24388 [::core::mem::offset_of!(LL_USART_InitTypeDef, BaudRate) - 4usize];
24389 ["Offset of field: LL_USART_InitTypeDef::DataWidth"]
24390 [::core::mem::offset_of!(LL_USART_InitTypeDef, DataWidth) - 8usize];
24391 ["Offset of field: LL_USART_InitTypeDef::StopBits"]
24392 [::core::mem::offset_of!(LL_USART_InitTypeDef, StopBits) - 12usize];
24393 ["Offset of field: LL_USART_InitTypeDef::Parity"]
24394 [::core::mem::offset_of!(LL_USART_InitTypeDef, Parity) - 16usize];
24395 ["Offset of field: LL_USART_InitTypeDef::TransferDirection"]
24396 [::core::mem::offset_of!(LL_USART_InitTypeDef, TransferDirection) - 20usize];
24397 ["Offset of field: LL_USART_InitTypeDef::HardwareFlowControl"]
24398 [::core::mem::offset_of!(LL_USART_InitTypeDef, HardwareFlowControl) - 24usize];
24399 ["Offset of field: LL_USART_InitTypeDef::OverSampling"]
24400 [::core::mem::offset_of!(LL_USART_InitTypeDef, OverSampling) - 28usize];
24401};
24402unsafe extern "C" {
24403 pub fn LL_USART_Init(
24404 USARTx: *mut USART_TypeDef,
24405 USART_InitStruct: *const LL_USART_InitTypeDef,
24406 ) -> ErrorStatus;
24407}
24408unsafe extern "C" {
24409 #[doc = "UTILS_EF_SYSTEM SYSTEM\n # "]
24410 pub fn LL_SetSystemCoreClock(HCLKFrequency: u32);
24411}
24412#[repr(C)]
24413#[derive(Debug, Copy, Clone)]
24414pub struct SubGhzBlockConst {
24415 pub te_long: u16,
24416 pub te_short: u16,
24417 pub te_delta: u16,
24418 pub min_count_bit_for_found: u8,
24419}
24420#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24421const _: () = {
24422 ["Size of SubGhzBlockConst"][::core::mem::size_of::<SubGhzBlockConst>() - 8usize];
24423 ["Alignment of SubGhzBlockConst"][::core::mem::align_of::<SubGhzBlockConst>() - 2usize];
24424 ["Offset of field: SubGhzBlockConst::te_long"]
24425 [::core::mem::offset_of!(SubGhzBlockConst, te_long) - 0usize];
24426 ["Offset of field: SubGhzBlockConst::te_short"]
24427 [::core::mem::offset_of!(SubGhzBlockConst, te_short) - 2usize];
24428 ["Offset of field: SubGhzBlockConst::te_delta"]
24429 [::core::mem::offset_of!(SubGhzBlockConst, te_delta) - 4usize];
24430 ["Offset of field: SubGhzBlockConst::min_count_bit_for_found"]
24431 [::core::mem::offset_of!(SubGhzBlockConst, min_count_bit_for_found) - 6usize];
24432};
24433#[repr(C)]
24434#[derive(Debug, Copy, Clone)]
24435pub struct SubGhzBlockDecoder {
24436 pub parser_step: u32,
24437 pub te_last: u32,
24438 pub decode_data: u64,
24439 pub decode_count_bit: u8,
24440}
24441#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24442const _: () = {
24443 ["Size of SubGhzBlockDecoder"][::core::mem::size_of::<SubGhzBlockDecoder>() - 24usize];
24444 ["Alignment of SubGhzBlockDecoder"][::core::mem::align_of::<SubGhzBlockDecoder>() - 8usize];
24445 ["Offset of field: SubGhzBlockDecoder::parser_step"]
24446 [::core::mem::offset_of!(SubGhzBlockDecoder, parser_step) - 0usize];
24447 ["Offset of field: SubGhzBlockDecoder::te_last"]
24448 [::core::mem::offset_of!(SubGhzBlockDecoder, te_last) - 4usize];
24449 ["Offset of field: SubGhzBlockDecoder::decode_data"]
24450 [::core::mem::offset_of!(SubGhzBlockDecoder, decode_data) - 8usize];
24451 ["Offset of field: SubGhzBlockDecoder::decode_count_bit"]
24452 [::core::mem::offset_of!(SubGhzBlockDecoder, decode_count_bit) - 16usize];
24453};
24454unsafe extern "C" {
24455 #[doc = "Add data bit when decoding.\n # Arguments\n\n* `decoder` - Pointer to a SubGhzBlockDecoder instance\n * `bit` - data, 1bit"]
24456 pub fn subghz_protocol_blocks_add_bit(decoder: *mut SubGhzBlockDecoder, bit: u8);
24457}
24458unsafe extern "C" {
24459 #[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"]
24460 pub fn subghz_protocol_blocks_add_to_128_bit(
24461 decoder: *mut SubGhzBlockDecoder,
24462 bit: u8,
24463 head_64_bit: *mut u64,
24464 );
24465}
24466unsafe extern "C" {
24467 #[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"]
24468 pub fn subghz_protocol_blocks_get_hash_data(decoder: *mut SubGhzBlockDecoder, len: usize)
24469 -> u8;
24470}
24471#[repr(C)]
24472#[derive(Debug, Copy, Clone)]
24473pub struct SubGhzProtocolBlockEncoder {
24474 pub is_running: bool,
24475 pub repeat: usize,
24476 pub front: usize,
24477 pub size_upload: usize,
24478 pub upload: *mut LevelDuration,
24479}
24480#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24481const _: () = {
24482 ["Size of SubGhzProtocolBlockEncoder"]
24483 [::core::mem::size_of::<SubGhzProtocolBlockEncoder>() - 20usize];
24484 ["Alignment of SubGhzProtocolBlockEncoder"]
24485 [::core::mem::align_of::<SubGhzProtocolBlockEncoder>() - 4usize];
24486 ["Offset of field: SubGhzProtocolBlockEncoder::is_running"]
24487 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, is_running) - 0usize];
24488 ["Offset of field: SubGhzProtocolBlockEncoder::repeat"]
24489 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, repeat) - 4usize];
24490 ["Offset of field: SubGhzProtocolBlockEncoder::front"]
24491 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, front) - 8usize];
24492 ["Offset of field: SubGhzProtocolBlockEncoder::size_upload"]
24493 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, size_upload) - 12usize];
24494 ["Offset of field: SubGhzProtocolBlockEncoder::upload"]
24495 [::core::mem::offset_of!(SubGhzProtocolBlockEncoder, upload) - 16usize];
24496};
24497pub const SubGhzProtocolBlockAlignBitLeft: SubGhzProtocolBlockAlignBit =
24498 SubGhzProtocolBlockAlignBit(0);
24499pub const SubGhzProtocolBlockAlignBitRight: SubGhzProtocolBlockAlignBit =
24500 SubGhzProtocolBlockAlignBit(1);
24501#[repr(transparent)]
24502#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24503pub struct SubGhzProtocolBlockAlignBit(pub core::ffi::c_uchar);
24504unsafe extern "C" {
24505 #[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"]
24506 pub fn subghz_protocol_blocks_set_bit_array(
24507 bit_value: bool,
24508 data_array: *mut u8,
24509 set_index_bit: usize,
24510 max_size_array: usize,
24511 );
24512}
24513unsafe extern "C" {
24514 #[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"]
24515 pub fn subghz_protocol_blocks_get_bit_array(data_array: *mut u8, read_index_bit: usize)
24516 -> bool;
24517}
24518unsafe extern "C" {
24519 #[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"]
24520 pub fn subghz_protocol_blocks_get_upload_from_bit_array(
24521 data_array: *mut u8,
24522 count_bit_data_array: usize,
24523 upload: *mut LevelDuration,
24524 max_size_upload: usize,
24525 duration_bit: u32,
24526 align_bit: SubGhzProtocolBlockAlignBit,
24527 ) -> usize;
24528}
24529#[repr(C)]
24530#[derive(Debug, Copy, Clone)]
24531pub struct SubGhzEnvironment {
24532 _unused: [u8; 0],
24533}
24534#[repr(C)]
24535#[derive(Debug, Copy, Clone)]
24536pub struct SubGhzProtocolRegistry {
24537 pub items: *const *const SubGhzProtocol,
24538 pub size: usize,
24539}
24540#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24541const _: () = {
24542 ["Size of SubGhzProtocolRegistry"][::core::mem::size_of::<SubGhzProtocolRegistry>() - 8usize];
24543 ["Alignment of SubGhzProtocolRegistry"]
24544 [::core::mem::align_of::<SubGhzProtocolRegistry>() - 4usize];
24545 ["Offset of field: SubGhzProtocolRegistry::items"]
24546 [::core::mem::offset_of!(SubGhzProtocolRegistry, items) - 0usize];
24547 ["Offset of field: SubGhzProtocolRegistry::size"]
24548 [::core::mem::offset_of!(SubGhzProtocolRegistry, size) - 4usize];
24549};
24550unsafe extern "C" {
24551 #[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"]
24552 pub fn subghz_protocol_registry_get_by_name(
24553 protocol_registry: *const SubGhzProtocolRegistry,
24554 name: *const core::ffi::c_char,
24555 ) -> *const SubGhzProtocol;
24556}
24557unsafe extern "C" {
24558 #[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"]
24559 pub fn subghz_protocol_registry_get_by_index(
24560 protocol_registry: *const SubGhzProtocolRegistry,
24561 index: usize,
24562 ) -> *const SubGhzProtocol;
24563}
24564unsafe extern "C" {
24565 #[doc = "Getting the number of registered protocols.\n # Arguments\n\n* `protocol_registry` - SubGhzProtocolRegistry\n # Returns\n\nNumber of protocols"]
24566 pub fn subghz_protocol_registry_count(
24567 protocol_registry: *const SubGhzProtocolRegistry,
24568 ) -> usize;
24569}
24570#[repr(C)]
24571#[derive(Debug, Copy, Clone)]
24572pub struct SubGhzKey {
24573 pub name: *mut FuriString,
24574 pub key: u64,
24575 pub type_: u16,
24576}
24577#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24578const _: () = {
24579 ["Size of SubGhzKey"][::core::mem::size_of::<SubGhzKey>() - 24usize];
24580 ["Alignment of SubGhzKey"][::core::mem::align_of::<SubGhzKey>() - 8usize];
24581 ["Offset of field: SubGhzKey::name"][::core::mem::offset_of!(SubGhzKey, name) - 0usize];
24582 ["Offset of field: SubGhzKey::key"][::core::mem::offset_of!(SubGhzKey, key) - 8usize];
24583 ["Offset of field: SubGhzKey::type_"][::core::mem::offset_of!(SubGhzKey, type_) - 16usize];
24584};
24585#[repr(C)]
24586#[derive(Debug, Copy, Clone)]
24587pub struct SubGhzKeyArray_s {
24588 pub size: usize,
24589 pub alloc: usize,
24590 pub ptr: *mut SubGhzKey,
24591}
24592#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24593const _: () = {
24594 ["Size of SubGhzKeyArray_s"][::core::mem::size_of::<SubGhzKeyArray_s>() - 12usize];
24595 ["Alignment of SubGhzKeyArray_s"][::core::mem::align_of::<SubGhzKeyArray_s>() - 4usize];
24596 ["Offset of field: SubGhzKeyArray_s::size"]
24597 [::core::mem::offset_of!(SubGhzKeyArray_s, size) - 0usize];
24598 ["Offset of field: SubGhzKeyArray_s::alloc"]
24599 [::core::mem::offset_of!(SubGhzKeyArray_s, alloc) - 4usize];
24600 ["Offset of field: SubGhzKeyArray_s::ptr"]
24601 [::core::mem::offset_of!(SubGhzKeyArray_s, ptr) - 8usize];
24602};
24603pub type SubGhzKeyArray_t = [SubGhzKeyArray_s; 1usize];
24604#[repr(C)]
24605#[derive(Debug, Copy, Clone)]
24606pub struct SubGhzKeyArray_it_s {
24607 pub index: usize,
24608 pub array: *const SubGhzKeyArray_s,
24609}
24610#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24611const _: () = {
24612 ["Size of SubGhzKeyArray_it_s"][::core::mem::size_of::<SubGhzKeyArray_it_s>() - 8usize];
24613 ["Alignment of SubGhzKeyArray_it_s"][::core::mem::align_of::<SubGhzKeyArray_it_s>() - 4usize];
24614 ["Offset of field: SubGhzKeyArray_it_s::index"]
24615 [::core::mem::offset_of!(SubGhzKeyArray_it_s, index) - 0usize];
24616 ["Offset of field: SubGhzKeyArray_it_s::array"]
24617 [::core::mem::offset_of!(SubGhzKeyArray_it_s, array) - 4usize];
24618};
24619pub type SubGhzKeyArray_it_t = [SubGhzKeyArray_it_s; 1usize];
24620pub type SubGhzKeyArray_ptr = *mut SubGhzKeyArray_s;
24621pub type SubGhzKeyArray_srcptr = *const SubGhzKeyArray_s;
24622pub type SubGhzKeyArray_ct = SubGhzKeyArray_t;
24623pub type SubGhzKeyArray_it_ct = SubGhzKeyArray_it_t;
24624pub type SubGhzKeyArray_subtype_ct = SubGhzKey;
24625#[repr(C)]
24626#[derive(Debug, Copy, Clone)]
24627pub struct SubGhzKeystore {
24628 _unused: [u8; 0],
24629}
24630unsafe extern "C" {
24631 #[doc = "Allocate SubGhzKeystore.\n # Returns\n\nSubGhzKeystore* pointer to a SubGhzKeystore instance"]
24632 pub fn subghz_keystore_alloc() -> *mut SubGhzKeystore;
24633}
24634unsafe extern "C" {
24635 #[doc = "Free SubGhzKeystore.\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance"]
24636 pub fn subghz_keystore_free(instance: *mut SubGhzKeystore);
24637}
24638unsafe extern "C" {
24639 #[doc = "Loading manufacture key from file\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance\n * `filename` - Full path to the file"]
24640 pub fn subghz_keystore_load(
24641 instance: *mut SubGhzKeystore,
24642 filename: *const core::ffi::c_char,
24643 ) -> bool;
24644}
24645unsafe extern "C" {
24646 #[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"]
24647 pub fn subghz_keystore_save(
24648 instance: *mut SubGhzKeystore,
24649 filename: *const core::ffi::c_char,
24650 iv: *mut u8,
24651 ) -> bool;
24652}
24653unsafe extern "C" {
24654 #[doc = "Get array of keys and names manufacture\n # Arguments\n\n* `instance` - Pointer to a SubGhzKeystore instance\n # Returns\n\nSubGhzKeyArray_t*"]
24655 pub fn subghz_keystore_get_data(instance: *mut SubGhzKeystore) -> *mut SubGhzKeyArray_t;
24656}
24657unsafe extern "C" {
24658 #[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"]
24659 pub fn subghz_keystore_raw_encrypted_save(
24660 input_file_name: *const core::ffi::c_char,
24661 output_file_name: *const core::ffi::c_char,
24662 iv: *mut u8,
24663 ) -> bool;
24664}
24665unsafe extern "C" {
24666 #[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"]
24667 pub fn subghz_keystore_raw_get_data(
24668 file_name: *const core::ffi::c_char,
24669 offset: usize,
24670 data: *mut u8,
24671 len: usize,
24672 ) -> bool;
24673}
24674unsafe extern "C" {
24675 #[doc = "Allocate SubGhzEnvironment.\n # Returns\n\nSubGhzEnvironment* pointer to a SubGhzEnvironment instance"]
24676 pub fn subghz_environment_alloc() -> *mut SubGhzEnvironment;
24677}
24678unsafe extern "C" {
24679 #[doc = "Free SubGhzEnvironment.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance"]
24680 pub fn subghz_environment_free(instance: *mut SubGhzEnvironment);
24681}
24682unsafe extern "C" {
24683 #[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"]
24684 pub fn subghz_environment_load_keystore(
24685 instance: *mut SubGhzEnvironment,
24686 filename: *const core::ffi::c_char,
24687 ) -> bool;
24688}
24689unsafe extern "C" {
24690 #[doc = "Get pointer to a SubGhzKeystore* instance.\n # Returns\n\nSubGhzEnvironment* pointer to a SubGhzEnvironment instance"]
24691 pub fn subghz_environment_get_keystore(instance: *mut SubGhzEnvironment)
24692 -> *mut SubGhzKeystore;
24693}
24694unsafe extern "C" {
24695 #[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"]
24696 pub fn subghz_environment_set_came_atomo_rainbow_table_file_name(
24697 instance: *mut SubGhzEnvironment,
24698 filename: *const core::ffi::c_char,
24699 );
24700}
24701unsafe extern "C" {
24702 #[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"]
24703 pub fn subghz_environment_get_came_atomo_rainbow_table_file_name(
24704 instance: *mut SubGhzEnvironment,
24705 ) -> *const core::ffi::c_char;
24706}
24707unsafe extern "C" {
24708 #[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"]
24709 pub fn subghz_environment_set_alutech_at_4n_rainbow_table_file_name(
24710 instance: *mut SubGhzEnvironment,
24711 filename: *const core::ffi::c_char,
24712 );
24713}
24714unsafe extern "C" {
24715 #[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"]
24716 pub fn subghz_environment_get_alutech_at_4n_rainbow_table_file_name(
24717 instance: *mut SubGhzEnvironment,
24718 ) -> *const core::ffi::c_char;
24719}
24720unsafe extern "C" {
24721 #[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"]
24722 pub fn subghz_environment_set_nice_flor_s_rainbow_table_file_name(
24723 instance: *mut SubGhzEnvironment,
24724 filename: *const core::ffi::c_char,
24725 );
24726}
24727unsafe extern "C" {
24728 #[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"]
24729 pub fn subghz_environment_get_nice_flor_s_rainbow_table_file_name(
24730 instance: *mut SubGhzEnvironment,
24731 ) -> *const core::ffi::c_char;
24732}
24733unsafe extern "C" {
24734 #[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"]
24735 pub fn subghz_environment_set_protocol_registry(
24736 instance: *mut SubGhzEnvironment,
24737 protocol_registry_items: *const SubGhzProtocolRegistry,
24738 );
24739}
24740unsafe extern "C" {
24741 #[doc = "Get list of protocols to work.\n # Arguments\n\n* `instance` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nPointer to a SubGhzProtocolRegistry"]
24742 pub fn subghz_environment_get_protocol_registry(
24743 instance: *mut SubGhzEnvironment,
24744 ) -> *const SubGhzProtocolRegistry;
24745}
24746unsafe extern "C" {
24747 #[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"]
24748 pub fn subghz_environment_get_protocol_name_registry(
24749 instance: *mut SubGhzEnvironment,
24750 idx: usize,
24751 ) -> *const core::ffi::c_char;
24752}
24753#[repr(C)]
24754#[derive(Debug, Copy, Clone)]
24755pub struct SubGhzRadioPreset {
24756 pub name: *mut FuriString,
24757 pub frequency: u32,
24758 pub data: *mut u8,
24759 pub data_size: usize,
24760}
24761#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24762const _: () = {
24763 ["Size of SubGhzRadioPreset"][::core::mem::size_of::<SubGhzRadioPreset>() - 16usize];
24764 ["Alignment of SubGhzRadioPreset"][::core::mem::align_of::<SubGhzRadioPreset>() - 4usize];
24765 ["Offset of field: SubGhzRadioPreset::name"]
24766 [::core::mem::offset_of!(SubGhzRadioPreset, name) - 0usize];
24767 ["Offset of field: SubGhzRadioPreset::frequency"]
24768 [::core::mem::offset_of!(SubGhzRadioPreset, frequency) - 4usize];
24769 ["Offset of field: SubGhzRadioPreset::data"]
24770 [::core::mem::offset_of!(SubGhzRadioPreset, data) - 8usize];
24771 ["Offset of field: SubGhzRadioPreset::data_size"]
24772 [::core::mem::offset_of!(SubGhzRadioPreset, data_size) - 12usize];
24773};
24774pub const SubGhzProtocolStatusOk: SubGhzProtocolStatus = SubGhzProtocolStatus(0);
24775#[doc = "< General unclassified error"]
24776pub const SubGhzProtocolStatusError: SubGhzProtocolStatus = SubGhzProtocolStatus(-1);
24777#[doc = "< Missing or invalid file header"]
24778pub const SubGhzProtocolStatusErrorParserHeader: SubGhzProtocolStatus = SubGhzProtocolStatus(-2);
24779#[doc = "< Missing `Frequency`"]
24780pub const SubGhzProtocolStatusErrorParserFrequency: SubGhzProtocolStatus = SubGhzProtocolStatus(-3);
24781#[doc = "< Missing `Preset`"]
24782pub const SubGhzProtocolStatusErrorParserPreset: SubGhzProtocolStatus = SubGhzProtocolStatus(-4);
24783#[doc = "< Missing `Custom_preset_module`"]
24784pub const SubGhzProtocolStatusErrorParserCustomPreset: SubGhzProtocolStatus =
24785 SubGhzProtocolStatus(-5);
24786#[doc = "< Missing `Protocol` name"]
24787pub const SubGhzProtocolStatusErrorParserProtocolName: SubGhzProtocolStatus =
24788 SubGhzProtocolStatus(-6);
24789#[doc = "< Missing `Bit`"]
24790pub const SubGhzProtocolStatusErrorParserBitCount: SubGhzProtocolStatus = SubGhzProtocolStatus(-7);
24791#[doc = "< Missing `Key`"]
24792pub const SubGhzProtocolStatusErrorParserKey: SubGhzProtocolStatus = SubGhzProtocolStatus(-8);
24793#[doc = "< Missing `Te`"]
24794pub const SubGhzProtocolStatusErrorParserTe: SubGhzProtocolStatus = SubGhzProtocolStatus(-9);
24795#[doc = "< Missing some other mandatory keys"]
24796pub const SubGhzProtocolStatusErrorParserOthers: SubGhzProtocolStatus = SubGhzProtocolStatus(-10);
24797#[doc = "< Invalid bit count value"]
24798pub const SubGhzProtocolStatusErrorValueBitCount: SubGhzProtocolStatus = SubGhzProtocolStatus(-11);
24799#[doc = "< Payload encoder failure"]
24800pub const SubGhzProtocolStatusErrorEncoderGetUpload: SubGhzProtocolStatus =
24801 SubGhzProtocolStatus(-12);
24802#[doc = "< Protocol not found"]
24803pub const SubGhzProtocolStatusErrorProtocolNotFound: SubGhzProtocolStatus =
24804 SubGhzProtocolStatus(-13);
24805#[doc = "< Prevents enum down-size compiler optimization."]
24806pub const SubGhzProtocolStatusReserved: SubGhzProtocolStatus = SubGhzProtocolStatus(2147483647);
24807#[repr(transparent)]
24808#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24809pub struct SubGhzProtocolStatus(pub core::ffi::c_int);
24810pub type SubGhzAlloc = ::core::option::Option<
24811 unsafe extern "C" fn(environment: *mut SubGhzEnvironment) -> *mut core::ffi::c_void,
24812>;
24813pub type SubGhzFree = ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
24814pub type SubGhzSerialize = ::core::option::Option<
24815 unsafe extern "C" fn(
24816 context: *mut core::ffi::c_void,
24817 flipper_format: *mut FlipperFormat,
24818 preset: *mut SubGhzRadioPreset,
24819 ) -> SubGhzProtocolStatus,
24820>;
24821pub type SubGhzDeserialize = ::core::option::Option<
24822 unsafe extern "C" fn(
24823 context: *mut core::ffi::c_void,
24824 flipper_format: *mut FlipperFormat,
24825 ) -> SubGhzProtocolStatus,
24826>;
24827pub type SubGhzDecoderFeed = ::core::option::Option<
24828 unsafe extern "C" fn(decoder: *mut core::ffi::c_void, level: bool, duration: u32),
24829>;
24830pub type SubGhzDecoderReset =
24831 ::core::option::Option<unsafe extern "C" fn(decoder: *mut core::ffi::c_void)>;
24832pub type SubGhzGetHashData =
24833 ::core::option::Option<unsafe extern "C" fn(decoder: *mut core::ffi::c_void) -> u8>;
24834pub type SubGhzGetString = ::core::option::Option<
24835 unsafe extern "C" fn(decoder: *mut core::ffi::c_void, output: *mut FuriString),
24836>;
24837pub type SubGhzEncoderStop =
24838 ::core::option::Option<unsafe extern "C" fn(encoder: *mut core::ffi::c_void)>;
24839pub type SubGhzEncoderYield =
24840 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void) -> LevelDuration>;
24841#[repr(C)]
24842#[derive(Debug, Copy, Clone)]
24843pub struct SubGhzProtocolDecoder {
24844 pub alloc: SubGhzAlloc,
24845 pub free: SubGhzFree,
24846 pub feed: SubGhzDecoderFeed,
24847 pub reset: SubGhzDecoderReset,
24848 pub get_hash_data: SubGhzGetHashData,
24849 pub get_string: SubGhzGetString,
24850 pub serialize: SubGhzSerialize,
24851 pub deserialize: SubGhzDeserialize,
24852}
24853#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24854const _: () = {
24855 ["Size of SubGhzProtocolDecoder"][::core::mem::size_of::<SubGhzProtocolDecoder>() - 32usize];
24856 ["Alignment of SubGhzProtocolDecoder"]
24857 [::core::mem::align_of::<SubGhzProtocolDecoder>() - 4usize];
24858 ["Offset of field: SubGhzProtocolDecoder::alloc"]
24859 [::core::mem::offset_of!(SubGhzProtocolDecoder, alloc) - 0usize];
24860 ["Offset of field: SubGhzProtocolDecoder::free"]
24861 [::core::mem::offset_of!(SubGhzProtocolDecoder, free) - 4usize];
24862 ["Offset of field: SubGhzProtocolDecoder::feed"]
24863 [::core::mem::offset_of!(SubGhzProtocolDecoder, feed) - 8usize];
24864 ["Offset of field: SubGhzProtocolDecoder::reset"]
24865 [::core::mem::offset_of!(SubGhzProtocolDecoder, reset) - 12usize];
24866 ["Offset of field: SubGhzProtocolDecoder::get_hash_data"]
24867 [::core::mem::offset_of!(SubGhzProtocolDecoder, get_hash_data) - 16usize];
24868 ["Offset of field: SubGhzProtocolDecoder::get_string"]
24869 [::core::mem::offset_of!(SubGhzProtocolDecoder, get_string) - 20usize];
24870 ["Offset of field: SubGhzProtocolDecoder::serialize"]
24871 [::core::mem::offset_of!(SubGhzProtocolDecoder, serialize) - 24usize];
24872 ["Offset of field: SubGhzProtocolDecoder::deserialize"]
24873 [::core::mem::offset_of!(SubGhzProtocolDecoder, deserialize) - 28usize];
24874};
24875#[repr(C)]
24876#[derive(Debug, Copy, Clone)]
24877pub struct SubGhzProtocolEncoder {
24878 pub alloc: SubGhzAlloc,
24879 pub free: SubGhzFree,
24880 pub deserialize: SubGhzDeserialize,
24881 pub stop: SubGhzEncoderStop,
24882 pub yield_: SubGhzEncoderYield,
24883}
24884#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24885const _: () = {
24886 ["Size of SubGhzProtocolEncoder"][::core::mem::size_of::<SubGhzProtocolEncoder>() - 20usize];
24887 ["Alignment of SubGhzProtocolEncoder"]
24888 [::core::mem::align_of::<SubGhzProtocolEncoder>() - 4usize];
24889 ["Offset of field: SubGhzProtocolEncoder::alloc"]
24890 [::core::mem::offset_of!(SubGhzProtocolEncoder, alloc) - 0usize];
24891 ["Offset of field: SubGhzProtocolEncoder::free"]
24892 [::core::mem::offset_of!(SubGhzProtocolEncoder, free) - 4usize];
24893 ["Offset of field: SubGhzProtocolEncoder::deserialize"]
24894 [::core::mem::offset_of!(SubGhzProtocolEncoder, deserialize) - 8usize];
24895 ["Offset of field: SubGhzProtocolEncoder::stop"]
24896 [::core::mem::offset_of!(SubGhzProtocolEncoder, stop) - 12usize];
24897 ["Offset of field: SubGhzProtocolEncoder::yield_"]
24898 [::core::mem::offset_of!(SubGhzProtocolEncoder, yield_) - 16usize];
24899};
24900pub const SubGhzProtocolTypeUnknown: SubGhzProtocolType = SubGhzProtocolType(0);
24901pub const SubGhzProtocolTypeStatic: SubGhzProtocolType = SubGhzProtocolType(1);
24902pub const SubGhzProtocolTypeDynamic: SubGhzProtocolType = SubGhzProtocolType(2);
24903pub const SubGhzProtocolTypeRAW: SubGhzProtocolType = SubGhzProtocolType(3);
24904pub const SubGhzProtocolWeatherStation: SubGhzProtocolType = SubGhzProtocolType(4);
24905pub const SubGhzProtocolCustom: SubGhzProtocolType = SubGhzProtocolType(5);
24906#[repr(transparent)]
24907#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24908pub struct SubGhzProtocolType(pub core::ffi::c_uchar);
24909pub const SubGhzProtocolFlag_RAW: SubGhzProtocolFlag = SubGhzProtocolFlag(1);
24910pub const SubGhzProtocolFlag_Decodable: SubGhzProtocolFlag = SubGhzProtocolFlag(2);
24911pub const SubGhzProtocolFlag_315: SubGhzProtocolFlag = SubGhzProtocolFlag(4);
24912pub const SubGhzProtocolFlag_433: SubGhzProtocolFlag = SubGhzProtocolFlag(8);
24913pub const SubGhzProtocolFlag_868: SubGhzProtocolFlag = SubGhzProtocolFlag(16);
24914pub const SubGhzProtocolFlag_AM: SubGhzProtocolFlag = SubGhzProtocolFlag(32);
24915pub const SubGhzProtocolFlag_FM: SubGhzProtocolFlag = SubGhzProtocolFlag(64);
24916pub const SubGhzProtocolFlag_Save: SubGhzProtocolFlag = SubGhzProtocolFlag(128);
24917pub const SubGhzProtocolFlag_Load: SubGhzProtocolFlag = SubGhzProtocolFlag(256);
24918pub const SubGhzProtocolFlag_Send: SubGhzProtocolFlag = SubGhzProtocolFlag(512);
24919pub const SubGhzProtocolFlag_BinRAW: SubGhzProtocolFlag = SubGhzProtocolFlag(1024);
24920#[repr(transparent)]
24921#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
24922pub struct SubGhzProtocolFlag(pub core::ffi::c_ushort);
24923#[repr(C)]
24924#[derive(Debug, Copy, Clone)]
24925pub struct SubGhzProtocol {
24926 pub name: *const core::ffi::c_char,
24927 pub type_: SubGhzProtocolType,
24928 pub flag: SubGhzProtocolFlag,
24929 pub encoder: *const SubGhzProtocolEncoder,
24930 pub decoder: *const SubGhzProtocolDecoder,
24931}
24932#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24933const _: () = {
24934 ["Size of SubGhzProtocol"][::core::mem::size_of::<SubGhzProtocol>() - 16usize];
24935 ["Alignment of SubGhzProtocol"][::core::mem::align_of::<SubGhzProtocol>() - 4usize];
24936 ["Offset of field: SubGhzProtocol::name"]
24937 [::core::mem::offset_of!(SubGhzProtocol, name) - 0usize];
24938 ["Offset of field: SubGhzProtocol::type_"]
24939 [::core::mem::offset_of!(SubGhzProtocol, type_) - 4usize];
24940 ["Offset of field: SubGhzProtocol::flag"]
24941 [::core::mem::offset_of!(SubGhzProtocol, flag) - 6usize];
24942 ["Offset of field: SubGhzProtocol::encoder"]
24943 [::core::mem::offset_of!(SubGhzProtocol, encoder) - 8usize];
24944 ["Offset of field: SubGhzProtocol::decoder"]
24945 [::core::mem::offset_of!(SubGhzProtocol, decoder) - 12usize];
24946};
24947#[repr(C)]
24948#[derive(Debug, Copy, Clone)]
24949pub struct SubGhzBlockGeneric {
24950 pub protocol_name: *const core::ffi::c_char,
24951 pub data: u64,
24952 pub serial: u32,
24953 pub data_count_bit: u16,
24954 pub btn: u8,
24955 pub cnt: u32,
24956}
24957#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24958const _: () = {
24959 ["Size of SubGhzBlockGeneric"][::core::mem::size_of::<SubGhzBlockGeneric>() - 32usize];
24960 ["Alignment of SubGhzBlockGeneric"][::core::mem::align_of::<SubGhzBlockGeneric>() - 8usize];
24961 ["Offset of field: SubGhzBlockGeneric::protocol_name"]
24962 [::core::mem::offset_of!(SubGhzBlockGeneric, protocol_name) - 0usize];
24963 ["Offset of field: SubGhzBlockGeneric::data"]
24964 [::core::mem::offset_of!(SubGhzBlockGeneric, data) - 8usize];
24965 ["Offset of field: SubGhzBlockGeneric::serial"]
24966 [::core::mem::offset_of!(SubGhzBlockGeneric, serial) - 16usize];
24967 ["Offset of field: SubGhzBlockGeneric::data_count_bit"]
24968 [::core::mem::offset_of!(SubGhzBlockGeneric, data_count_bit) - 20usize];
24969 ["Offset of field: SubGhzBlockGeneric::btn"]
24970 [::core::mem::offset_of!(SubGhzBlockGeneric, btn) - 22usize];
24971 ["Offset of field: SubGhzBlockGeneric::cnt"]
24972 [::core::mem::offset_of!(SubGhzBlockGeneric, cnt) - 24usize];
24973};
24974unsafe extern "C" {
24975 #[doc = "Get name preset.\n # Arguments\n\n* `preset_name` - name preset\n * `preset_str` - Output name preset"]
24976 pub fn subghz_block_generic_get_preset_name(
24977 preset_name: *const core::ffi::c_char,
24978 preset_str: *mut FuriString,
24979 );
24980}
24981unsafe extern "C" {
24982 #[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"]
24983 pub fn subghz_block_generic_serialize(
24984 instance: *mut SubGhzBlockGeneric,
24985 flipper_format: *mut FlipperFormat,
24986 preset: *mut SubGhzRadioPreset,
24987 ) -> SubGhzProtocolStatus;
24988}
24989unsafe extern "C" {
24990 #[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"]
24991 pub fn subghz_block_generic_deserialize(
24992 instance: *mut SubGhzBlockGeneric,
24993 flipper_format: *mut FlipperFormat,
24994 ) -> SubGhzProtocolStatus;
24995}
24996unsafe extern "C" {
24997 #[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"]
24998 pub fn subghz_block_generic_deserialize_check_count_bit(
24999 instance: *mut SubGhzBlockGeneric,
25000 flipper_format: *mut FlipperFormat,
25001 count_bit: u16,
25002 ) -> SubGhzProtocolStatus;
25003}
25004unsafe extern "C" {
25005 #[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"]
25006 pub fn subghz_protocol_blocks_reverse_key(key: u64, bit_count: u8) -> u64;
25007}
25008unsafe extern "C" {
25009 #[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"]
25010 pub fn subghz_protocol_blocks_get_parity(key: u64, bit_count: u8) -> u8;
25011}
25012unsafe extern "C" {
25013 #[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"]
25014 pub fn subghz_protocol_blocks_crc4(
25015 message: *const u8,
25016 size: usize,
25017 polynomial: u8,
25018 init: u8,
25019 ) -> u8;
25020}
25021unsafe extern "C" {
25022 #[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"]
25023 pub fn subghz_protocol_blocks_crc7(
25024 message: *const u8,
25025 size: usize,
25026 polynomial: u8,
25027 init: u8,
25028 ) -> u8;
25029}
25030unsafe extern "C" {
25031 #[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"]
25032 pub fn subghz_protocol_blocks_crc8(
25033 message: *const u8,
25034 size: usize,
25035 polynomial: u8,
25036 init: u8,
25037 ) -> u8;
25038}
25039unsafe extern "C" {
25040 #[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"]
25041 pub fn subghz_protocol_blocks_crc8le(
25042 message: *const u8,
25043 size: usize,
25044 polynomial: u8,
25045 init: u8,
25046 ) -> u8;
25047}
25048unsafe extern "C" {
25049 #[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"]
25050 pub fn subghz_protocol_blocks_crc16lsb(
25051 message: *const u8,
25052 size: usize,
25053 polynomial: u16,
25054 init: u16,
25055 ) -> u16;
25056}
25057unsafe extern "C" {
25058 #[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"]
25059 pub fn subghz_protocol_blocks_crc16(
25060 message: *const u8,
25061 size: usize,
25062 polynomial: u16,
25063 init: u16,
25064 ) -> u16;
25065}
25066unsafe extern "C" {
25067 #[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"]
25068 pub fn subghz_protocol_blocks_lfsr_digest8(
25069 message: *const u8,
25070 size: usize,
25071 gen_: u8,
25072 key: u8,
25073 ) -> u8;
25074}
25075unsafe extern "C" {
25076 #[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"]
25077 pub fn subghz_protocol_blocks_lfsr_digest8_reflect(
25078 message: *const u8,
25079 size: usize,
25080 gen_: u8,
25081 key: u8,
25082 ) -> u8;
25083}
25084unsafe extern "C" {
25085 #[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"]
25086 pub fn subghz_protocol_blocks_lfsr_digest16(
25087 message: *const u8,
25088 size: usize,
25089 gen_: u16,
25090 key: u16,
25091 ) -> u16;
25092}
25093unsafe extern "C" {
25094 #[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"]
25095 pub fn subghz_protocol_blocks_add_bytes(message: *const u8, size: usize) -> u8;
25096}
25097unsafe extern "C" {
25098 #[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"]
25099 pub fn subghz_protocol_blocks_parity8(byte: u8) -> u8;
25100}
25101unsafe extern "C" {
25102 #[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"]
25103 pub fn subghz_protocol_blocks_parity_bytes(message: *const u8, size: usize) -> u8;
25104}
25105unsafe extern "C" {
25106 #[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"]
25107 pub fn subghz_protocol_blocks_xor_bytes(message: *const u8, size: usize) -> u8;
25108}
25109unsafe extern "C" {
25110 pub static subghz_device_cc1101_preset_ook_270khz_async_regs: [u8; 0usize];
25111}
25112unsafe extern "C" {
25113 pub static subghz_device_cc1101_preset_ook_650khz_async_regs: [u8; 0usize];
25114}
25115unsafe extern "C" {
25116 pub static subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs: [u8; 0usize];
25117}
25118unsafe extern "C" {
25119 pub static subghz_device_cc1101_preset_2fsk_dev12khz_async_regs: [u8; 0usize];
25120}
25121unsafe extern "C" {
25122 pub static subghz_device_cc1101_preset_2fsk_dev47_6khz_async_regs: [u8; 0usize];
25123}
25124unsafe extern "C" {
25125 pub static subghz_device_cc1101_preset_msk_99_97kb_async_regs: [u8; 0usize];
25126}
25127unsafe extern "C" {
25128 pub static subghz_device_cc1101_preset_gfsk_9_99kb_async_regs: [u8; 0usize];
25129}
25130#[repr(C)]
25131#[derive(Debug, Copy, Clone)]
25132pub struct SubGhzDeviceCC1101Int {
25133 _unused: [u8; 0],
25134}
25135unsafe extern "C" {
25136 #[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"]
25137 pub fn subghz_protocol_secplus_v2_create_data(
25138 context: *mut core::ffi::c_void,
25139 flipper_format: *mut FlipperFormat,
25140 serial: u32,
25141 btn: u8,
25142 cnt: u32,
25143 preset: *mut SubGhzRadioPreset,
25144 ) -> bool;
25145}
25146unsafe extern "C" {
25147 #[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"]
25148 pub fn subghz_protocol_keeloq_create_data(
25149 context: *mut core::ffi::c_void,
25150 flipper_format: *mut FlipperFormat,
25151 serial: u32,
25152 btn: u8,
25153 cnt: u16,
25154 manufacture_name: *const core::ffi::c_char,
25155 preset: *mut SubGhzRadioPreset,
25156 ) -> bool;
25157}
25158#[repr(C)]
25159#[derive(Debug, Copy, Clone)]
25160pub struct SubGhzProtocolDecoderBinRAW {
25161 _unused: [u8; 0],
25162}
25163unsafe extern "C" {
25164 pub fn subghz_protocol_decoder_bin_raw_data_input_rssi(
25165 instance: *mut SubGhzProtocolDecoderBinRAW,
25166 rssi: f32,
25167 );
25168}
25169unsafe extern "C" {
25170 #[doc = "Validation of fixed parts SubGhzProtocolDecoderSecPlus_v1.\n # Arguments\n\n* `fixed` - fixed parts\n # Returns\n\ntrue On success"]
25171 pub fn subghz_protocol_secplus_v1_check_fixed(fixed: u32) -> bool;
25172}
25173pub type SubGhzProtocolDecoderBaseRxCallback = ::core::option::Option<
25174 unsafe extern "C" fn(instance: *mut SubGhzProtocolDecoderBase, context: *mut core::ffi::c_void),
25175>;
25176pub type SubGhzProtocolDecoderBaseSerialize = ::core::option::Option<
25177 unsafe extern "C" fn(decoder_base: *mut SubGhzProtocolDecoderBase, output: *mut FuriString),
25178>;
25179#[repr(C)]
25180#[derive(Debug, Copy, Clone)]
25181pub struct SubGhzProtocolDecoderBase {
25182 pub protocol: *const SubGhzProtocol,
25183 pub callback: SubGhzProtocolDecoderBaseRxCallback,
25184 pub context: *mut core::ffi::c_void,
25185}
25186#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25187const _: () = {
25188 ["Size of SubGhzProtocolDecoderBase"]
25189 [::core::mem::size_of::<SubGhzProtocolDecoderBase>() - 12usize];
25190 ["Alignment of SubGhzProtocolDecoderBase"]
25191 [::core::mem::align_of::<SubGhzProtocolDecoderBase>() - 4usize];
25192 ["Offset of field: SubGhzProtocolDecoderBase::protocol"]
25193 [::core::mem::offset_of!(SubGhzProtocolDecoderBase, protocol) - 0usize];
25194 ["Offset of field: SubGhzProtocolDecoderBase::callback"]
25195 [::core::mem::offset_of!(SubGhzProtocolDecoderBase, callback) - 4usize];
25196 ["Offset of field: SubGhzProtocolDecoderBase::context"]
25197 [::core::mem::offset_of!(SubGhzProtocolDecoderBase, context) - 8usize];
25198};
25199unsafe extern "C" {
25200 #[doc = "Getting a textual representation of the received data.\n # Arguments\n\n* `decoder_base` - Pointer to a SubGhzProtocolDecoderBase instance\n * `output` - Resulting text"]
25201 pub fn subghz_protocol_decoder_base_get_string(
25202 decoder_base: *mut SubGhzProtocolDecoderBase,
25203 output: *mut FuriString,
25204 ) -> bool;
25205}
25206unsafe extern "C" {
25207 #[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"]
25208 pub fn subghz_protocol_decoder_base_serialize(
25209 decoder_base: *mut SubGhzProtocolDecoderBase,
25210 flipper_format: *mut FlipperFormat,
25211 preset: *mut SubGhzRadioPreset,
25212 ) -> SubGhzProtocolStatus;
25213}
25214unsafe extern "C" {
25215 #[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"]
25216 pub fn subghz_protocol_decoder_base_deserialize(
25217 decoder_base: *mut SubGhzProtocolDecoderBase,
25218 flipper_format: *mut FlipperFormat,
25219 ) -> SubGhzProtocolStatus;
25220}
25221unsafe extern "C" {
25222 #[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"]
25223 pub fn subghz_protocol_decoder_base_get_hash_data(
25224 decoder_base: *mut SubGhzProtocolDecoderBase,
25225 ) -> u8;
25226}
25227#[repr(C)]
25228#[derive(Debug, Copy, Clone)]
25229pub struct SubGhzProtocolEncoderBase {
25230 pub protocol: *const SubGhzProtocol,
25231}
25232#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25233const _: () = {
25234 ["Size of SubGhzProtocolEncoderBase"]
25235 [::core::mem::size_of::<SubGhzProtocolEncoderBase>() - 4usize];
25236 ["Alignment of SubGhzProtocolEncoderBase"]
25237 [::core::mem::align_of::<SubGhzProtocolEncoderBase>() - 4usize];
25238 ["Offset of field: SubGhzProtocolEncoderBase::protocol"]
25239 [::core::mem::offset_of!(SubGhzProtocolEncoderBase, protocol) - 0usize];
25240};
25241pub type SubGhzProtocolEncoderRAWCallbackEnd =
25242 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25243#[repr(C)]
25244#[derive(Debug, Copy, Clone)]
25245pub struct SubGhzProtocolDecoderRAW {
25246 _unused: [u8; 0],
25247}
25248#[repr(C)]
25249#[derive(Debug, Copy, Clone)]
25250pub struct SubGhzProtocolEncoderRAW {
25251 _unused: [u8; 0],
25252}
25253unsafe extern "C" {
25254 pub static subghz_protocol_raw_decoder: SubGhzProtocolDecoder;
25255}
25256unsafe extern "C" {
25257 pub static subghz_protocol_raw_encoder: SubGhzProtocolEncoder;
25258}
25259unsafe extern "C" {
25260 pub static subghz_protocol_raw: SubGhzProtocol;
25261}
25262unsafe extern "C" {
25263 #[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"]
25264 pub fn subghz_protocol_raw_save_to_file_init(
25265 instance: *mut SubGhzProtocolDecoderRAW,
25266 dev_name: *const core::ffi::c_char,
25267 preset: *mut SubGhzRadioPreset,
25268 ) -> bool;
25269}
25270unsafe extern "C" {
25271 #[doc = "Stop writing file to flash\n # Arguments\n\n* `instance` - Pointer to a SubGhzProtocolDecoderRAW instance"]
25272 pub fn subghz_protocol_raw_save_to_file_stop(instance: *mut SubGhzProtocolDecoderRAW);
25273}
25274unsafe extern "C" {
25275 #[doc = "Get the number of samples received SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `instance` - Pointer to a SubGhzProtocolDecoderRAW instance\n # Returns\n\ncount of samples"]
25276 pub fn subghz_protocol_raw_get_sample_write(instance: *mut SubGhzProtocolDecoderRAW) -> usize;
25277}
25278unsafe extern "C" {
25279 #[doc = "Allocate SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzProtocolDecoderRAW* pointer to a SubGhzProtocolDecoderRAW instance"]
25280 pub fn subghz_protocol_decoder_raw_alloc(
25281 environment: *mut SubGhzEnvironment,
25282 ) -> *mut core::ffi::c_void;
25283}
25284unsafe extern "C" {
25285 #[doc = "Free SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance"]
25286 pub fn subghz_protocol_decoder_raw_free(context: *mut core::ffi::c_void);
25287}
25288unsafe extern "C" {
25289 #[doc = "Reset decoder SubGhzProtocolDecoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance"]
25290 pub fn subghz_protocol_decoder_raw_reset(context: *mut core::ffi::c_void);
25291}
25292unsafe extern "C" {
25293 #[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"]
25294 pub fn subghz_protocol_decoder_raw_feed(
25295 context: *mut core::ffi::c_void,
25296 level: bool,
25297 duration: u32,
25298 );
25299}
25300unsafe extern "C" {
25301 #[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"]
25302 pub fn subghz_protocol_decoder_raw_deserialize(
25303 context: *mut core::ffi::c_void,
25304 flipper_format: *mut FlipperFormat,
25305 ) -> SubGhzProtocolStatus;
25306}
25307unsafe extern "C" {
25308 #[doc = "Getting a textual representation of the received data.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolDecoderRAW instance\n * `output` - Resulting text"]
25309 pub fn subghz_protocol_decoder_raw_get_string(
25310 context: *mut core::ffi::c_void,
25311 output: *mut FuriString,
25312 );
25313}
25314unsafe extern "C" {
25315 #[doc = "Allocate SubGhzProtocolEncoderRAW.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzProtocolEncoderRAW* pointer to a SubGhzProtocolEncoderRAW instance"]
25316 pub fn subghz_protocol_encoder_raw_alloc(
25317 environment: *mut SubGhzEnvironment,
25318 ) -> *mut core::ffi::c_void;
25319}
25320unsafe extern "C" {
25321 #[doc = "Free SubGhzProtocolEncoderRAW.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance"]
25322 pub fn subghz_protocol_encoder_raw_free(context: *mut core::ffi::c_void);
25323}
25324unsafe extern "C" {
25325 #[doc = "Forced transmission stop.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance"]
25326 pub fn subghz_protocol_encoder_raw_stop(context: *mut core::ffi::c_void);
25327}
25328unsafe extern "C" {
25329 #[doc = "pause writing to flash.\n # Arguments\n\n* `context` - Pointer to a SubGhzProtocolEncoderRAW instance\n * `pause` - pause writing"]
25330 pub fn subghz_protocol_raw_save_to_file_pause(
25331 instance: *mut SubGhzProtocolDecoderRAW,
25332 pause: bool,
25333 );
25334}
25335unsafe extern "C" {
25336 #[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"]
25337 pub fn subghz_protocol_raw_file_encoder_worker_set_callback_end(
25338 instance: *mut SubGhzProtocolEncoderRAW,
25339 callback_end: SubGhzProtocolEncoderRAWCallbackEnd,
25340 context_end: *mut core::ffi::c_void,
25341 );
25342}
25343unsafe extern "C" {
25344 #[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"]
25345 pub fn subghz_protocol_raw_gen_fff_data(
25346 flipper_format: *mut FlipperFormat,
25347 file_path: *const core::ffi::c_char,
25348 radio_dev_name: *const core::ffi::c_char,
25349 );
25350}
25351unsafe extern "C" {
25352 #[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"]
25353 pub fn subghz_protocol_encoder_raw_deserialize(
25354 context: *mut core::ffi::c_void,
25355 flipper_format: *mut FlipperFormat,
25356 ) -> SubGhzProtocolStatus;
25357}
25358unsafe extern "C" {
25359 #[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"]
25360 pub fn subghz_protocol_encoder_raw_yield(context: *mut core::ffi::c_void) -> LevelDuration;
25361}
25362#[repr(C)]
25363#[derive(Debug, Copy, Clone)]
25364pub struct SubGhzReceiver {
25365 _unused: [u8; 0],
25366}
25367pub type SubGhzReceiverCallback = ::core::option::Option<
25368 unsafe extern "C" fn(
25369 decoder: *mut SubGhzReceiver,
25370 decoder_base: *mut SubGhzProtocolDecoderBase,
25371 context: *mut core::ffi::c_void,
25372 ),
25373>;
25374unsafe extern "C" {
25375 #[doc = "Allocate and init SubGhzReceiver.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzReceiver* pointer to a SubGhzReceiver instance"]
25376 pub fn subghz_receiver_alloc_init(environment: *mut SubGhzEnvironment) -> *mut SubGhzReceiver;
25377}
25378unsafe extern "C" {
25379 #[doc = "Free SubGhzReceiver.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance"]
25380 pub fn subghz_receiver_free(instance: *mut SubGhzReceiver);
25381}
25382unsafe extern "C" {
25383 #[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"]
25384 pub fn subghz_receiver_decode(instance: *mut SubGhzReceiver, level: bool, duration: u32);
25385}
25386unsafe extern "C" {
25387 #[doc = "Reset decoder SubGhzReceiver.\n # Arguments\n\n* `instance` - Pointer to a SubGhzReceiver instance"]
25388 pub fn subghz_receiver_reset(instance: *mut SubGhzReceiver);
25389}
25390unsafe extern "C" {
25391 #[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"]
25392 pub fn subghz_receiver_set_rx_callback(
25393 instance: *mut SubGhzReceiver,
25394 callback: SubGhzReceiverCallback,
25395 context: *mut core::ffi::c_void,
25396 );
25397}
25398unsafe extern "C" {
25399 #[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"]
25400 pub fn subghz_receiver_set_filter(instance: *mut SubGhzReceiver, filter: SubGhzProtocolFlag);
25401}
25402unsafe extern "C" {
25403 #[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"]
25404 pub fn subghz_receiver_search_decoder_base_by_name(
25405 instance: *mut SubGhzReceiver,
25406 decoder_name: *const core::ffi::c_char,
25407 ) -> *mut SubGhzProtocolDecoderBase;
25408}
25409pub type SubGhzFileEncoderWorkerCallbackEnd =
25410 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25411#[repr(C)]
25412#[derive(Debug, Copy, Clone)]
25413pub struct SubGhzFileEncoderWorker {
25414 _unused: [u8; 0],
25415}
25416unsafe extern "C" {
25417 #[doc = "End callback SubGhzWorker.\n # Arguments\n\n* `instance` - SubGhzFileEncoderWorker instance\n * `callback` - SubGhzFileEncoderWorkerCallbackEnd callback"]
25418 pub fn subghz_file_encoder_worker_callback_end(
25419 instance: *mut SubGhzFileEncoderWorker,
25420 callback_end: SubGhzFileEncoderWorkerCallbackEnd,
25421 context_end: *mut core::ffi::c_void,
25422 );
25423}
25424unsafe extern "C" {
25425 #[doc = "Allocate SubGhzFileEncoderWorker.\n # Returns\n\nSubGhzFileEncoderWorker* pointer to a SubGhzFileEncoderWorker instance"]
25426 pub fn subghz_file_encoder_worker_alloc() -> *mut SubGhzFileEncoderWorker;
25427}
25428unsafe extern "C" {
25429 #[doc = "Free SubGhzFileEncoderWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance"]
25430 pub fn subghz_file_encoder_worker_free(instance: *mut SubGhzFileEncoderWorker);
25431}
25432unsafe extern "C" {
25433 #[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"]
25434 pub fn subghz_file_encoder_worker_get_level_duration(
25435 context: *mut core::ffi::c_void,
25436 ) -> LevelDuration;
25437}
25438unsafe extern "C" {
25439 #[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"]
25440 pub fn subghz_file_encoder_worker_start(
25441 instance: *mut SubGhzFileEncoderWorker,
25442 file_path: *const core::ffi::c_char,
25443 radio_device_name: *const core::ffi::c_char,
25444 ) -> bool;
25445}
25446unsafe extern "C" {
25447 #[doc = "Stop SubGhzFileEncoderWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance"]
25448 pub fn subghz_file_encoder_worker_stop(instance: *mut SubGhzFileEncoderWorker);
25449}
25450unsafe extern "C" {
25451 #[doc = "Check if worker is running\n # Arguments\n\n* `instance` - Pointer to a SubGhzFileEncoderWorker instance\n # Returns\n\nbool - true if running"]
25452 pub fn subghz_file_encoder_worker_is_running(instance: *mut SubGhzFileEncoderWorker) -> bool;
25453}
25454unsafe extern "C" {
25455 pub static subghz_protocol_registry: SubGhzProtocolRegistry;
25456}
25457#[repr(C)]
25458#[derive(Debug, Copy, Clone)]
25459pub struct SubGhzSetting {
25460 _unused: [u8; 0],
25461}
25462unsafe extern "C" {
25463 pub fn subghz_setting_alloc() -> *mut SubGhzSetting;
25464}
25465unsafe extern "C" {
25466 pub fn subghz_setting_free(instance: *mut SubGhzSetting);
25467}
25468unsafe extern "C" {
25469 pub fn subghz_setting_load(instance: *mut SubGhzSetting, file_path: *const core::ffi::c_char);
25470}
25471unsafe extern "C" {
25472 pub fn subghz_setting_get_frequency_count(instance: *mut SubGhzSetting) -> usize;
25473}
25474unsafe extern "C" {
25475 pub fn subghz_setting_get_hopper_frequency_count(instance: *mut SubGhzSetting) -> usize;
25476}
25477unsafe extern "C" {
25478 pub fn subghz_setting_get_preset_count(instance: *mut SubGhzSetting) -> usize;
25479}
25480unsafe extern "C" {
25481 pub fn subghz_setting_get_preset_name(
25482 instance: *mut SubGhzSetting,
25483 idx: usize,
25484 ) -> *const core::ffi::c_char;
25485}
25486unsafe extern "C" {
25487 pub fn subghz_setting_get_inx_preset_by_name(
25488 instance: *mut SubGhzSetting,
25489 preset_name: *const core::ffi::c_char,
25490 ) -> core::ffi::c_int;
25491}
25492unsafe extern "C" {
25493 pub fn subghz_setting_get_preset_data(instance: *mut SubGhzSetting, idx: usize) -> *mut u8;
25494}
25495unsafe extern "C" {
25496 pub fn subghz_setting_get_preset_data_size(instance: *mut SubGhzSetting, idx: usize) -> usize;
25497}
25498unsafe extern "C" {
25499 pub fn subghz_setting_get_preset_data_by_name(
25500 instance: *mut SubGhzSetting,
25501 preset_name: *const core::ffi::c_char,
25502 ) -> *mut u8;
25503}
25504unsafe extern "C" {
25505 pub fn subghz_setting_load_custom_preset(
25506 instance: *mut SubGhzSetting,
25507 preset_name: *const core::ffi::c_char,
25508 fff_data_file: *mut FlipperFormat,
25509 ) -> bool;
25510}
25511unsafe extern "C" {
25512 pub fn subghz_setting_delete_custom_preset(
25513 instance: *mut SubGhzSetting,
25514 preset_name: *const core::ffi::c_char,
25515 ) -> bool;
25516}
25517unsafe extern "C" {
25518 pub fn subghz_setting_get_frequency(instance: *mut SubGhzSetting, idx: usize) -> u32;
25519}
25520unsafe extern "C" {
25521 pub fn subghz_setting_get_hopper_frequency(instance: *mut SubGhzSetting, idx: usize) -> u32;
25522}
25523unsafe extern "C" {
25524 pub fn subghz_setting_get_frequency_default_index(instance: *mut SubGhzSetting) -> u32;
25525}
25526unsafe extern "C" {
25527 pub fn subghz_setting_get_default_frequency(instance: *mut SubGhzSetting) -> u32;
25528}
25529unsafe extern "C" {
25530 pub fn subghz_devices_init();
25531}
25532unsafe extern "C" {
25533 pub fn subghz_devices_deinit();
25534}
25535unsafe extern "C" {
25536 pub fn subghz_devices_get_by_name(device_name: *const core::ffi::c_char)
25537 -> *const SubGhzDevice;
25538}
25539unsafe extern "C" {
25540 pub fn subghz_devices_get_name(device: *const SubGhzDevice) -> *const core::ffi::c_char;
25541}
25542unsafe extern "C" {
25543 pub fn subghz_devices_begin(device: *const SubGhzDevice) -> bool;
25544}
25545unsafe extern "C" {
25546 pub fn subghz_devices_end(device: *const SubGhzDevice);
25547}
25548unsafe extern "C" {
25549 pub fn subghz_devices_is_connect(device: *const SubGhzDevice) -> bool;
25550}
25551unsafe extern "C" {
25552 pub fn subghz_devices_reset(device: *const SubGhzDevice);
25553}
25554unsafe extern "C" {
25555 pub fn subghz_devices_sleep(device: *const SubGhzDevice);
25556}
25557unsafe extern "C" {
25558 pub fn subghz_devices_idle(device: *const SubGhzDevice);
25559}
25560unsafe extern "C" {
25561 pub fn subghz_devices_load_preset(
25562 device: *const SubGhzDevice,
25563 preset: FuriHalSubGhzPreset,
25564 preset_data: *mut u8,
25565 );
25566}
25567unsafe extern "C" {
25568 pub fn subghz_devices_set_frequency(device: *const SubGhzDevice, frequency: u32) -> u32;
25569}
25570unsafe extern "C" {
25571 pub fn subghz_devices_is_frequency_valid(device: *const SubGhzDevice, frequency: u32) -> bool;
25572}
25573unsafe extern "C" {
25574 pub fn subghz_devices_set_async_mirror_pin(device: *const SubGhzDevice, gpio: *const GpioPin);
25575}
25576unsafe extern "C" {
25577 pub fn subghz_devices_get_data_gpio(device: *const SubGhzDevice) -> *const GpioPin;
25578}
25579unsafe extern "C" {
25580 pub fn subghz_devices_set_tx(device: *const SubGhzDevice) -> bool;
25581}
25582unsafe extern "C" {
25583 pub fn subghz_devices_flush_tx(device: *const SubGhzDevice);
25584}
25585unsafe extern "C" {
25586 pub fn subghz_devices_start_async_tx(
25587 device: *const SubGhzDevice,
25588 callback: *mut core::ffi::c_void,
25589 context: *mut core::ffi::c_void,
25590 ) -> bool;
25591}
25592unsafe extern "C" {
25593 pub fn subghz_devices_is_async_complete_tx(device: *const SubGhzDevice) -> bool;
25594}
25595unsafe extern "C" {
25596 pub fn subghz_devices_stop_async_tx(device: *const SubGhzDevice);
25597}
25598unsafe extern "C" {
25599 pub fn subghz_devices_set_rx(device: *const SubGhzDevice);
25600}
25601unsafe extern "C" {
25602 pub fn subghz_devices_flush_rx(device: *const SubGhzDevice);
25603}
25604unsafe extern "C" {
25605 pub fn subghz_devices_start_async_rx(
25606 device: *const SubGhzDevice,
25607 callback: *mut core::ffi::c_void,
25608 context: *mut core::ffi::c_void,
25609 );
25610}
25611unsafe extern "C" {
25612 pub fn subghz_devices_stop_async_rx(device: *const SubGhzDevice);
25613}
25614unsafe extern "C" {
25615 pub fn subghz_devices_get_rssi(device: *const SubGhzDevice) -> f32;
25616}
25617unsafe extern "C" {
25618 pub fn subghz_devices_get_lqi(device: *const SubGhzDevice) -> u8;
25619}
25620unsafe extern "C" {
25621 pub fn subghz_devices_rx_pipe_not_empty(device: *const SubGhzDevice) -> bool;
25622}
25623unsafe extern "C" {
25624 pub fn subghz_devices_is_rx_data_crc_valid(device: *const SubGhzDevice) -> bool;
25625}
25626unsafe extern "C" {
25627 pub fn subghz_devices_read_packet(device: *const SubGhzDevice, data: *mut u8, size: *mut u8);
25628}
25629unsafe extern "C" {
25630 pub fn subghz_devices_write_packet(device: *const SubGhzDevice, data: *const u8, size: u8);
25631}
25632pub type SubGhzTxRxWorkerCallbackHaveRead =
25633 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25634#[repr(C)]
25635#[derive(Debug, Copy, Clone)]
25636pub struct SubGhzTxRxWorker {
25637 _unused: [u8; 0],
25638}
25639pub const SubGhzTxRxWorkerStatusIDLE: SubGhzTxRxWorkerStatus = SubGhzTxRxWorkerStatus(0);
25640pub const SubGhzTxRxWorkerStatusTx: SubGhzTxRxWorkerStatus = SubGhzTxRxWorkerStatus(1);
25641pub const SubGhzTxRxWorkerStatusRx: SubGhzTxRxWorkerStatus = SubGhzTxRxWorkerStatus(2);
25642#[repr(transparent)]
25643#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25644pub struct SubGhzTxRxWorkerStatus(pub core::ffi::c_uchar);
25645unsafe extern "C" {
25646 #[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"]
25647 pub fn subghz_tx_rx_worker_write(
25648 instance: *mut SubGhzTxRxWorker,
25649 data: *mut u8,
25650 size: usize,
25651 ) -> bool;
25652}
25653unsafe extern "C" {
25654 #[doc = "SubGhzTxRxWorker, get available data\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n # Returns\n\nsize_t data size"]
25655 pub fn subghz_tx_rx_worker_available(instance: *mut SubGhzTxRxWorker) -> usize;
25656}
25657unsafe extern "C" {
25658 #[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"]
25659 pub fn subghz_tx_rx_worker_read(
25660 instance: *mut SubGhzTxRxWorker,
25661 data: *mut u8,
25662 size: usize,
25663 ) -> usize;
25664}
25665unsafe extern "C" {
25666 #[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` -"]
25667 pub fn subghz_tx_rx_worker_set_callback_have_read(
25668 instance: *mut SubGhzTxRxWorker,
25669 callback: SubGhzTxRxWorkerCallbackHaveRead,
25670 context: *mut core::ffi::c_void,
25671 );
25672}
25673unsafe extern "C" {
25674 #[doc = "Allocate SubGhzTxRxWorker\n # Returns\n\nSubGhzTxRxWorker* Pointer to a SubGhzTxRxWorker instance"]
25675 pub fn subghz_tx_rx_worker_alloc() -> *mut SubGhzTxRxWorker;
25676}
25677unsafe extern "C" {
25678 #[doc = "Free SubGhzTxRxWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance"]
25679 pub fn subghz_tx_rx_worker_free(instance: *mut SubGhzTxRxWorker);
25680}
25681unsafe extern "C" {
25682 #[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"]
25683 pub fn subghz_tx_rx_worker_start(
25684 instance: *mut SubGhzTxRxWorker,
25685 device: *const SubGhzDevice,
25686 frequency: u32,
25687 ) -> bool;
25688}
25689unsafe extern "C" {
25690 #[doc = "Stop SubGhzTxRxWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance"]
25691 pub fn subghz_tx_rx_worker_stop(instance: *mut SubGhzTxRxWorker);
25692}
25693unsafe extern "C" {
25694 #[doc = "Check if worker is running\n # Arguments\n\n* `instance` - Pointer to a SubGhzTxRxWorker instance\n # Returns\n\nbool - true if running"]
25695 pub fn subghz_tx_rx_worker_is_running(instance: *mut SubGhzTxRxWorker) -> bool;
25696}
25697#[repr(C)]
25698#[derive(Debug, Copy, Clone)]
25699pub struct SubGhzWorker {
25700 _unused: [u8; 0],
25701}
25702pub type SubGhzWorkerOverrunCallback =
25703 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25704pub type SubGhzWorkerPairCallback = ::core::option::Option<
25705 unsafe extern "C" fn(context: *mut core::ffi::c_void, level: bool, duration: u32),
25706>;
25707unsafe extern "C" {
25708 pub fn subghz_worker_rx_callback(level: bool, duration: u32, context: *mut core::ffi::c_void);
25709}
25710unsafe extern "C" {
25711 #[doc = "Allocate SubGhzWorker.\n # Returns\n\nSubGhzWorker* Pointer to a SubGhzWorker instance"]
25712 pub fn subghz_worker_alloc() -> *mut SubGhzWorker;
25713}
25714unsafe extern "C" {
25715 #[doc = "Free SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance"]
25716 pub fn subghz_worker_free(instance: *mut SubGhzWorker);
25717}
25718unsafe extern "C" {
25719 #[doc = "Overrun callback SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `callback` - SubGhzWorkerOverrunCallback callback"]
25720 pub fn subghz_worker_set_overrun_callback(
25721 instance: *mut SubGhzWorker,
25722 callback: SubGhzWorkerOverrunCallback,
25723 );
25724}
25725unsafe extern "C" {
25726 #[doc = "Pair callback SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `callback` - SubGhzWorkerOverrunCallback callback"]
25727 pub fn subghz_worker_set_pair_callback(
25728 instance: *mut SubGhzWorker,
25729 callback: SubGhzWorkerPairCallback,
25730 );
25731}
25732unsafe extern "C" {
25733 #[doc = "Context callback SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n * `context` -"]
25734 pub fn subghz_worker_set_context(instance: *mut SubGhzWorker, context: *mut core::ffi::c_void);
25735}
25736unsafe extern "C" {
25737 #[doc = "Start SubGhzWorker.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance"]
25738 pub fn subghz_worker_start(instance: *mut SubGhzWorker);
25739}
25740unsafe extern "C" {
25741 #[doc = "Stop SubGhzWorker\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance"]
25742 pub fn subghz_worker_stop(instance: *mut SubGhzWorker);
25743}
25744unsafe extern "C" {
25745 #[doc = "Check if worker is running.\n # Arguments\n\n* `instance` - Pointer to a SubGhzWorker instance\n # Returns\n\nbool - true if running"]
25746 pub fn subghz_worker_is_running(instance: *mut SubGhzWorker) -> bool;
25747}
25748unsafe extern "C" {
25749 #[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"]
25750 pub fn subghz_worker_set_filter(instance: *mut SubGhzWorker, timeout: u16);
25751}
25752#[repr(C)]
25753#[derive(Debug, Copy, Clone)]
25754pub struct SubGhzTransmitter {
25755 _unused: [u8; 0],
25756}
25757unsafe extern "C" {
25758 #[doc = "Allocate and init SubGhzTransmitter.\n # Arguments\n\n* `environment` - Pointer to a SubGhzEnvironment instance\n # Returns\n\nSubGhzTransmitter* pointer to a SubGhzTransmitter instance"]
25759 pub fn subghz_transmitter_alloc_init(
25760 environment: *mut SubGhzEnvironment,
25761 protocol_name: *const core::ffi::c_char,
25762 ) -> *mut SubGhzTransmitter;
25763}
25764unsafe extern "C" {
25765 #[doc = "Free SubGhzTransmitter.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance"]
25766 pub fn subghz_transmitter_free(instance: *mut SubGhzTransmitter);
25767}
25768unsafe extern "C" {
25769 #[doc = "Get protocol instance.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance"]
25770 pub fn subghz_transmitter_get_protocol_instance(
25771 instance: *mut SubGhzTransmitter,
25772 ) -> *mut SubGhzProtocolEncoderBase;
25773}
25774unsafe extern "C" {
25775 #[doc = "Forced transmission stop.\n # Arguments\n\n* `instance` - Pointer to a SubGhzTransmitter instance"]
25776 pub fn subghz_transmitter_stop(instance: *mut SubGhzTransmitter) -> bool;
25777}
25778unsafe extern "C" {
25779 #[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"]
25780 pub fn subghz_transmitter_deserialize(
25781 instance: *mut SubGhzTransmitter,
25782 flipper_format: *mut FlipperFormat,
25783 ) -> SubGhzProtocolStatus;
25784}
25785unsafe extern "C" {
25786 #[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"]
25787 pub fn subghz_transmitter_yield(context: *mut core::ffi::c_void) -> LevelDuration;
25788}
25789pub type FuriApiLock = *mut FuriEventFlag;
25790unsafe extern "C" {
25791 #[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"]
25792 pub fn args_read_int_and_trim(args: *mut FuriString, value: *mut core::ffi::c_int) -> bool;
25793}
25794unsafe extern "C" {
25795 #[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"]
25796 pub fn args_read_float_and_trim(args: *mut FuriString, value: *mut f32) -> bool;
25797}
25798unsafe extern "C" {
25799 #[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"]
25800 pub fn args_read_string_and_trim(args: *mut FuriString, word: *mut FuriString) -> bool;
25801}
25802unsafe extern "C" {
25803 #[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"]
25804 pub fn args_read_probably_quoted_string_and_trim(
25805 args: *mut FuriString,
25806 word: *mut FuriString,
25807 ) -> bool;
25808}
25809unsafe extern "C" {
25810 #[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"]
25811 pub fn args_read_hex_bytes(args: *mut FuriString, bytes: *mut u8, bytes_count: usize) -> bool;
25812}
25813unsafe extern "C" {
25814 #[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."]
25815 pub fn args_read_duration(
25816 args: *mut FuriString,
25817 value: *mut u32,
25818 default_unit: *const core::ffi::c_char,
25819 ) -> bool;
25820}
25821unsafe extern "C" {
25822 #[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"]
25823 pub fn args_get_first_word_length(args: *mut FuriString) -> usize;
25824}
25825unsafe extern "C" {
25826 #[doc = "Get length of arguments string\n\n # Arguments\n\n* `args` - arguments string\n # Returns\n\nsize_t length of arguments string"]
25827 pub fn args_length(args: *mut FuriString) -> usize;
25828}
25829unsafe extern "C" {
25830 #[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"]
25831 pub fn args_char_to_hex(
25832 hi_nibble: core::ffi::c_char,
25833 low_nibble: core::ffi::c_char,
25834 byte: *mut u8,
25835 ) -> bool;
25836}
25837pub const CliKeyUnrecognized: CliKey = CliKey(0);
25838pub const CliKeySOH: CliKey = CliKey(1);
25839pub const CliKeyETX: CliKey = CliKey(3);
25840pub const CliKeyEOT: CliKey = CliKey(4);
25841pub const CliKeyBell: CliKey = CliKey(7);
25842pub const CliKeyBackspace: CliKey = CliKey(8);
25843pub const CliKeyTab: CliKey = CliKey(9);
25844pub const CliKeyLF: CliKey = CliKey(10);
25845pub const CliKeyFF: CliKey = CliKey(12);
25846pub const CliKeyCR: CliKey = CliKey(13);
25847pub const CliKeyETB: CliKey = CliKey(23);
25848pub const CliKeyEsc: CliKey = CliKey(27);
25849pub const CliKeyUS: CliKey = CliKey(31);
25850pub const CliKeySpace: CliKey = CliKey(32);
25851pub const CliKeyDEL: CliKey = CliKey(127);
25852pub const CliKeySpecial: CliKey = CliKey(128);
25853pub const CliKeyLeft: CliKey = CliKey(129);
25854pub const CliKeyRight: CliKey = CliKey(130);
25855pub const CliKeyUp: CliKey = CliKey(131);
25856pub const CliKeyDown: CliKey = CliKey(132);
25857pub const CliKeyHome: CliKey = CliKey(133);
25858pub const CliKeyEnd: CliKey = CliKey(134);
25859#[repr(transparent)]
25860#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25861pub struct CliKey(pub core::ffi::c_uchar);
25862pub const CliModKeyNo: CliModKey = CliModKey(0);
25863pub const CliModKeyAlt: CliModKey = CliModKey(2);
25864pub const CliModKeyCtrl: CliModKey = CliModKey(4);
25865pub const CliModKeyMeta: CliModKey = CliModKey(8);
25866#[repr(transparent)]
25867#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25868pub struct CliModKey(pub core::ffi::c_uchar);
25869#[repr(C)]
25870#[derive(Debug, Copy, Clone)]
25871pub struct CliKeyCombo {
25872 pub modifiers: CliModKey,
25873 pub key: CliKey,
25874}
25875#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25876const _: () = {
25877 ["Size of CliKeyCombo"][::core::mem::size_of::<CliKeyCombo>() - 2usize];
25878 ["Alignment of CliKeyCombo"][::core::mem::align_of::<CliKeyCombo>() - 1usize];
25879 ["Offset of field: CliKeyCombo::modifiers"]
25880 [::core::mem::offset_of!(CliKeyCombo, modifiers) - 0usize];
25881 ["Offset of field: CliKeyCombo::key"][::core::mem::offset_of!(CliKeyCombo, key) - 1usize];
25882};
25883#[repr(C)]
25884#[derive(Debug, Copy, Clone)]
25885pub struct CliAnsiParser {
25886 _unused: [u8; 0],
25887}
25888#[repr(C)]
25889#[derive(Debug, Copy, Clone)]
25890pub struct CliAnsiParserResult {
25891 pub is_done: bool,
25892 pub result: CliKeyCombo,
25893}
25894#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25895const _: () = {
25896 ["Size of CliAnsiParserResult"][::core::mem::size_of::<CliAnsiParserResult>() - 3usize];
25897 ["Alignment of CliAnsiParserResult"][::core::mem::align_of::<CliAnsiParserResult>() - 1usize];
25898 ["Offset of field: CliAnsiParserResult::is_done"]
25899 [::core::mem::offset_of!(CliAnsiParserResult, is_done) - 0usize];
25900 ["Offset of field: CliAnsiParserResult::result"]
25901 [::core::mem::offset_of!(CliAnsiParserResult, result) - 1usize];
25902};
25903unsafe extern "C" {
25904 #[doc = "Allocates an ANSI parser"]
25905 pub fn cli_ansi_parser_alloc() -> *mut CliAnsiParser;
25906}
25907unsafe extern "C" {
25908 #[doc = "Frees an ANSI parser"]
25909 pub fn cli_ansi_parser_free(parser: *mut CliAnsiParser);
25910}
25911unsafe extern "C" {
25912 #[doc = "Feeds an ANSI parser a character"]
25913 pub fn cli_ansi_parser_feed(
25914 parser: *mut CliAnsiParser,
25915 c: core::ffi::c_char,
25916 ) -> CliAnsiParserResult;
25917}
25918unsafe extern "C" {
25919 #[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."]
25920 pub fn cli_ansi_parser_feed_timeout(parser: *mut CliAnsiParser) -> CliAnsiParserResult;
25921}
25922#[repr(C)]
25923#[derive(Debug, Copy, Clone)]
25924pub struct CliShell {
25925 _unused: [u8; 0],
25926}
25927#[doc = "Called from the shell thread to print the Message of the Day when the shell\n is started."]
25928pub type CliShellMotd =
25929 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>;
25930unsafe extern "C" {
25931 #[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"]
25932 pub fn cli_shell_alloc(
25933 motd: CliShellMotd,
25934 context: *mut core::ffi::c_void,
25935 pipe: *mut PipeSide,
25936 registry: *mut CliRegistry,
25937 ext_config: *const CliCommandExternalConfig,
25938 ) -> *mut CliShell;
25939}
25940unsafe extern "C" {
25941 #[doc = "Frees a shell\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25942 pub fn cli_shell_free(shell: *mut CliShell);
25943}
25944unsafe extern "C" {
25945 #[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"]
25946 pub fn cli_shell_start(shell: *mut CliShell);
25947}
25948unsafe extern "C" {
25949 #[doc = "Joins the shell thread\n\n This call is blocking.\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25950 pub fn cli_shell_join(shell: *mut CliShell);
25951}
25952unsafe extern "C" {
25953 #[doc = "Sets optional text before prompt (`>:`)\n\n # Arguments\n\n* `[in]` - shell Shell instance"]
25954 pub fn cli_shell_set_prompt(shell: *mut CliShell, prompt: *const core::ffi::c_char);
25955}
25956#[repr(C)]
25957#[derive(Debug, Copy, Clone)]
25958pub struct CompressIcon {
25959 _unused: [u8; 0],
25960}
25961unsafe extern "C" {
25962 #[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"]
25963 pub fn compress_icon_alloc(decode_buf_size: usize) -> *mut CompressIcon;
25964}
25965unsafe extern "C" {
25966 #[doc = "Free icon compressor\n\n # Arguments\n\n* `instance` - The Compress Icon instance"]
25967 pub fn compress_icon_free(instance: *mut CompressIcon);
25968}
25969unsafe extern "C" {
25970 #[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"]
25971 pub fn compress_icon_decode(
25972 instance: *mut CompressIcon,
25973 icon_data: *const u8,
25974 output: *mut *mut u8,
25975 );
25976}
25977#[repr(C)]
25978#[derive(Debug, Copy, Clone)]
25979pub struct Compress {
25980 _unused: [u8; 0],
25981}
25982pub const CompressTypeHeatshrink: CompressType = CompressType(0);
25983#[repr(transparent)]
25984#[doc = "Supported compression types"]
25985#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25986pub struct CompressType(pub core::ffi::c_uchar);
25987#[doc = "Configuration for heatshrink compression"]
25988#[repr(C)]
25989#[derive(Debug, Copy, Clone)]
25990pub struct CompressConfigHeatshrink {
25991 pub window_sz2: u16,
25992 pub lookahead_sz2: u16,
25993 pub input_buffer_sz: u16,
25994}
25995#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25996const _: () = {
25997 ["Size of CompressConfigHeatshrink"]
25998 [::core::mem::size_of::<CompressConfigHeatshrink>() - 6usize];
25999 ["Alignment of CompressConfigHeatshrink"]
26000 [::core::mem::align_of::<CompressConfigHeatshrink>() - 2usize];
26001 ["Offset of field: CompressConfigHeatshrink::window_sz2"]
26002 [::core::mem::offset_of!(CompressConfigHeatshrink, window_sz2) - 0usize];
26003 ["Offset of field: CompressConfigHeatshrink::lookahead_sz2"]
26004 [::core::mem::offset_of!(CompressConfigHeatshrink, lookahead_sz2) - 2usize];
26005 ["Offset of field: CompressConfigHeatshrink::input_buffer_sz"]
26006 [::core::mem::offset_of!(CompressConfigHeatshrink, input_buffer_sz) - 4usize];
26007};
26008unsafe extern "C" {
26009 #[doc = "Default configuration for heatshrink compression. Used for image assets."]
26010 pub static compress_config_heatshrink_default: CompressConfigHeatshrink;
26011}
26012unsafe extern "C" {
26013 #[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"]
26014 pub fn compress_alloc(type_: CompressType, config: *const core::ffi::c_void) -> *mut Compress;
26015}
26016unsafe extern "C" {
26017 #[doc = "Free encoder and decoder\n\n # Arguments\n\n* `compress` - Compress instance"]
26018 pub fn compress_free(compress: *mut Compress);
26019}
26020unsafe extern "C" {
26021 #[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"]
26022 pub fn compress_encode(
26023 compress: *mut Compress,
26024 data_in: *mut u8,
26025 data_in_size: usize,
26026 data_out: *mut u8,
26027 data_out_size: usize,
26028 data_res_size: *mut usize,
26029 ) -> bool;
26030}
26031unsafe extern "C" {
26032 #[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"]
26033 pub fn compress_decode(
26034 compress: *mut Compress,
26035 data_in: *mut u8,
26036 data_in_size: usize,
26037 data_out: *mut u8,
26038 data_out_size: usize,
26039 data_res_size: *mut usize,
26040 ) -> bool;
26041}
26042#[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"]
26043pub type CompressIoCallback = ::core::option::Option<
26044 unsafe extern "C" fn(context: *mut core::ffi::c_void, buffer: *mut u8, size: usize) -> i32,
26045>;
26046unsafe extern "C" {
26047 #[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"]
26048 pub fn compress_decode_streamed(
26049 compress: *mut Compress,
26050 read_cb: CompressIoCallback,
26051 read_context: *mut core::ffi::c_void,
26052 write_cb: CompressIoCallback,
26053 write_context: *mut core::ffi::c_void,
26054 ) -> bool;
26055}
26056#[repr(C)]
26057#[derive(Debug, Copy, Clone)]
26058pub struct CompressStreamDecoder {
26059 _unused: [u8; 0],
26060}
26061unsafe extern "C" {
26062 #[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"]
26063 pub fn compress_stream_decoder_alloc(
26064 type_: CompressType,
26065 config: *const core::ffi::c_void,
26066 read_cb: CompressIoCallback,
26067 read_context: *mut core::ffi::c_void,
26068 ) -> *mut CompressStreamDecoder;
26069}
26070unsafe extern "C" {
26071 #[doc = "Free stream decoder\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance"]
26072 pub fn compress_stream_decoder_free(instance: *mut CompressStreamDecoder);
26073}
26074unsafe extern "C" {
26075 #[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"]
26076 pub fn compress_stream_decoder_read(
26077 instance: *mut CompressStreamDecoder,
26078 data_out: *mut u8,
26079 data_out_size: usize,
26080 ) -> bool;
26081}
26082unsafe extern "C" {
26083 #[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"]
26084 pub fn compress_stream_decoder_seek(
26085 instance: *mut CompressStreamDecoder,
26086 position: usize,
26087 ) -> bool;
26088}
26089unsafe extern "C" {
26090 #[doc = "Get current position in uncompressed data stream\n\n # Arguments\n\n* `instance` - The CompressStreamDecoder instance\n\n # Returns\n\ncurrent position"]
26091 pub fn compress_stream_decoder_tell(instance: *mut CompressStreamDecoder) -> usize;
26092}
26093unsafe extern "C" {
26094 #[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"]
26095 pub fn compress_stream_decoder_rewind(instance: *mut CompressStreamDecoder) -> bool;
26096}
26097unsafe extern "C" {
26098 pub fn crc32_calc_buffer(crc: u32, buffer: *const core::ffi::c_void, size: usize) -> u32;
26099}
26100pub type FileCrcProgressCb =
26101 ::core::option::Option<unsafe extern "C" fn(progress: u8, context: *mut core::ffi::c_void)>;
26102unsafe extern "C" {
26103 pub fn crc32_calc_file(
26104 file: *mut File,
26105 progress_cb: FileCrcProgressCb,
26106 context: *mut core::ffi::c_void,
26107 ) -> u32;
26108}
26109#[repr(C)]
26110#[derive(Debug, Copy, Clone)]
26111pub struct DirWalk {
26112 _unused: [u8; 0],
26113}
26114#[doc = "< OK"]
26115pub const DirWalkOK: DirWalkResult = DirWalkResult(0);
26116#[doc = "< Error"]
26117pub const DirWalkError: DirWalkResult = DirWalkResult(1);
26118#[doc = "< Last element"]
26119pub const DirWalkLast: DirWalkResult = DirWalkResult(2);
26120#[repr(transparent)]
26121#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26122pub struct DirWalkResult(pub core::ffi::c_uchar);
26123pub type DirWalkFilterCb = ::core::option::Option<
26124 unsafe extern "C" fn(
26125 name: *const core::ffi::c_char,
26126 fileinfo: *mut FileInfo,
26127 ctx: *mut core::ffi::c_void,
26128 ) -> bool,
26129>;
26130unsafe extern "C" {
26131 #[doc = "Allocate DirWalk\n # Arguments\n\n* `storage` -\n # Returns\n\nDirWalk*"]
26132 pub fn dir_walk_alloc(storage: *mut Storage) -> *mut DirWalk;
26133}
26134unsafe extern "C" {
26135 #[doc = "Free DirWalk\n # Arguments\n\n* `dir_walk` -"]
26136 pub fn dir_walk_free(dir_walk: *mut DirWalk);
26137}
26138unsafe extern "C" {
26139 #[doc = "Set recursive mode (true by default)\n # Arguments\n\n* `dir_walk` -\n * `recursive` -"]
26140 pub fn dir_walk_set_recursive(dir_walk: *mut DirWalk, recursive: bool);
26141}
26142unsafe extern "C" {
26143 #[doc = "Set filter callback (Should return true if the data is valid)\n # Arguments\n\n* `dir_walk` -\n * `cb` -\n * `context` -"]
26144 pub fn dir_walk_set_filter_cb(
26145 dir_walk: *mut DirWalk,
26146 cb: DirWalkFilterCb,
26147 context: *mut core::ffi::c_void,
26148 );
26149}
26150unsafe extern "C" {
26151 #[doc = "Open directory\n # Arguments\n\n* `dir_walk` -\n * `path` -\n # Returns\n\ntrue\n false"]
26152 pub fn dir_walk_open(dir_walk: *mut DirWalk, path: *const core::ffi::c_char) -> bool;
26153}
26154unsafe extern "C" {
26155 #[doc = "Get error id\n # Arguments\n\n* `dir_walk` -\n # Returns\n\nFS_Error"]
26156 pub fn dir_walk_get_error(dir_walk: *mut DirWalk) -> FS_Error;
26157}
26158unsafe extern "C" {
26159 #[doc = "Read next element from directory\n # Arguments\n\n* `dir_walk` -\n * `return_path` -\n * `fileinfo` -\n # Returns\n\nDirWalkResult"]
26160 pub fn dir_walk_read(
26161 dir_walk: *mut DirWalk,
26162 return_path: *mut FuriString,
26163 fileinfo: *mut FileInfo,
26164 ) -> DirWalkResult;
26165}
26166unsafe extern "C" {
26167 #[doc = "Close directory\n # Arguments\n\n* `dir_walk` -"]
26168 pub fn dir_walk_close(dir_walk: *mut DirWalk);
26169}
26170unsafe extern "C" {
26171 #[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"]
26172 pub fn float_is_equal(a: f32, b: f32) -> bool;
26173}
26174unsafe extern "C" {
26175 #[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"]
26176 pub fn hex_char_to_hex_nibble(c: core::ffi::c_char, nibble: *mut u8) -> bool;
26177}
26178unsafe extern "C" {
26179 #[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"]
26180 pub fn hex_char_to_uint8(hi: core::ffi::c_char, low: core::ffi::c_char, value: *mut u8)
26181 -> bool;
26182}
26183unsafe extern "C" {
26184 #[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"]
26185 pub fn hex_chars_to_uint8(value_str: *const core::ffi::c_char, value: *mut u8) -> bool;
26186}
26187unsafe extern "C" {
26188 #[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"]
26189 pub fn hex_chars_to_uint64(value_str: *const core::ffi::c_char, value: *mut u64) -> bool;
26190}
26191unsafe extern "C" {
26192 #[doc = "Convert uint8_t to ASCII hex values\n # Arguments\n\n* `src` - source data\n * `target` - output value\n * `length` - data length\n"]
26193 pub fn uint8_to_hex_chars(src: *const u8, target: *mut u8, length: core::ffi::c_int);
26194}
26195pub const KeysDictModeOpenExisting: KeysDictMode = KeysDictMode(0);
26196pub const KeysDictModeOpenAlways: KeysDictMode = KeysDictMode(1);
26197#[repr(transparent)]
26198#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26199pub struct KeysDictMode(pub core::ffi::c_uchar);
26200#[repr(C)]
26201#[derive(Debug, Copy, Clone)]
26202pub struct KeysDict {
26203 _unused: [u8; 0],
26204}
26205unsafe extern "C" {
26206 #[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"]
26207 pub fn keys_dict_check_presence(path: *const core::ffi::c_char) -> bool;
26208}
26209unsafe extern "C" {
26210 #[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"]
26211 pub fn keys_dict_alloc(
26212 path: *const core::ffi::c_char,
26213 mode: KeysDictMode,
26214 key_size: usize,
26215 ) -> *mut KeysDict;
26216}
26217unsafe extern "C" {
26218 #[doc = "Close list\n\n # Arguments\n\n* `instance` - - KeysDict list instance"]
26219 pub fn keys_dict_free(instance: *mut KeysDict);
26220}
26221unsafe extern "C" {
26222 #[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"]
26223 pub fn keys_dict_get_total_keys(instance: *mut KeysDict) -> usize;
26224}
26225unsafe extern "C" {
26226 #[doc = "Rewind list\n\n # Arguments\n\n* `instance` - - KeysDict list instance\n\n # Returns\n\nReturns true if rewind was successful, false otherwise"]
26227 pub fn keys_dict_rewind(instance: *mut KeysDict) -> bool;
26228}
26229unsafe extern "C" {
26230 #[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"]
26231 pub fn keys_dict_is_key_present(
26232 instance: *mut KeysDict,
26233 key: *const u8,
26234 key_size: usize,
26235 ) -> bool;
26236}
26237unsafe extern "C" {
26238 #[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"]
26239 pub fn keys_dict_get_next_key(instance: *mut KeysDict, key: *mut u8, key_size: usize) -> bool;
26240}
26241unsafe extern "C" {
26242 #[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"]
26243 pub fn keys_dict_add_key(instance: *mut KeysDict, key: *const u8, key_size: usize) -> bool;
26244}
26245unsafe extern "C" {
26246 #[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"]
26247 pub fn keys_dict_delete_key(instance: *mut KeysDict, key: *const u8, key_size: usize) -> bool;
26248}
26249pub const ManchesterEventShortLow: ManchesterEvent = ManchesterEvent(0);
26250pub const ManchesterEventShortHigh: ManchesterEvent = ManchesterEvent(2);
26251pub const ManchesterEventLongLow: ManchesterEvent = ManchesterEvent(4);
26252pub const ManchesterEventLongHigh: ManchesterEvent = ManchesterEvent(6);
26253pub const ManchesterEventReset: ManchesterEvent = ManchesterEvent(8);
26254#[repr(transparent)]
26255#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26256pub struct ManchesterEvent(pub core::ffi::c_uchar);
26257pub const ManchesterStateStart1: ManchesterState = ManchesterState(0);
26258pub const ManchesterStateMid1: ManchesterState = ManchesterState(1);
26259pub const ManchesterStateMid0: ManchesterState = ManchesterState(2);
26260pub const ManchesterStateStart0: ManchesterState = ManchesterState(3);
26261#[repr(transparent)]
26262#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26263pub struct ManchesterState(pub core::ffi::c_uchar);
26264unsafe extern "C" {
26265 pub fn manchester_advance(
26266 state: ManchesterState,
26267 event: ManchesterEvent,
26268 next_state: *mut ManchesterState,
26269 data: *mut bool,
26270 ) -> bool;
26271}
26272#[repr(C)]
26273#[derive(Debug, Copy, Clone)]
26274pub struct ManchesterEncoderState {
26275 pub prev_bit: bool,
26276 pub step: u8,
26277}
26278#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26279const _: () = {
26280 ["Size of ManchesterEncoderState"][::core::mem::size_of::<ManchesterEncoderState>() - 2usize];
26281 ["Alignment of ManchesterEncoderState"]
26282 [::core::mem::align_of::<ManchesterEncoderState>() - 1usize];
26283 ["Offset of field: ManchesterEncoderState::prev_bit"]
26284 [::core::mem::offset_of!(ManchesterEncoderState, prev_bit) - 0usize];
26285 ["Offset of field: ManchesterEncoderState::step"]
26286 [::core::mem::offset_of!(ManchesterEncoderState, step) - 1usize];
26287};
26288pub const ManchesterEncoderResultShortLow: ManchesterEncoderResult = ManchesterEncoderResult(0);
26289pub const ManchesterEncoderResultLongLow: ManchesterEncoderResult = ManchesterEncoderResult(1);
26290pub const ManchesterEncoderResultLongHigh: ManchesterEncoderResult = ManchesterEncoderResult(2);
26291pub const ManchesterEncoderResultShortHigh: ManchesterEncoderResult = ManchesterEncoderResult(3);
26292#[repr(transparent)]
26293#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26294pub struct ManchesterEncoderResult(pub core::ffi::c_uchar);
26295unsafe extern "C" {
26296 pub fn manchester_encoder_reset(state: *mut ManchesterEncoderState);
26297}
26298unsafe extern "C" {
26299 pub fn manchester_encoder_advance(
26300 state: *mut ManchesterEncoderState,
26301 curr_bit: bool,
26302 result: *mut ManchesterEncoderResult,
26303 ) -> bool;
26304}
26305unsafe extern "C" {
26306 pub fn manchester_encoder_finish(state: *mut ManchesterEncoderState)
26307 -> ManchesterEncoderResult;
26308}
26309unsafe extern "C" {
26310 pub fn md5_calc_file(
26311 file: *mut File,
26312 path: *const core::ffi::c_char,
26313 output: *mut core::ffi::c_uchar,
26314 file_error: *mut FS_Error,
26315 ) -> bool;
26316}
26317unsafe extern "C" {
26318 pub fn md5_string_calc_file(
26319 file: *mut File,
26320 path: *const core::ffi::c_char,
26321 output: *mut FuriString,
26322 file_error: *mut FS_Error,
26323 ) -> bool;
26324}
26325unsafe extern "C" {
26326 #[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"]
26327 pub fn name_generator_make_auto(
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 = "Generates random name\n\n # Arguments\n\n* `name` - buffer to write random name\n * `max_name_size` - length of given buffer"]
26335 pub fn name_generator_make_random(name: *mut core::ffi::c_char, max_name_size: usize);
26336}
26337unsafe extern "C" {
26338 #[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"]
26339 pub fn name_generator_make_detailed(
26340 name: *mut core::ffi::c_char,
26341 max_name_size: usize,
26342 prefix: *const core::ffi::c_char,
26343 );
26344}
26345unsafe extern "C" {
26346 #[doc = "Extract filename without extension from path.\n\n # Arguments\n\n* `path` - path string\n * `filename` - output filename string. Must be initialized before."]
26347 pub fn path_extract_filename_no_ext(path: *const core::ffi::c_char, filename: *mut FuriString);
26348}
26349unsafe extern "C" {
26350 #[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"]
26351 pub fn path_extract_filename(path: *mut FuriString, filename: *mut FuriString, trim_ext: bool);
26352}
26353unsafe extern "C" {
26354 #[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"]
26355 pub fn path_extract_extension(
26356 path: *mut FuriString,
26357 ext: *mut core::ffi::c_char,
26358 ext_len_max: usize,
26359 );
26360}
26361unsafe extern "C" {
26362 #[doc = "Extract last path component\n\n # Arguments\n\n* `path` - path string\n * `filename` - output string. Must be initialized before."]
26363 pub fn path_extract_basename(path: *const core::ffi::c_char, basename: *mut FuriString);
26364}
26365unsafe extern "C" {
26366 #[doc = "Extract path, except for last component\n\n # Arguments\n\n* `path` - path string\n * `filename` - output string. Must be initialized before."]
26367 pub fn path_extract_dirname(path: *const core::ffi::c_char, dirname: *mut FuriString);
26368}
26369unsafe extern "C" {
26370 #[doc = "Appends new component to path, adding path delimiter\n\n # Arguments\n\n* `path` - path string\n * `suffix` - path part to apply"]
26371 pub fn path_append(path: *mut FuriString, suffix: *const core::ffi::c_char);
26372}
26373unsafe extern "C" {
26374 #[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"]
26375 pub fn path_concat(
26376 path: *const core::ffi::c_char,
26377 suffix: *const core::ffi::c_char,
26378 out_path: *mut FuriString,
26379 );
26380}
26381unsafe extern "C" {
26382 #[doc = "Check that path contains only ascii characters\n\n # Arguments\n\n* `path` -\n # Returns\n\ntrue\n false"]
26383 pub fn path_contains_only_ascii(path: *const core::ffi::c_char) -> bool;
26384}
26385unsafe extern "C" {
26386 #[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"]
26387 pub fn pretty_format_bytes_hex_canonical(
26388 result: *mut FuriString,
26389 num_places: usize,
26390 line_prefix: *const core::ffi::c_char,
26391 data: *const u8,
26392 data_size: usize,
26393 );
26394}
26395#[repr(C)]
26396#[derive(Debug, Copy, Clone)]
26397pub struct PulseGlue {
26398 _unused: [u8; 0],
26399}
26400unsafe extern "C" {
26401 pub fn pulse_glue_alloc() -> *mut PulseGlue;
26402}
26403unsafe extern "C" {
26404 pub fn pulse_glue_free(pulse_glue: *mut PulseGlue);
26405}
26406unsafe extern "C" {
26407 pub fn pulse_glue_reset(pulse_glue: *mut PulseGlue);
26408}
26409unsafe extern "C" {
26410 pub fn pulse_glue_push(pulse_glue: *mut PulseGlue, polarity: bool, length: u32) -> bool;
26411}
26412unsafe extern "C" {
26413 pub fn pulse_glue_pop(pulse_glue: *mut PulseGlue, length: *mut u32, period: *mut u32);
26414}
26415unsafe extern "C" {
26416 #[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"]
26417 pub fn saved_struct_load(
26418 path: *const core::ffi::c_char,
26419 data: *mut core::ffi::c_void,
26420 size: usize,
26421 magic: u8,
26422 version: u8,
26423 ) -> bool;
26424}
26425unsafe extern "C" {
26426 #[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"]
26427 pub fn saved_struct_save(
26428 path: *const core::ffi::c_char,
26429 data: *const core::ffi::c_void,
26430 size: usize,
26431 magic: u8,
26432 version: u8,
26433 ) -> bool;
26434}
26435unsafe extern "C" {
26436 #[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"]
26437 pub fn saved_struct_get_metadata(
26438 path: *const core::ffi::c_char,
26439 magic: *mut u8,
26440 version: *mut u8,
26441 payload_size: *mut usize,
26442 ) -> bool;
26443}
26444#[doc = "StrBuffer instance\n\n Place this struct directly wherever you want, it doesn't have to be `alloc`ed\n and `free`d."]
26445#[repr(C)]
26446#[derive(Debug, Copy, Clone)]
26447pub struct StrBuffer {
26448 pub owned_strings: *mut *mut core::ffi::c_char,
26449 pub n_owned_strings: usize,
26450}
26451#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26452const _: () = {
26453 ["Size of StrBuffer"][::core::mem::size_of::<StrBuffer>() - 8usize];
26454 ["Alignment of StrBuffer"][::core::mem::align_of::<StrBuffer>() - 4usize];
26455 ["Offset of field: StrBuffer::owned_strings"]
26456 [::core::mem::offset_of!(StrBuffer, owned_strings) - 0usize];
26457 ["Offset of field: StrBuffer::n_owned_strings"]
26458 [::core::mem::offset_of!(StrBuffer, n_owned_strings) - 4usize];
26459};
26460unsafe extern "C" {
26461 #[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"]
26462 pub fn str_buffer_make_owned_clone(
26463 buffer: *mut StrBuffer,
26464 str_: *const core::ffi::c_char,
26465 ) -> *const core::ffi::c_char;
26466}
26467unsafe extern "C" {
26468 #[doc = "Clears all owned duplicates\n\n # Arguments\n\n* `buffer` (direction in) - StrBuffer instance"]
26469 pub fn str_buffer_clear_all_clones(buffer: *mut StrBuffer);
26470}
26471unsafe extern "C" {
26472 #[doc = "Allocate a file stream with buffered read operations\n # Returns\n\nStream*"]
26473 pub fn buffered_file_stream_alloc(storage: *mut Storage) -> *mut Stream;
26474}
26475unsafe extern "C" {
26476 #[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."]
26477 pub fn buffered_file_stream_open(
26478 stream: *mut Stream,
26479 path: *const core::ffi::c_char,
26480 access_mode: FS_AccessMode,
26481 open_mode: FS_OpenMode,
26482 ) -> bool;
26483}
26484unsafe extern "C" {
26485 #[doc = "Closes the file.\n # Arguments\n\n* `stream` - pointer to file stream object.\n # Returns\n\nTrue on success, False on failure."]
26486 pub fn buffered_file_stream_close(stream: *mut Stream) -> bool;
26487}
26488unsafe extern "C" {
26489 #[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."]
26490 pub fn buffered_file_stream_sync(stream: *mut Stream) -> bool;
26491}
26492unsafe extern "C" {
26493 #[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"]
26494 pub fn buffered_file_stream_get_error(stream: *mut Stream) -> FS_Error;
26495}
26496unsafe extern "C" {
26497 #[doc = "Allocate file stream\n # Returns\n\nStream*"]
26498 pub fn file_stream_alloc(storage: *mut Storage) -> *mut Stream;
26499}
26500unsafe extern "C" {
26501 #[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."]
26502 pub fn file_stream_open(
26503 stream: *mut Stream,
26504 path: *const core::ffi::c_char,
26505 access_mode: FS_AccessMode,
26506 open_mode: FS_OpenMode,
26507 ) -> bool;
26508}
26509unsafe extern "C" {
26510 #[doc = "Closes the file.\n # Arguments\n\n* `stream` -\n # Returns\n\ntrue\n false"]
26511 pub fn file_stream_close(stream: *mut Stream) -> bool;
26512}
26513unsafe extern "C" {
26514 #[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"]
26515 pub fn file_stream_get_error(stream: *mut Stream) -> FS_Error;
26516}
26517unsafe extern "C" {
26518 #[doc = "Allocate string stream\n # Returns\n\nStream*"]
26519 pub fn string_stream_alloc() -> *mut Stream;
26520}
26521#[doc = "!< Conversion performed successfully"]
26522pub const StrintParseNoError: StrintParseError = StrintParseError(0);
26523#[doc = "!< Multiple leading `+` or `-` characters, or leading `-` character if the type is unsigned"]
26524pub const StrintParseSignError: StrintParseError = StrintParseError(1);
26525#[doc = "!< No valid digits after the leading whitespace, sign and prefix"]
26526pub const StrintParseAbsentError: StrintParseError = StrintParseError(2);
26527#[doc = "!< Result does not fit in the requested type"]
26528pub const StrintParseOverflowError: StrintParseError = StrintParseError(3);
26529#[repr(transparent)]
26530#[doc = "String to integer conversion error"]
26531#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26532pub struct StrintParseError(pub core::ffi::c_uchar);
26533unsafe extern "C" {
26534 #[doc = "See `strint_to_uint32`"]
26535 pub fn strint_to_uint64(
26536 str_: *const core::ffi::c_char,
26537 end: *mut *mut core::ffi::c_char,
26538 out: *mut u64,
26539 base: u8,
26540 ) -> StrintParseError;
26541}
26542unsafe extern "C" {
26543 #[doc = "See `strint_to_uint32`"]
26544 pub fn strint_to_int64(
26545 str_: *const core::ffi::c_char,
26546 end: *mut *mut core::ffi::c_char,
26547 out: *mut i64,
26548 base: u8,
26549 ) -> StrintParseError;
26550}
26551unsafe extern "C" {
26552 #[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."]
26553 pub fn strint_to_uint32(
26554 str_: *const core::ffi::c_char,
26555 end: *mut *mut core::ffi::c_char,
26556 out: *mut u32,
26557 base: u8,
26558 ) -> StrintParseError;
26559}
26560unsafe extern "C" {
26561 #[doc = "See `strint_to_uint32`"]
26562 pub fn strint_to_int32(
26563 str_: *const core::ffi::c_char,
26564 end: *mut *mut core::ffi::c_char,
26565 out: *mut i32,
26566 base: u8,
26567 ) -> StrintParseError;
26568}
26569unsafe extern "C" {
26570 #[doc = "See `strint_to_uint32`"]
26571 pub fn strint_to_uint16(
26572 str_: *const core::ffi::c_char,
26573 end: *mut *mut core::ffi::c_char,
26574 out: *mut u16,
26575 base: u8,
26576 ) -> StrintParseError;
26577}
26578unsafe extern "C" {
26579 #[doc = "See `strint_to_uint32`"]
26580 pub fn strint_to_int16(
26581 str_: *const core::ffi::c_char,
26582 end: *mut *mut core::ffi::c_char,
26583 out: *mut i16,
26584 base: u8,
26585 ) -> StrintParseError;
26586}
26587#[repr(C)]
26588#[derive(Debug, Copy, Clone)]
26589pub struct TarArchive {
26590 _unused: [u8; 0],
26591}
26592pub const TarOpenModeRead: TarOpenMode = TarOpenMode(114);
26593pub const TarOpenModeWrite: TarOpenMode = TarOpenMode(119);
26594pub const TarOpenModeReadHeatshrink: TarOpenMode = TarOpenMode(104);
26595#[repr(transparent)]
26596#[doc = "Tar archive open mode"]
26597#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26598pub struct TarOpenMode(pub core::ffi::c_uchar);
26599unsafe extern "C" {
26600 #[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"]
26601 pub fn tar_archive_get_mode_for_path(path: *const core::ffi::c_char) -> TarOpenMode;
26602}
26603unsafe extern "C" {
26604 #[doc = "Tar archive constructor\n\n # Arguments\n\n* `storage` - Storage API pointer\n\n # Returns\n\nallocated object"]
26605 pub fn tar_archive_alloc(storage: *mut Storage) -> *mut TarArchive;
26606}
26607unsafe extern "C" {
26608 #[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"]
26609 pub fn tar_archive_open(
26610 archive: *mut TarArchive,
26611 path: *const core::ffi::c_char,
26612 mode: TarOpenMode,
26613 ) -> bool;
26614}
26615unsafe extern "C" {
26616 #[doc = "Tar archive destructor\n\n # Arguments\n\n* `archive` - Tar archive object"]
26617 pub fn tar_archive_free(archive: *mut TarArchive);
26618}
26619pub type TarArchiveNameConverter =
26620 ::core::option::Option<unsafe extern "C" fn(arg1: *mut FuriString)>;
26621unsafe extern "C" {
26622 #[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"]
26623 pub fn tar_archive_unpack_to(
26624 archive: *mut TarArchive,
26625 destination: *const core::ffi::c_char,
26626 converter: TarArchiveNameConverter,
26627 ) -> bool;
26628}
26629unsafe extern "C" {
26630 #[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"]
26631 pub fn tar_archive_add_file(
26632 archive: *mut TarArchive,
26633 fs_file_path: *const core::ffi::c_char,
26634 archive_fname: *const core::ffi::c_char,
26635 file_size: i32,
26636 ) -> bool;
26637}
26638unsafe extern "C" {
26639 #[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"]
26640 pub fn tar_archive_add_dir(
26641 archive: *mut TarArchive,
26642 fs_full_path: *const core::ffi::c_char,
26643 path_prefix: *const core::ffi::c_char,
26644 ) -> bool;
26645}
26646unsafe extern "C" {
26647 #[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"]
26648 pub fn tar_archive_get_entries_count(archive: *mut TarArchive) -> i32;
26649}
26650unsafe extern "C" {
26651 #[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"]
26652 pub fn tar_archive_get_read_progress(
26653 archive: *mut TarArchive,
26654 processed: *mut i32,
26655 total: *mut i32,
26656 ) -> bool;
26657}
26658unsafe extern "C" {
26659 #[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"]
26660 pub fn tar_archive_unpack_file(
26661 archive: *mut TarArchive,
26662 archive_fname: *const core::ffi::c_char,
26663 destination: *const core::ffi::c_char,
26664 ) -> bool;
26665}
26666#[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"]
26667pub type tar_unpack_file_cb = ::core::option::Option<
26668 unsafe extern "C" fn(
26669 name: *const core::ffi::c_char,
26670 is_directory: bool,
26671 context: *mut core::ffi::c_void,
26672 ) -> bool,
26673>;
26674unsafe extern "C" {
26675 #[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"]
26676 pub fn tar_archive_set_file_callback(
26677 archive: *mut TarArchive,
26678 callback: tar_unpack_file_cb,
26679 context: *mut core::ffi::c_void,
26680 );
26681}
26682unsafe extern "C" {
26683 #[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"]
26684 pub fn tar_archive_dir_add_element(
26685 archive: *mut TarArchive,
26686 dirpath: *const core::ffi::c_char,
26687 ) -> bool;
26688}
26689unsafe extern "C" {
26690 #[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"]
26691 pub fn tar_archive_file_add_header(
26692 archive: *mut TarArchive,
26693 path: *const core::ffi::c_char,
26694 data_len: i32,
26695 ) -> bool;
26696}
26697unsafe extern "C" {
26698 #[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"]
26699 pub fn tar_archive_file_add_data_block(
26700 archive: *mut TarArchive,
26701 data_block: *const u8,
26702 block_len: i32,
26703 ) -> bool;
26704}
26705unsafe extern "C" {
26706 #[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"]
26707 pub fn tar_archive_file_finalize(archive: *mut TarArchive) -> bool;
26708}
26709unsafe extern "C" {
26710 #[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"]
26711 pub fn tar_archive_store_data(
26712 archive: *mut TarArchive,
26713 path: *const core::ffi::c_char,
26714 data: *const u8,
26715 data_len: i32,
26716 ) -> bool;
26717}
26718unsafe extern "C" {
26719 #[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"]
26720 pub fn tar_archive_finalize(archive: *mut TarArchive) -> bool;
26721}
26722unsafe extern "C" {
26723 #[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."]
26724 pub fn value_index_int32(value: i32, values: *const i32, values_count: usize) -> usize;
26725}
26726unsafe extern "C" {
26727 #[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."]
26728 pub fn value_index_uint32(value: u32, values: *const u32, values_count: usize) -> usize;
26729}
26730unsafe extern "C" {
26731 #[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."]
26732 pub fn value_index_float(value: f32, values: *const f32, values_count: usize) -> usize;
26733}
26734unsafe extern "C" {
26735 #[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."]
26736 pub fn value_index_bool(value: bool, values: *const bool, values_count: usize) -> usize;
26737}
26738unsafe extern "C" {
26739 #[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"]
26740 pub fn varint_uint32_pack(value: u32, output: *mut u8) -> usize;
26741}
26742unsafe extern "C" {
26743 pub fn varint_uint32_unpack(value: *mut u32, input: *const u8, input_size: usize) -> usize;
26744}
26745unsafe extern "C" {
26746 pub fn varint_uint32_length(value: u32) -> usize;
26747}
26748unsafe extern "C" {
26749 #[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"]
26750 pub fn varint_int32_pack(value: i32, output: *mut u8) -> usize;
26751}
26752unsafe extern "C" {
26753 pub fn varint_int32_unpack(value: *mut i32, input: *const u8, input_size: usize) -> usize;
26754}
26755unsafe extern "C" {
26756 pub fn varint_int32_length(value: i32) -> usize;
26757}
26758pub const BleEventNotAck: BleEventAckStatus = BleEventAckStatus(0);
26759pub const BleEventAckFlowEnable: BleEventAckStatus = BleEventAckStatus(1);
26760pub const BleEventAckFlowDisable: BleEventAckStatus = BleEventAckStatus(2);
26761#[repr(transparent)]
26762#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26763pub struct BleEventAckStatus(pub core::ffi::c_uchar);
26764pub const BleEventFlowDisable: BleEventFlowStatus = BleEventFlowStatus(0);
26765pub const BleEventFlowEnable: BleEventFlowStatus = BleEventFlowStatus(1);
26766#[repr(transparent)]
26767#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26768pub struct BleEventFlowStatus(pub core::ffi::c_uchar);
26769pub type BleSvcEventHandlerCb = ::core::option::Option<
26770 unsafe extern "C" fn(
26771 event: *mut core::ffi::c_void,
26772 context: *mut core::ffi::c_void,
26773 ) -> BleEventAckStatus,
26774>;
26775#[repr(C)]
26776#[derive(Debug, Copy, Clone)]
26777pub struct GapEventHandler {
26778 _unused: [u8; 0],
26779}
26780pub type GapSvcEventHandler = GapEventHandler;
26781unsafe extern "C" {
26782 pub fn ble_event_dispatcher_register_svc_handler(
26783 handler: BleSvcEventHandlerCb,
26784 context: *mut core::ffi::c_void,
26785 ) -> *mut GapSvcEventHandler;
26786}
26787unsafe extern "C" {
26788 pub fn ble_event_dispatcher_unregister_svc_handler(handler: *mut GapSvcEventHandler);
26789}
26790#[repr(C, packed)]
26791#[derive(Copy, Clone)]
26792pub union Service_UUID_t {
26793 #[doc = "16-bit UUID"]
26794 pub Service_UUID_16: u16,
26795 #[doc = "128-bit UUID"]
26796 pub Service_UUID_128: [u8; 16usize],
26797}
26798#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26799const _: () = {
26800 ["Size of Service_UUID_t"][::core::mem::size_of::<Service_UUID_t>() - 16usize];
26801 ["Alignment of Service_UUID_t"][::core::mem::align_of::<Service_UUID_t>() - 1usize];
26802 ["Offset of field: Service_UUID_t::Service_UUID_16"]
26803 [::core::mem::offset_of!(Service_UUID_t, Service_UUID_16) - 0usize];
26804 ["Offset of field: Service_UUID_t::Service_UUID_128"]
26805 [::core::mem::offset_of!(Service_UUID_t, Service_UUID_128) - 0usize];
26806};
26807#[repr(C, packed)]
26808#[derive(Copy, Clone)]
26809pub union Char_UUID_t {
26810 #[doc = "16-bit UUID"]
26811 pub Char_UUID_16: u16,
26812 #[doc = "128-bit UUID"]
26813 pub Char_UUID_128: [u8; 16usize],
26814}
26815#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26816const _: () = {
26817 ["Size of Char_UUID_t"][::core::mem::size_of::<Char_UUID_t>() - 16usize];
26818 ["Alignment of Char_UUID_t"][::core::mem::align_of::<Char_UUID_t>() - 1usize];
26819 ["Offset of field: Char_UUID_t::Char_UUID_16"]
26820 [::core::mem::offset_of!(Char_UUID_t, Char_UUID_16) - 0usize];
26821 ["Offset of field: Char_UUID_t::Char_UUID_128"]
26822 [::core::mem::offset_of!(Char_UUID_t, Char_UUID_128) - 0usize];
26823};
26824#[repr(C, packed)]
26825#[derive(Copy, Clone)]
26826pub union Char_Desc_Uuid_t {
26827 #[doc = "16-bit UUID"]
26828 pub Char_UUID_16: u16,
26829 #[doc = "128-bit UUID"]
26830 pub Char_UUID_128: [u8; 16usize],
26831}
26832#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26833const _: () = {
26834 ["Size of Char_Desc_Uuid_t"][::core::mem::size_of::<Char_Desc_Uuid_t>() - 16usize];
26835 ["Alignment of Char_Desc_Uuid_t"][::core::mem::align_of::<Char_Desc_Uuid_t>() - 1usize];
26836 ["Offset of field: Char_Desc_Uuid_t::Char_UUID_16"]
26837 [::core::mem::offset_of!(Char_Desc_Uuid_t, Char_UUID_16) - 0usize];
26838 ["Offset of field: Char_Desc_Uuid_t::Char_UUID_128"]
26839 [::core::mem::offset_of!(Char_Desc_Uuid_t, Char_UUID_128) - 0usize];
26840};
26841pub type cbBleGattCharacteristicData = ::core::option::Option<
26842 unsafe extern "C" fn(
26843 context: *const core::ffi::c_void,
26844 data: *mut *const u8,
26845 data_len: *mut u16,
26846 ) -> bool,
26847>;
26848pub const FlipperGattCharacteristicDataFixed: BleGattCharacteristicDataType =
26849 BleGattCharacteristicDataType(0);
26850pub const FlipperGattCharacteristicDataCallback: BleGattCharacteristicDataType =
26851 BleGattCharacteristicDataType(1);
26852#[repr(transparent)]
26853#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26854pub struct BleGattCharacteristicDataType(pub core::ffi::c_uchar);
26855#[repr(C)]
26856#[derive(Copy, Clone)]
26857pub struct BleGattCharacteristicDescriptorParams {
26858 pub uuid: Char_Desc_Uuid_t,
26859 pub data_callback: BleGattCharacteristicDescriptorParams__bindgen_ty_1,
26860 pub uuid_type: u8,
26861 pub max_length: u8,
26862 pub security_permissions: u8,
26863 pub access_permissions: u8,
26864 pub gatt_evt_mask: u8,
26865 pub is_variable: u8,
26866}
26867#[repr(C)]
26868#[derive(Debug, Copy, Clone)]
26869pub struct BleGattCharacteristicDescriptorParams__bindgen_ty_1 {
26870 pub fn_: cbBleGattCharacteristicData,
26871 pub context: *const core::ffi::c_void,
26872}
26873#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26874const _: () = {
26875 ["Size of BleGattCharacteristicDescriptorParams__bindgen_ty_1"]
26876 [::core::mem::size_of::<BleGattCharacteristicDescriptorParams__bindgen_ty_1>() - 8usize];
26877 ["Alignment of BleGattCharacteristicDescriptorParams__bindgen_ty_1"]
26878 [::core::mem::align_of::<BleGattCharacteristicDescriptorParams__bindgen_ty_1>() - 4usize];
26879 ["Offset of field: BleGattCharacteristicDescriptorParams__bindgen_ty_1::fn_"][::core::mem::offset_of!(
26880 BleGattCharacteristicDescriptorParams__bindgen_ty_1,
26881 fn_
26882 ) - 0usize];
26883 ["Offset of field: BleGattCharacteristicDescriptorParams__bindgen_ty_1::context"][::core::mem::offset_of!(
26884 BleGattCharacteristicDescriptorParams__bindgen_ty_1,
26885 context
26886 ) - 4usize];
26887};
26888#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26889const _: () = {
26890 ["Size of BleGattCharacteristicDescriptorParams"]
26891 [::core::mem::size_of::<BleGattCharacteristicDescriptorParams>() - 32usize];
26892 ["Alignment of BleGattCharacteristicDescriptorParams"]
26893 [::core::mem::align_of::<BleGattCharacteristicDescriptorParams>() - 4usize];
26894 ["Offset of field: BleGattCharacteristicDescriptorParams::uuid"]
26895 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, uuid) - 0usize];
26896 ["Offset of field: BleGattCharacteristicDescriptorParams::data_callback"]
26897 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, data_callback) - 16usize];
26898 ["Offset of field: BleGattCharacteristicDescriptorParams::uuid_type"]
26899 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, uuid_type) - 24usize];
26900 ["Offset of field: BleGattCharacteristicDescriptorParams::max_length"]
26901 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, max_length) - 25usize];
26902 ["Offset of field: BleGattCharacteristicDescriptorParams::security_permissions"][::core::mem::offset_of!(
26903 BleGattCharacteristicDescriptorParams,
26904 security_permissions
26905 ) - 26usize];
26906 ["Offset of field: BleGattCharacteristicDescriptorParams::access_permissions"][::core::mem::offset_of!(
26907 BleGattCharacteristicDescriptorParams,
26908 access_permissions
26909 ) - 27usize];
26910 ["Offset of field: BleGattCharacteristicDescriptorParams::gatt_evt_mask"]
26911 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, gatt_evt_mask) - 28usize];
26912 ["Offset of field: BleGattCharacteristicDescriptorParams::is_variable"]
26913 [::core::mem::offset_of!(BleGattCharacteristicDescriptorParams, is_variable) - 29usize];
26914};
26915#[repr(C)]
26916#[derive(Copy, Clone)]
26917pub struct BleGattCharacteristicParams {
26918 pub name: *const core::ffi::c_char,
26919 pub descriptor_params: *mut BleGattCharacteristicDescriptorParams,
26920 pub data: BleGattCharacteristicParams__bindgen_ty_1,
26921 pub uuid: Char_UUID_t,
26922 pub _bitfield_align_1: [u8; 0],
26923 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
26924 pub char_properties: u8,
26925 pub security_permissions: u8,
26926 pub gatt_evt_mask: u8,
26927}
26928#[repr(C)]
26929#[derive(Copy, Clone)]
26930pub union BleGattCharacteristicParams__bindgen_ty_1 {
26931 pub fixed: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26932 pub callback: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26933}
26934#[repr(C)]
26935#[derive(Debug, Copy, Clone)]
26936pub struct BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1 {
26937 pub ptr: *const u8,
26938 pub length: u16,
26939}
26940#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26941const _: () = {
26942 ["Size of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1"][::core::mem::size_of::<
26943 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26944 >() - 8usize];
26945 ["Alignment of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1"][::core::mem::align_of::<
26946 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26947 >() - 4usize];
26948 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1::ptr"][::core::mem::offset_of!(
26949 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26950 ptr
26951 ) - 0usize];
26952 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1::length"][::core::mem::offset_of!(
26953 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_1,
26954 length
26955 )
26956 - 4usize];
26957};
26958#[repr(C)]
26959#[derive(Debug, Copy, Clone)]
26960pub struct BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2 {
26961 pub fn_: cbBleGattCharacteristicData,
26962 pub context: *const core::ffi::c_void,
26963}
26964#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26965const _: () = {
26966 ["Size of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2"][::core::mem::size_of::<
26967 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26968 >() - 8usize];
26969 ["Alignment of BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2"][::core::mem::align_of::<
26970 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26971 >() - 4usize];
26972 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2::fn_"][::core::mem::offset_of!(
26973 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26974 fn_
26975 ) - 0usize];
26976 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2::context"][::core::mem::offset_of!(
26977 BleGattCharacteristicParams__bindgen_ty_1__bindgen_ty_2,
26978 context
26979 )
26980 - 4usize];
26981};
26982#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26983const _: () = {
26984 ["Size of BleGattCharacteristicParams__bindgen_ty_1"]
26985 [::core::mem::size_of::<BleGattCharacteristicParams__bindgen_ty_1>() - 8usize];
26986 ["Alignment of BleGattCharacteristicParams__bindgen_ty_1"]
26987 [::core::mem::align_of::<BleGattCharacteristicParams__bindgen_ty_1>() - 4usize];
26988 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1::fixed"]
26989 [::core::mem::offset_of!(BleGattCharacteristicParams__bindgen_ty_1, fixed) - 0usize];
26990 ["Offset of field: BleGattCharacteristicParams__bindgen_ty_1::callback"]
26991 [::core::mem::offset_of!(BleGattCharacteristicParams__bindgen_ty_1, callback) - 0usize];
26992};
26993#[allow(clippy::unnecessary_operation, clippy::identity_op)]
26994const _: () = {
26995 ["Size of BleGattCharacteristicParams"]
26996 [::core::mem::size_of::<BleGattCharacteristicParams>() - 36usize];
26997 ["Alignment of BleGattCharacteristicParams"]
26998 [::core::mem::align_of::<BleGattCharacteristicParams>() - 4usize];
26999 ["Offset of field: BleGattCharacteristicParams::name"]
27000 [::core::mem::offset_of!(BleGattCharacteristicParams, name) - 0usize];
27001 ["Offset of field: BleGattCharacteristicParams::descriptor_params"]
27002 [::core::mem::offset_of!(BleGattCharacteristicParams, descriptor_params) - 4usize];
27003 ["Offset of field: BleGattCharacteristicParams::data"]
27004 [::core::mem::offset_of!(BleGattCharacteristicParams, data) - 8usize];
27005 ["Offset of field: BleGattCharacteristicParams::uuid"]
27006 [::core::mem::offset_of!(BleGattCharacteristicParams, uuid) - 16usize];
27007 ["Offset of field: BleGattCharacteristicParams::char_properties"]
27008 [::core::mem::offset_of!(BleGattCharacteristicParams, char_properties) - 33usize];
27009 ["Offset of field: BleGattCharacteristicParams::security_permissions"]
27010 [::core::mem::offset_of!(BleGattCharacteristicParams, security_permissions) - 34usize];
27011 ["Offset of field: BleGattCharacteristicParams::gatt_evt_mask"]
27012 [::core::mem::offset_of!(BleGattCharacteristicParams, gatt_evt_mask) - 35usize];
27013};
27014impl BleGattCharacteristicParams {
27015 #[inline]
27016 pub fn data_prop_type(&self) -> BleGattCharacteristicDataType {
27017 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u8) }
27018 }
27019 #[inline]
27020 pub fn set_data_prop_type(&mut self, val: BleGattCharacteristicDataType) {
27021 unsafe {
27022 let val: u8 = ::core::mem::transmute(val);
27023 self._bitfield_1.set(0usize, 2u8, val as u64)
27024 }
27025 }
27026 #[inline]
27027 pub unsafe fn data_prop_type_raw(this: *const Self) -> BleGattCharacteristicDataType {
27028 unsafe {
27029 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
27030 ::core::ptr::addr_of!((*this)._bitfield_1),
27031 0usize,
27032 2u8,
27033 ) as u8)
27034 }
27035 }
27036 #[inline]
27037 pub unsafe fn set_data_prop_type_raw(this: *mut Self, val: BleGattCharacteristicDataType) {
27038 unsafe {
27039 let val: u8 = ::core::mem::transmute(val);
27040 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
27041 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
27042 0usize,
27043 2u8,
27044 val as u64,
27045 )
27046 }
27047 }
27048 #[inline]
27049 pub fn is_variable(&self) -> u8 {
27050 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u8) }
27051 }
27052 #[inline]
27053 pub fn set_is_variable(&mut self, val: u8) {
27054 unsafe {
27055 let val: u8 = ::core::mem::transmute(val);
27056 self._bitfield_1.set(2usize, 2u8, val as u64)
27057 }
27058 }
27059 #[inline]
27060 pub unsafe fn is_variable_raw(this: *const Self) -> u8 {
27061 unsafe {
27062 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
27063 ::core::ptr::addr_of!((*this)._bitfield_1),
27064 2usize,
27065 2u8,
27066 ) as u8)
27067 }
27068 }
27069 #[inline]
27070 pub unsafe fn set_is_variable_raw(this: *mut Self, val: u8) {
27071 unsafe {
27072 let val: u8 = ::core::mem::transmute(val);
27073 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
27074 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
27075 2usize,
27076 2u8,
27077 val as u64,
27078 )
27079 }
27080 }
27081 #[inline]
27082 pub fn uuid_type(&self) -> u8 {
27083 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) }
27084 }
27085 #[inline]
27086 pub fn set_uuid_type(&mut self, val: u8) {
27087 unsafe {
27088 let val: u8 = ::core::mem::transmute(val);
27089 self._bitfield_1.set(4usize, 2u8, val as u64)
27090 }
27091 }
27092 #[inline]
27093 pub unsafe fn uuid_type_raw(this: *const Self) -> u8 {
27094 unsafe {
27095 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
27096 ::core::ptr::addr_of!((*this)._bitfield_1),
27097 4usize,
27098 2u8,
27099 ) as u8)
27100 }
27101 }
27102 #[inline]
27103 pub unsafe fn set_uuid_type_raw(this: *mut Self, val: u8) {
27104 unsafe {
27105 let val: u8 = ::core::mem::transmute(val);
27106 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
27107 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
27108 4usize,
27109 2u8,
27110 val as u64,
27111 )
27112 }
27113 }
27114 #[inline]
27115 pub fn new_bitfield_1(
27116 data_prop_type: BleGattCharacteristicDataType,
27117 is_variable: u8,
27118 uuid_type: u8,
27119 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
27120 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
27121 __bindgen_bitfield_unit.set(0usize, 2u8, {
27122 let data_prop_type: u8 = unsafe { ::core::mem::transmute(data_prop_type) };
27123 data_prop_type as u64
27124 });
27125 __bindgen_bitfield_unit.set(2usize, 2u8, {
27126 let is_variable: u8 = unsafe { ::core::mem::transmute(is_variable) };
27127 is_variable as u64
27128 });
27129 __bindgen_bitfield_unit.set(4usize, 2u8, {
27130 let uuid_type: u8 = unsafe { ::core::mem::transmute(uuid_type) };
27131 uuid_type as u64
27132 });
27133 __bindgen_bitfield_unit
27134 }
27135}
27136#[repr(C)]
27137#[derive(Debug, Copy, Clone)]
27138pub struct BleGattCharacteristicInstance {
27139 pub characteristic: *const BleGattCharacteristicParams,
27140 pub handle: u16,
27141 pub descriptor_handle: u16,
27142}
27143#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27144const _: () = {
27145 ["Size of BleGattCharacteristicInstance"]
27146 [::core::mem::size_of::<BleGattCharacteristicInstance>() - 8usize];
27147 ["Alignment of BleGattCharacteristicInstance"]
27148 [::core::mem::align_of::<BleGattCharacteristicInstance>() - 4usize];
27149 ["Offset of field: BleGattCharacteristicInstance::characteristic"]
27150 [::core::mem::offset_of!(BleGattCharacteristicInstance, characteristic) - 0usize];
27151 ["Offset of field: BleGattCharacteristicInstance::handle"]
27152 [::core::mem::offset_of!(BleGattCharacteristicInstance, handle) - 4usize];
27153 ["Offset of field: BleGattCharacteristicInstance::descriptor_handle"]
27154 [::core::mem::offset_of!(BleGattCharacteristicInstance, descriptor_handle) - 6usize];
27155};
27156unsafe extern "C" {
27157 pub fn ble_gatt_characteristic_init(
27158 svc_handle: u16,
27159 char_descriptor: *const BleGattCharacteristicParams,
27160 char_instance: *mut BleGattCharacteristicInstance,
27161 );
27162}
27163unsafe extern "C" {
27164 pub fn ble_gatt_characteristic_delete(
27165 svc_handle: u16,
27166 char_instance: *mut BleGattCharacteristicInstance,
27167 );
27168}
27169unsafe extern "C" {
27170 pub fn ble_gatt_characteristic_update(
27171 svc_handle: u16,
27172 char_instance: *mut BleGattCharacteristicInstance,
27173 source: *const core::ffi::c_void,
27174 ) -> bool;
27175}
27176unsafe extern "C" {
27177 pub fn ble_gatt_service_add(
27178 Service_UUID_Type: u8,
27179 Service_UUID: *const Service_UUID_t,
27180 Service_Type: u8,
27181 Max_Attribute_Records: u8,
27182 Service_Handle: *mut u16,
27183 ) -> bool;
27184}
27185unsafe extern "C" {
27186 pub fn ble_gatt_service_delete(svc_handle: u16) -> bool;
27187}
27188pub const SerialServiceEventTypeDataReceived: SerialServiceEventType = SerialServiceEventType(0);
27189pub const SerialServiceEventTypeDataSent: SerialServiceEventType = SerialServiceEventType(1);
27190pub const SerialServiceEventTypesBleResetRequest: SerialServiceEventType =
27191 SerialServiceEventType(2);
27192#[repr(transparent)]
27193#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27194pub struct SerialServiceEventType(pub core::ffi::c_uchar);
27195#[repr(C)]
27196#[derive(Debug, Copy, Clone)]
27197pub struct SerialServiceData {
27198 pub buffer: *mut u8,
27199 pub size: u16,
27200}
27201#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27202const _: () = {
27203 ["Size of SerialServiceData"][::core::mem::size_of::<SerialServiceData>() - 8usize];
27204 ["Alignment of SerialServiceData"][::core::mem::align_of::<SerialServiceData>() - 4usize];
27205 ["Offset of field: SerialServiceData::buffer"]
27206 [::core::mem::offset_of!(SerialServiceData, buffer) - 0usize];
27207 ["Offset of field: SerialServiceData::size"]
27208 [::core::mem::offset_of!(SerialServiceData, size) - 4usize];
27209};
27210#[repr(C)]
27211#[derive(Debug, Copy, Clone)]
27212pub struct SerialServiceEvent {
27213 pub event: SerialServiceEventType,
27214 pub data: SerialServiceData,
27215}
27216#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27217const _: () = {
27218 ["Size of SerialServiceEvent"][::core::mem::size_of::<SerialServiceEvent>() - 12usize];
27219 ["Alignment of SerialServiceEvent"][::core::mem::align_of::<SerialServiceEvent>() - 4usize];
27220 ["Offset of field: SerialServiceEvent::event"]
27221 [::core::mem::offset_of!(SerialServiceEvent, event) - 0usize];
27222 ["Offset of field: SerialServiceEvent::data"]
27223 [::core::mem::offset_of!(SerialServiceEvent, data) - 4usize];
27224};
27225pub type SerialServiceEventCallback = ::core::option::Option<
27226 unsafe extern "C" fn(event: SerialServiceEvent, context: *mut core::ffi::c_void) -> u16,
27227>;
27228#[repr(C)]
27229#[derive(Debug, Copy, Clone)]
27230pub struct BleServiceSerial {
27231 _unused: [u8; 0],
27232}
27233unsafe extern "C" {
27234 pub fn ble_svc_serial_start() -> *mut BleServiceSerial;
27235}
27236unsafe extern "C" {
27237 pub fn ble_svc_serial_stop(service: *mut BleServiceSerial);
27238}
27239unsafe extern "C" {
27240 pub fn ble_svc_serial_set_callbacks(
27241 service: *mut BleServiceSerial,
27242 buff_size: u16,
27243 callback: SerialServiceEventCallback,
27244 context: *mut core::ffi::c_void,
27245 );
27246}
27247unsafe extern "C" {
27248 pub fn ble_svc_serial_set_rpc_active(service: *mut BleServiceSerial, active: bool);
27249}
27250unsafe extern "C" {
27251 pub fn ble_svc_serial_notify_buffer_is_empty(service: *mut BleServiceSerial);
27252}
27253unsafe extern "C" {
27254 pub fn ble_svc_serial_update_tx(
27255 service: *mut BleServiceSerial,
27256 data: *mut u8,
27257 data_len: u16,
27258 ) -> bool;
27259}
27260pub const FuriHalBtSerialRpcStatusNotActive: FuriHalBtSerialRpcStatus = FuriHalBtSerialRpcStatus(0);
27261pub const FuriHalBtSerialRpcStatusActive: FuriHalBtSerialRpcStatus = FuriHalBtSerialRpcStatus(1);
27262#[repr(transparent)]
27263#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27264pub struct FuriHalBtSerialRpcStatus(pub core::ffi::c_uchar);
27265#[doc = "Serial service callback type"]
27266pub type FuriHalBtSerialCallback = SerialServiceEventCallback;
27267unsafe extern "C" {
27268 #[doc = "Serial profile descriptor"]
27269 pub static ble_profile_serial: *const FuriHalBleProfileTemplate;
27270}
27271unsafe extern "C" {
27272 #[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"]
27273 pub fn ble_profile_serial_tx(
27274 profile: *mut FuriHalBleProfileBase,
27275 data: *mut u8,
27276 size: u16,
27277 ) -> bool;
27278}
27279unsafe extern "C" {
27280 #[doc = "Set BLE RPC status\n\n # Arguments\n\n* `profile` - Profile instance\n * `active` - true if RPC is active"]
27281 pub fn ble_profile_serial_set_rpc_active(profile: *mut FuriHalBleProfileBase, active: bool);
27282}
27283unsafe extern "C" {
27284 #[doc = "Notify that application buffer is empty\n # Arguments\n\n* `profile` - Profile instance"]
27285 pub fn ble_profile_serial_notify_buffer_is_empty(profile: *mut FuriHalBleProfileBase);
27286}
27287unsafe extern "C" {
27288 #[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"]
27289 pub fn ble_profile_serial_set_event_callback(
27290 profile: *mut FuriHalBleProfileBase,
27291 buff_size: u16,
27292 callback: FuriHalBtSerialCallback,
27293 context: *mut core::ffi::c_void,
27294 );
27295}
27296#[repr(C)]
27297#[derive(Debug, Copy, Clone)]
27298pub struct BleServiceBattery {
27299 _unused: [u8; 0],
27300}
27301unsafe extern "C" {
27302 pub fn ble_svc_battery_start(auto_update: bool) -> *mut BleServiceBattery;
27303}
27304unsafe extern "C" {
27305 pub fn ble_svc_battery_stop(service: *mut BleServiceBattery);
27306}
27307unsafe extern "C" {
27308 pub fn ble_svc_battery_update_level(service: *mut BleServiceBattery, battery_level: u8)
27309 -> bool;
27310}
27311unsafe extern "C" {
27312 pub fn ble_svc_battery_update_power_state(
27313 service: *mut BleServiceBattery,
27314 charging: bool,
27315 ) -> bool;
27316}
27317unsafe extern "C" {
27318 pub fn ble_svc_battery_state_update(battery_level: *mut u8, charging: *mut bool);
27319}
27320#[repr(C)]
27321#[derive(Debug, Copy, Clone)]
27322pub struct BleServiceDevInfo {
27323 _unused: [u8; 0],
27324}
27325unsafe extern "C" {
27326 pub fn ble_svc_dev_info_start() -> *mut BleServiceDevInfo;
27327}
27328unsafe extern "C" {
27329 pub fn ble_svc_dev_info_stop(service: *mut BleServiceDevInfo);
27330}
27331pub const CdcStateDisconnected: CdcState = CdcState(0);
27332pub const CdcStateConnected: CdcState = CdcState(1);
27333#[repr(transparent)]
27334#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27335pub struct CdcState(pub core::ffi::c_uchar);
27336pub const CdcCtrlLineDTR: CdcCtrlLine = CdcCtrlLine(1);
27337pub const CdcCtrlLineRTS: CdcCtrlLine = CdcCtrlLine(2);
27338#[repr(transparent)]
27339#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27340pub struct CdcCtrlLine(pub core::ffi::c_uchar);
27341#[repr(C)]
27342#[derive(Debug, Copy, Clone)]
27343pub struct CdcCallbacks {
27344 pub tx_ep_callback:
27345 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>,
27346 pub rx_ep_callback:
27347 ::core::option::Option<unsafe extern "C" fn(context: *mut core::ffi::c_void)>,
27348 pub state_callback: ::core::option::Option<
27349 unsafe extern "C" fn(context: *mut core::ffi::c_void, state: CdcState),
27350 >,
27351 pub ctrl_line_callback: ::core::option::Option<
27352 unsafe extern "C" fn(context: *mut core::ffi::c_void, ctrl_lines: CdcCtrlLine),
27353 >,
27354 pub config_callback: ::core::option::Option<
27355 unsafe extern "C" fn(context: *mut core::ffi::c_void, config: *mut usb_cdc_line_coding),
27356 >,
27357}
27358#[allow(clippy::unnecessary_operation, clippy::identity_op)]
27359const _: () = {
27360 ["Size of CdcCallbacks"][::core::mem::size_of::<CdcCallbacks>() - 20usize];
27361 ["Alignment of CdcCallbacks"][::core::mem::align_of::<CdcCallbacks>() - 4usize];
27362 ["Offset of field: CdcCallbacks::tx_ep_callback"]
27363 [::core::mem::offset_of!(CdcCallbacks, tx_ep_callback) - 0usize];
27364 ["Offset of field: CdcCallbacks::rx_ep_callback"]
27365 [::core::mem::offset_of!(CdcCallbacks, rx_ep_callback) - 4usize];
27366 ["Offset of field: CdcCallbacks::state_callback"]
27367 [::core::mem::offset_of!(CdcCallbacks, state_callback) - 8usize];
27368 ["Offset of field: CdcCallbacks::ctrl_line_callback"]
27369 [::core::mem::offset_of!(CdcCallbacks, ctrl_line_callback) - 12usize];
27370 ["Offset of field: CdcCallbacks::config_callback"]
27371 [::core::mem::offset_of!(CdcCallbacks, config_callback) - 16usize];
27372};
27373unsafe extern "C" {
27374 pub fn furi_hal_cdc_set_callbacks(
27375 if_num: u8,
27376 cb: *mut CdcCallbacks,
27377 context: *mut core::ffi::c_void,
27378 );
27379}
27380unsafe extern "C" {
27381 pub fn furi_hal_cdc_get_port_settings(if_num: u8) -> *mut usb_cdc_line_coding;
27382}
27383unsafe extern "C" {
27384 pub fn furi_hal_cdc_get_ctrl_line_state(if_num: u8) -> u8;
27385}
27386unsafe extern "C" {
27387 pub fn furi_hal_cdc_send(if_num: u8, buf: *mut u8, len: u16);
27388}
27389unsafe extern "C" {
27390 pub fn furi_hal_cdc_receive(if_num: u8, buf: *mut u8, max_len: u16) -> i32;
27391}
27392unsafe extern "C" {
27393 pub fn __errno() -> *mut core::ffi::c_int;
27394}
27395unsafe extern "C" {
27396 pub fn __cxa_pure_virtual();
27397}
27398unsafe extern "C" {
27399 pub fn __clear_cache(arg1: *mut core::ffi::c_void, arg2: *mut core::ffi::c_void);
27400}
27401unsafe extern "C" {
27402 pub fn __aeabi_uldivmod(arg1: u64, arg2: u64) -> *mut core::ffi::c_void;
27403}
27404unsafe extern "C" {
27405 pub fn __aeabi_f2d(arg1: f32) -> f64;
27406}
27407unsafe extern "C" {
27408 #[doc = "Init memory pool manager"]
27409 pub fn furi_hal_memory_init();
27410}
27411unsafe extern "C" {
27412 #[doc = "Allocate memory from separate memory pool. That memory can't be freed.\n\n # Arguments\n\n* `size` -\n # Returns\n\nvoid*"]
27413 pub fn furi_hal_memory_alloc(size: usize) -> *mut core::ffi::c_void;
27414}
27415unsafe extern "C" {
27416 #[doc = "Get free memory pool size\n\n # Returns\n\nsize_t"]
27417 pub fn furi_hal_memory_get_free() -> usize;
27418}
27419unsafe extern "C" {
27420 #[doc = "Get max free block size from memory pool\n\n # Returns\n\nsize_t"]
27421 pub fn furi_hal_memory_max_pool_block() -> usize;
27422}
27423pub const FuriHalMpuRegionNULL: FuriHalMpuRegion = FuriHalMpuRegion(0);
27424pub const FuriHalMpuRegionMainStack: FuriHalMpuRegion = FuriHalMpuRegion(1);
27425pub const FuriHalMpuRegionThreadStack: FuriHalMpuRegion = FuriHalMpuRegion(2);
27426pub const FuriHalMpuRegion3: FuriHalMpuRegion = FuriHalMpuRegion(3);
27427pub const FuriHalMpuRegion4: FuriHalMpuRegion = FuriHalMpuRegion(4);
27428pub const FuriHalMpuRegion5: FuriHalMpuRegion = FuriHalMpuRegion(5);
27429pub const FuriHalMpuRegion6: FuriHalMpuRegion = FuriHalMpuRegion(6);
27430pub const FuriHalMpuRegion7: FuriHalMpuRegion = FuriHalMpuRegion(7);
27431#[repr(transparent)]
27432#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27433pub struct FuriHalMpuRegion(pub core::ffi::c_uchar);
27434pub const FuriHalMPURegionSize32B: FuriHalMPURegionSize = FuriHalMPURegionSize(4);
27435pub const FuriHalMPURegionSize64B: FuriHalMPURegionSize = FuriHalMPURegionSize(5);
27436pub const FuriHalMPURegionSize128B: FuriHalMPURegionSize = FuriHalMPURegionSize(6);
27437pub const FuriHalMPURegionSize256B: FuriHalMPURegionSize = FuriHalMPURegionSize(7);
27438pub const FuriHalMPURegionSize512B: FuriHalMPURegionSize = FuriHalMPURegionSize(8);
27439pub const FuriHalMPURegionSize1KB: FuriHalMPURegionSize = FuriHalMPURegionSize(9);
27440pub const FuriHalMPURegionSize2KB: FuriHalMPURegionSize = FuriHalMPURegionSize(10);
27441pub const FuriHalMPURegionSize4KB: FuriHalMPURegionSize = FuriHalMPURegionSize(11);
27442pub const FuriHalMPURegionSize8KB: FuriHalMPURegionSize = FuriHalMPURegionSize(12);
27443pub const FuriHalMPURegionSize16KB: FuriHalMPURegionSize = FuriHalMPURegionSize(13);
27444pub const FuriHalMPURegionSize32KB: FuriHalMPURegionSize = FuriHalMPURegionSize(14);
27445pub const FuriHalMPURegionSize64KB: FuriHalMPURegionSize = FuriHalMPURegionSize(15);
27446pub const FuriHalMPURegionSize128KB: FuriHalMPURegionSize = FuriHalMPURegionSize(16);
27447pub const FuriHalMPURegionSize256KB: FuriHalMPURegionSize = FuriHalMPURegionSize(17);
27448pub const FuriHalMPURegionSize512KB: FuriHalMPURegionSize = FuriHalMPURegionSize(18);
27449pub const FuriHalMPURegionSize1MB: FuriHalMPURegionSize = FuriHalMPURegionSize(19);
27450pub const FuriHalMPURegionSize2MB: FuriHalMPURegionSize = FuriHalMPURegionSize(20);
27451pub const FuriHalMPURegionSize4MB: FuriHalMPURegionSize = FuriHalMPURegionSize(21);
27452pub const FuriHalMPURegionSize8MB: FuriHalMPURegionSize = FuriHalMPURegionSize(22);
27453pub const FuriHalMPURegionSize16MB: FuriHalMPURegionSize = FuriHalMPURegionSize(23);
27454pub const FuriHalMPURegionSize32MB: FuriHalMPURegionSize = FuriHalMPURegionSize(24);
27455pub const FuriHalMPURegionSize64MB: FuriHalMPURegionSize = FuriHalMPURegionSize(25);
27456pub const FuriHalMPURegionSize128MB: FuriHalMPURegionSize = FuriHalMPURegionSize(26);
27457pub const FuriHalMPURegionSize256MB: FuriHalMPURegionSize = FuriHalMPURegionSize(27);
27458pub const FuriHalMPURegionSize512MB: FuriHalMPURegionSize = FuriHalMPURegionSize(28);
27459pub const FuriHalMPURegionSize1GB: FuriHalMPURegionSize = FuriHalMPURegionSize(29);
27460pub const FuriHalMPURegionSize2GB: FuriHalMPURegionSize = FuriHalMPURegionSize(30);
27461pub const FuriHalMPURegionSize4GB: FuriHalMPURegionSize = FuriHalMPURegionSize(31);
27462#[repr(transparent)]
27463#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27464pub struct FuriHalMPURegionSize(pub core::ffi::c_uchar);
27465unsafe extern "C" {
27466 #[doc = "Enable memory protection unit"]
27467 pub fn furi_hal_mpu_enable();
27468}
27469unsafe extern "C" {
27470 #[doc = "Disable memory protection unit"]
27471 pub fn furi_hal_mpu_disable();
27472}
27473unsafe extern "C" {
27474 pub fn furi_hal_mpu_protect_no_access(
27475 region: FuriHalMpuRegion,
27476 address: u32,
27477 size: FuriHalMPURegionSize,
27478 );
27479}
27480unsafe extern "C" {
27481 pub fn furi_hal_mpu_protect_read_only(
27482 region: FuriHalMpuRegion,
27483 address: u32,
27484 size: FuriHalMPURegionSize,
27485 );
27486}
27487unsafe extern "C" {
27488 pub fn furi_hal_mpu_protect_disable(region: FuriHalMpuRegion);
27489}
27490pub const HidU2fDisconnected: HidU2fEvent = HidU2fEvent(0);
27491pub const HidU2fConnected: HidU2fEvent = HidU2fEvent(1);
27492pub const HidU2fRequest: HidU2fEvent = HidU2fEvent(2);
27493#[repr(transparent)]
27494#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
27495pub struct HidU2fEvent(pub core::ffi::c_uchar);
27496pub type HidU2fCallback =
27497 ::core::option::Option<unsafe extern "C" fn(ev: HidU2fEvent, context: *mut core::ffi::c_void)>;
27498unsafe extern "C" {
27499 #[doc = "Get HID U2F connection state\n\n # Returns\n\ntrue / false"]
27500 pub fn furi_hal_hid_u2f_is_connected() -> bool;
27501}
27502unsafe extern "C" {
27503 #[doc = "Set HID U2F event callback\n\n # Arguments\n\n* `cb` - callback\n * `ctx` - callback context"]
27504 pub fn furi_hal_hid_u2f_set_callback(cb: HidU2fCallback, ctx: *mut core::ffi::c_void);
27505}
27506unsafe extern "C" {
27507 #[doc = "Get received U2F HID packet\n"]
27508 pub fn furi_hal_hid_u2f_get_request(data: *mut u8) -> u32;
27509}
27510unsafe extern "C" {
27511 #[doc = "Send U2F HID response packet\n\n # Arguments\n\n* `data` - response data\n * `len` - packet length"]
27512 pub fn furi_hal_hid_u2f_send_response(data: *mut u8, len: u8);
27513}