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 pub fn get_bit(&self, index: usize) -> bool {
20 debug_assert!(index / 8 < self.storage.as_ref().len());
21 let byte_index = index / 8;
22 let byte = self.storage.as_ref()[byte_index];
23 let bit_index = if cfg!(target_endian = "big") {
24 7 - (index % 8)
25 } else {
26 index % 8
27 };
28 let mask = 1 << bit_index;
29 byte & mask == mask
30 }
31 #[inline]
32 pub fn set_bit(&mut self, index: usize, val: bool) {
33 debug_assert!(index / 8 < self.storage.as_ref().len());
34 let byte_index = index / 8;
35 let byte = &mut self.storage.as_mut()[byte_index];
36 let bit_index = if cfg!(target_endian = "big") {
37 7 - (index % 8)
38 } else {
39 index % 8
40 };
41 let mask = 1 << bit_index;
42 if val {
43 *byte |= mask;
44 } else {
45 *byte &= !mask;
46 }
47 }
48 #[inline]
49 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
50 debug_assert!(bit_width <= 64);
51 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
52 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
53 let mut val = 0;
54 for i in 0..(bit_width as usize) {
55 if self.get_bit(i + bit_offset) {
56 let index = if cfg!(target_endian = "big") {
57 bit_width as usize - 1 - i
58 } else {
59 i
60 };
61 val |= 1 << index;
62 }
63 }
64 val
65 }
66 #[inline]
67 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
68 debug_assert!(bit_width <= 64);
69 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
70 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
71 for i in 0..(bit_width as usize) {
72 let mask = 1 << i;
73 let val_bit_is_set = val & mask == mask;
74 let index = if cfg!(target_endian = "big") {
75 bit_width as usize - 1 - i
76 } else {
77 i
78 };
79 self.set_bit(index + bit_offset, val_bit_is_set);
80 }
81 }
82}
83extern "C" {
84 pub fn rc_adc_init() -> ::std::os::raw::c_int;
85}
86extern "C" {
87 pub fn rc_adc_cleanup() -> ::std::os::raw::c_int;
88}
89extern "C" {
90 pub fn rc_adc_read_raw(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
91}
92extern "C" {
93 pub fn rc_adc_read_volt(ch: ::std::os::raw::c_int) -> f64;
94}
95extern "C" {
96 pub fn rc_adc_batt() -> f64;
97}
98extern "C" {
99 pub fn rc_adc_dc_jack() -> f64;
100}
101pub const BMP_OVERSAMPLE_1: rc_bmp_oversample_t = 4;
102pub const BMP_OVERSAMPLE_2: rc_bmp_oversample_t = 8;
103pub const BMP_OVERSAMPLE_4: rc_bmp_oversample_t = 12;
104pub const BMP_OVERSAMPLE_8: rc_bmp_oversample_t = 16;
105pub const BMP_OVERSAMPLE_16: rc_bmp_oversample_t = 20;
106pub type rc_bmp_oversample_t = ::std::os::raw::c_uint;
107pub const BMP_FILTER_OFF: rc_bmp_filter_t = 0;
108pub const BMP_FILTER_2: rc_bmp_filter_t = 4;
109pub const BMP_FILTER_4: rc_bmp_filter_t = 8;
110pub const BMP_FILTER_8: rc_bmp_filter_t = 12;
111pub const BMP_FILTER_16: rc_bmp_filter_t = 16;
112pub type rc_bmp_filter_t = ::std::os::raw::c_uint;
113#[repr(C)]
114#[derive(Debug, Default, Copy, Clone)]
115pub struct rc_bmp_data_t {
116 pub temp_c: f64,
117 pub alt_m: f64,
118 pub pressure_pa: f64,
119}
120#[test]
121fn bindgen_test_layout_rc_bmp_data_t() {
122 const UNINIT: ::std::mem::MaybeUninit<rc_bmp_data_t> = ::std::mem::MaybeUninit::uninit();
123 let ptr = UNINIT.as_ptr();
124 assert_eq!(
125 ::std::mem::size_of::<rc_bmp_data_t>(),
126 24usize,
127 concat!("Size of: ", stringify!(rc_bmp_data_t))
128 );
129 assert_eq!(
130 ::std::mem::align_of::<rc_bmp_data_t>(),
131 8usize,
132 concat!("Alignment of ", stringify!(rc_bmp_data_t))
133 );
134 assert_eq!(
135 unsafe { ::std::ptr::addr_of!((*ptr).temp_c) as usize - ptr as usize },
136 0usize,
137 concat!("Offset of field: ", stringify!(rc_bmp_data_t), "::", stringify!(temp_c))
138 );
139 assert_eq!(
140 unsafe { ::std::ptr::addr_of!((*ptr).alt_m) as usize - ptr as usize },
141 8usize,
142 concat!("Offset of field: ", stringify!(rc_bmp_data_t), "::", stringify!(alt_m))
143 );
144 assert_eq!(
145 unsafe { ::std::ptr::addr_of!((*ptr).pressure_pa) as usize - ptr as usize },
146 16usize,
147 concat!(
148 "Offset of field: ",
149 stringify!(rc_bmp_data_t),
150 "::",
151 stringify!(pressure_pa)
152 )
153 );
154}
155extern "C" {
156 pub fn rc_bmp_init(oversample: rc_bmp_oversample_t, filter: rc_bmp_filter_t) -> ::std::os::raw::c_int;
157}
158extern "C" {
159 pub fn rc_bmp_set_sea_level_pressure_pa(pa: f64) -> ::std::os::raw::c_int;
160}
161extern "C" {
162 pub fn rc_bmp_power_off() -> ::std::os::raw::c_int;
163}
164extern "C" {
165 pub fn rc_bmp_read(data: *mut rc_bmp_data_t) -> ::std::os::raw::c_int;
166}
167extern "C" {
168 pub fn rc_button_init(
169 chip: ::std::os::raw::c_int,
170 pin: ::std::os::raw::c_int,
171 polarity: ::std::os::raw::c_char,
172 debounce_us: ::std::os::raw::c_int,
173 ) -> ::std::os::raw::c_int;
174}
175extern "C" {
176 pub fn rc_button_cleanup();
177}
178extern "C" {
179 pub fn rc_button_set_callbacks(
180 chip: ::std::os::raw::c_int,
181 pin: ::std::os::raw::c_int,
182 press_func: ::std::option::Option<unsafe extern "C" fn()>,
183 release_func: ::std::option::Option<unsafe extern "C" fn()>,
184 ) -> ::std::os::raw::c_int;
185}
186extern "C" {
187 pub fn rc_button_get_state(chip: ::std::os::raw::c_int, pin: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
188}
189extern "C" {
190 pub fn rc_button_wait_for_event(
191 chip: ::std::os::raw::c_int,
192 pin: ::std::os::raw::c_int,
193 press_or_release: ::std::os::raw::c_int,
194 ) -> ::std::os::raw::c_int;
195}
196pub const RC_GOV_POWERSAVE: rc_governor_t = 0;
197pub const RC_GOV_PERFORMANCE: rc_governor_t = 1;
198pub const RC_GOV_ONDEMAND: rc_governor_t = 2;
199pub const RC_GOV_SCHEDUTIL: rc_governor_t = 3;
200pub const RC_GOV_CONSERVATIVE: rc_governor_t = 4;
201pub type rc_governor_t = ::std::os::raw::c_uint;
202extern "C" {
203 pub fn rc_cpu_set_governor(gov: rc_governor_t) -> ::std::os::raw::c_int;
204}
205extern "C" {
206 pub fn rc_cpu_get_freq() -> ::std::os::raw::c_int;
207}
208extern "C" {
209 pub fn rc_cpu_print_freq() -> ::std::os::raw::c_int;
210}
211extern "C" {
212 pub fn rc_initialize() -> ::std::os::raw::c_int;
213}
214extern "C" {
215 pub fn rc_cleanup() -> ::std::os::raw::c_int;
216}
217pub const RELEASED: rc_button_state_t = 0;
218pub const PRESSED: rc_button_state_t = 1;
219pub type rc_button_state_t = ::std::os::raw::c_uint;
220extern "C" {
221 pub fn rc_set_pause_pressed_func(func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int;
222}
223extern "C" {
224 pub fn rc_set_pause_released_func(func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int;
225}
226extern "C" {
227 pub fn rc_set_mode_pressed_func(func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int;
228}
229extern "C" {
230 pub fn rc_set_mode_released_func(func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int;
231}
232extern "C" {
233 pub fn rc_get_pause_button() -> rc_button_state_t;
234}
235extern "C" {
236 pub fn rc_get_mode_button() -> rc_button_state_t;
237}
238extern "C" {
239 pub fn rc_get_encoder_pos(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
240}
241extern "C" {
242 pub fn rc_set_encoder_pos(ch: ::std::os::raw::c_int, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
243}
244extern "C" {
245 pub fn rc_enable_motors() -> ::std::os::raw::c_int;
246}
247extern "C" {
248 pub fn rc_disable_motors() -> ::std::os::raw::c_int;
249}
250extern "C" {
251 pub fn rc_set_motor(motor: ::std::os::raw::c_int, duty: f32) -> ::std::os::raw::c_int;
252}
253extern "C" {
254 pub fn rc_set_motor_all(duty: f32) -> ::std::os::raw::c_int;
255}
256extern "C" {
257 pub fn rc_set_motor_free_spin(motor: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
258}
259extern "C" {
260 pub fn rc_set_motor_free_spin_all() -> ::std::os::raw::c_int;
261}
262extern "C" {
263 pub fn rc_set_motor_brake(motor: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
264}
265extern "C" {
266 pub fn rc_set_motor_brake_all() -> ::std::os::raw::c_int;
267}
268extern "C" {
269 pub fn rc_dsm_init() -> ::std::os::raw::c_int;
270}
271extern "C" {
272 pub fn rc_dsm_cleanup() -> ::std::os::raw::c_int;
273}
274extern "C" {
275 pub fn rc_dsm_ch_raw(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
276}
277extern "C" {
278 pub fn rc_dsm_ch_normalized(ch: ::std::os::raw::c_int) -> f64;
279}
280extern "C" {
281 pub fn rc_dsm_is_new_data() -> ::std::os::raw::c_int;
282}
283extern "C" {
284 pub fn rc_dsm_set_callback(func: ::std::option::Option<unsafe extern "C" fn()>);
285}
286extern "C" {
287 pub fn rc_dsm_set_disconnect_callback(func: ::std::option::Option<unsafe extern "C" fn()>);
288}
289extern "C" {
290 pub fn rc_dsm_is_connection_active() -> ::std::os::raw::c_int;
291}
292extern "C" {
293 pub fn rc_dsm_nanos_since_last_packet() -> i64;
294}
295extern "C" {
296 pub fn rc_dsm_resolution() -> ::std::os::raw::c_int;
297}
298extern "C" {
299 pub fn rc_dsm_channels() -> ::std::os::raw::c_int;
300}
301extern "C" {
302 pub fn rc_dsm_bind_routine() -> ::std::os::raw::c_int;
303}
304extern "C" {
305 pub fn rc_dsm_calibrate_routine() -> ::std::os::raw::c_int;
306}
307extern "C" {
308 pub fn rc_encoder_eqep_init() -> ::std::os::raw::c_int;
309}
310extern "C" {
311 pub fn rc_encoder_eqep_cleanup() -> ::std::os::raw::c_int;
312}
313extern "C" {
314 pub fn rc_encoder_eqep_read(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
315}
316extern "C" {
317 pub fn rc_encoder_eqep_write(ch: ::std::os::raw::c_int, pos: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
318}
319extern "C" {
320 pub fn rc_encoder_pru_init() -> ::std::os::raw::c_int;
321}
322extern "C" {
323 pub fn rc_encoder_pru_cleanup();
324}
325extern "C" {
326 pub fn rc_encoder_pru_read() -> ::std::os::raw::c_int;
327}
328extern "C" {
329 pub fn rc_encoder_pru_write(pos: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
330}
331extern "C" {
332 pub fn rc_encoder_init() -> ::std::os::raw::c_int;
333}
334extern "C" {
335 pub fn rc_encoder_cleanup() -> ::std::os::raw::c_int;
336}
337extern "C" {
338 pub fn rc_encoder_read(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
339}
340extern "C" {
341 pub fn rc_encoder_write(ch: ::std::os::raw::c_int, pos: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
342}
343extern "C" {
344 pub fn rc_gpio_init(
345 chip: ::std::os::raw::c_int,
346 pin: ::std::os::raw::c_int,
347 handle_flags: ::std::os::raw::c_int,
348 ) -> ::std::os::raw::c_int;
349}
350extern "C" {
351 pub fn rc_gpio_set_value(
352 chip: ::std::os::raw::c_int,
353 pin: ::std::os::raw::c_int,
354 value: ::std::os::raw::c_int,
355 ) -> ::std::os::raw::c_int;
356}
357extern "C" {
358 pub fn rc_gpio_get_value(chip: ::std::os::raw::c_int, pin: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
359}
360extern "C" {
361 pub fn rc_gpio_init_event(
362 chip: ::std::os::raw::c_int,
363 pin: ::std::os::raw::c_int,
364 handle_flags: ::std::os::raw::c_int,
365 event_flags: ::std::os::raw::c_int,
366 ) -> ::std::os::raw::c_int;
367}
368extern "C" {
369 pub fn rc_gpio_poll(
370 chip: ::std::os::raw::c_int,
371 pin: ::std::os::raw::c_int,
372 timeout_ms: ::std::os::raw::c_int,
373 event_time_ns: *mut u64,
374 ) -> ::std::os::raw::c_int;
375}
376extern "C" {
377 pub fn rc_gpio_cleanup(chip: ::std::os::raw::c_int, pin: ::std::os::raw::c_int);
378}
379extern "C" {
380 pub fn rc_i2c_init(bus: ::std::os::raw::c_int, devAddr: u8) -> ::std::os::raw::c_int;
381}
382extern "C" {
383 pub fn rc_i2c_close(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
384}
385extern "C" {
386 pub fn rc_i2c_set_device_address(bus: ::std::os::raw::c_int, devAddr: u8) -> ::std::os::raw::c_int;
387}
388extern "C" {
389 pub fn rc_i2c_read_byte(bus: ::std::os::raw::c_int, regAddr: u8, data: *mut u8) -> ::std::os::raw::c_int;
390}
391extern "C" {
392 pub fn rc_i2c_read_bytes(
393 bus: ::std::os::raw::c_int,
394 regAddr: u8,
395 count: usize,
396 data: *mut u8,
397 ) -> ::std::os::raw::c_int;
398}
399extern "C" {
400 pub fn rc_i2c_read_word(bus: ::std::os::raw::c_int, regAddr: u8, data: *mut u16) -> ::std::os::raw::c_int;
401}
402extern "C" {
403 pub fn rc_i2c_read_words(
404 bus: ::std::os::raw::c_int,
405 regAddr: u8,
406 count: usize,
407 data: *mut u16,
408 ) -> ::std::os::raw::c_int;
409}
410extern "C" {
411 pub fn rc_i2c_write_byte(bus: ::std::os::raw::c_int, regAddr: u8, data: u8) -> ::std::os::raw::c_int;
412}
413extern "C" {
414 pub fn rc_i2c_write_bytes(
415 bus: ::std::os::raw::c_int,
416 regAddr: u8,
417 count: usize,
418 data: *mut u8,
419 ) -> ::std::os::raw::c_int;
420}
421extern "C" {
422 pub fn rc_i2c_write_word(bus: ::std::os::raw::c_int, regAddr: u8, data: u16) -> ::std::os::raw::c_int;
423}
424extern "C" {
425 pub fn rc_i2c_write_words(
426 bus: ::std::os::raw::c_int,
427 regAddr: u8,
428 count: usize,
429 data: *mut u16,
430 ) -> ::std::os::raw::c_int;
431}
432extern "C" {
433 pub fn rc_i2c_send_bytes(bus: ::std::os::raw::c_int, count: usize, data: *mut u8) -> ::std::os::raw::c_int;
434}
435extern "C" {
436 pub fn rc_i2c_send_byte(bus: ::std::os::raw::c_int, data: u8) -> ::std::os::raw::c_int;
437}
438extern "C" {
439 pub fn rc_i2c_lock_bus(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
440}
441extern "C" {
442 pub fn rc_i2c_unlock_bus(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
443}
444extern "C" {
445 pub fn rc_i2c_get_lock(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
446}
447extern "C" {
448 pub fn rc_i2c_get_fd(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
449}
450pub const RC_LED_GREEN: rc_led_t = 0;
451pub const RC_LED_RED: rc_led_t = 1;
452pub const RC_LED_USR0: rc_led_t = 2;
453pub const RC_LED_USR1: rc_led_t = 3;
454pub const RC_LED_USR2: rc_led_t = 4;
455pub const RC_LED_USR3: rc_led_t = 5;
456pub const RC_LED_BAT25: rc_led_t = 6;
457pub const RC_LED_BAT50: rc_led_t = 7;
458pub const RC_LED_BAT75: rc_led_t = 8;
459pub const RC_LED_BAT100: rc_led_t = 9;
460pub const RC_LED_WIFI: rc_led_t = 10;
461pub type rc_led_t = ::std::os::raw::c_uint;
462extern "C" {
463 pub fn rc_led_set(led: rc_led_t, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
464}
465extern "C" {
466 pub fn rc_led_cleanup();
467}
468extern "C" {
469 pub fn rc_led_get(led: rc_led_t) -> ::std::os::raw::c_int;
470}
471extern "C" {
472 pub fn rc_led_blink(led: rc_led_t, hz: f32, duration: f32) -> ::std::os::raw::c_int;
473}
474extern "C" {
475 pub fn rc_led_stop_blink(led: rc_led_t);
476}
477extern "C" {
478 pub fn rc_led_stop_blink_all();
479}
480#[repr(C)]
481#[derive(Debug, Copy, Clone)]
482pub struct rc_vector_t {
483 pub len: ::std::os::raw::c_int,
484 pub d: *mut f64,
485 pub initialized: ::std::os::raw::c_int,
486}
487#[test]
488fn bindgen_test_layout_rc_vector_t() {
489 const UNINIT: ::std::mem::MaybeUninit<rc_vector_t> = ::std::mem::MaybeUninit::uninit();
490 let ptr = UNINIT.as_ptr();
491 assert_eq!(
492 ::std::mem::size_of::<rc_vector_t>(),
493 12usize,
494 concat!("Size of: ", stringify!(rc_vector_t))
495 );
496 assert_eq!(
497 ::std::mem::align_of::<rc_vector_t>(),
498 4usize,
499 concat!("Alignment of ", stringify!(rc_vector_t))
500 );
501 assert_eq!(
502 unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
503 0usize,
504 concat!("Offset of field: ", stringify!(rc_vector_t), "::", stringify!(len))
505 );
506 assert_eq!(
507 unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
508 4usize,
509 concat!("Offset of field: ", stringify!(rc_vector_t), "::", stringify!(d))
510 );
511 assert_eq!(
512 unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize },
513 8usize,
514 concat!(
515 "Offset of field: ",
516 stringify!(rc_vector_t),
517 "::",
518 stringify!(initialized)
519 )
520 );
521}
522impl Default for rc_vector_t {
523 fn default() -> Self {
524 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
525 unsafe {
526 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
527 s.assume_init()
528 }
529 }
530}
531extern "C" {
532 pub fn rc_vector_empty() -> rc_vector_t;
533}
534extern "C" {
535 pub fn rc_vector_alloc(v: *mut rc_vector_t, length: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
536}
537extern "C" {
538 pub fn rc_vector_free(v: *mut rc_vector_t) -> ::std::os::raw::c_int;
539}
540extern "C" {
541 pub fn rc_vector_zeros(v: *mut rc_vector_t, length: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
542}
543extern "C" {
544 pub fn rc_vector_ones(v: *mut rc_vector_t, length: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
545}
546extern "C" {
547 pub fn rc_vector_random(v: *mut rc_vector_t, length: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
548}
549extern "C" {
550 pub fn rc_vector_fibonnaci(v: *mut rc_vector_t, length: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
551}
552extern "C" {
553 pub fn rc_vector_from_array(
554 v: *mut rc_vector_t,
555 ptr: *mut f64,
556 length: ::std::os::raw::c_int,
557 ) -> ::std::os::raw::c_int;
558}
559extern "C" {
560 pub fn rc_vector_duplicate(a: rc_vector_t, b: *mut rc_vector_t) -> ::std::os::raw::c_int;
561}
562extern "C" {
563 pub fn rc_vector_print(v: rc_vector_t) -> ::std::os::raw::c_int;
564}
565extern "C" {
566 pub fn rc_vector_print_sci(v: rc_vector_t) -> ::std::os::raw::c_int;
567}
568extern "C" {
569 pub fn rc_vector_zero_out(v: *mut rc_vector_t) -> ::std::os::raw::c_int;
570}
571extern "C" {
572 pub fn rc_vector_times_scalar(v: *mut rc_vector_t, s: f64) -> ::std::os::raw::c_int;
573}
574extern "C" {
575 pub fn rc_vector_norm(v: rc_vector_t, p: f64) -> f64;
576}
577extern "C" {
578 pub fn rc_vector_max(v: rc_vector_t) -> ::std::os::raw::c_int;
579}
580extern "C" {
581 pub fn rc_vector_min(v: rc_vector_t) -> ::std::os::raw::c_int;
582}
583extern "C" {
584 pub fn rc_vector_std_dev(v: rc_vector_t) -> f64;
585}
586extern "C" {
587 pub fn rc_vector_mean(v: rc_vector_t) -> f64;
588}
589extern "C" {
590 pub fn rc_vector_projection(v: rc_vector_t, e: rc_vector_t, p: *mut rc_vector_t) -> ::std::os::raw::c_int;
591}
592extern "C" {
593 pub fn rc_vector_dot_product(v1: rc_vector_t, v2: rc_vector_t) -> f64;
594}
595extern "C" {
596 pub fn rc_vector_cross_product(v1: rc_vector_t, v2: rc_vector_t, p: *mut rc_vector_t) -> ::std::os::raw::c_int;
597}
598extern "C" {
599 pub fn rc_vector_sum(v1: rc_vector_t, v2: rc_vector_t, s: *mut rc_vector_t) -> ::std::os::raw::c_int;
600}
601extern "C" {
602 pub fn rc_vector_sum_inplace(v1: *mut rc_vector_t, v2: rc_vector_t) -> ::std::os::raw::c_int;
603}
604extern "C" {
605 pub fn rc_vector_subtract(v1: rc_vector_t, v2: rc_vector_t, s: *mut rc_vector_t) -> ::std::os::raw::c_int;
606}
607#[repr(C)]
608#[derive(Debug, Copy, Clone)]
609pub struct rc_matrix_t {
610 pub rows: ::std::os::raw::c_int,
611 pub cols: ::std::os::raw::c_int,
612 pub d: *mut *mut f64,
613 pub initialized: ::std::os::raw::c_int,
614}
615#[test]
616fn bindgen_test_layout_rc_matrix_t() {
617 const UNINIT: ::std::mem::MaybeUninit<rc_matrix_t> = ::std::mem::MaybeUninit::uninit();
618 let ptr = UNINIT.as_ptr();
619 assert_eq!(
620 ::std::mem::size_of::<rc_matrix_t>(),
621 16usize,
622 concat!("Size of: ", stringify!(rc_matrix_t))
623 );
624 assert_eq!(
625 ::std::mem::align_of::<rc_matrix_t>(),
626 4usize,
627 concat!("Alignment of ", stringify!(rc_matrix_t))
628 );
629 assert_eq!(
630 unsafe { ::std::ptr::addr_of!((*ptr).rows) as usize - ptr as usize },
631 0usize,
632 concat!("Offset of field: ", stringify!(rc_matrix_t), "::", stringify!(rows))
633 );
634 assert_eq!(
635 unsafe { ::std::ptr::addr_of!((*ptr).cols) as usize - ptr as usize },
636 4usize,
637 concat!("Offset of field: ", stringify!(rc_matrix_t), "::", stringify!(cols))
638 );
639 assert_eq!(
640 unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
641 8usize,
642 concat!("Offset of field: ", stringify!(rc_matrix_t), "::", stringify!(d))
643 );
644 assert_eq!(
645 unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize },
646 12usize,
647 concat!(
648 "Offset of field: ",
649 stringify!(rc_matrix_t),
650 "::",
651 stringify!(initialized)
652 )
653 );
654}
655impl Default for rc_matrix_t {
656 fn default() -> Self {
657 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
658 unsafe {
659 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
660 s.assume_init()
661 }
662 }
663}
664extern "C" {
665 pub fn rc_matrix_empty() -> rc_matrix_t;
666}
667extern "C" {
668 pub fn rc_matrix_alloc(
669 A: *mut rc_matrix_t,
670 rows: ::std::os::raw::c_int,
671 cols: ::std::os::raw::c_int,
672 ) -> ::std::os::raw::c_int;
673}
674extern "C" {
675 pub fn rc_matrix_free(A: *mut rc_matrix_t) -> ::std::os::raw::c_int;
676}
677extern "C" {
678 pub fn rc_matrix_zeros(
679 A: *mut rc_matrix_t,
680 rows: ::std::os::raw::c_int,
681 cols: ::std::os::raw::c_int,
682 ) -> ::std::os::raw::c_int;
683}
684extern "C" {
685 pub fn rc_matrix_identity(A: *mut rc_matrix_t, dim: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
686}
687extern "C" {
688 pub fn rc_matrix_random(
689 A: *mut rc_matrix_t,
690 rows: ::std::os::raw::c_int,
691 cols: ::std::os::raw::c_int,
692 ) -> ::std::os::raw::c_int;
693}
694extern "C" {
695 pub fn rc_matrix_diagonal(A: *mut rc_matrix_t, v: rc_vector_t) -> ::std::os::raw::c_int;
696}
697extern "C" {
698 pub fn rc_matrix_duplicate(A: rc_matrix_t, B: *mut rc_matrix_t) -> ::std::os::raw::c_int;
699}
700extern "C" {
701 pub fn rc_matrix_print(A: rc_matrix_t) -> ::std::os::raw::c_int;
702}
703extern "C" {
704 pub fn rc_matrix_print_sci(A: rc_matrix_t) -> ::std::os::raw::c_int;
705}
706extern "C" {
707 pub fn rc_matrix_zero_out(A: *mut rc_matrix_t) -> ::std::os::raw::c_int;
708}
709extern "C" {
710 pub fn rc_matrix_times_scalar(A: *mut rc_matrix_t, s: f64) -> ::std::os::raw::c_int;
711}
712extern "C" {
713 pub fn rc_matrix_multiply(A: rc_matrix_t, B: rc_matrix_t, C: *mut rc_matrix_t) -> ::std::os::raw::c_int;
714}
715extern "C" {
716 pub fn rc_matrix_left_multiply_inplace(A: rc_matrix_t, B: *mut rc_matrix_t) -> ::std::os::raw::c_int;
717}
718extern "C" {
719 pub fn rc_matrix_right_multiply_inplace(A: *mut rc_matrix_t, B: rc_matrix_t) -> ::std::os::raw::c_int;
720}
721extern "C" {
722 pub fn rc_matrix_add(A: rc_matrix_t, B: rc_matrix_t, C: *mut rc_matrix_t) -> ::std::os::raw::c_int;
723}
724extern "C" {
725 pub fn rc_matrix_add_inplace(A: *mut rc_matrix_t, B: rc_matrix_t) -> ::std::os::raw::c_int;
726}
727extern "C" {
728 pub fn rc_matrix_subtract_inplace(A: *mut rc_matrix_t, B: rc_matrix_t) -> ::std::os::raw::c_int;
729}
730extern "C" {
731 pub fn rc_matrix_transpose(A: rc_matrix_t, T: *mut rc_matrix_t) -> ::std::os::raw::c_int;
732}
733extern "C" {
734 pub fn rc_matrix_transpose_inplace(A: *mut rc_matrix_t) -> ::std::os::raw::c_int;
735}
736extern "C" {
737 pub fn rc_matrix_times_col_vec(A: rc_matrix_t, v: rc_vector_t, c: *mut rc_vector_t) -> ::std::os::raw::c_int;
738}
739extern "C" {
740 pub fn rc_matrix_row_vec_times_matrix(v: rc_vector_t, A: rc_matrix_t, c: *mut rc_vector_t)
741 -> ::std::os::raw::c_int;
742}
743extern "C" {
744 pub fn rc_matrix_outer_product(v1: rc_vector_t, v2: rc_vector_t, A: *mut rc_matrix_t) -> ::std::os::raw::c_int;
745}
746extern "C" {
747 pub fn rc_matrix_determinant(A: rc_matrix_t) -> f64;
748}
749extern "C" {
750 pub fn rc_matrix_symmetrize(P: *mut rc_matrix_t) -> ::std::os::raw::c_int;
751}
752extern "C" {
753 pub fn rc_algebra_lup_decomp(
754 A: rc_matrix_t,
755 L: *mut rc_matrix_t,
756 U: *mut rc_matrix_t,
757 P: *mut rc_matrix_t,
758 ) -> ::std::os::raw::c_int;
759}
760extern "C" {
761 pub fn rc_algebra_qr_decomp(A: rc_matrix_t, Q: *mut rc_matrix_t, R: *mut rc_matrix_t) -> ::std::os::raw::c_int;
762}
763extern "C" {
764 pub fn rc_algebra_invert_matrix(A: rc_matrix_t, Ainv: *mut rc_matrix_t) -> ::std::os::raw::c_int;
765}
766extern "C" {
767 pub fn rc_algebra_invert_matrix_inplace(A: *mut rc_matrix_t) -> ::std::os::raw::c_int;
768}
769extern "C" {
770 pub fn rc_algebra_lin_system_solve(A: rc_matrix_t, b: rc_vector_t, x: *mut rc_vector_t) -> ::std::os::raw::c_int;
771}
772extern "C" {
773 pub fn rc_algebra_set_zero_tolerance(tol: f64);
774}
775extern "C" {
776 pub fn rc_algebra_lin_system_solve_qr(A: rc_matrix_t, b: rc_vector_t, x: *mut rc_vector_t)
777 -> ::std::os::raw::c_int;
778}
779extern "C" {
780 pub fn rc_algebra_fit_ellipsoid(
781 points: rc_matrix_t,
782 center: *mut rc_vector_t,
783 lengths: *mut rc_vector_t,
784 ) -> ::std::os::raw::c_int;
785}
786#[repr(C)]
787#[derive(Debug, Copy, Clone)]
788pub struct rc_ringbuf_t {
789 pub d: *mut f64,
790 pub size: ::std::os::raw::c_int,
791 pub index: ::std::os::raw::c_int,
792 pub initialized: ::std::os::raw::c_int,
793}
794#[test]
795fn bindgen_test_layout_rc_ringbuf_t() {
796 const UNINIT: ::std::mem::MaybeUninit<rc_ringbuf_t> = ::std::mem::MaybeUninit::uninit();
797 let ptr = UNINIT.as_ptr();
798 assert_eq!(
799 ::std::mem::size_of::<rc_ringbuf_t>(),
800 16usize,
801 concat!("Size of: ", stringify!(rc_ringbuf_t))
802 );
803 assert_eq!(
804 ::std::mem::align_of::<rc_ringbuf_t>(),
805 4usize,
806 concat!("Alignment of ", stringify!(rc_ringbuf_t))
807 );
808 assert_eq!(
809 unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
810 0usize,
811 concat!("Offset of field: ", stringify!(rc_ringbuf_t), "::", stringify!(d))
812 );
813 assert_eq!(
814 unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
815 4usize,
816 concat!("Offset of field: ", stringify!(rc_ringbuf_t), "::", stringify!(size))
817 );
818 assert_eq!(
819 unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize },
820 8usize,
821 concat!("Offset of field: ", stringify!(rc_ringbuf_t), "::", stringify!(index))
822 );
823 assert_eq!(
824 unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize },
825 12usize,
826 concat!(
827 "Offset of field: ",
828 stringify!(rc_ringbuf_t),
829 "::",
830 stringify!(initialized)
831 )
832 );
833}
834impl Default for rc_ringbuf_t {
835 fn default() -> Self {
836 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
837 unsafe {
838 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
839 s.assume_init()
840 }
841 }
842}
843extern "C" {
844 pub fn rc_ringbuf_empty() -> rc_ringbuf_t;
845}
846extern "C" {
847 pub fn rc_ringbuf_alloc(buf: *mut rc_ringbuf_t, size: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
848}
849extern "C" {
850 pub fn rc_ringbuf_free(buf: *mut rc_ringbuf_t) -> ::std::os::raw::c_int;
851}
852extern "C" {
853 pub fn rc_ringbuf_reset(buf: *mut rc_ringbuf_t) -> ::std::os::raw::c_int;
854}
855extern "C" {
856 pub fn rc_ringbuf_insert(buf: *mut rc_ringbuf_t, val: f64) -> ::std::os::raw::c_int;
857}
858extern "C" {
859 pub fn rc_ringbuf_get_value(buf: *mut rc_ringbuf_t, position: ::std::os::raw::c_int) -> f64;
860}
861extern "C" {
862 pub fn rc_ringbuf_std_dev(buf: rc_ringbuf_t) -> f64;
863}
864#[repr(C)]
865#[derive(Debug, Copy, Clone)]
866pub struct rc_filter_t {
867 pub order: ::std::os::raw::c_int,
868 pub dt: f64,
869 pub gain: f64,
870 pub num: rc_vector_t,
871 pub den: rc_vector_t,
872 pub sat_en: ::std::os::raw::c_int,
873 pub sat_min: f64,
874 pub sat_max: f64,
875 pub sat_flag: ::std::os::raw::c_int,
876 pub ss_en: ::std::os::raw::c_int,
877 pub ss_steps: f64,
878 pub in_buf: rc_ringbuf_t,
879 pub out_buf: rc_ringbuf_t,
880 pub newest_input: f64,
881 pub newest_output: f64,
882 pub step: u64,
883 pub initialized: ::std::os::raw::c_int,
884}
885#[test]
886fn bindgen_test_layout_rc_filter_t() {
887 const UNINIT: ::std::mem::MaybeUninit<rc_filter_t> = ::std::mem::MaybeUninit::uninit();
888 let ptr = UNINIT.as_ptr();
889 assert_eq!(
890 ::std::mem::size_of::<rc_filter_t>(),
891 152usize,
892 concat!("Size of: ", stringify!(rc_filter_t))
893 );
894 assert_eq!(
895 ::std::mem::align_of::<rc_filter_t>(),
896 8usize,
897 concat!("Alignment of ", stringify!(rc_filter_t))
898 );
899 assert_eq!(
900 unsafe { ::std::ptr::addr_of!((*ptr).order) as usize - ptr as usize },
901 0usize,
902 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(order))
903 );
904 assert_eq!(
905 unsafe { ::std::ptr::addr_of!((*ptr).dt) as usize - ptr as usize },
906 8usize,
907 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(dt))
908 );
909 assert_eq!(
910 unsafe { ::std::ptr::addr_of!((*ptr).gain) as usize - ptr as usize },
911 16usize,
912 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(gain))
913 );
914 assert_eq!(
915 unsafe { ::std::ptr::addr_of!((*ptr).num) as usize - ptr as usize },
916 24usize,
917 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(num))
918 );
919 assert_eq!(
920 unsafe { ::std::ptr::addr_of!((*ptr).den) as usize - ptr as usize },
921 36usize,
922 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(den))
923 );
924 assert_eq!(
925 unsafe { ::std::ptr::addr_of!((*ptr).sat_en) as usize - ptr as usize },
926 48usize,
927 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(sat_en))
928 );
929 assert_eq!(
930 unsafe { ::std::ptr::addr_of!((*ptr).sat_min) as usize - ptr as usize },
931 56usize,
932 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(sat_min))
933 );
934 assert_eq!(
935 unsafe { ::std::ptr::addr_of!((*ptr).sat_max) as usize - ptr as usize },
936 64usize,
937 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(sat_max))
938 );
939 assert_eq!(
940 unsafe { ::std::ptr::addr_of!((*ptr).sat_flag) as usize - ptr as usize },
941 72usize,
942 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(sat_flag))
943 );
944 assert_eq!(
945 unsafe { ::std::ptr::addr_of!((*ptr).ss_en) as usize - ptr as usize },
946 76usize,
947 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(ss_en))
948 );
949 assert_eq!(
950 unsafe { ::std::ptr::addr_of!((*ptr).ss_steps) as usize - ptr as usize },
951 80usize,
952 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(ss_steps))
953 );
954 assert_eq!(
955 unsafe { ::std::ptr::addr_of!((*ptr).in_buf) as usize - ptr as usize },
956 88usize,
957 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(in_buf))
958 );
959 assert_eq!(
960 unsafe { ::std::ptr::addr_of!((*ptr).out_buf) as usize - ptr as usize },
961 104usize,
962 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(out_buf))
963 );
964 assert_eq!(
965 unsafe { ::std::ptr::addr_of!((*ptr).newest_input) as usize - ptr as usize },
966 120usize,
967 concat!(
968 "Offset of field: ",
969 stringify!(rc_filter_t),
970 "::",
971 stringify!(newest_input)
972 )
973 );
974 assert_eq!(
975 unsafe { ::std::ptr::addr_of!((*ptr).newest_output) as usize - ptr as usize },
976 128usize,
977 concat!(
978 "Offset of field: ",
979 stringify!(rc_filter_t),
980 "::",
981 stringify!(newest_output)
982 )
983 );
984 assert_eq!(
985 unsafe { ::std::ptr::addr_of!((*ptr).step) as usize - ptr as usize },
986 136usize,
987 concat!("Offset of field: ", stringify!(rc_filter_t), "::", stringify!(step))
988 );
989 assert_eq!(
990 unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize },
991 144usize,
992 concat!(
993 "Offset of field: ",
994 stringify!(rc_filter_t),
995 "::",
996 stringify!(initialized)
997 )
998 );
999}
1000impl Default for rc_filter_t {
1001 fn default() -> Self {
1002 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1003 unsafe {
1004 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1005 s.assume_init()
1006 }
1007 }
1008}
1009extern "C" {
1010 pub fn rc_filter_empty() -> rc_filter_t;
1011}
1012extern "C" {
1013 pub fn rc_filter_alloc(f: *mut rc_filter_t, num: rc_vector_t, den: rc_vector_t, dt: f64) -> ::std::os::raw::c_int;
1014}
1015extern "C" {
1016 pub fn rc_filter_alloc_from_arrays(
1017 f: *mut rc_filter_t,
1018 dt: f64,
1019 num: *mut f64,
1020 numlen: ::std::os::raw::c_int,
1021 den: *mut f64,
1022 denlen: ::std::os::raw::c_int,
1023 ) -> ::std::os::raw::c_int;
1024}
1025extern "C" {
1026 pub fn rc_filter_duplicate(f: *mut rc_filter_t, old: rc_filter_t) -> ::std::os::raw::c_int;
1027}
1028extern "C" {
1029 pub fn rc_filter_free(f: *mut rc_filter_t) -> ::std::os::raw::c_int;
1030}
1031extern "C" {
1032 pub fn rc_filter_print(f: rc_filter_t) -> ::std::os::raw::c_int;
1033}
1034extern "C" {
1035 pub fn rc_filter_march(f: *mut rc_filter_t, new_input: f64) -> f64;
1036}
1037extern "C" {
1038 pub fn rc_filter_reset(f: *mut rc_filter_t) -> ::std::os::raw::c_int;
1039}
1040extern "C" {
1041 pub fn rc_filter_enable_saturation(f: *mut rc_filter_t, min: f64, max: f64) -> ::std::os::raw::c_int;
1042}
1043extern "C" {
1044 pub fn rc_filter_get_saturation_flag(f: *mut rc_filter_t) -> ::std::os::raw::c_int;
1045}
1046extern "C" {
1047 pub fn rc_filter_enable_soft_start(f: *mut rc_filter_t, seconds: f64) -> ::std::os::raw::c_int;
1048}
1049extern "C" {
1050 pub fn rc_filter_previous_input(f: *mut rc_filter_t, steps: ::std::os::raw::c_int) -> f64;
1051}
1052extern "C" {
1053 pub fn rc_filter_previous_output(f: *mut rc_filter_t, steps: ::std::os::raw::c_int) -> f64;
1054}
1055extern "C" {
1056 pub fn rc_filter_prefill_inputs(f: *mut rc_filter_t, in_: f64) -> ::std::os::raw::c_int;
1057}
1058extern "C" {
1059 pub fn rc_filter_prefill_outputs(f: *mut rc_filter_t, out: f64) -> ::std::os::raw::c_int;
1060}
1061extern "C" {
1062 pub fn rc_filter_multiply(f1: rc_filter_t, f2: rc_filter_t, out: *mut rc_filter_t) -> ::std::os::raw::c_int;
1063}
1064extern "C" {
1065 pub fn rc_filter_multiply_three(
1066 f1: rc_filter_t,
1067 f2: rc_filter_t,
1068 f3: rc_filter_t,
1069 out: *mut rc_filter_t,
1070 ) -> ::std::os::raw::c_int;
1071}
1072extern "C" {
1073 pub fn rc_filter_c2d_tustin(
1074 f: *mut rc_filter_t,
1075 dt: f64,
1076 num: rc_vector_t,
1077 den: rc_vector_t,
1078 w: f64,
1079 ) -> ::std::os::raw::c_int;
1080}
1081extern "C" {
1082 pub fn rc_filter_normalize(f: *mut rc_filter_t) -> ::std::os::raw::c_int;
1083}
1084extern "C" {
1085 pub fn rc_filter_first_order_lowpass(f: *mut rc_filter_t, dt: f64, tc: f64) -> ::std::os::raw::c_int;
1086}
1087extern "C" {
1088 pub fn rc_filter_first_order_highpass(f: *mut rc_filter_t, dt: f64, tc: f64) -> ::std::os::raw::c_int;
1089}
1090extern "C" {
1091 pub fn rc_filter_butterworth_lowpass(
1092 f: *mut rc_filter_t,
1093 order: ::std::os::raw::c_int,
1094 dt: f64,
1095 wc: f64,
1096 ) -> ::std::os::raw::c_int;
1097}
1098extern "C" {
1099 pub fn rc_filter_butterworth_highpass(
1100 f: *mut rc_filter_t,
1101 order: ::std::os::raw::c_int,
1102 dt: f64,
1103 wc: f64,
1104 ) -> ::std::os::raw::c_int;
1105}
1106extern "C" {
1107 pub fn rc_filter_moving_average(
1108 f: *mut rc_filter_t,
1109 samples: ::std::os::raw::c_int,
1110 dt: f64,
1111 ) -> ::std::os::raw::c_int;
1112}
1113extern "C" {
1114 pub fn rc_filter_integrator(f: *mut rc_filter_t, dt: f64) -> ::std::os::raw::c_int;
1115}
1116extern "C" {
1117 pub fn rc_filter_double_integrator(f: *mut rc_filter_t, dt: f64) -> ::std::os::raw::c_int;
1118}
1119extern "C" {
1120 pub fn rc_filter_pid(f: *mut rc_filter_t, kp: f64, ki: f64, kd: f64, Tf: f64, dt: f64) -> ::std::os::raw::c_int;
1121}
1122extern "C" {
1123 pub fn rc_filter_third_order_complement(
1124 lp: *mut rc_filter_t,
1125 hp: *mut rc_filter_t,
1126 freq: f64,
1127 damp: f64,
1128 dt: f64,
1129 ) -> ::std::os::raw::c_int;
1130}
1131#[repr(C)]
1132#[derive(Debug, Copy, Clone)]
1133pub struct rc_kalman_t {
1134 pub F: rc_matrix_t,
1135 pub G: rc_matrix_t,
1136 pub H: rc_matrix_t,
1137 pub Q: rc_matrix_t,
1138 pub R: rc_matrix_t,
1139 pub P: rc_matrix_t,
1140 pub Pi: rc_matrix_t,
1141 pub x_est: rc_vector_t,
1142 pub x_pre: rc_vector_t,
1143 pub initialized: ::std::os::raw::c_int,
1144 pub step: u64,
1145}
1146#[test]
1147fn bindgen_test_layout_rc_kalman_t() {
1148 const UNINIT: ::std::mem::MaybeUninit<rc_kalman_t> = ::std::mem::MaybeUninit::uninit();
1149 let ptr = UNINIT.as_ptr();
1150 assert_eq!(
1151 ::std::mem::size_of::<rc_kalman_t>(),
1152 152usize,
1153 concat!("Size of: ", stringify!(rc_kalman_t))
1154 );
1155 assert_eq!(
1156 ::std::mem::align_of::<rc_kalman_t>(),
1157 8usize,
1158 concat!("Alignment of ", stringify!(rc_kalman_t))
1159 );
1160 assert_eq!(
1161 unsafe { ::std::ptr::addr_of!((*ptr).F) as usize - ptr as usize },
1162 0usize,
1163 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(F))
1164 );
1165 assert_eq!(
1166 unsafe { ::std::ptr::addr_of!((*ptr).G) as usize - ptr as usize },
1167 16usize,
1168 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(G))
1169 );
1170 assert_eq!(
1171 unsafe { ::std::ptr::addr_of!((*ptr).H) as usize - ptr as usize },
1172 32usize,
1173 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(H))
1174 );
1175 assert_eq!(
1176 unsafe { ::std::ptr::addr_of!((*ptr).Q) as usize - ptr as usize },
1177 48usize,
1178 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(Q))
1179 );
1180 assert_eq!(
1181 unsafe { ::std::ptr::addr_of!((*ptr).R) as usize - ptr as usize },
1182 64usize,
1183 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(R))
1184 );
1185 assert_eq!(
1186 unsafe { ::std::ptr::addr_of!((*ptr).P) as usize - ptr as usize },
1187 80usize,
1188 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(P))
1189 );
1190 assert_eq!(
1191 unsafe { ::std::ptr::addr_of!((*ptr).Pi) as usize - ptr as usize },
1192 96usize,
1193 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(Pi))
1194 );
1195 assert_eq!(
1196 unsafe { ::std::ptr::addr_of!((*ptr).x_est) as usize - ptr as usize },
1197 112usize,
1198 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(x_est))
1199 );
1200 assert_eq!(
1201 unsafe { ::std::ptr::addr_of!((*ptr).x_pre) as usize - ptr as usize },
1202 124usize,
1203 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(x_pre))
1204 );
1205 assert_eq!(
1206 unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize },
1207 136usize,
1208 concat!(
1209 "Offset of field: ",
1210 stringify!(rc_kalman_t),
1211 "::",
1212 stringify!(initialized)
1213 )
1214 );
1215 assert_eq!(
1216 unsafe { ::std::ptr::addr_of!((*ptr).step) as usize - ptr as usize },
1217 144usize,
1218 concat!("Offset of field: ", stringify!(rc_kalman_t), "::", stringify!(step))
1219 );
1220}
1221impl Default for rc_kalman_t {
1222 fn default() -> Self {
1223 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1224 unsafe {
1225 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1226 s.assume_init()
1227 }
1228 }
1229}
1230extern "C" {
1231 pub fn rc_kalman_empty() -> rc_kalman_t;
1232}
1233extern "C" {
1234 pub fn rc_kalman_alloc_lin(
1235 kf: *mut rc_kalman_t,
1236 F: rc_matrix_t,
1237 G: rc_matrix_t,
1238 H: rc_matrix_t,
1239 Q: rc_matrix_t,
1240 R: rc_matrix_t,
1241 Pi: rc_matrix_t,
1242 ) -> ::std::os::raw::c_int;
1243}
1244extern "C" {
1245 pub fn rc_kalman_alloc_ekf(
1246 kf: *mut rc_kalman_t,
1247 Q: rc_matrix_t,
1248 R: rc_matrix_t,
1249 Pi: rc_matrix_t,
1250 ) -> ::std::os::raw::c_int;
1251}
1252extern "C" {
1253 pub fn rc_kalman_free(kf: *mut rc_kalman_t) -> ::std::os::raw::c_int;
1254}
1255extern "C" {
1256 pub fn rc_kalman_reset(kf: *mut rc_kalman_t) -> ::std::os::raw::c_int;
1257}
1258extern "C" {
1259 pub fn rc_kalman_update_lin(kf: *mut rc_kalman_t, u: rc_vector_t, y: rc_vector_t) -> ::std::os::raw::c_int;
1260}
1261extern "C" {
1262 pub fn rc_kalman_update_ekf(
1263 kf: *mut rc_kalman_t,
1264 F: rc_matrix_t,
1265 H: rc_matrix_t,
1266 x_pre: rc_vector_t,
1267 y: rc_vector_t,
1268 h: rc_vector_t,
1269 ) -> ::std::os::raw::c_int;
1270}
1271extern "C" {
1272 pub fn rc_get_random_float() -> f32;
1273}
1274extern "C" {
1275 pub fn rc_get_random_double() -> f64;
1276}
1277extern "C" {
1278 pub fn rc_saturate_float(val: *mut f32, min: f32, max: f32) -> ::std::os::raw::c_int;
1279}
1280extern "C" {
1281 pub fn rc_saturate_double(val: *mut f64, min: f64, max: f64) -> ::std::os::raw::c_int;
1282}
1283extern "C" {
1284 pub fn rc_poly_print(v: rc_vector_t) -> ::std::os::raw::c_int;
1285}
1286extern "C" {
1287 pub fn rc_poly_conv(a: rc_vector_t, b: rc_vector_t, c: *mut rc_vector_t) -> ::std::os::raw::c_int;
1288}
1289extern "C" {
1290 pub fn rc_poly_power(a: rc_vector_t, n: ::std::os::raw::c_int, b: *mut rc_vector_t) -> ::std::os::raw::c_int;
1291}
1292extern "C" {
1293 pub fn rc_poly_add(a: rc_vector_t, b: rc_vector_t, c: *mut rc_vector_t) -> ::std::os::raw::c_int;
1294}
1295extern "C" {
1296 pub fn rc_poly_add_inplace(a: *mut rc_vector_t, b: rc_vector_t) -> ::std::os::raw::c_int;
1297}
1298extern "C" {
1299 pub fn rc_poly_subtract(a: rc_vector_t, b: rc_vector_t, c: *mut rc_vector_t) -> ::std::os::raw::c_int;
1300}
1301extern "C" {
1302 pub fn rc_poly_subtract_inplace(a: *mut rc_vector_t, b: rc_vector_t) -> ::std::os::raw::c_int;
1303}
1304extern "C" {
1305 pub fn rc_poly_differentiate(
1306 a: rc_vector_t,
1307 d: ::std::os::raw::c_int,
1308 b: *mut rc_vector_t,
1309 ) -> ::std::os::raw::c_int;
1310}
1311extern "C" {
1312 pub fn rc_poly_divide(
1313 n: rc_vector_t,
1314 d: rc_vector_t,
1315 div: *mut rc_vector_t,
1316 rem: *mut rc_vector_t,
1317 ) -> ::std::os::raw::c_int;
1318}
1319extern "C" {
1320 pub fn rc_poly_butter(N: ::std::os::raw::c_int, wc: f64, b: *mut rc_vector_t) -> ::std::os::raw::c_int;
1321}
1322extern "C" {
1323 pub fn rc_quaternion_norm(q: rc_vector_t) -> f64;
1324}
1325extern "C" {
1326 pub fn rc_quaternion_norm_array(q: *mut f64) -> f64;
1327}
1328extern "C" {
1329 pub fn rc_normalize_quaternion(q: *mut rc_vector_t) -> ::std::os::raw::c_int;
1330}
1331extern "C" {
1332 pub fn rc_normalize_quaternion_array(q: *mut f64) -> ::std::os::raw::c_int;
1333}
1334extern "C" {
1335 pub fn rc_quaternion_to_tb(q: rc_vector_t, tb: *mut rc_vector_t) -> ::std::os::raw::c_int;
1336}
1337extern "C" {
1338 pub fn rc_quaternion_to_tb_array(q: *mut f64, tb: *mut f64) -> ::std::os::raw::c_int;
1339}
1340extern "C" {
1341 pub fn rc_quaternion_from_tb(tb: rc_vector_t, q: *mut rc_vector_t) -> ::std::os::raw::c_int;
1342}
1343extern "C" {
1344 pub fn rc_quaternion_from_tb_array(tb: *mut f64, q: *mut f64) -> ::std::os::raw::c_int;
1345}
1346extern "C" {
1347 pub fn rc_quaternion_conjugate(q: rc_vector_t, c: *mut rc_vector_t) -> ::std::os::raw::c_int;
1348}
1349extern "C" {
1350 pub fn rc_quaternion_conjugate_inplace(q: *mut rc_vector_t) -> ::std::os::raw::c_int;
1351}
1352extern "C" {
1353 pub fn rc_quaternion_conjugate_array(q: *mut f64, c: *mut f64) -> ::std::os::raw::c_int;
1354}
1355extern "C" {
1356 pub fn rc_quaternion_conjugate_array_inplace(q: *mut f64) -> ::std::os::raw::c_int;
1357}
1358extern "C" {
1359 pub fn rc_quaternion_imaginary_part(q: rc_vector_t, img: *mut rc_vector_t) -> ::std::os::raw::c_int;
1360}
1361extern "C" {
1362 pub fn rc_quaternion_multiply(a: rc_vector_t, b: rc_vector_t, c: *mut rc_vector_t) -> ::std::os::raw::c_int;
1363}
1364extern "C" {
1365 pub fn rc_quaternion_multiply_array(a: *mut f64, b: *mut f64, c: *mut f64) -> ::std::os::raw::c_int;
1366}
1367extern "C" {
1368 pub fn rc_quaternion_rotate(p: *mut rc_vector_t, q: rc_vector_t) -> ::std::os::raw::c_int;
1369}
1370extern "C" {
1371 pub fn rc_quaternion_rotate_array(p: *mut f64, q: *mut f64) -> ::std::os::raw::c_int;
1372}
1373extern "C" {
1374 pub fn rc_quaternion_rotate_vector(v: *mut rc_vector_t, q: rc_vector_t) -> ::std::os::raw::c_int;
1375}
1376extern "C" {
1377 pub fn rc_quaternion_rotate_vector_array(v: *mut f64, q: *mut f64) -> ::std::os::raw::c_int;
1378}
1379extern "C" {
1380 pub fn rc_quaternion_to_rotation_matrix(q: rc_vector_t, m: *mut rc_matrix_t) -> ::std::os::raw::c_int;
1381}
1382#[repr(C, packed)]
1383#[derive(Debug, Copy, Clone)]
1384pub struct __mavlink_message {
1385 pub checksum: u16,
1386 pub magic: u8,
1387 pub len: u8,
1388 pub incompat_flags: u8,
1389 pub compat_flags: u8,
1390 pub seq: u8,
1391 pub sysid: u8,
1392 pub compid: u8,
1393 pub _bitfield_align_1: [u8; 0],
1394 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
1395 pub payload64: [u64; 33usize],
1396 pub ck: [u8; 2usize],
1397 pub signature: [u8; 13usize],
1398}
1399#[test]
1400fn bindgen_test_layout___mavlink_message() {
1401 const UNINIT: ::std::mem::MaybeUninit<__mavlink_message> = ::std::mem::MaybeUninit::uninit();
1402 let ptr = UNINIT.as_ptr();
1403 assert_eq!(
1404 ::std::mem::size_of::<__mavlink_message>(),
1405 291usize,
1406 concat!("Size of: ", stringify!(__mavlink_message))
1407 );
1408 assert_eq!(
1409 ::std::mem::align_of::<__mavlink_message>(),
1410 1usize,
1411 concat!("Alignment of ", stringify!(__mavlink_message))
1412 );
1413 assert_eq!(
1414 unsafe { ::std::ptr::addr_of!((*ptr).checksum) as usize - ptr as usize },
1415 0usize,
1416 concat!(
1417 "Offset of field: ",
1418 stringify!(__mavlink_message),
1419 "::",
1420 stringify!(checksum)
1421 )
1422 );
1423 assert_eq!(
1424 unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize },
1425 2usize,
1426 concat!(
1427 "Offset of field: ",
1428 stringify!(__mavlink_message),
1429 "::",
1430 stringify!(magic)
1431 )
1432 );
1433 assert_eq!(
1434 unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize },
1435 3usize,
1436 concat!(
1437 "Offset of field: ",
1438 stringify!(__mavlink_message),
1439 "::",
1440 stringify!(len)
1441 )
1442 );
1443 assert_eq!(
1444 unsafe { ::std::ptr::addr_of!((*ptr).incompat_flags) as usize - ptr as usize },
1445 4usize,
1446 concat!(
1447 "Offset of field: ",
1448 stringify!(__mavlink_message),
1449 "::",
1450 stringify!(incompat_flags)
1451 )
1452 );
1453 assert_eq!(
1454 unsafe { ::std::ptr::addr_of!((*ptr).compat_flags) as usize - ptr as usize },
1455 5usize,
1456 concat!(
1457 "Offset of field: ",
1458 stringify!(__mavlink_message),
1459 "::",
1460 stringify!(compat_flags)
1461 )
1462 );
1463 assert_eq!(
1464 unsafe { ::std::ptr::addr_of!((*ptr).seq) as usize - ptr as usize },
1465 6usize,
1466 concat!(
1467 "Offset of field: ",
1468 stringify!(__mavlink_message),
1469 "::",
1470 stringify!(seq)
1471 )
1472 );
1473 assert_eq!(
1474 unsafe { ::std::ptr::addr_of!((*ptr).sysid) as usize - ptr as usize },
1475 7usize,
1476 concat!(
1477 "Offset of field: ",
1478 stringify!(__mavlink_message),
1479 "::",
1480 stringify!(sysid)
1481 )
1482 );
1483 assert_eq!(
1484 unsafe { ::std::ptr::addr_of!((*ptr).compid) as usize - ptr as usize },
1485 8usize,
1486 concat!(
1487 "Offset of field: ",
1488 stringify!(__mavlink_message),
1489 "::",
1490 stringify!(compid)
1491 )
1492 );
1493 assert_eq!(
1494 unsafe { ::std::ptr::addr_of!((*ptr).payload64) as usize - ptr as usize },
1495 12usize,
1496 concat!(
1497 "Offset of field: ",
1498 stringify!(__mavlink_message),
1499 "::",
1500 stringify!(payload64)
1501 )
1502 );
1503 assert_eq!(
1504 unsafe { ::std::ptr::addr_of!((*ptr).ck) as usize - ptr as usize },
1505 276usize,
1506 concat!("Offset of field: ", stringify!(__mavlink_message), "::", stringify!(ck))
1507 );
1508 assert_eq!(
1509 unsafe { ::std::ptr::addr_of!((*ptr).signature) as usize - ptr as usize },
1510 278usize,
1511 concat!(
1512 "Offset of field: ",
1513 stringify!(__mavlink_message),
1514 "::",
1515 stringify!(signature)
1516 )
1517 );
1518}
1519impl Default for __mavlink_message {
1520 fn default() -> Self {
1521 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1522 unsafe {
1523 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1524 s.assume_init()
1525 }
1526 }
1527}
1528impl __mavlink_message {
1529 #[inline]
1530 pub fn msgid(&self) -> u32 {
1531 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
1532 }
1533 #[inline]
1534 pub fn set_msgid(&mut self, val: u32) {
1535 unsafe {
1536 let val: u32 = ::std::mem::transmute(val);
1537 self._bitfield_1.set(0usize, 24u8, val as u64)
1538 }
1539 }
1540 #[inline]
1541 pub fn new_bitfield_1(msgid: u32) -> __BindgenBitfieldUnit<[u8; 3usize]> {
1542 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
1543 __bindgen_bitfield_unit.set(0usize, 24u8, {
1544 let msgid: u32 = unsafe { ::std::mem::transmute(msgid) };
1545 msgid as u64
1546 });
1547 __bindgen_bitfield_unit
1548 }
1549}
1550pub type mavlink_message_t = __mavlink_message;
1551#[repr(C, packed)]
1552#[derive(Debug, Default, Copy, Clone)]
1553pub struct __mavlink_heartbeat_t {
1554 pub custom_mode: u32,
1555 pub type_: u8,
1556 pub autopilot: u8,
1557 pub base_mode: u8,
1558 pub system_status: u8,
1559 pub mavlink_version: u8,
1560}
1561#[test]
1562fn bindgen_test_layout___mavlink_heartbeat_t() {
1563 const UNINIT: ::std::mem::MaybeUninit<__mavlink_heartbeat_t> = ::std::mem::MaybeUninit::uninit();
1564 let ptr = UNINIT.as_ptr();
1565 assert_eq!(
1566 ::std::mem::size_of::<__mavlink_heartbeat_t>(),
1567 9usize,
1568 concat!("Size of: ", stringify!(__mavlink_heartbeat_t))
1569 );
1570 assert_eq!(
1571 ::std::mem::align_of::<__mavlink_heartbeat_t>(),
1572 1usize,
1573 concat!("Alignment of ", stringify!(__mavlink_heartbeat_t))
1574 );
1575 assert_eq!(
1576 unsafe { ::std::ptr::addr_of!((*ptr).custom_mode) as usize - ptr as usize },
1577 0usize,
1578 concat!(
1579 "Offset of field: ",
1580 stringify!(__mavlink_heartbeat_t),
1581 "::",
1582 stringify!(custom_mode)
1583 )
1584 );
1585 assert_eq!(
1586 unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
1587 4usize,
1588 concat!(
1589 "Offset of field: ",
1590 stringify!(__mavlink_heartbeat_t),
1591 "::",
1592 stringify!(type_)
1593 )
1594 );
1595 assert_eq!(
1596 unsafe { ::std::ptr::addr_of!((*ptr).autopilot) as usize - ptr as usize },
1597 5usize,
1598 concat!(
1599 "Offset of field: ",
1600 stringify!(__mavlink_heartbeat_t),
1601 "::",
1602 stringify!(autopilot)
1603 )
1604 );
1605 assert_eq!(
1606 unsafe { ::std::ptr::addr_of!((*ptr).base_mode) as usize - ptr as usize },
1607 6usize,
1608 concat!(
1609 "Offset of field: ",
1610 stringify!(__mavlink_heartbeat_t),
1611 "::",
1612 stringify!(base_mode)
1613 )
1614 );
1615 assert_eq!(
1616 unsafe { ::std::ptr::addr_of!((*ptr).system_status) as usize - ptr as usize },
1617 7usize,
1618 concat!(
1619 "Offset of field: ",
1620 stringify!(__mavlink_heartbeat_t),
1621 "::",
1622 stringify!(system_status)
1623 )
1624 );
1625 assert_eq!(
1626 unsafe { ::std::ptr::addr_of!((*ptr).mavlink_version) as usize - ptr as usize },
1627 8usize,
1628 concat!(
1629 "Offset of field: ",
1630 stringify!(__mavlink_heartbeat_t),
1631 "::",
1632 stringify!(mavlink_version)
1633 )
1634 );
1635}
1636pub type mavlink_heartbeat_t = __mavlink_heartbeat_t;
1637#[repr(C, packed)]
1638#[derive(Debug, Default, Copy, Clone)]
1639pub struct __mavlink_sys_status_t {
1640 pub onboard_control_sensors_present: u32,
1641 pub onboard_control_sensors_enabled: u32,
1642 pub onboard_control_sensors_health: u32,
1643 pub load: u16,
1644 pub voltage_battery: u16,
1645 pub current_battery: i16,
1646 pub drop_rate_comm: u16,
1647 pub errors_comm: u16,
1648 pub errors_count1: u16,
1649 pub errors_count2: u16,
1650 pub errors_count3: u16,
1651 pub errors_count4: u16,
1652 pub battery_remaining: i8,
1653}
1654#[test]
1655fn bindgen_test_layout___mavlink_sys_status_t() {
1656 const UNINIT: ::std::mem::MaybeUninit<__mavlink_sys_status_t> = ::std::mem::MaybeUninit::uninit();
1657 let ptr = UNINIT.as_ptr();
1658 assert_eq!(
1659 ::std::mem::size_of::<__mavlink_sys_status_t>(),
1660 31usize,
1661 concat!("Size of: ", stringify!(__mavlink_sys_status_t))
1662 );
1663 assert_eq!(
1664 ::std::mem::align_of::<__mavlink_sys_status_t>(),
1665 1usize,
1666 concat!("Alignment of ", stringify!(__mavlink_sys_status_t))
1667 );
1668 assert_eq!(
1669 unsafe { ::std::ptr::addr_of!((*ptr).onboard_control_sensors_present) as usize - ptr as usize },
1670 0usize,
1671 concat!(
1672 "Offset of field: ",
1673 stringify!(__mavlink_sys_status_t),
1674 "::",
1675 stringify!(onboard_control_sensors_present)
1676 )
1677 );
1678 assert_eq!(
1679 unsafe { ::std::ptr::addr_of!((*ptr).onboard_control_sensors_enabled) as usize - ptr as usize },
1680 4usize,
1681 concat!(
1682 "Offset of field: ",
1683 stringify!(__mavlink_sys_status_t),
1684 "::",
1685 stringify!(onboard_control_sensors_enabled)
1686 )
1687 );
1688 assert_eq!(
1689 unsafe { ::std::ptr::addr_of!((*ptr).onboard_control_sensors_health) as usize - ptr as usize },
1690 8usize,
1691 concat!(
1692 "Offset of field: ",
1693 stringify!(__mavlink_sys_status_t),
1694 "::",
1695 stringify!(onboard_control_sensors_health)
1696 )
1697 );
1698 assert_eq!(
1699 unsafe { ::std::ptr::addr_of!((*ptr).load) as usize - ptr as usize },
1700 12usize,
1701 concat!(
1702 "Offset of field: ",
1703 stringify!(__mavlink_sys_status_t),
1704 "::",
1705 stringify!(load)
1706 )
1707 );
1708 assert_eq!(
1709 unsafe { ::std::ptr::addr_of!((*ptr).voltage_battery) as usize - ptr as usize },
1710 14usize,
1711 concat!(
1712 "Offset of field: ",
1713 stringify!(__mavlink_sys_status_t),
1714 "::",
1715 stringify!(voltage_battery)
1716 )
1717 );
1718 assert_eq!(
1719 unsafe { ::std::ptr::addr_of!((*ptr).current_battery) as usize - ptr as usize },
1720 16usize,
1721 concat!(
1722 "Offset of field: ",
1723 stringify!(__mavlink_sys_status_t),
1724 "::",
1725 stringify!(current_battery)
1726 )
1727 );
1728 assert_eq!(
1729 unsafe { ::std::ptr::addr_of!((*ptr).drop_rate_comm) as usize - ptr as usize },
1730 18usize,
1731 concat!(
1732 "Offset of field: ",
1733 stringify!(__mavlink_sys_status_t),
1734 "::",
1735 stringify!(drop_rate_comm)
1736 )
1737 );
1738 assert_eq!(
1739 unsafe { ::std::ptr::addr_of!((*ptr).errors_comm) as usize - ptr as usize },
1740 20usize,
1741 concat!(
1742 "Offset of field: ",
1743 stringify!(__mavlink_sys_status_t),
1744 "::",
1745 stringify!(errors_comm)
1746 )
1747 );
1748 assert_eq!(
1749 unsafe { ::std::ptr::addr_of!((*ptr).errors_count1) as usize - ptr as usize },
1750 22usize,
1751 concat!(
1752 "Offset of field: ",
1753 stringify!(__mavlink_sys_status_t),
1754 "::",
1755 stringify!(errors_count1)
1756 )
1757 );
1758 assert_eq!(
1759 unsafe { ::std::ptr::addr_of!((*ptr).errors_count2) as usize - ptr as usize },
1760 24usize,
1761 concat!(
1762 "Offset of field: ",
1763 stringify!(__mavlink_sys_status_t),
1764 "::",
1765 stringify!(errors_count2)
1766 )
1767 );
1768 assert_eq!(
1769 unsafe { ::std::ptr::addr_of!((*ptr).errors_count3) as usize - ptr as usize },
1770 26usize,
1771 concat!(
1772 "Offset of field: ",
1773 stringify!(__mavlink_sys_status_t),
1774 "::",
1775 stringify!(errors_count3)
1776 )
1777 );
1778 assert_eq!(
1779 unsafe { ::std::ptr::addr_of!((*ptr).errors_count4) as usize - ptr as usize },
1780 28usize,
1781 concat!(
1782 "Offset of field: ",
1783 stringify!(__mavlink_sys_status_t),
1784 "::",
1785 stringify!(errors_count4)
1786 )
1787 );
1788 assert_eq!(
1789 unsafe { ::std::ptr::addr_of!((*ptr).battery_remaining) as usize - ptr as usize },
1790 30usize,
1791 concat!(
1792 "Offset of field: ",
1793 stringify!(__mavlink_sys_status_t),
1794 "::",
1795 stringify!(battery_remaining)
1796 )
1797 );
1798}
1799pub type mavlink_sys_status_t = __mavlink_sys_status_t;
1800#[repr(C, packed)]
1801#[derive(Debug, Default, Copy, Clone)]
1802pub struct __mavlink_gps_raw_int_t {
1803 pub time_usec: u64,
1804 pub lat: i32,
1805 pub lon: i32,
1806 pub alt: i32,
1807 pub eph: u16,
1808 pub epv: u16,
1809 pub vel: u16,
1810 pub cog: u16,
1811 pub fix_type: u8,
1812 pub satellites_visible: u8,
1813 pub alt_ellipsoid: i32,
1814 pub h_acc: u32,
1815 pub v_acc: u32,
1816 pub vel_acc: u32,
1817 pub hdg_acc: u32,
1818}
1819#[test]
1820fn bindgen_test_layout___mavlink_gps_raw_int_t() {
1821 const UNINIT: ::std::mem::MaybeUninit<__mavlink_gps_raw_int_t> = ::std::mem::MaybeUninit::uninit();
1822 let ptr = UNINIT.as_ptr();
1823 assert_eq!(
1824 ::std::mem::size_of::<__mavlink_gps_raw_int_t>(),
1825 50usize,
1826 concat!("Size of: ", stringify!(__mavlink_gps_raw_int_t))
1827 );
1828 assert_eq!(
1829 ::std::mem::align_of::<__mavlink_gps_raw_int_t>(),
1830 1usize,
1831 concat!("Alignment of ", stringify!(__mavlink_gps_raw_int_t))
1832 );
1833 assert_eq!(
1834 unsafe { ::std::ptr::addr_of!((*ptr).time_usec) as usize - ptr as usize },
1835 0usize,
1836 concat!(
1837 "Offset of field: ",
1838 stringify!(__mavlink_gps_raw_int_t),
1839 "::",
1840 stringify!(time_usec)
1841 )
1842 );
1843 assert_eq!(
1844 unsafe { ::std::ptr::addr_of!((*ptr).lat) as usize - ptr as usize },
1845 8usize,
1846 concat!(
1847 "Offset of field: ",
1848 stringify!(__mavlink_gps_raw_int_t),
1849 "::",
1850 stringify!(lat)
1851 )
1852 );
1853 assert_eq!(
1854 unsafe { ::std::ptr::addr_of!((*ptr).lon) as usize - ptr as usize },
1855 12usize,
1856 concat!(
1857 "Offset of field: ",
1858 stringify!(__mavlink_gps_raw_int_t),
1859 "::",
1860 stringify!(lon)
1861 )
1862 );
1863 assert_eq!(
1864 unsafe { ::std::ptr::addr_of!((*ptr).alt) as usize - ptr as usize },
1865 16usize,
1866 concat!(
1867 "Offset of field: ",
1868 stringify!(__mavlink_gps_raw_int_t),
1869 "::",
1870 stringify!(alt)
1871 )
1872 );
1873 assert_eq!(
1874 unsafe { ::std::ptr::addr_of!((*ptr).eph) as usize - ptr as usize },
1875 20usize,
1876 concat!(
1877 "Offset of field: ",
1878 stringify!(__mavlink_gps_raw_int_t),
1879 "::",
1880 stringify!(eph)
1881 )
1882 );
1883 assert_eq!(
1884 unsafe { ::std::ptr::addr_of!((*ptr).epv) as usize - ptr as usize },
1885 22usize,
1886 concat!(
1887 "Offset of field: ",
1888 stringify!(__mavlink_gps_raw_int_t),
1889 "::",
1890 stringify!(epv)
1891 )
1892 );
1893 assert_eq!(
1894 unsafe { ::std::ptr::addr_of!((*ptr).vel) as usize - ptr as usize },
1895 24usize,
1896 concat!(
1897 "Offset of field: ",
1898 stringify!(__mavlink_gps_raw_int_t),
1899 "::",
1900 stringify!(vel)
1901 )
1902 );
1903 assert_eq!(
1904 unsafe { ::std::ptr::addr_of!((*ptr).cog) as usize - ptr as usize },
1905 26usize,
1906 concat!(
1907 "Offset of field: ",
1908 stringify!(__mavlink_gps_raw_int_t),
1909 "::",
1910 stringify!(cog)
1911 )
1912 );
1913 assert_eq!(
1914 unsafe { ::std::ptr::addr_of!((*ptr).fix_type) as usize - ptr as usize },
1915 28usize,
1916 concat!(
1917 "Offset of field: ",
1918 stringify!(__mavlink_gps_raw_int_t),
1919 "::",
1920 stringify!(fix_type)
1921 )
1922 );
1923 assert_eq!(
1924 unsafe { ::std::ptr::addr_of!((*ptr).satellites_visible) as usize - ptr as usize },
1925 29usize,
1926 concat!(
1927 "Offset of field: ",
1928 stringify!(__mavlink_gps_raw_int_t),
1929 "::",
1930 stringify!(satellites_visible)
1931 )
1932 );
1933 assert_eq!(
1934 unsafe { ::std::ptr::addr_of!((*ptr).alt_ellipsoid) as usize - ptr as usize },
1935 30usize,
1936 concat!(
1937 "Offset of field: ",
1938 stringify!(__mavlink_gps_raw_int_t),
1939 "::",
1940 stringify!(alt_ellipsoid)
1941 )
1942 );
1943 assert_eq!(
1944 unsafe { ::std::ptr::addr_of!((*ptr).h_acc) as usize - ptr as usize },
1945 34usize,
1946 concat!(
1947 "Offset of field: ",
1948 stringify!(__mavlink_gps_raw_int_t),
1949 "::",
1950 stringify!(h_acc)
1951 )
1952 );
1953 assert_eq!(
1954 unsafe { ::std::ptr::addr_of!((*ptr).v_acc) as usize - ptr as usize },
1955 38usize,
1956 concat!(
1957 "Offset of field: ",
1958 stringify!(__mavlink_gps_raw_int_t),
1959 "::",
1960 stringify!(v_acc)
1961 )
1962 );
1963 assert_eq!(
1964 unsafe { ::std::ptr::addr_of!((*ptr).vel_acc) as usize - ptr as usize },
1965 42usize,
1966 concat!(
1967 "Offset of field: ",
1968 stringify!(__mavlink_gps_raw_int_t),
1969 "::",
1970 stringify!(vel_acc)
1971 )
1972 );
1973 assert_eq!(
1974 unsafe { ::std::ptr::addr_of!((*ptr).hdg_acc) as usize - ptr as usize },
1975 46usize,
1976 concat!(
1977 "Offset of field: ",
1978 stringify!(__mavlink_gps_raw_int_t),
1979 "::",
1980 stringify!(hdg_acc)
1981 )
1982 );
1983}
1984pub type mavlink_gps_raw_int_t = __mavlink_gps_raw_int_t;
1985#[repr(C, packed)]
1986#[derive(Debug, Default, Copy, Clone)]
1987pub struct __mavlink_scaled_pressure_t {
1988 pub time_boot_ms: u32,
1989 pub press_abs: f32,
1990 pub press_diff: f32,
1991 pub temperature: i16,
1992}
1993#[test]
1994fn bindgen_test_layout___mavlink_scaled_pressure_t() {
1995 const UNINIT: ::std::mem::MaybeUninit<__mavlink_scaled_pressure_t> = ::std::mem::MaybeUninit::uninit();
1996 let ptr = UNINIT.as_ptr();
1997 assert_eq!(
1998 ::std::mem::size_of::<__mavlink_scaled_pressure_t>(),
1999 14usize,
2000 concat!("Size of: ", stringify!(__mavlink_scaled_pressure_t))
2001 );
2002 assert_eq!(
2003 ::std::mem::align_of::<__mavlink_scaled_pressure_t>(),
2004 1usize,
2005 concat!("Alignment of ", stringify!(__mavlink_scaled_pressure_t))
2006 );
2007 assert_eq!(
2008 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
2009 0usize,
2010 concat!(
2011 "Offset of field: ",
2012 stringify!(__mavlink_scaled_pressure_t),
2013 "::",
2014 stringify!(time_boot_ms)
2015 )
2016 );
2017 assert_eq!(
2018 unsafe { ::std::ptr::addr_of!((*ptr).press_abs) as usize - ptr as usize },
2019 4usize,
2020 concat!(
2021 "Offset of field: ",
2022 stringify!(__mavlink_scaled_pressure_t),
2023 "::",
2024 stringify!(press_abs)
2025 )
2026 );
2027 assert_eq!(
2028 unsafe { ::std::ptr::addr_of!((*ptr).press_diff) as usize - ptr as usize },
2029 8usize,
2030 concat!(
2031 "Offset of field: ",
2032 stringify!(__mavlink_scaled_pressure_t),
2033 "::",
2034 stringify!(press_diff)
2035 )
2036 );
2037 assert_eq!(
2038 unsafe { ::std::ptr::addr_of!((*ptr).temperature) as usize - ptr as usize },
2039 12usize,
2040 concat!(
2041 "Offset of field: ",
2042 stringify!(__mavlink_scaled_pressure_t),
2043 "::",
2044 stringify!(temperature)
2045 )
2046 );
2047}
2048pub type mavlink_scaled_pressure_t = __mavlink_scaled_pressure_t;
2049#[repr(C, packed)]
2050#[derive(Debug, Default, Copy, Clone)]
2051pub struct __mavlink_attitude_t {
2052 pub time_boot_ms: u32,
2053 pub roll: f32,
2054 pub pitch: f32,
2055 pub yaw: f32,
2056 pub rollspeed: f32,
2057 pub pitchspeed: f32,
2058 pub yawspeed: f32,
2059}
2060#[test]
2061fn bindgen_test_layout___mavlink_attitude_t() {
2062 const UNINIT: ::std::mem::MaybeUninit<__mavlink_attitude_t> = ::std::mem::MaybeUninit::uninit();
2063 let ptr = UNINIT.as_ptr();
2064 assert_eq!(
2065 ::std::mem::size_of::<__mavlink_attitude_t>(),
2066 28usize,
2067 concat!("Size of: ", stringify!(__mavlink_attitude_t))
2068 );
2069 assert_eq!(
2070 ::std::mem::align_of::<__mavlink_attitude_t>(),
2071 1usize,
2072 concat!("Alignment of ", stringify!(__mavlink_attitude_t))
2073 );
2074 assert_eq!(
2075 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
2076 0usize,
2077 concat!(
2078 "Offset of field: ",
2079 stringify!(__mavlink_attitude_t),
2080 "::",
2081 stringify!(time_boot_ms)
2082 )
2083 );
2084 assert_eq!(
2085 unsafe { ::std::ptr::addr_of!((*ptr).roll) as usize - ptr as usize },
2086 4usize,
2087 concat!(
2088 "Offset of field: ",
2089 stringify!(__mavlink_attitude_t),
2090 "::",
2091 stringify!(roll)
2092 )
2093 );
2094 assert_eq!(
2095 unsafe { ::std::ptr::addr_of!((*ptr).pitch) as usize - ptr as usize },
2096 8usize,
2097 concat!(
2098 "Offset of field: ",
2099 stringify!(__mavlink_attitude_t),
2100 "::",
2101 stringify!(pitch)
2102 )
2103 );
2104 assert_eq!(
2105 unsafe { ::std::ptr::addr_of!((*ptr).yaw) as usize - ptr as usize },
2106 12usize,
2107 concat!(
2108 "Offset of field: ",
2109 stringify!(__mavlink_attitude_t),
2110 "::",
2111 stringify!(yaw)
2112 )
2113 );
2114 assert_eq!(
2115 unsafe { ::std::ptr::addr_of!((*ptr).rollspeed) as usize - ptr as usize },
2116 16usize,
2117 concat!(
2118 "Offset of field: ",
2119 stringify!(__mavlink_attitude_t),
2120 "::",
2121 stringify!(rollspeed)
2122 )
2123 );
2124 assert_eq!(
2125 unsafe { ::std::ptr::addr_of!((*ptr).pitchspeed) as usize - ptr as usize },
2126 20usize,
2127 concat!(
2128 "Offset of field: ",
2129 stringify!(__mavlink_attitude_t),
2130 "::",
2131 stringify!(pitchspeed)
2132 )
2133 );
2134 assert_eq!(
2135 unsafe { ::std::ptr::addr_of!((*ptr).yawspeed) as usize - ptr as usize },
2136 24usize,
2137 concat!(
2138 "Offset of field: ",
2139 stringify!(__mavlink_attitude_t),
2140 "::",
2141 stringify!(yawspeed)
2142 )
2143 );
2144}
2145pub type mavlink_attitude_t = __mavlink_attitude_t;
2146#[repr(C, packed)]
2147#[derive(Debug, Default, Copy, Clone)]
2148pub struct __mavlink_attitude_quaternion_t {
2149 pub time_boot_ms: u32,
2150 pub q1: f32,
2151 pub q2: f32,
2152 pub q3: f32,
2153 pub q4: f32,
2154 pub rollspeed: f32,
2155 pub pitchspeed: f32,
2156 pub yawspeed: f32,
2157}
2158#[test]
2159fn bindgen_test_layout___mavlink_attitude_quaternion_t() {
2160 const UNINIT: ::std::mem::MaybeUninit<__mavlink_attitude_quaternion_t> = ::std::mem::MaybeUninit::uninit();
2161 let ptr = UNINIT.as_ptr();
2162 assert_eq!(
2163 ::std::mem::size_of::<__mavlink_attitude_quaternion_t>(),
2164 32usize,
2165 concat!("Size of: ", stringify!(__mavlink_attitude_quaternion_t))
2166 );
2167 assert_eq!(
2168 ::std::mem::align_of::<__mavlink_attitude_quaternion_t>(),
2169 1usize,
2170 concat!("Alignment of ", stringify!(__mavlink_attitude_quaternion_t))
2171 );
2172 assert_eq!(
2173 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
2174 0usize,
2175 concat!(
2176 "Offset of field: ",
2177 stringify!(__mavlink_attitude_quaternion_t),
2178 "::",
2179 stringify!(time_boot_ms)
2180 )
2181 );
2182 assert_eq!(
2183 unsafe { ::std::ptr::addr_of!((*ptr).q1) as usize - ptr as usize },
2184 4usize,
2185 concat!(
2186 "Offset of field: ",
2187 stringify!(__mavlink_attitude_quaternion_t),
2188 "::",
2189 stringify!(q1)
2190 )
2191 );
2192 assert_eq!(
2193 unsafe { ::std::ptr::addr_of!((*ptr).q2) as usize - ptr as usize },
2194 8usize,
2195 concat!(
2196 "Offset of field: ",
2197 stringify!(__mavlink_attitude_quaternion_t),
2198 "::",
2199 stringify!(q2)
2200 )
2201 );
2202 assert_eq!(
2203 unsafe { ::std::ptr::addr_of!((*ptr).q3) as usize - ptr as usize },
2204 12usize,
2205 concat!(
2206 "Offset of field: ",
2207 stringify!(__mavlink_attitude_quaternion_t),
2208 "::",
2209 stringify!(q3)
2210 )
2211 );
2212 assert_eq!(
2213 unsafe { ::std::ptr::addr_of!((*ptr).q4) as usize - ptr as usize },
2214 16usize,
2215 concat!(
2216 "Offset of field: ",
2217 stringify!(__mavlink_attitude_quaternion_t),
2218 "::",
2219 stringify!(q4)
2220 )
2221 );
2222 assert_eq!(
2223 unsafe { ::std::ptr::addr_of!((*ptr).rollspeed) as usize - ptr as usize },
2224 20usize,
2225 concat!(
2226 "Offset of field: ",
2227 stringify!(__mavlink_attitude_quaternion_t),
2228 "::",
2229 stringify!(rollspeed)
2230 )
2231 );
2232 assert_eq!(
2233 unsafe { ::std::ptr::addr_of!((*ptr).pitchspeed) as usize - ptr as usize },
2234 24usize,
2235 concat!(
2236 "Offset of field: ",
2237 stringify!(__mavlink_attitude_quaternion_t),
2238 "::",
2239 stringify!(pitchspeed)
2240 )
2241 );
2242 assert_eq!(
2243 unsafe { ::std::ptr::addr_of!((*ptr).yawspeed) as usize - ptr as usize },
2244 28usize,
2245 concat!(
2246 "Offset of field: ",
2247 stringify!(__mavlink_attitude_quaternion_t),
2248 "::",
2249 stringify!(yawspeed)
2250 )
2251 );
2252}
2253pub type mavlink_attitude_quaternion_t = __mavlink_attitude_quaternion_t;
2254#[repr(C, packed)]
2255#[derive(Debug, Default, Copy, Clone)]
2256pub struct __mavlink_local_position_ned_t {
2257 pub time_boot_ms: u32,
2258 pub x: f32,
2259 pub y: f32,
2260 pub z: f32,
2261 pub vx: f32,
2262 pub vy: f32,
2263 pub vz: f32,
2264}
2265#[test]
2266fn bindgen_test_layout___mavlink_local_position_ned_t() {
2267 const UNINIT: ::std::mem::MaybeUninit<__mavlink_local_position_ned_t> = ::std::mem::MaybeUninit::uninit();
2268 let ptr = UNINIT.as_ptr();
2269 assert_eq!(
2270 ::std::mem::size_of::<__mavlink_local_position_ned_t>(),
2271 28usize,
2272 concat!("Size of: ", stringify!(__mavlink_local_position_ned_t))
2273 );
2274 assert_eq!(
2275 ::std::mem::align_of::<__mavlink_local_position_ned_t>(),
2276 1usize,
2277 concat!("Alignment of ", stringify!(__mavlink_local_position_ned_t))
2278 );
2279 assert_eq!(
2280 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
2281 0usize,
2282 concat!(
2283 "Offset of field: ",
2284 stringify!(__mavlink_local_position_ned_t),
2285 "::",
2286 stringify!(time_boot_ms)
2287 )
2288 );
2289 assert_eq!(
2290 unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
2291 4usize,
2292 concat!(
2293 "Offset of field: ",
2294 stringify!(__mavlink_local_position_ned_t),
2295 "::",
2296 stringify!(x)
2297 )
2298 );
2299 assert_eq!(
2300 unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
2301 8usize,
2302 concat!(
2303 "Offset of field: ",
2304 stringify!(__mavlink_local_position_ned_t),
2305 "::",
2306 stringify!(y)
2307 )
2308 );
2309 assert_eq!(
2310 unsafe { ::std::ptr::addr_of!((*ptr).z) as usize - ptr as usize },
2311 12usize,
2312 concat!(
2313 "Offset of field: ",
2314 stringify!(__mavlink_local_position_ned_t),
2315 "::",
2316 stringify!(z)
2317 )
2318 );
2319 assert_eq!(
2320 unsafe { ::std::ptr::addr_of!((*ptr).vx) as usize - ptr as usize },
2321 16usize,
2322 concat!(
2323 "Offset of field: ",
2324 stringify!(__mavlink_local_position_ned_t),
2325 "::",
2326 stringify!(vx)
2327 )
2328 );
2329 assert_eq!(
2330 unsafe { ::std::ptr::addr_of!((*ptr).vy) as usize - ptr as usize },
2331 20usize,
2332 concat!(
2333 "Offset of field: ",
2334 stringify!(__mavlink_local_position_ned_t),
2335 "::",
2336 stringify!(vy)
2337 )
2338 );
2339 assert_eq!(
2340 unsafe { ::std::ptr::addr_of!((*ptr).vz) as usize - ptr as usize },
2341 24usize,
2342 concat!(
2343 "Offset of field: ",
2344 stringify!(__mavlink_local_position_ned_t),
2345 "::",
2346 stringify!(vz)
2347 )
2348 );
2349}
2350pub type mavlink_local_position_ned_t = __mavlink_local_position_ned_t;
2351#[repr(C, packed)]
2352#[derive(Debug, Default, Copy, Clone)]
2353pub struct __mavlink_global_position_int_t {
2354 pub time_boot_ms: u32,
2355 pub lat: i32,
2356 pub lon: i32,
2357 pub alt: i32,
2358 pub relative_alt: i32,
2359 pub vx: i16,
2360 pub vy: i16,
2361 pub vz: i16,
2362 pub hdg: u16,
2363}
2364#[test]
2365fn bindgen_test_layout___mavlink_global_position_int_t() {
2366 const UNINIT: ::std::mem::MaybeUninit<__mavlink_global_position_int_t> = ::std::mem::MaybeUninit::uninit();
2367 let ptr = UNINIT.as_ptr();
2368 assert_eq!(
2369 ::std::mem::size_of::<__mavlink_global_position_int_t>(),
2370 28usize,
2371 concat!("Size of: ", stringify!(__mavlink_global_position_int_t))
2372 );
2373 assert_eq!(
2374 ::std::mem::align_of::<__mavlink_global_position_int_t>(),
2375 1usize,
2376 concat!("Alignment of ", stringify!(__mavlink_global_position_int_t))
2377 );
2378 assert_eq!(
2379 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
2380 0usize,
2381 concat!(
2382 "Offset of field: ",
2383 stringify!(__mavlink_global_position_int_t),
2384 "::",
2385 stringify!(time_boot_ms)
2386 )
2387 );
2388 assert_eq!(
2389 unsafe { ::std::ptr::addr_of!((*ptr).lat) as usize - ptr as usize },
2390 4usize,
2391 concat!(
2392 "Offset of field: ",
2393 stringify!(__mavlink_global_position_int_t),
2394 "::",
2395 stringify!(lat)
2396 )
2397 );
2398 assert_eq!(
2399 unsafe { ::std::ptr::addr_of!((*ptr).lon) as usize - ptr as usize },
2400 8usize,
2401 concat!(
2402 "Offset of field: ",
2403 stringify!(__mavlink_global_position_int_t),
2404 "::",
2405 stringify!(lon)
2406 )
2407 );
2408 assert_eq!(
2409 unsafe { ::std::ptr::addr_of!((*ptr).alt) as usize - ptr as usize },
2410 12usize,
2411 concat!(
2412 "Offset of field: ",
2413 stringify!(__mavlink_global_position_int_t),
2414 "::",
2415 stringify!(alt)
2416 )
2417 );
2418 assert_eq!(
2419 unsafe { ::std::ptr::addr_of!((*ptr).relative_alt) as usize - ptr as usize },
2420 16usize,
2421 concat!(
2422 "Offset of field: ",
2423 stringify!(__mavlink_global_position_int_t),
2424 "::",
2425 stringify!(relative_alt)
2426 )
2427 );
2428 assert_eq!(
2429 unsafe { ::std::ptr::addr_of!((*ptr).vx) as usize - ptr as usize },
2430 20usize,
2431 concat!(
2432 "Offset of field: ",
2433 stringify!(__mavlink_global_position_int_t),
2434 "::",
2435 stringify!(vx)
2436 )
2437 );
2438 assert_eq!(
2439 unsafe { ::std::ptr::addr_of!((*ptr).vy) as usize - ptr as usize },
2440 22usize,
2441 concat!(
2442 "Offset of field: ",
2443 stringify!(__mavlink_global_position_int_t),
2444 "::",
2445 stringify!(vy)
2446 )
2447 );
2448 assert_eq!(
2449 unsafe { ::std::ptr::addr_of!((*ptr).vz) as usize - ptr as usize },
2450 24usize,
2451 concat!(
2452 "Offset of field: ",
2453 stringify!(__mavlink_global_position_int_t),
2454 "::",
2455 stringify!(vz)
2456 )
2457 );
2458 assert_eq!(
2459 unsafe { ::std::ptr::addr_of!((*ptr).hdg) as usize - ptr as usize },
2460 26usize,
2461 concat!(
2462 "Offset of field: ",
2463 stringify!(__mavlink_global_position_int_t),
2464 "::",
2465 stringify!(hdg)
2466 )
2467 );
2468}
2469pub type mavlink_global_position_int_t = __mavlink_global_position_int_t;
2470#[repr(C, packed)]
2471#[derive(Debug, Default, Copy, Clone)]
2472pub struct __mavlink_servo_output_raw_t {
2473 pub time_usec: u32,
2474 pub servo1_raw: u16,
2475 pub servo2_raw: u16,
2476 pub servo3_raw: u16,
2477 pub servo4_raw: u16,
2478 pub servo5_raw: u16,
2479 pub servo6_raw: u16,
2480 pub servo7_raw: u16,
2481 pub servo8_raw: u16,
2482 pub port: u8,
2483 pub servo9_raw: u16,
2484 pub servo10_raw: u16,
2485 pub servo11_raw: u16,
2486 pub servo12_raw: u16,
2487 pub servo13_raw: u16,
2488 pub servo14_raw: u16,
2489 pub servo15_raw: u16,
2490 pub servo16_raw: u16,
2491}
2492#[test]
2493fn bindgen_test_layout___mavlink_servo_output_raw_t() {
2494 const UNINIT: ::std::mem::MaybeUninit<__mavlink_servo_output_raw_t> = ::std::mem::MaybeUninit::uninit();
2495 let ptr = UNINIT.as_ptr();
2496 assert_eq!(
2497 ::std::mem::size_of::<__mavlink_servo_output_raw_t>(),
2498 37usize,
2499 concat!("Size of: ", stringify!(__mavlink_servo_output_raw_t))
2500 );
2501 assert_eq!(
2502 ::std::mem::align_of::<__mavlink_servo_output_raw_t>(),
2503 1usize,
2504 concat!("Alignment of ", stringify!(__mavlink_servo_output_raw_t))
2505 );
2506 assert_eq!(
2507 unsafe { ::std::ptr::addr_of!((*ptr).time_usec) as usize - ptr as usize },
2508 0usize,
2509 concat!(
2510 "Offset of field: ",
2511 stringify!(__mavlink_servo_output_raw_t),
2512 "::",
2513 stringify!(time_usec)
2514 )
2515 );
2516 assert_eq!(
2517 unsafe { ::std::ptr::addr_of!((*ptr).servo1_raw) as usize - ptr as usize },
2518 4usize,
2519 concat!(
2520 "Offset of field: ",
2521 stringify!(__mavlink_servo_output_raw_t),
2522 "::",
2523 stringify!(servo1_raw)
2524 )
2525 );
2526 assert_eq!(
2527 unsafe { ::std::ptr::addr_of!((*ptr).servo2_raw) as usize - ptr as usize },
2528 6usize,
2529 concat!(
2530 "Offset of field: ",
2531 stringify!(__mavlink_servo_output_raw_t),
2532 "::",
2533 stringify!(servo2_raw)
2534 )
2535 );
2536 assert_eq!(
2537 unsafe { ::std::ptr::addr_of!((*ptr).servo3_raw) as usize - ptr as usize },
2538 8usize,
2539 concat!(
2540 "Offset of field: ",
2541 stringify!(__mavlink_servo_output_raw_t),
2542 "::",
2543 stringify!(servo3_raw)
2544 )
2545 );
2546 assert_eq!(
2547 unsafe { ::std::ptr::addr_of!((*ptr).servo4_raw) as usize - ptr as usize },
2548 10usize,
2549 concat!(
2550 "Offset of field: ",
2551 stringify!(__mavlink_servo_output_raw_t),
2552 "::",
2553 stringify!(servo4_raw)
2554 )
2555 );
2556 assert_eq!(
2557 unsafe { ::std::ptr::addr_of!((*ptr).servo5_raw) as usize - ptr as usize },
2558 12usize,
2559 concat!(
2560 "Offset of field: ",
2561 stringify!(__mavlink_servo_output_raw_t),
2562 "::",
2563 stringify!(servo5_raw)
2564 )
2565 );
2566 assert_eq!(
2567 unsafe { ::std::ptr::addr_of!((*ptr).servo6_raw) as usize - ptr as usize },
2568 14usize,
2569 concat!(
2570 "Offset of field: ",
2571 stringify!(__mavlink_servo_output_raw_t),
2572 "::",
2573 stringify!(servo6_raw)
2574 )
2575 );
2576 assert_eq!(
2577 unsafe { ::std::ptr::addr_of!((*ptr).servo7_raw) as usize - ptr as usize },
2578 16usize,
2579 concat!(
2580 "Offset of field: ",
2581 stringify!(__mavlink_servo_output_raw_t),
2582 "::",
2583 stringify!(servo7_raw)
2584 )
2585 );
2586 assert_eq!(
2587 unsafe { ::std::ptr::addr_of!((*ptr).servo8_raw) as usize - ptr as usize },
2588 18usize,
2589 concat!(
2590 "Offset of field: ",
2591 stringify!(__mavlink_servo_output_raw_t),
2592 "::",
2593 stringify!(servo8_raw)
2594 )
2595 );
2596 assert_eq!(
2597 unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize },
2598 20usize,
2599 concat!(
2600 "Offset of field: ",
2601 stringify!(__mavlink_servo_output_raw_t),
2602 "::",
2603 stringify!(port)
2604 )
2605 );
2606 assert_eq!(
2607 unsafe { ::std::ptr::addr_of!((*ptr).servo9_raw) as usize - ptr as usize },
2608 21usize,
2609 concat!(
2610 "Offset of field: ",
2611 stringify!(__mavlink_servo_output_raw_t),
2612 "::",
2613 stringify!(servo9_raw)
2614 )
2615 );
2616 assert_eq!(
2617 unsafe { ::std::ptr::addr_of!((*ptr).servo10_raw) as usize - ptr as usize },
2618 23usize,
2619 concat!(
2620 "Offset of field: ",
2621 stringify!(__mavlink_servo_output_raw_t),
2622 "::",
2623 stringify!(servo10_raw)
2624 )
2625 );
2626 assert_eq!(
2627 unsafe { ::std::ptr::addr_of!((*ptr).servo11_raw) as usize - ptr as usize },
2628 25usize,
2629 concat!(
2630 "Offset of field: ",
2631 stringify!(__mavlink_servo_output_raw_t),
2632 "::",
2633 stringify!(servo11_raw)
2634 )
2635 );
2636 assert_eq!(
2637 unsafe { ::std::ptr::addr_of!((*ptr).servo12_raw) as usize - ptr as usize },
2638 27usize,
2639 concat!(
2640 "Offset of field: ",
2641 stringify!(__mavlink_servo_output_raw_t),
2642 "::",
2643 stringify!(servo12_raw)
2644 )
2645 );
2646 assert_eq!(
2647 unsafe { ::std::ptr::addr_of!((*ptr).servo13_raw) as usize - ptr as usize },
2648 29usize,
2649 concat!(
2650 "Offset of field: ",
2651 stringify!(__mavlink_servo_output_raw_t),
2652 "::",
2653 stringify!(servo13_raw)
2654 )
2655 );
2656 assert_eq!(
2657 unsafe { ::std::ptr::addr_of!((*ptr).servo14_raw) as usize - ptr as usize },
2658 31usize,
2659 concat!(
2660 "Offset of field: ",
2661 stringify!(__mavlink_servo_output_raw_t),
2662 "::",
2663 stringify!(servo14_raw)
2664 )
2665 );
2666 assert_eq!(
2667 unsafe { ::std::ptr::addr_of!((*ptr).servo15_raw) as usize - ptr as usize },
2668 33usize,
2669 concat!(
2670 "Offset of field: ",
2671 stringify!(__mavlink_servo_output_raw_t),
2672 "::",
2673 stringify!(servo15_raw)
2674 )
2675 );
2676 assert_eq!(
2677 unsafe { ::std::ptr::addr_of!((*ptr).servo16_raw) as usize - ptr as usize },
2678 35usize,
2679 concat!(
2680 "Offset of field: ",
2681 stringify!(__mavlink_servo_output_raw_t),
2682 "::",
2683 stringify!(servo16_raw)
2684 )
2685 );
2686}
2687pub type mavlink_servo_output_raw_t = __mavlink_servo_output_raw_t;
2688#[repr(C, packed)]
2689#[derive(Debug, Default, Copy, Clone)]
2690pub struct __mavlink_manual_control_t {
2691 pub x: i16,
2692 pub y: i16,
2693 pub z: i16,
2694 pub r: i16,
2695 pub buttons: u16,
2696 pub target: u8,
2697}
2698#[test]
2699fn bindgen_test_layout___mavlink_manual_control_t() {
2700 const UNINIT: ::std::mem::MaybeUninit<__mavlink_manual_control_t> = ::std::mem::MaybeUninit::uninit();
2701 let ptr = UNINIT.as_ptr();
2702 assert_eq!(
2703 ::std::mem::size_of::<__mavlink_manual_control_t>(),
2704 11usize,
2705 concat!("Size of: ", stringify!(__mavlink_manual_control_t))
2706 );
2707 assert_eq!(
2708 ::std::mem::align_of::<__mavlink_manual_control_t>(),
2709 1usize,
2710 concat!("Alignment of ", stringify!(__mavlink_manual_control_t))
2711 );
2712 assert_eq!(
2713 unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
2714 0usize,
2715 concat!(
2716 "Offset of field: ",
2717 stringify!(__mavlink_manual_control_t),
2718 "::",
2719 stringify!(x)
2720 )
2721 );
2722 assert_eq!(
2723 unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
2724 2usize,
2725 concat!(
2726 "Offset of field: ",
2727 stringify!(__mavlink_manual_control_t),
2728 "::",
2729 stringify!(y)
2730 )
2731 );
2732 assert_eq!(
2733 unsafe { ::std::ptr::addr_of!((*ptr).z) as usize - ptr as usize },
2734 4usize,
2735 concat!(
2736 "Offset of field: ",
2737 stringify!(__mavlink_manual_control_t),
2738 "::",
2739 stringify!(z)
2740 )
2741 );
2742 assert_eq!(
2743 unsafe { ::std::ptr::addr_of!((*ptr).r) as usize - ptr as usize },
2744 6usize,
2745 concat!(
2746 "Offset of field: ",
2747 stringify!(__mavlink_manual_control_t),
2748 "::",
2749 stringify!(r)
2750 )
2751 );
2752 assert_eq!(
2753 unsafe { ::std::ptr::addr_of!((*ptr).buttons) as usize - ptr as usize },
2754 8usize,
2755 concat!(
2756 "Offset of field: ",
2757 stringify!(__mavlink_manual_control_t),
2758 "::",
2759 stringify!(buttons)
2760 )
2761 );
2762 assert_eq!(
2763 unsafe { ::std::ptr::addr_of!((*ptr).target) as usize - ptr as usize },
2764 10usize,
2765 concat!(
2766 "Offset of field: ",
2767 stringify!(__mavlink_manual_control_t),
2768 "::",
2769 stringify!(target)
2770 )
2771 );
2772}
2773pub type mavlink_manual_control_t = __mavlink_manual_control_t;
2774#[repr(C, packed)]
2775#[derive(Debug, Default, Copy, Clone)]
2776pub struct __mavlink_set_position_target_local_ned_t {
2777 pub time_boot_ms: u32,
2778 pub x: f32,
2779 pub y: f32,
2780 pub z: f32,
2781 pub vx: f32,
2782 pub vy: f32,
2783 pub vz: f32,
2784 pub afx: f32,
2785 pub afy: f32,
2786 pub afz: f32,
2787 pub yaw: f32,
2788 pub yaw_rate: f32,
2789 pub type_mask: u16,
2790 pub target_system: u8,
2791 pub target_component: u8,
2792 pub coordinate_frame: u8,
2793}
2794#[test]
2795fn bindgen_test_layout___mavlink_set_position_target_local_ned_t() {
2796 const UNINIT: ::std::mem::MaybeUninit<__mavlink_set_position_target_local_ned_t> =
2797 ::std::mem::MaybeUninit::uninit();
2798 let ptr = UNINIT.as_ptr();
2799 assert_eq!(
2800 ::std::mem::size_of::<__mavlink_set_position_target_local_ned_t>(),
2801 53usize,
2802 concat!("Size of: ", stringify!(__mavlink_set_position_target_local_ned_t))
2803 );
2804 assert_eq!(
2805 ::std::mem::align_of::<__mavlink_set_position_target_local_ned_t>(),
2806 1usize,
2807 concat!("Alignment of ", stringify!(__mavlink_set_position_target_local_ned_t))
2808 );
2809 assert_eq!(
2810 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
2811 0usize,
2812 concat!(
2813 "Offset of field: ",
2814 stringify!(__mavlink_set_position_target_local_ned_t),
2815 "::",
2816 stringify!(time_boot_ms)
2817 )
2818 );
2819 assert_eq!(
2820 unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
2821 4usize,
2822 concat!(
2823 "Offset of field: ",
2824 stringify!(__mavlink_set_position_target_local_ned_t),
2825 "::",
2826 stringify!(x)
2827 )
2828 );
2829 assert_eq!(
2830 unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
2831 8usize,
2832 concat!(
2833 "Offset of field: ",
2834 stringify!(__mavlink_set_position_target_local_ned_t),
2835 "::",
2836 stringify!(y)
2837 )
2838 );
2839 assert_eq!(
2840 unsafe { ::std::ptr::addr_of!((*ptr).z) as usize - ptr as usize },
2841 12usize,
2842 concat!(
2843 "Offset of field: ",
2844 stringify!(__mavlink_set_position_target_local_ned_t),
2845 "::",
2846 stringify!(z)
2847 )
2848 );
2849 assert_eq!(
2850 unsafe { ::std::ptr::addr_of!((*ptr).vx) as usize - ptr as usize },
2851 16usize,
2852 concat!(
2853 "Offset of field: ",
2854 stringify!(__mavlink_set_position_target_local_ned_t),
2855 "::",
2856 stringify!(vx)
2857 )
2858 );
2859 assert_eq!(
2860 unsafe { ::std::ptr::addr_of!((*ptr).vy) as usize - ptr as usize },
2861 20usize,
2862 concat!(
2863 "Offset of field: ",
2864 stringify!(__mavlink_set_position_target_local_ned_t),
2865 "::",
2866 stringify!(vy)
2867 )
2868 );
2869 assert_eq!(
2870 unsafe { ::std::ptr::addr_of!((*ptr).vz) as usize - ptr as usize },
2871 24usize,
2872 concat!(
2873 "Offset of field: ",
2874 stringify!(__mavlink_set_position_target_local_ned_t),
2875 "::",
2876 stringify!(vz)
2877 )
2878 );
2879 assert_eq!(
2880 unsafe { ::std::ptr::addr_of!((*ptr).afx) as usize - ptr as usize },
2881 28usize,
2882 concat!(
2883 "Offset of field: ",
2884 stringify!(__mavlink_set_position_target_local_ned_t),
2885 "::",
2886 stringify!(afx)
2887 )
2888 );
2889 assert_eq!(
2890 unsafe { ::std::ptr::addr_of!((*ptr).afy) as usize - ptr as usize },
2891 32usize,
2892 concat!(
2893 "Offset of field: ",
2894 stringify!(__mavlink_set_position_target_local_ned_t),
2895 "::",
2896 stringify!(afy)
2897 )
2898 );
2899 assert_eq!(
2900 unsafe { ::std::ptr::addr_of!((*ptr).afz) as usize - ptr as usize },
2901 36usize,
2902 concat!(
2903 "Offset of field: ",
2904 stringify!(__mavlink_set_position_target_local_ned_t),
2905 "::",
2906 stringify!(afz)
2907 )
2908 );
2909 assert_eq!(
2910 unsafe { ::std::ptr::addr_of!((*ptr).yaw) as usize - ptr as usize },
2911 40usize,
2912 concat!(
2913 "Offset of field: ",
2914 stringify!(__mavlink_set_position_target_local_ned_t),
2915 "::",
2916 stringify!(yaw)
2917 )
2918 );
2919 assert_eq!(
2920 unsafe { ::std::ptr::addr_of!((*ptr).yaw_rate) as usize - ptr as usize },
2921 44usize,
2922 concat!(
2923 "Offset of field: ",
2924 stringify!(__mavlink_set_position_target_local_ned_t),
2925 "::",
2926 stringify!(yaw_rate)
2927 )
2928 );
2929 assert_eq!(
2930 unsafe { ::std::ptr::addr_of!((*ptr).type_mask) as usize - ptr as usize },
2931 48usize,
2932 concat!(
2933 "Offset of field: ",
2934 stringify!(__mavlink_set_position_target_local_ned_t),
2935 "::",
2936 stringify!(type_mask)
2937 )
2938 );
2939 assert_eq!(
2940 unsafe { ::std::ptr::addr_of!((*ptr).target_system) as usize - ptr as usize },
2941 50usize,
2942 concat!(
2943 "Offset of field: ",
2944 stringify!(__mavlink_set_position_target_local_ned_t),
2945 "::",
2946 stringify!(target_system)
2947 )
2948 );
2949 assert_eq!(
2950 unsafe { ::std::ptr::addr_of!((*ptr).target_component) as usize - ptr as usize },
2951 51usize,
2952 concat!(
2953 "Offset of field: ",
2954 stringify!(__mavlink_set_position_target_local_ned_t),
2955 "::",
2956 stringify!(target_component)
2957 )
2958 );
2959 assert_eq!(
2960 unsafe { ::std::ptr::addr_of!((*ptr).coordinate_frame) as usize - ptr as usize },
2961 52usize,
2962 concat!(
2963 "Offset of field: ",
2964 stringify!(__mavlink_set_position_target_local_ned_t),
2965 "::",
2966 stringify!(coordinate_frame)
2967 )
2968 );
2969}
2970pub type mavlink_set_position_target_local_ned_t = __mavlink_set_position_target_local_ned_t;
2971#[repr(C, packed)]
2972#[derive(Debug, Default, Copy, Clone)]
2973pub struct __mavlink_set_position_target_global_int_t {
2974 pub time_boot_ms: u32,
2975 pub lat_int: i32,
2976 pub lon_int: i32,
2977 pub alt: f32,
2978 pub vx: f32,
2979 pub vy: f32,
2980 pub vz: f32,
2981 pub afx: f32,
2982 pub afy: f32,
2983 pub afz: f32,
2984 pub yaw: f32,
2985 pub yaw_rate: f32,
2986 pub type_mask: u16,
2987 pub target_system: u8,
2988 pub target_component: u8,
2989 pub coordinate_frame: u8,
2990}
2991#[test]
2992fn bindgen_test_layout___mavlink_set_position_target_global_int_t() {
2993 const UNINIT: ::std::mem::MaybeUninit<__mavlink_set_position_target_global_int_t> =
2994 ::std::mem::MaybeUninit::uninit();
2995 let ptr = UNINIT.as_ptr();
2996 assert_eq!(
2997 ::std::mem::size_of::<__mavlink_set_position_target_global_int_t>(),
2998 53usize,
2999 concat!("Size of: ", stringify!(__mavlink_set_position_target_global_int_t))
3000 );
3001 assert_eq!(
3002 ::std::mem::align_of::<__mavlink_set_position_target_global_int_t>(),
3003 1usize,
3004 concat!("Alignment of ", stringify!(__mavlink_set_position_target_global_int_t))
3005 );
3006 assert_eq!(
3007 unsafe { ::std::ptr::addr_of!((*ptr).time_boot_ms) as usize - ptr as usize },
3008 0usize,
3009 concat!(
3010 "Offset of field: ",
3011 stringify!(__mavlink_set_position_target_global_int_t),
3012 "::",
3013 stringify!(time_boot_ms)
3014 )
3015 );
3016 assert_eq!(
3017 unsafe { ::std::ptr::addr_of!((*ptr).lat_int) as usize - ptr as usize },
3018 4usize,
3019 concat!(
3020 "Offset of field: ",
3021 stringify!(__mavlink_set_position_target_global_int_t),
3022 "::",
3023 stringify!(lat_int)
3024 )
3025 );
3026 assert_eq!(
3027 unsafe { ::std::ptr::addr_of!((*ptr).lon_int) as usize - ptr as usize },
3028 8usize,
3029 concat!(
3030 "Offset of field: ",
3031 stringify!(__mavlink_set_position_target_global_int_t),
3032 "::",
3033 stringify!(lon_int)
3034 )
3035 );
3036 assert_eq!(
3037 unsafe { ::std::ptr::addr_of!((*ptr).alt) as usize - ptr as usize },
3038 12usize,
3039 concat!(
3040 "Offset of field: ",
3041 stringify!(__mavlink_set_position_target_global_int_t),
3042 "::",
3043 stringify!(alt)
3044 )
3045 );
3046 assert_eq!(
3047 unsafe { ::std::ptr::addr_of!((*ptr).vx) as usize - ptr as usize },
3048 16usize,
3049 concat!(
3050 "Offset of field: ",
3051 stringify!(__mavlink_set_position_target_global_int_t),
3052 "::",
3053 stringify!(vx)
3054 )
3055 );
3056 assert_eq!(
3057 unsafe { ::std::ptr::addr_of!((*ptr).vy) as usize - ptr as usize },
3058 20usize,
3059 concat!(
3060 "Offset of field: ",
3061 stringify!(__mavlink_set_position_target_global_int_t),
3062 "::",
3063 stringify!(vy)
3064 )
3065 );
3066 assert_eq!(
3067 unsafe { ::std::ptr::addr_of!((*ptr).vz) as usize - ptr as usize },
3068 24usize,
3069 concat!(
3070 "Offset of field: ",
3071 stringify!(__mavlink_set_position_target_global_int_t),
3072 "::",
3073 stringify!(vz)
3074 )
3075 );
3076 assert_eq!(
3077 unsafe { ::std::ptr::addr_of!((*ptr).afx) as usize - ptr as usize },
3078 28usize,
3079 concat!(
3080 "Offset of field: ",
3081 stringify!(__mavlink_set_position_target_global_int_t),
3082 "::",
3083 stringify!(afx)
3084 )
3085 );
3086 assert_eq!(
3087 unsafe { ::std::ptr::addr_of!((*ptr).afy) as usize - ptr as usize },
3088 32usize,
3089 concat!(
3090 "Offset of field: ",
3091 stringify!(__mavlink_set_position_target_global_int_t),
3092 "::",
3093 stringify!(afy)
3094 )
3095 );
3096 assert_eq!(
3097 unsafe { ::std::ptr::addr_of!((*ptr).afz) as usize - ptr as usize },
3098 36usize,
3099 concat!(
3100 "Offset of field: ",
3101 stringify!(__mavlink_set_position_target_global_int_t),
3102 "::",
3103 stringify!(afz)
3104 )
3105 );
3106 assert_eq!(
3107 unsafe { ::std::ptr::addr_of!((*ptr).yaw) as usize - ptr as usize },
3108 40usize,
3109 concat!(
3110 "Offset of field: ",
3111 stringify!(__mavlink_set_position_target_global_int_t),
3112 "::",
3113 stringify!(yaw)
3114 )
3115 );
3116 assert_eq!(
3117 unsafe { ::std::ptr::addr_of!((*ptr).yaw_rate) as usize - ptr as usize },
3118 44usize,
3119 concat!(
3120 "Offset of field: ",
3121 stringify!(__mavlink_set_position_target_global_int_t),
3122 "::",
3123 stringify!(yaw_rate)
3124 )
3125 );
3126 assert_eq!(
3127 unsafe { ::std::ptr::addr_of!((*ptr).type_mask) as usize - ptr as usize },
3128 48usize,
3129 concat!(
3130 "Offset of field: ",
3131 stringify!(__mavlink_set_position_target_global_int_t),
3132 "::",
3133 stringify!(type_mask)
3134 )
3135 );
3136 assert_eq!(
3137 unsafe { ::std::ptr::addr_of!((*ptr).target_system) as usize - ptr as usize },
3138 50usize,
3139 concat!(
3140 "Offset of field: ",
3141 stringify!(__mavlink_set_position_target_global_int_t),
3142 "::",
3143 stringify!(target_system)
3144 )
3145 );
3146 assert_eq!(
3147 unsafe { ::std::ptr::addr_of!((*ptr).target_component) as usize - ptr as usize },
3148 51usize,
3149 concat!(
3150 "Offset of field: ",
3151 stringify!(__mavlink_set_position_target_global_int_t),
3152 "::",
3153 stringify!(target_component)
3154 )
3155 );
3156 assert_eq!(
3157 unsafe { ::std::ptr::addr_of!((*ptr).coordinate_frame) as usize - ptr as usize },
3158 52usize,
3159 concat!(
3160 "Offset of field: ",
3161 stringify!(__mavlink_set_position_target_global_int_t),
3162 "::",
3163 stringify!(coordinate_frame)
3164 )
3165 );
3166}
3167pub type mavlink_set_position_target_global_int_t = __mavlink_set_position_target_global_int_t;
3168#[repr(C, packed)]
3169#[derive(Debug, Default, Copy, Clone)]
3170pub struct __mavlink_att_pos_mocap_t {
3171 pub time_usec: u64,
3172 pub q: [f32; 4usize],
3173 pub x: f32,
3174 pub y: f32,
3175 pub z: f32,
3176}
3177#[test]
3178fn bindgen_test_layout___mavlink_att_pos_mocap_t() {
3179 const UNINIT: ::std::mem::MaybeUninit<__mavlink_att_pos_mocap_t> = ::std::mem::MaybeUninit::uninit();
3180 let ptr = UNINIT.as_ptr();
3181 assert_eq!(
3182 ::std::mem::size_of::<__mavlink_att_pos_mocap_t>(),
3183 36usize,
3184 concat!("Size of: ", stringify!(__mavlink_att_pos_mocap_t))
3185 );
3186 assert_eq!(
3187 ::std::mem::align_of::<__mavlink_att_pos_mocap_t>(),
3188 1usize,
3189 concat!("Alignment of ", stringify!(__mavlink_att_pos_mocap_t))
3190 );
3191 assert_eq!(
3192 unsafe { ::std::ptr::addr_of!((*ptr).time_usec) as usize - ptr as usize },
3193 0usize,
3194 concat!(
3195 "Offset of field: ",
3196 stringify!(__mavlink_att_pos_mocap_t),
3197 "::",
3198 stringify!(time_usec)
3199 )
3200 );
3201 assert_eq!(
3202 unsafe { ::std::ptr::addr_of!((*ptr).q) as usize - ptr as usize },
3203 8usize,
3204 concat!(
3205 "Offset of field: ",
3206 stringify!(__mavlink_att_pos_mocap_t),
3207 "::",
3208 stringify!(q)
3209 )
3210 );
3211 assert_eq!(
3212 unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
3213 24usize,
3214 concat!(
3215 "Offset of field: ",
3216 stringify!(__mavlink_att_pos_mocap_t),
3217 "::",
3218 stringify!(x)
3219 )
3220 );
3221 assert_eq!(
3222 unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
3223 28usize,
3224 concat!(
3225 "Offset of field: ",
3226 stringify!(__mavlink_att_pos_mocap_t),
3227 "::",
3228 stringify!(y)
3229 )
3230 );
3231 assert_eq!(
3232 unsafe { ::std::ptr::addr_of!((*ptr).z) as usize - ptr as usize },
3233 32usize,
3234 concat!(
3235 "Offset of field: ",
3236 stringify!(__mavlink_att_pos_mocap_t),
3237 "::",
3238 stringify!(z)
3239 )
3240 );
3241}
3242pub type mavlink_att_pos_mocap_t = __mavlink_att_pos_mocap_t;
3243extern "C" {
3244 pub fn rc_mav_send_heartbeat_abbreviated() -> ::std::os::raw::c_int;
3245}
3246extern "C" {
3247 pub fn rc_mav_send_heartbeat(
3248 custom_mode: u32,
3249 type_: u8,
3250 autopilot: u8,
3251 base_mode: u8,
3252 system_status: u8,
3253 ) -> ::std::os::raw::c_int;
3254}
3255extern "C" {
3256 pub fn rc_mav_get_heartbeat(data: *mut mavlink_heartbeat_t) -> ::std::os::raw::c_int;
3257}
3258extern "C" {
3259 pub fn rc_mav_send_attitude(
3260 roll: f32,
3261 pitch: f32,
3262 yaw: f32,
3263 rollspeed: f32,
3264 pitchspeed: f32,
3265 yawspeed: f32,
3266 ) -> ::std::os::raw::c_int;
3267}
3268extern "C" {
3269 pub fn rc_mav_get_attitude(data: *mut mavlink_attitude_t) -> ::std::os::raw::c_int;
3270}
3271extern "C" {
3272 pub fn rc_mav_send_attitude_quaternion(
3273 q1: f32,
3274 q2: f32,
3275 q3: f32,
3276 q4: f32,
3277 rollspeed: f32,
3278 pitchspeed: f32,
3279 yawspeed: f32,
3280 ) -> ::std::os::raw::c_int;
3281}
3282extern "C" {
3283 pub fn rc_mav_get_attitude_quaternion(data: *mut mavlink_attitude_quaternion_t) -> ::std::os::raw::c_int;
3284}
3285extern "C" {
3286 pub fn rc_mav_send_local_position_ned(x: f32, y: f32, z: f32, vx: f32, vy: f32, vz: f32) -> ::std::os::raw::c_int;
3287}
3288extern "C" {
3289 pub fn rc_mav_get_local_position_ned(data: *mut mavlink_local_position_ned_t) -> ::std::os::raw::c_int;
3290}
3291extern "C" {
3292 pub fn rc_mav_send_global_position_int(
3293 lat: i32,
3294 lon: i32,
3295 alt: i32,
3296 relative_alt: i32,
3297 vx: i16,
3298 vy: i16,
3299 vz: i16,
3300 hdg: u16,
3301 ) -> ::std::os::raw::c_int;
3302}
3303extern "C" {
3304 pub fn rc_mav_get_global_position_int(data: *mut mavlink_global_position_int_t) -> ::std::os::raw::c_int;
3305}
3306extern "C" {
3307 pub fn rc_mav_send_set_position_target_local_ned(
3308 x: f32,
3309 y: f32,
3310 z: f32,
3311 vx: f32,
3312 vy: f32,
3313 vz: f32,
3314 afx: f32,
3315 afy: f32,
3316 afz: f32,
3317 yaw: f32,
3318 yaw_rate: f32,
3319 type_mask: u16,
3320 target_system: u8,
3321 target_component: u8,
3322 coordinate_frame: u8,
3323 ) -> ::std::os::raw::c_int;
3324}
3325extern "C" {
3326 pub fn rc_mav_get_set_position_target_local_ned(
3327 data: *mut mavlink_set_position_target_local_ned_t,
3328 ) -> ::std::os::raw::c_int;
3329}
3330extern "C" {
3331 pub fn rc_mav_send_set_position_target_global_int(
3332 lat_int: i32,
3333 lon_int: i32,
3334 alt: f32,
3335 vx: f32,
3336 vy: f32,
3337 vz: f32,
3338 afx: f32,
3339 afy: f32,
3340 afz: f32,
3341 yaw: f32,
3342 yaw_rate: f32,
3343 type_mask: u16,
3344 target_system: u8,
3345 target_component: u8,
3346 coordinate_frame: u8,
3347 ) -> ::std::os::raw::c_int;
3348}
3349extern "C" {
3350 pub fn rc_mav_get_set_position_target_global_int(
3351 data: *mut mavlink_set_position_target_global_int_t,
3352 ) -> ::std::os::raw::c_int;
3353}
3354extern "C" {
3355 pub fn rc_mav_send_gps_raw_int(
3356 lat: i32,
3357 lon: i32,
3358 alt: i32,
3359 eph: u16,
3360 epv: u16,
3361 vel: u16,
3362 cog: u16,
3363 fix_type: u8,
3364 satellites_visible: u8,
3365 alt_ellipsoid: i32,
3366 h_acc: u32,
3367 v_acc: u32,
3368 vel_acc: u32,
3369 hdg_acc: u32,
3370 ) -> ::std::os::raw::c_int;
3371}
3372extern "C" {
3373 pub fn rc_mav_get_gps_raw_int(data: *mut mavlink_gps_raw_int_t) -> ::std::os::raw::c_int;
3374}
3375extern "C" {
3376 pub fn rc_mav_send_scaled_pressure(press_abs: f32, press_diff: f32, temperature: i16) -> ::std::os::raw::c_int;
3377}
3378extern "C" {
3379 pub fn rc_mav_get_scaled_pressure(data: *mut mavlink_scaled_pressure_t) -> ::std::os::raw::c_int;
3380}
3381extern "C" {
3382 pub fn rc_mav_send_servo_output_raw(
3383 servo1_raw: u16,
3384 servo2_raw: u16,
3385 servo3_raw: u16,
3386 servo4_raw: u16,
3387 servo5_raw: u16,
3388 servo6_raw: u16,
3389 servo7_raw: u16,
3390 servo8_raw: u16,
3391 port: u8,
3392 servo9_raw: u16,
3393 servo10_raw: u16,
3394 servo11_raw: u16,
3395 servo12_raw: u16,
3396 servo13_raw: u16,
3397 servo14_raw: u16,
3398 servo15_raw: u16,
3399 servo16_raw: u16,
3400 ) -> ::std::os::raw::c_int;
3401}
3402extern "C" {
3403 pub fn rc_mav_get_servo_output_raw(data: *mut mavlink_servo_output_raw_t) -> ::std::os::raw::c_int;
3404}
3405extern "C" {
3406 pub fn rc_mav_send_sys_status(
3407 onboard_control_sensors_present: u32,
3408 onboard_control_sensors_enabled: u32,
3409 onboard_control_sensors_health: u32,
3410 load: u16,
3411 voltage_battery: u16,
3412 current_battery: i16,
3413 drop_rate_comm: u16,
3414 errors_comm: u16,
3415 errors_count1: u16,
3416 errors_count2: u16,
3417 errors_count3: u16,
3418 errors_count4: u16,
3419 battery_remaining: i8,
3420 ) -> ::std::os::raw::c_int;
3421}
3422extern "C" {
3423 pub fn rc_mav_get_sys_status(data: *mut mavlink_sys_status_t) -> ::std::os::raw::c_int;
3424}
3425extern "C" {
3426 pub fn rc_mav_send_manual_control(
3427 x: i16,
3428 y: i16,
3429 z: i16,
3430 r: i16,
3431 buttons: u16,
3432 target: u8,
3433 ) -> ::std::os::raw::c_int;
3434}
3435extern "C" {
3436 pub fn rc_mav_get_manual_control(data: *mut mavlink_manual_control_t) -> ::std::os::raw::c_int;
3437}
3438extern "C" {
3439 pub fn rc_mav_send_att_pos_mocap(q: *mut f32, x: f32, y: f32, z: f32) -> ::std::os::raw::c_int;
3440}
3441extern "C" {
3442 pub fn rc_mav_get_att_pos_mocap(data: *mut mavlink_att_pos_mocap_t) -> ::std::os::raw::c_int;
3443}
3444pub const MAV_CONNECTION_WAITING: rc_mav_connection_state_t = 0;
3445pub const MAV_CONNECTION_ACTIVE: rc_mav_connection_state_t = 1;
3446pub const MAV_CONNECTION_LOST: rc_mav_connection_state_t = 2;
3447pub type rc_mav_connection_state_t = ::std::os::raw::c_uint;
3448extern "C" {
3449 pub fn rc_mav_init(
3450 system_id: u8,
3451 dest_ip: *const ::std::os::raw::c_char,
3452 port: u16,
3453 connection_timeout_us: u64,
3454 ) -> ::std::os::raw::c_int;
3455}
3456extern "C" {
3457 pub fn rc_mav_set_dest_ip(dest_ip: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
3458}
3459extern "C" {
3460 pub fn rc_mav_set_system_id(system_id: u8) -> ::std::os::raw::c_int;
3461}
3462extern "C" {
3463 pub fn rc_mav_cleanup() -> ::std::os::raw::c_int;
3464}
3465extern "C" {
3466 pub fn rc_mav_send_msg(msg: mavlink_message_t) -> ::std::os::raw::c_int;
3467}
3468extern "C" {
3469 pub fn rc_mav_is_new_msg(msg_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3470}
3471extern "C" {
3472 pub fn rc_mav_get_msg(msg_id: ::std::os::raw::c_int, msg: *mut mavlink_message_t) -> ::std::os::raw::c_int;
3473}
3474extern "C" {
3475 pub fn rc_mav_set_callback(
3476 msg_id: ::std::os::raw::c_int,
3477 func: ::std::option::Option<unsafe extern "C" fn()>,
3478 ) -> ::std::os::raw::c_int;
3479}
3480extern "C" {
3481 pub fn rc_mav_set_callback_all(func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int;
3482}
3483extern "C" {
3484 pub fn rc_mav_set_callback_connection_lost(
3485 func: ::std::option::Option<unsafe extern "C" fn()>,
3486 ) -> ::std::os::raw::c_int;
3487}
3488extern "C" {
3489 pub fn rc_mav_get_connection_state() -> rc_mav_connection_state_t;
3490}
3491extern "C" {
3492 pub fn rc_mav_get_sys_id_of_last_msg(msg_id: ::std::os::raw::c_int) -> u8;
3493}
3494extern "C" {
3495 pub fn rc_mav_get_sys_id_of_last_msg_any() -> u8;
3496}
3497extern "C" {
3498 pub fn rc_mav_ns_since_last_msg(msg_id: ::std::os::raw::c_int) -> i64;
3499}
3500extern "C" {
3501 pub fn rc_mav_ns_since_last_msg_any() -> i64;
3502}
3503extern "C" {
3504 pub fn rc_mav_msg_id_of_last_msg() -> ::std::os::raw::c_int;
3505}
3506extern "C" {
3507 pub fn rc_mav_print_msg_name(msg_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3508}
3509pub const MODEL_UNKNOWN: rc_model_t = 0;
3510pub const MODEL_BB_BLACK: rc_model_t = 1;
3511pub const MODEL_BB_BLACK_RC: rc_model_t = 2;
3512pub const MODEL_BB_BLACK_W: rc_model_t = 3;
3513pub const MODEL_BB_BLACK_W_RC: rc_model_t = 4;
3514pub const MODEL_BB_GREEN: rc_model_t = 5;
3515pub const MODEL_BB_GREEN_W: rc_model_t = 6;
3516pub const MODEL_BB_BLUE: rc_model_t = 7;
3517pub const MODEL_BB_POCKET: rc_model_t = 8;
3518pub const MODEL_RPI_B: rc_model_t = 9;
3519pub const MODEL_RPI_B_PLUS: rc_model_t = 10;
3520pub const MODEL_RPI2_B: rc_model_t = 11;
3521pub const MODEL_RPI3_B: rc_model_t = 12;
3522pub const MODEL_RPI3_B_PLUS: rc_model_t = 13;
3523pub const MODEL_RPI0: rc_model_t = 14;
3524pub const MODEL_RPI0_W: rc_model_t = 15;
3525pub const MODEL_RPI_CM: rc_model_t = 16;
3526pub const MODEL_RPI_CM3: rc_model_t = 17;
3527pub const MODEL_PC: rc_model_t = 18;
3528pub type rc_model_t = ::std::os::raw::c_uint;
3529pub const CATEGORY_UNKNOWN: rc_model_category_t = 0;
3530pub const CATEGORY_BEAGLEBONE: rc_model_category_t = 1;
3531pub const CATEGORY_RPI: rc_model_category_t = 2;
3532pub const CATEGORY_PC: rc_model_category_t = 3;
3533pub type rc_model_category_t = ::std::os::raw::c_uint;
3534extern "C" {
3535 pub fn rc_model() -> rc_model_t;
3536}
3537extern "C" {
3538 pub fn rc_model_category() -> rc_model_category_t;
3539}
3540extern "C" {
3541 pub fn rc_model_print();
3542}
3543extern "C" {
3544 pub fn rc_model_category_print();
3545}
3546extern "C" {
3547 pub fn rc_motor_init() -> ::std::os::raw::c_int;
3548}
3549extern "C" {
3550 pub fn rc_motor_init_freq(pwm_frequency_hz: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3551}
3552extern "C" {
3553 pub fn rc_motor_cleanup() -> ::std::os::raw::c_int;
3554}
3555extern "C" {
3556 pub fn rc_motor_standby(standby_en: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3557}
3558extern "C" {
3559 pub fn rc_motor_set(ch: ::std::os::raw::c_int, duty: f64) -> ::std::os::raw::c_int;
3560}
3561extern "C" {
3562 pub fn rc_motor_free_spin(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3563}
3564extern "C" {
3565 pub fn rc_motor_brake(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
3566}
3567pub type time_t = ::std::os::raw::c_longlong;
3568#[repr(C)]
3569#[derive(Debug, Default, Copy, Clone)]
3570pub struct timespec {
3571 pub tv_sec: time_t,
3572 pub tv_nsec: ::std::os::raw::c_long,
3573 pub _bitfield_align_1: [u8; 0],
3574 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
3575}
3576#[test]
3577fn bindgen_test_layout_timespec() {
3578 const UNINIT: ::std::mem::MaybeUninit<timespec> = ::std::mem::MaybeUninit::uninit();
3579 let ptr = UNINIT.as_ptr();
3580 assert_eq!(
3581 ::std::mem::size_of::<timespec>(),
3582 16usize,
3583 concat!("Size of: ", stringify!(timespec))
3584 );
3585 assert_eq!(
3586 ::std::mem::align_of::<timespec>(),
3587 8usize,
3588 concat!("Alignment of ", stringify!(timespec))
3589 );
3590 assert_eq!(
3591 unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
3592 0usize,
3593 concat!("Offset of field: ", stringify!(timespec), "::", stringify!(tv_sec))
3594 );
3595 assert_eq!(
3596 unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize },
3597 8usize,
3598 concat!("Offset of field: ", stringify!(timespec), "::", stringify!(tv_nsec))
3599 );
3600}
3601impl timespec {
3602 #[inline]
3603 pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 4usize]> {
3604 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
3605 __bindgen_bitfield_unit
3606 }
3607}
3608#[repr(C)]
3609#[derive(Debug, Copy, Clone)]
3610pub struct __pthread {
3611 _unused: [u8; 0],
3612}
3613pub type pthread_t = *mut __pthread;
3614pub const ACCEL_FSR_2G: rc_mpu_accel_fsr_t = 0;
3615pub const ACCEL_FSR_4G: rc_mpu_accel_fsr_t = 1;
3616pub const ACCEL_FSR_8G: rc_mpu_accel_fsr_t = 2;
3617pub const ACCEL_FSR_16G: rc_mpu_accel_fsr_t = 3;
3618pub type rc_mpu_accel_fsr_t = ::std::os::raw::c_uint;
3619pub const GYRO_FSR_250DPS: rc_mpu_gyro_fsr_t = 0;
3620pub const GYRO_FSR_500DPS: rc_mpu_gyro_fsr_t = 1;
3621pub const GYRO_FSR_1000DPS: rc_mpu_gyro_fsr_t = 2;
3622pub const GYRO_FSR_2000DPS: rc_mpu_gyro_fsr_t = 3;
3623pub type rc_mpu_gyro_fsr_t = ::std::os::raw::c_uint;
3624pub const ACCEL_DLPF_OFF: rc_mpu_accel_dlpf_t = 0;
3625pub const ACCEL_DLPF_460: rc_mpu_accel_dlpf_t = 1;
3626pub const ACCEL_DLPF_184: rc_mpu_accel_dlpf_t = 2;
3627pub const ACCEL_DLPF_92: rc_mpu_accel_dlpf_t = 3;
3628pub const ACCEL_DLPF_41: rc_mpu_accel_dlpf_t = 4;
3629pub const ACCEL_DLPF_20: rc_mpu_accel_dlpf_t = 5;
3630pub const ACCEL_DLPF_10: rc_mpu_accel_dlpf_t = 6;
3631pub const ACCEL_DLPF_5: rc_mpu_accel_dlpf_t = 7;
3632pub type rc_mpu_accel_dlpf_t = ::std::os::raw::c_uint;
3633pub const GYRO_DLPF_OFF: rc_mpu_gyro_dlpf_t = 0;
3634pub const GYRO_DLPF_250: rc_mpu_gyro_dlpf_t = 1;
3635pub const GYRO_DLPF_184: rc_mpu_gyro_dlpf_t = 2;
3636pub const GYRO_DLPF_92: rc_mpu_gyro_dlpf_t = 3;
3637pub const GYRO_DLPF_41: rc_mpu_gyro_dlpf_t = 4;
3638pub const GYRO_DLPF_20: rc_mpu_gyro_dlpf_t = 5;
3639pub const GYRO_DLPF_10: rc_mpu_gyro_dlpf_t = 6;
3640pub const GYRO_DLPF_5: rc_mpu_gyro_dlpf_t = 7;
3641pub type rc_mpu_gyro_dlpf_t = ::std::os::raw::c_uint;
3642pub const ORIENTATION_Z_UP: rc_mpu_orientation_t = 136;
3643pub const ORIENTATION_Z_DOWN: rc_mpu_orientation_t = 396;
3644pub const ORIENTATION_X_UP: rc_mpu_orientation_t = 14;
3645pub const ORIENTATION_X_DOWN: rc_mpu_orientation_t = 266;
3646pub const ORIENTATION_Y_UP: rc_mpu_orientation_t = 112;
3647pub const ORIENTATION_Y_DOWN: rc_mpu_orientation_t = 336;
3648pub const ORIENTATION_X_FORWARD: rc_mpu_orientation_t = 133;
3649pub const ORIENTATION_X_BACK: rc_mpu_orientation_t = 161;
3650pub type rc_mpu_orientation_t = ::std::os::raw::c_uint;
3651#[repr(C)]
3652#[derive(Debug, Copy, Clone)]
3653pub struct rc_mpu_config_t {
3654 pub gpio_interrupt_pin_chip: ::std::os::raw::c_int,
3655 pub gpio_interrupt_pin: ::std::os::raw::c_int,
3656 pub i2c_bus: ::std::os::raw::c_int,
3657 pub i2c_addr: u8,
3658 pub show_warnings: ::std::os::raw::c_int,
3659 pub accel_fsr: rc_mpu_accel_fsr_t,
3660 pub gyro_fsr: rc_mpu_gyro_fsr_t,
3661 pub accel_dlpf: rc_mpu_accel_dlpf_t,
3662 pub gyro_dlpf: rc_mpu_gyro_dlpf_t,
3663 pub enable_magnetometer: ::std::os::raw::c_int,
3664 pub dmp_sample_rate: ::std::os::raw::c_int,
3665 pub dmp_fetch_accel_gyro: ::std::os::raw::c_int,
3666 pub dmp_auto_calibrate_gyro: ::std::os::raw::c_int,
3667 pub orient: rc_mpu_orientation_t,
3668 pub compass_time_constant: f64,
3669 pub dmp_interrupt_sched_policy: ::std::os::raw::c_int,
3670 pub dmp_interrupt_priority: ::std::os::raw::c_int,
3671 pub read_mag_after_callback: ::std::os::raw::c_int,
3672 pub mag_sample_rate_div: ::std::os::raw::c_int,
3673 pub tap_threshold: ::std::os::raw::c_int,
3674}
3675#[test]
3676fn bindgen_test_layout_rc_mpu_config_t() {
3677 const UNINIT: ::std::mem::MaybeUninit<rc_mpu_config_t> = ::std::mem::MaybeUninit::uninit();
3678 let ptr = UNINIT.as_ptr();
3679 assert_eq!(
3680 ::std::mem::size_of::<rc_mpu_config_t>(),
3681 88usize,
3682 concat!("Size of: ", stringify!(rc_mpu_config_t))
3683 );
3684 assert_eq!(
3685 ::std::mem::align_of::<rc_mpu_config_t>(),
3686 8usize,
3687 concat!("Alignment of ", stringify!(rc_mpu_config_t))
3688 );
3689 assert_eq!(
3690 unsafe { ::std::ptr::addr_of!((*ptr).gpio_interrupt_pin_chip) as usize - ptr as usize },
3691 0usize,
3692 concat!(
3693 "Offset of field: ",
3694 stringify!(rc_mpu_config_t),
3695 "::",
3696 stringify!(gpio_interrupt_pin_chip)
3697 )
3698 );
3699 assert_eq!(
3700 unsafe { ::std::ptr::addr_of!((*ptr).gpio_interrupt_pin) as usize - ptr as usize },
3701 4usize,
3702 concat!(
3703 "Offset of field: ",
3704 stringify!(rc_mpu_config_t),
3705 "::",
3706 stringify!(gpio_interrupt_pin)
3707 )
3708 );
3709 assert_eq!(
3710 unsafe { ::std::ptr::addr_of!((*ptr).i2c_bus) as usize - ptr as usize },
3711 8usize,
3712 concat!(
3713 "Offset of field: ",
3714 stringify!(rc_mpu_config_t),
3715 "::",
3716 stringify!(i2c_bus)
3717 )
3718 );
3719 assert_eq!(
3720 unsafe { ::std::ptr::addr_of!((*ptr).i2c_addr) as usize - ptr as usize },
3721 12usize,
3722 concat!(
3723 "Offset of field: ",
3724 stringify!(rc_mpu_config_t),
3725 "::",
3726 stringify!(i2c_addr)
3727 )
3728 );
3729 assert_eq!(
3730 unsafe { ::std::ptr::addr_of!((*ptr).show_warnings) as usize - ptr as usize },
3731 16usize,
3732 concat!(
3733 "Offset of field: ",
3734 stringify!(rc_mpu_config_t),
3735 "::",
3736 stringify!(show_warnings)
3737 )
3738 );
3739 assert_eq!(
3740 unsafe { ::std::ptr::addr_of!((*ptr).accel_fsr) as usize - ptr as usize },
3741 20usize,
3742 concat!(
3743 "Offset of field: ",
3744 stringify!(rc_mpu_config_t),
3745 "::",
3746 stringify!(accel_fsr)
3747 )
3748 );
3749 assert_eq!(
3750 unsafe { ::std::ptr::addr_of!((*ptr).gyro_fsr) as usize - ptr as usize },
3751 24usize,
3752 concat!(
3753 "Offset of field: ",
3754 stringify!(rc_mpu_config_t),
3755 "::",
3756 stringify!(gyro_fsr)
3757 )
3758 );
3759 assert_eq!(
3760 unsafe { ::std::ptr::addr_of!((*ptr).accel_dlpf) as usize - ptr as usize },
3761 28usize,
3762 concat!(
3763 "Offset of field: ",
3764 stringify!(rc_mpu_config_t),
3765 "::",
3766 stringify!(accel_dlpf)
3767 )
3768 );
3769 assert_eq!(
3770 unsafe { ::std::ptr::addr_of!((*ptr).gyro_dlpf) as usize - ptr as usize },
3771 32usize,
3772 concat!(
3773 "Offset of field: ",
3774 stringify!(rc_mpu_config_t),
3775 "::",
3776 stringify!(gyro_dlpf)
3777 )
3778 );
3779 assert_eq!(
3780 unsafe { ::std::ptr::addr_of!((*ptr).enable_magnetometer) as usize - ptr as usize },
3781 36usize,
3782 concat!(
3783 "Offset of field: ",
3784 stringify!(rc_mpu_config_t),
3785 "::",
3786 stringify!(enable_magnetometer)
3787 )
3788 );
3789 assert_eq!(
3790 unsafe { ::std::ptr::addr_of!((*ptr).dmp_sample_rate) as usize - ptr as usize },
3791 40usize,
3792 concat!(
3793 "Offset of field: ",
3794 stringify!(rc_mpu_config_t),
3795 "::",
3796 stringify!(dmp_sample_rate)
3797 )
3798 );
3799 assert_eq!(
3800 unsafe { ::std::ptr::addr_of!((*ptr).dmp_fetch_accel_gyro) as usize - ptr as usize },
3801 44usize,
3802 concat!(
3803 "Offset of field: ",
3804 stringify!(rc_mpu_config_t),
3805 "::",
3806 stringify!(dmp_fetch_accel_gyro)
3807 )
3808 );
3809 assert_eq!(
3810 unsafe { ::std::ptr::addr_of!((*ptr).dmp_auto_calibrate_gyro) as usize - ptr as usize },
3811 48usize,
3812 concat!(
3813 "Offset of field: ",
3814 stringify!(rc_mpu_config_t),
3815 "::",
3816 stringify!(dmp_auto_calibrate_gyro)
3817 )
3818 );
3819 assert_eq!(
3820 unsafe { ::std::ptr::addr_of!((*ptr).orient) as usize - ptr as usize },
3821 52usize,
3822 concat!(
3823 "Offset of field: ",
3824 stringify!(rc_mpu_config_t),
3825 "::",
3826 stringify!(orient)
3827 )
3828 );
3829 assert_eq!(
3830 unsafe { ::std::ptr::addr_of!((*ptr).compass_time_constant) as usize - ptr as usize },
3831 56usize,
3832 concat!(
3833 "Offset of field: ",
3834 stringify!(rc_mpu_config_t),
3835 "::",
3836 stringify!(compass_time_constant)
3837 )
3838 );
3839 assert_eq!(
3840 unsafe { ::std::ptr::addr_of!((*ptr).dmp_interrupt_sched_policy) as usize - ptr as usize },
3841 64usize,
3842 concat!(
3843 "Offset of field: ",
3844 stringify!(rc_mpu_config_t),
3845 "::",
3846 stringify!(dmp_interrupt_sched_policy)
3847 )
3848 );
3849 assert_eq!(
3850 unsafe { ::std::ptr::addr_of!((*ptr).dmp_interrupt_priority) as usize - ptr as usize },
3851 68usize,
3852 concat!(
3853 "Offset of field: ",
3854 stringify!(rc_mpu_config_t),
3855 "::",
3856 stringify!(dmp_interrupt_priority)
3857 )
3858 );
3859 assert_eq!(
3860 unsafe { ::std::ptr::addr_of!((*ptr).read_mag_after_callback) as usize - ptr as usize },
3861 72usize,
3862 concat!(
3863 "Offset of field: ",
3864 stringify!(rc_mpu_config_t),
3865 "::",
3866 stringify!(read_mag_after_callback)
3867 )
3868 );
3869 assert_eq!(
3870 unsafe { ::std::ptr::addr_of!((*ptr).mag_sample_rate_div) as usize - ptr as usize },
3871 76usize,
3872 concat!(
3873 "Offset of field: ",
3874 stringify!(rc_mpu_config_t),
3875 "::",
3876 stringify!(mag_sample_rate_div)
3877 )
3878 );
3879 assert_eq!(
3880 unsafe { ::std::ptr::addr_of!((*ptr).tap_threshold) as usize - ptr as usize },
3881 80usize,
3882 concat!(
3883 "Offset of field: ",
3884 stringify!(rc_mpu_config_t),
3885 "::",
3886 stringify!(tap_threshold)
3887 )
3888 );
3889}
3890impl Default for rc_mpu_config_t {
3891 fn default() -> Self {
3892 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
3893 unsafe {
3894 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3895 s.assume_init()
3896 }
3897 }
3898}
3899#[repr(C)]
3900#[derive(Debug, Default, Copy, Clone)]
3901pub struct rc_mpu_data_t {
3902 pub accel: [f64; 3usize],
3903 pub gyro: [f64; 3usize],
3904 pub mag: [f64; 3usize],
3905 pub temp: f64,
3906 pub raw_gyro: [i16; 3usize],
3907 pub raw_accel: [i16; 3usize],
3908 pub accel_to_ms2: f64,
3909 pub gyro_to_degs: f64,
3910 pub dmp_quat: [f64; 4usize],
3911 pub dmp_TaitBryan: [f64; 3usize],
3912 pub tap_detected: ::std::os::raw::c_int,
3913 pub last_tap_direction: ::std::os::raw::c_int,
3914 pub last_tap_count: ::std::os::raw::c_int,
3915 pub fused_quat: [f64; 4usize],
3916 pub fused_TaitBryan: [f64; 3usize],
3917 pub compass_heading: f64,
3918 pub compass_heading_raw: f64,
3919}
3920#[test]
3921fn bindgen_test_layout_rc_mpu_data_t() {
3922 const UNINIT: ::std::mem::MaybeUninit<rc_mpu_data_t> = ::std::mem::MaybeUninit::uninit();
3923 let ptr = UNINIT.as_ptr();
3924 assert_eq!(
3925 ::std::mem::size_of::<rc_mpu_data_t>(),
3926 256usize,
3927 concat!("Size of: ", stringify!(rc_mpu_data_t))
3928 );
3929 assert_eq!(
3930 ::std::mem::align_of::<rc_mpu_data_t>(),
3931 8usize,
3932 concat!("Alignment of ", stringify!(rc_mpu_data_t))
3933 );
3934 assert_eq!(
3935 unsafe { ::std::ptr::addr_of!((*ptr).accel) as usize - ptr as usize },
3936 0usize,
3937 concat!("Offset of field: ", stringify!(rc_mpu_data_t), "::", stringify!(accel))
3938 );
3939 assert_eq!(
3940 unsafe { ::std::ptr::addr_of!((*ptr).gyro) as usize - ptr as usize },
3941 24usize,
3942 concat!("Offset of field: ", stringify!(rc_mpu_data_t), "::", stringify!(gyro))
3943 );
3944 assert_eq!(
3945 unsafe { ::std::ptr::addr_of!((*ptr).mag) as usize - ptr as usize },
3946 48usize,
3947 concat!("Offset of field: ", stringify!(rc_mpu_data_t), "::", stringify!(mag))
3948 );
3949 assert_eq!(
3950 unsafe { ::std::ptr::addr_of!((*ptr).temp) as usize - ptr as usize },
3951 72usize,
3952 concat!("Offset of field: ", stringify!(rc_mpu_data_t), "::", stringify!(temp))
3953 );
3954 assert_eq!(
3955 unsafe { ::std::ptr::addr_of!((*ptr).raw_gyro) as usize - ptr as usize },
3956 80usize,
3957 concat!(
3958 "Offset of field: ",
3959 stringify!(rc_mpu_data_t),
3960 "::",
3961 stringify!(raw_gyro)
3962 )
3963 );
3964 assert_eq!(
3965 unsafe { ::std::ptr::addr_of!((*ptr).raw_accel) as usize - ptr as usize },
3966 86usize,
3967 concat!(
3968 "Offset of field: ",
3969 stringify!(rc_mpu_data_t),
3970 "::",
3971 stringify!(raw_accel)
3972 )
3973 );
3974 assert_eq!(
3975 unsafe { ::std::ptr::addr_of!((*ptr).accel_to_ms2) as usize - ptr as usize },
3976 96usize,
3977 concat!(
3978 "Offset of field: ",
3979 stringify!(rc_mpu_data_t),
3980 "::",
3981 stringify!(accel_to_ms2)
3982 )
3983 );
3984 assert_eq!(
3985 unsafe { ::std::ptr::addr_of!((*ptr).gyro_to_degs) as usize - ptr as usize },
3986 104usize,
3987 concat!(
3988 "Offset of field: ",
3989 stringify!(rc_mpu_data_t),
3990 "::",
3991 stringify!(gyro_to_degs)
3992 )
3993 );
3994 assert_eq!(
3995 unsafe { ::std::ptr::addr_of!((*ptr).dmp_quat) as usize - ptr as usize },
3996 112usize,
3997 concat!(
3998 "Offset of field: ",
3999 stringify!(rc_mpu_data_t),
4000 "::",
4001 stringify!(dmp_quat)
4002 )
4003 );
4004 assert_eq!(
4005 unsafe { ::std::ptr::addr_of!((*ptr).dmp_TaitBryan) as usize - ptr as usize },
4006 144usize,
4007 concat!(
4008 "Offset of field: ",
4009 stringify!(rc_mpu_data_t),
4010 "::",
4011 stringify!(dmp_TaitBryan)
4012 )
4013 );
4014 assert_eq!(
4015 unsafe { ::std::ptr::addr_of!((*ptr).tap_detected) as usize - ptr as usize },
4016 168usize,
4017 concat!(
4018 "Offset of field: ",
4019 stringify!(rc_mpu_data_t),
4020 "::",
4021 stringify!(tap_detected)
4022 )
4023 );
4024 assert_eq!(
4025 unsafe { ::std::ptr::addr_of!((*ptr).last_tap_direction) as usize - ptr as usize },
4026 172usize,
4027 concat!(
4028 "Offset of field: ",
4029 stringify!(rc_mpu_data_t),
4030 "::",
4031 stringify!(last_tap_direction)
4032 )
4033 );
4034 assert_eq!(
4035 unsafe { ::std::ptr::addr_of!((*ptr).last_tap_count) as usize - ptr as usize },
4036 176usize,
4037 concat!(
4038 "Offset of field: ",
4039 stringify!(rc_mpu_data_t),
4040 "::",
4041 stringify!(last_tap_count)
4042 )
4043 );
4044 assert_eq!(
4045 unsafe { ::std::ptr::addr_of!((*ptr).fused_quat) as usize - ptr as usize },
4046 184usize,
4047 concat!(
4048 "Offset of field: ",
4049 stringify!(rc_mpu_data_t),
4050 "::",
4051 stringify!(fused_quat)
4052 )
4053 );
4054 assert_eq!(
4055 unsafe { ::std::ptr::addr_of!((*ptr).fused_TaitBryan) as usize - ptr as usize },
4056 216usize,
4057 concat!(
4058 "Offset of field: ",
4059 stringify!(rc_mpu_data_t),
4060 "::",
4061 stringify!(fused_TaitBryan)
4062 )
4063 );
4064 assert_eq!(
4065 unsafe { ::std::ptr::addr_of!((*ptr).compass_heading) as usize - ptr as usize },
4066 240usize,
4067 concat!(
4068 "Offset of field: ",
4069 stringify!(rc_mpu_data_t),
4070 "::",
4071 stringify!(compass_heading)
4072 )
4073 );
4074 assert_eq!(
4075 unsafe { ::std::ptr::addr_of!((*ptr).compass_heading_raw) as usize - ptr as usize },
4076 248usize,
4077 concat!(
4078 "Offset of field: ",
4079 stringify!(rc_mpu_data_t),
4080 "::",
4081 stringify!(compass_heading_raw)
4082 )
4083 );
4084}
4085extern "C" {
4086 pub fn rc_mpu_default_config() -> rc_mpu_config_t;
4087}
4088extern "C" {
4089 pub fn rc_mpu_set_config_to_default(conf: *mut rc_mpu_config_t) -> ::std::os::raw::c_int;
4090}
4091extern "C" {
4092 pub fn rc_mpu_power_off() -> ::std::os::raw::c_int;
4093}
4094extern "C" {
4095 pub fn rc_mpu_initialize(data: *mut rc_mpu_data_t, conf: rc_mpu_config_t) -> ::std::os::raw::c_int;
4096}
4097extern "C" {
4098 pub fn rc_mpu_read_accel(data: *mut rc_mpu_data_t) -> ::std::os::raw::c_int;
4099}
4100extern "C" {
4101 pub fn rc_mpu_read_gyro(data: *mut rc_mpu_data_t) -> ::std::os::raw::c_int;
4102}
4103extern "C" {
4104 pub fn rc_mpu_read_temp(data: *mut rc_mpu_data_t) -> ::std::os::raw::c_int;
4105}
4106extern "C" {
4107 pub fn rc_mpu_read_mag(data: *mut rc_mpu_data_t) -> ::std::os::raw::c_int;
4108}
4109extern "C" {
4110 pub fn rc_mpu_initialize_dmp(data: *mut rc_mpu_data_t, conf: rc_mpu_config_t) -> ::std::os::raw::c_int;
4111}
4112extern "C" {
4113 pub fn rc_mpu_set_dmp_callback(func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int;
4114}
4115extern "C" {
4116 pub fn rc_mpu_block_until_dmp_data() -> ::std::os::raw::c_int;
4117}
4118extern "C" {
4119 pub fn rc_mpu_nanos_since_last_dmp_interrupt() -> i64;
4120}
4121extern "C" {
4122 pub fn rc_mpu_set_tap_callback(
4123 func: ::std::option::Option<
4124 unsafe extern "C" fn(direction: ::std::os::raw::c_int, counter: ::std::os::raw::c_int),
4125 >,
4126 ) -> ::std::os::raw::c_int;
4127}
4128extern "C" {
4129 pub fn rc_mpu_block_until_tap() -> ::std::os::raw::c_int;
4130}
4131extern "C" {
4132 pub fn rc_mpu_nanos_since_last_tap() -> i64;
4133}
4134extern "C" {
4135 pub fn rc_mpu_calibrate_gyro_routine(conf: rc_mpu_config_t) -> ::std::os::raw::c_int;
4136}
4137extern "C" {
4138 pub fn rc_mpu_calibrate_mag_routine(conf: rc_mpu_config_t) -> ::std::os::raw::c_int;
4139}
4140extern "C" {
4141 pub fn rc_mpu_calibrate_accel_routine(conf: rc_mpu_config_t) -> ::std::os::raw::c_int;
4142}
4143extern "C" {
4144 pub fn rc_mpu_is_gyro_calibrated() -> ::std::os::raw::c_int;
4145}
4146extern "C" {
4147 pub fn rc_mpu_is_mag_calibrated() -> ::std::os::raw::c_int;
4148}
4149extern "C" {
4150 pub fn rc_mpu_is_accel_calibrated() -> ::std::os::raw::c_int;
4151}
4152pub const PINMUX_GPIO: rc_pinmux_mode_t = 0;
4153pub const PINMUX_GPIO_PU: rc_pinmux_mode_t = 1;
4154pub const PINMUX_GPIO_PD: rc_pinmux_mode_t = 2;
4155pub const PINMUX_PWM: rc_pinmux_mode_t = 3;
4156pub const PINMUX_SPI: rc_pinmux_mode_t = 4;
4157pub const PINMUX_UART: rc_pinmux_mode_t = 5;
4158pub const PINMUX_CAN: rc_pinmux_mode_t = 6;
4159pub type rc_pinmux_mode_t = ::std::os::raw::c_uint;
4160extern "C" {
4161 pub fn rc_pinmux_set(pin: ::std::os::raw::c_int, mode: rc_pinmux_mode_t) -> ::std::os::raw::c_int;
4162}
4163extern "C" {
4164 pub fn rc_pinmux_set_default() -> ::std::os::raw::c_int;
4165}
4166extern "C" {
4167 pub fn rc_pru_start(ch: ::std::os::raw::c_int, fw_name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
4168}
4169extern "C" {
4170 pub fn rc_pru_shared_mem_ptr() -> *mut u32;
4171}
4172extern "C" {
4173 pub fn rc_pru_stop(ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4174}
4175extern "C" {
4176 pub fn rc_pthread_create(
4177 thread: *mut pthread_t,
4178 func: ::std::option::Option<
4179 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
4180 >,
4181 arg: *mut ::std::os::raw::c_void,
4182 policy: ::std::os::raw::c_int,
4183 priority: ::std::os::raw::c_int,
4184 ) -> ::std::os::raw::c_int;
4185}
4186extern "C" {
4187 pub fn rc_pthread_timed_join(
4188 thread: pthread_t,
4189 retval: *mut *mut ::std::os::raw::c_void,
4190 timeout_sec: f32,
4191 ) -> ::std::os::raw::c_int;
4192}
4193extern "C" {
4194 pub fn rc_pthread_print_properties(thread: pthread_t) -> ::std::os::raw::c_int;
4195}
4196extern "C" {
4197 pub fn rc_pthread_set_properties_self(
4198 policy: ::std::os::raw::c_int,
4199 priority: ::std::os::raw::c_int,
4200 ) -> ::std::os::raw::c_int;
4201}
4202extern "C" {
4203 pub fn rc_pthread_get_process_niceness() -> ::std::os::raw::c_int;
4204}
4205extern "C" {
4206 pub fn rc_pthread_set_process_niceness(niceness: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4207}
4208extern "C" {
4209 pub fn rc_pwm_init(ss: ::std::os::raw::c_int, frequency: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4210}
4211extern "C" {
4212 pub fn rc_pwm_cleanup(ss: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4213}
4214extern "C" {
4215 pub fn rc_pwm_set_duty(ss: ::std::os::raw::c_int, ch: ::std::os::raw::c_char, duty: f64) -> ::std::os::raw::c_int;
4216}
4217extern "C" {
4218 pub fn rc_pwm_set_duty_ns(
4219 ss: ::std::os::raw::c_int,
4220 ch: ::std::os::raw::c_char,
4221 duty_ns: ::std::os::raw::c_uint,
4222 ) -> ::std::os::raw::c_int;
4223}
4224extern "C" {
4225 pub fn rc_servo_init() -> ::std::os::raw::c_int;
4226}
4227extern "C" {
4228 pub fn rc_servo_cleanup();
4229}
4230extern "C" {
4231 pub fn rc_servo_power_rail_en(en: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4232}
4233extern "C" {
4234 pub fn rc_servo_set_esc_range(min: ::std::os::raw::c_int, max: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4235}
4236extern "C" {
4237 pub fn rc_servo_send_pulse_us(ch: ::std::os::raw::c_int, us: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4238}
4239extern "C" {
4240 pub fn rc_servo_send_pulse_normalized(ch: ::std::os::raw::c_int, input: f64) -> ::std::os::raw::c_int;
4241}
4242extern "C" {
4243 pub fn rc_servo_send_esc_pulse_normalized(ch: ::std::os::raw::c_int, input: f64) -> ::std::os::raw::c_int;
4244}
4245extern "C" {
4246 pub fn rc_servo_send_oneshot_pulse_normalized(ch: ::std::os::raw::c_int, input: f64) -> ::std::os::raw::c_int;
4247}
4248extern "C" {
4249 pub fn rc_spi_init_auto_slave(
4250 bus: ::std::os::raw::c_int,
4251 slave: ::std::os::raw::c_int,
4252 bus_mode: ::std::os::raw::c_int,
4253 speed_hz: ::std::os::raw::c_int,
4254 ) -> ::std::os::raw::c_int;
4255}
4256extern "C" {
4257 pub fn rc_spi_init_manual_slave(
4258 bus: ::std::os::raw::c_int,
4259 slave: ::std::os::raw::c_int,
4260 bus_mode: ::std::os::raw::c_int,
4261 speed_hz: ::std::os::raw::c_int,
4262 chip: ::std::os::raw::c_int,
4263 pin: ::std::os::raw::c_int,
4264 ) -> ::std::os::raw::c_int;
4265}
4266extern "C" {
4267 pub fn rc_spi_get_fd(bus: ::std::os::raw::c_int, slave: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4268}
4269extern "C" {
4270 pub fn rc_spi_close(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4271}
4272extern "C" {
4273 pub fn rc_spi_manual_select(
4274 bus: ::std::os::raw::c_int,
4275 slave: ::std::os::raw::c_int,
4276 select: ::std::os::raw::c_int,
4277 ) -> ::std::os::raw::c_int;
4278}
4279extern "C" {
4280 pub fn rc_spi_transfer(
4281 bus: ::std::os::raw::c_int,
4282 slave: ::std::os::raw::c_int,
4283 tx_data: *mut u8,
4284 tx_bytes: usize,
4285 rx_data: *mut u8,
4286 ) -> ::std::os::raw::c_int;
4287}
4288extern "C" {
4289 pub fn rc_spi_write(
4290 bus: ::std::os::raw::c_int,
4291 slave: ::std::os::raw::c_int,
4292 data: *mut u8,
4293 bytes: usize,
4294 ) -> ::std::os::raw::c_int;
4295}
4296extern "C" {
4297 pub fn rc_spi_read(
4298 bus: ::std::os::raw::c_int,
4299 slave: ::std::os::raw::c_int,
4300 data: *mut u8,
4301 bytes: usize,
4302 ) -> ::std::os::raw::c_int;
4303}
4304pub const UNINITIALIZED: rc_state_t = 0;
4305pub const RUNNING: rc_state_t = 1;
4306pub const PAUSED: rc_state_t = 2;
4307pub const EXITING: rc_state_t = 3;
4308pub type rc_state_t = ::std::os::raw::c_uint;
4309extern "C" {
4310 pub fn rc_get_state() -> rc_state_t;
4311}
4312extern "C" {
4313 pub fn rc_set_state(new_state: rc_state_t);
4314}
4315extern "C" {
4316 pub fn rc_print_state() -> ::std::os::raw::c_int;
4317}
4318extern "C" {
4319 pub fn rc_make_pid_file() -> ::std::os::raw::c_int;
4320}
4321extern "C" {
4322 pub fn rc_kill_existing_process(timeout_s: f32) -> ::std::os::raw::c_int;
4323}
4324extern "C" {
4325 pub fn rc_remove_pid_file() -> ::std::os::raw::c_int;
4326}
4327extern "C" {
4328 pub fn rc_enable_signal_handler() -> ::std::os::raw::c_int;
4329}
4330extern "C" {
4331 pub fn rc_disable_signal_handler() -> ::std::os::raw::c_int;
4332}
4333pub type suseconds_t = ::std::os::raw::c_longlong;
4334#[repr(C)]
4335#[derive(Debug, Default, Copy, Clone)]
4336pub struct timeval {
4337 pub tv_sec: time_t,
4338 pub tv_usec: suseconds_t,
4339}
4340#[test]
4341fn bindgen_test_layout_timeval() {
4342 const UNINIT: ::std::mem::MaybeUninit<timeval> = ::std::mem::MaybeUninit::uninit();
4343 let ptr = UNINIT.as_ptr();
4344 assert_eq!(
4345 ::std::mem::size_of::<timeval>(),
4346 16usize,
4347 concat!("Size of: ", stringify!(timeval))
4348 );
4349 assert_eq!(
4350 ::std::mem::align_of::<timeval>(),
4351 8usize,
4352 concat!("Alignment of ", stringify!(timeval))
4353 );
4354 assert_eq!(
4355 unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
4356 0usize,
4357 concat!("Offset of field: ", stringify!(timeval), "::", stringify!(tv_sec))
4358 );
4359 assert_eq!(
4360 unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize },
4361 8usize,
4362 concat!("Offset of field: ", stringify!(timeval), "::", stringify!(tv_usec))
4363 );
4364}
4365extern "C" {
4366 pub fn rc_nanosleep(ns: u64);
4367}
4368extern "C" {
4369 pub fn rc_usleep(us: ::std::os::raw::c_uint);
4370}
4371extern "C" {
4372 pub fn rc_nanos_since_epoch() -> u64;
4373}
4374extern "C" {
4375 pub fn rc_nanos_since_boot() -> u64;
4376}
4377extern "C" {
4378 pub fn rc_nanos_thread_time() -> u64;
4379}
4380extern "C" {
4381 pub fn rc_timespec_to_micros(ts: timespec) -> u64;
4382}
4383extern "C" {
4384 pub fn rc_timespec_to_millis(ts: timespec) -> u64;
4385}
4386extern "C" {
4387 pub fn rc_timeval_to_micros(tv: timeval) -> u64;
4388}
4389extern "C" {
4390 pub fn rc_timeval_to_millis(tv: timeval) -> u64;
4391}
4392extern "C" {
4393 pub fn rc_timespec_diff(A: timespec, B: timespec) -> timespec;
4394}
4395extern "C" {
4396 pub fn rc_timespec_add(start: *mut timespec, seconds: f64);
4397}
4398extern "C" {
4399 pub fn rc_uart_init(
4400 bus: ::std::os::raw::c_int,
4401 baudrate: ::std::os::raw::c_int,
4402 timeout: f32,
4403 canonical_en: ::std::os::raw::c_int,
4404 stop_bits: ::std::os::raw::c_int,
4405 parity_en: ::std::os::raw::c_int,
4406 ) -> ::std::os::raw::c_int;
4407}
4408extern "C" {
4409 pub fn rc_uart_close(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4410}
4411extern "C" {
4412 pub fn rc_uart_get_fd(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4413}
4414extern "C" {
4415 pub fn rc_uart_flush(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4416}
4417extern "C" {
4418 pub fn rc_uart_write(bus: ::std::os::raw::c_int, data: *mut u8, bytes: usize) -> ::std::os::raw::c_int;
4419}
4420extern "C" {
4421 pub fn rc_uart_read_bytes(bus: ::std::os::raw::c_int, buf: *mut u8, bytes: usize) -> ::std::os::raw::c_int;
4422}
4423extern "C" {
4424 pub fn rc_uart_read_line(bus: ::std::os::raw::c_int, buf: *mut u8, max_bytes: usize) -> ::std::os::raw::c_int;
4425}
4426extern "C" {
4427 pub fn rc_uart_bytes_available(bus: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4428}
4429extern "C" {
4430 pub fn rc_version() -> ::std::os::raw::c_uint;
4431}
4432extern "C" {
4433 pub fn rc_version_string() -> *const ::std::os::raw::c_char;
4434}
4435extern "C" {
4436 pub fn rc_version_print();
4437}