1#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
4pub mod root {
5 #[repr(C)]
6 #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
7 pub struct __BindgenBitfieldUnit<Storage> {
8 storage: Storage,
9 }
10 impl<Storage> __BindgenBitfieldUnit<Storage> {
11 #[inline]
12 pub const fn new(storage: Storage) -> Self {
13 Self { storage }
14 }
15 }
16 impl<Storage> __BindgenBitfieldUnit<Storage>
17 where
18 Storage: AsRef<[u8]> + AsMut<[u8]>,
19 {
20 #[inline]
21 pub fn get_bit(&self, index: usize) -> bool {
22 debug_assert!(index / 8 < self.storage.as_ref().len());
23 let byte_index = index / 8;
24 let byte = self.storage.as_ref()[byte_index];
25 let bit_index = if cfg!(target_endian = "big") {
26 7 - (index % 8)
27 } else {
28 index % 8
29 };
30 let mask = 1 << bit_index;
31 byte & mask == mask
32 }
33 #[inline]
34 pub fn set_bit(&mut self, index: usize, val: bool) {
35 debug_assert!(index / 8 < self.storage.as_ref().len());
36 let byte_index = index / 8;
37 let byte = &mut self.storage.as_mut()[byte_index];
38 let bit_index = if cfg!(target_endian = "big") {
39 7 - (index % 8)
40 } else {
41 index % 8
42 };
43 let mask = 1 << bit_index;
44 if val {
45 *byte |= mask;
46 } else {
47 *byte &= !mask;
48 }
49 }
50 #[inline]
51 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
52 debug_assert!(bit_width <= 64);
53 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
54 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
55 let mut val = 0;
56 for i in 0..(bit_width as usize) {
57 if self.get_bit(i + bit_offset) {
58 let index = if cfg!(target_endian = "big") {
59 bit_width as usize - 1 - i
60 } else {
61 i
62 };
63 val |= 1 << index;
64 }
65 }
66 val
67 }
68 #[inline]
69 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
70 debug_assert!(bit_width <= 64);
71 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
72 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
73 for i in 0..(bit_width as usize) {
74 let mask = 1 << i;
75 let val_bit_is_set = val & mask == mask;
76 let index = if cfg!(target_endian = "big") {
77 bit_width as usize - 1 - i
78 } else {
79 i
80 };
81 self.set_bit(index + bit_offset, val_bit_is_set);
82 }
83 }
84 }
85 #[allow(unused_imports)]
86 use self::super::root;
87 pub const HAL_kInvalidHandle: u32 = 0;
88 pub const HAL_IO_CONFIG_DATA_SIZE: u32 = 32;
89 pub const HAL_SYS_STATUS_DATA_SIZE: u32 = 44;
90 pub const HAL_USER_STATUS_DATA_SIZE: u32 = 908;
91 pub const HAL_kMaxJoystickAxes: u32 = 12;
92 pub const HAL_kMaxJoystickPOVs: u32 = 12;
93 pub const HAL_kMaxJoysticks: u32 = 6;
94 pub type __uint8_t = ::std::os::raw::c_uchar;
95 pub type __int16_t = ::std::os::raw::c_short;
96 pub type __uint16_t = ::std::os::raw::c_ushort;
97 pub type __int32_t = ::std::os::raw::c_int;
98 pub type __uint32_t = ::std::os::raw::c_uint;
99 pub type __int64_t = ::std::os::raw::c_long;
100 pub type __uint64_t = ::std::os::raw::c_ulong;
101 pub type __intmax_t = ::std::os::raw::c_long;
102 pub type intmax_t = root::__intmax_t;
103 pub mod std {
104 #[allow(unused_imports)]
105 use self::super::super::root;
106 pub type size_t = ::std::os::raw::c_ulong;
107 #[repr(C)]
108 pub struct basic_string<_CharT> {
109 pub _M_dataplus: root::std::basic_string__Alloc_hider,
110 pub _M_string_length: root::std::basic_string_size_type,
111 pub __bindgen_anon_1: root::std::basic_string__bindgen_ty_2<_CharT>,
112 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
113 }
114 pub type basic_string__Char_alloc_type = root::__gnu_cxx::__alloc_traits;
115 pub type basic_string__Alloc_traits = root::__gnu_cxx::__alloc_traits;
116 pub type basic_string_traits_type<_Traits> = _Traits;
117 pub type basic_string_value_type = [u8; 0usize];
118 pub type basic_string_allocator_type = root::std::basic_string__Char_alloc_type;
119 pub type basic_string_size_type = root::std::basic_string__Alloc_traits;
120 pub type basic_string_difference_type = root::std::basic_string__Alloc_traits;
121 pub type basic_string_reference = root::std::basic_string__Alloc_traits;
122 pub type basic_string_const_reference = root::std::basic_string__Alloc_traits;
123 pub type basic_string_pointer = root::std::basic_string__Alloc_traits;
124 pub type basic_string_const_pointer = root::std::basic_string__Alloc_traits;
125 pub type basic_string_iterator =
126 root::__gnu_cxx::__normal_iterator<root::std::basic_string_pointer>;
127 pub type basic_string_const_iterator =
128 root::__gnu_cxx::__normal_iterator<root::std::basic_string_const_pointer>;
129 pub type basic_string_const_reverse_iterator =
130 root::std::reverse_iterator<root::std::basic_string_const_iterator>;
131 pub type basic_string_reverse_iterator =
132 root::std::reverse_iterator<root::std::basic_string_iterator>;
133 pub type basic_string___const_iterator = root::std::basic_string_const_iterator;
134 pub type basic_string___sv_type<_CharT> = root::std::basic_string_view<_CharT>;
135 pub type basic_string__If_sv = root::std::enable_if_t;
136 #[repr(C)]
137 #[derive(Debug, Copy, Clone)]
138 pub struct basic_string___sv_wrapper<_CharT> {
139 pub _M_sv: root::std::basic_string___sv_type<_CharT>,
140 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
141 }
142 #[repr(C)]
143 #[derive(Debug, Copy, Clone)]
144 pub struct basic_string__Alloc_hider {
145 pub _M_p: root::std::basic_string_pointer,
146 }
147 pub const basic_string__S_local_capacity: root::std::basic_string__bindgen_ty_1 = 0;
148 pub type basic_string__bindgen_ty_1 = i32;
149 #[repr(C)]
150 pub union basic_string__bindgen_ty_2<_CharT> {
151 pub _M_local_buf: *mut _CharT,
152 pub _M_allocated_capacity: root::std::basic_string_size_type,
153 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
154 }
155 pub type integral_constant_value_type<_Tp> = _Tp;
156 pub type integral_constant_type = u8;
157 pub type true_type = u8;
158 pub type false_type = u8;
159 pub type __bool_constant = u8;
160 #[repr(C)]
161 #[derive(Debug, Copy, Clone)]
162 pub struct __and_ {
163 pub _address: u8,
164 }
165 #[repr(C)]
166 #[derive(Debug, Copy, Clone)]
167 pub struct is_empty {
168 pub _address: u8,
169 }
170 #[repr(C)]
171 #[derive(Debug, Copy, Clone)]
172 pub struct remove_cv {
173 pub _address: u8,
174 }
175 pub type remove_cv_type<_Tp> = _Tp;
176 #[repr(C)]
177 #[derive(Debug, Copy, Clone)]
178 pub struct make_unsigned {
179 pub _address: u8,
180 }
181 pub type make_unsigned_type = u8;
182 pub type __enable_if_t = u8;
183 pub type enable_if_t = u8;
184 #[repr(C)]
185 #[derive(Debug, Copy, Clone)]
186 pub struct __detector {
187 pub _address: u8,
188 }
189 pub type __detector_value_t = root::std::false_type;
190 pub type __detector_type<_Default> = _Default;
191 pub type __detected_or = root::std::__detector;
192 pub type __detected_or_t = root::std::__detected_or;
193 #[repr(C)]
194 #[derive(Debug, Copy, Clone)]
195 pub struct iterator {
196 pub _address: u8,
197 }
198 pub type iterator_iterator_category<_Category> = _Category;
199 pub type iterator_value_type<_Tp> = _Tp;
200 pub type iterator_difference_type<_Distance> = _Distance;
201 pub type iterator_pointer<_Pointer> = _Pointer;
202 pub type iterator_reference<_Reference> = _Reference;
203 #[repr(C)]
204 #[derive(Debug, Copy, Clone)]
205 pub struct __iterator_traits {
206 pub _address: u8,
207 }
208 #[repr(C)]
209 #[derive(Debug, Copy, Clone)]
210 pub struct iterator_traits {
211 pub _address: u8,
212 }
213 #[repr(C)]
214 #[derive(Debug, Copy, Clone)]
215 pub struct __replace_first_arg {
216 pub _address: u8,
217 }
218 #[repr(C)]
219 #[derive(Debug, Copy, Clone)]
220 pub struct __ptr_traits_elem_1 {
221 pub _address: u8,
222 }
223 #[repr(C)]
224 #[derive(Debug, Copy, Clone)]
225 pub struct __ptr_traits_elem {
226 pub _address: u8,
227 }
228 #[repr(C)]
229 #[derive(Debug, Copy, Clone)]
230 pub struct pointer_traits {
231 pub _address: u8,
232 }
233 pub type pointer_traits___difference_type = [u8; 0usize];
234 #[repr(C)]
235 #[derive(Debug, Copy, Clone)]
236 pub struct pointer_traits___rebind {
237 pub _address: u8,
238 }
239 pub type pointer_traits_pointer<_Ptr> = _Ptr;
240 pub type pointer_traits_difference_type = root::std::__detected_or_t;
241 pub type pointer_traits_rebind = root::std::pointer_traits___rebind;
242 #[repr(C)]
243 #[derive(Debug, Copy, Clone)]
244 pub struct reverse_iterator<_Iterator> {
245 pub current: _Iterator,
246 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>,
247 }
248 pub type reverse_iterator___traits_type = root::std::iterator_traits;
249 pub type reverse_iterator_iterator_type<_Iterator> = _Iterator;
250 pub type reverse_iterator_pointer = root::std::reverse_iterator___traits_type;
251 pub type reverse_iterator_difference_type = root::std::reverse_iterator___traits_type;
252 pub type reverse_iterator_reference = root::std::reverse_iterator___traits_type;
253 pub mod __detail {
254 #[allow(unused_imports)]
255 use self::super::super::super::root;
256 }
257 pub type __allocator_base = root::__gnu_cxx::new_allocator;
258 #[repr(C)]
259 #[derive(Debug)]
260 pub struct allocator {
261 pub _address: u8,
262 }
263 pub type allocator_value_type<_Tp> = _Tp;
264 pub type allocator_size_type = root::std::size_t;
265 pub type allocator_difference_type = isize;
266 pub type allocator_pointer<_Tp> = *mut _Tp;
267 pub type allocator_const_pointer<_Tp> = *const _Tp;
268 pub type allocator_reference<_Tp> = *mut _Tp;
269 pub type allocator_const_reference<_Tp> = *const _Tp;
270 #[repr(C)]
271 #[derive(Debug, Copy, Clone)]
272 pub struct allocator_rebind {
273 pub _address: u8,
274 }
275 pub type allocator_rebind_other = root::std::allocator;
276 pub type allocator_propagate_on_container_move_assignment = root::std::true_type;
277 pub type allocator_is_always_equal = root::std::true_type;
278 #[repr(C)]
279 #[derive(Debug, Copy, Clone)]
280 pub struct __allocator_traits_base {
281 pub _address: u8,
282 }
283 #[repr(C)]
284 #[derive(Debug, Copy, Clone)]
285 pub struct __allocator_traits_base___rebind {
286 pub _address: u8,
287 }
288 pub type __allocator_traits_base___pointer = [u8; 0usize];
289 pub type __allocator_traits_base___c_pointer = [u8; 0usize];
290 pub type __allocator_traits_base___v_pointer = [u8; 0usize];
291 pub type __allocator_traits_base___cv_pointer = [u8; 0usize];
292 pub type __allocator_traits_base___pocca = [u8; 0usize];
293 pub type __allocator_traits_base___pocma = [u8; 0usize];
294 pub type __allocator_traits_base___pocs = [u8; 0usize];
295 pub type __allocator_traits_base___equal = [u8; 0usize];
296 #[test]
297 fn bindgen_test_layout___allocator_traits_base() {
298 assert_eq!(
299 ::std::mem::size_of::<__allocator_traits_base>(),
300 1usize,
301 concat!("Size of: ", stringify!(__allocator_traits_base))
302 );
303 assert_eq!(
304 ::std::mem::align_of::<__allocator_traits_base>(),
305 1usize,
306 concat!("Alignment of ", stringify!(__allocator_traits_base))
307 );
308 }
309 pub type __alloc_rebind = root::std::__allocator_traits_base;
310 #[repr(C)]
311 #[derive(Debug, Copy, Clone)]
312 pub struct allocator_traits {
313 pub _address: u8,
314 }
315 pub type allocator_traits_allocator_type<_Alloc> = _Alloc;
316 pub type allocator_traits_value_type = [u8; 0usize];
317 pub type allocator_traits_pointer = root::std::__detected_or_t;
318 #[repr(C)]
319 #[derive(Debug, Copy, Clone)]
320 pub struct allocator_traits__Ptr {
321 pub _address: u8,
322 }
323 pub type allocator_traits__Ptr_type = [u8; 0usize];
324 #[repr(C)]
325 #[derive(Debug, Copy, Clone)]
326 pub struct allocator_traits__Diff {
327 pub _address: u8,
328 }
329 pub type allocator_traits__Diff_type = root::std::pointer_traits;
330 #[repr(C)]
331 #[derive(Debug, Copy, Clone)]
332 pub struct allocator_traits__Size {
333 pub _address: u8,
334 }
335 pub type allocator_traits_const_pointer = [u8; 0usize];
336 pub type allocator_traits_void_pointer = root::std::allocator_traits__Ptr;
337 pub type allocator_traits_const_void_pointer = root::std::allocator_traits__Ptr;
338 pub type allocator_traits_difference_type = [u8; 0usize];
339 pub type allocator_traits_size_type = [u8; 0usize];
340 pub type allocator_traits_propagate_on_container_copy_assignment =
341 root::std::__detected_or_t;
342 pub type allocator_traits_propagate_on_container_move_assignment =
343 root::std::__detected_or_t;
344 pub type allocator_traits_propagate_on_container_swap = root::std::__detected_or_t;
345 pub type allocator_traits_is_always_equal = root::std::__detected_or_t;
346 pub type allocator_traits_rebind_alloc = root::std::__alloc_rebind;
347 pub type allocator_traits_rebind_traits = root::std::allocator_traits;
348 #[repr(C)]
349 #[derive(Debug, Copy, Clone)]
350 pub struct allocator_traits___construct_helper {
351 pub _address: u8,
352 }
353 pub type allocator_traits___construct_helper_type<_Alloc> = _Alloc;
354 pub type allocator_traits___has_construct = root::std::allocator_traits___construct_helper;
355 pub type _TupleConstraints_is_constructible = root::std::__bool_constant;
356 #[repr(C)]
357 #[derive(Debug, Copy, Clone)]
358 pub struct tuple {
359 pub _address: u8,
360 }
361 pub type tuple__Inherited = u8;
362 pub type tuple__TCC = u8;
363 pub type tuple__ImplicitDefaultCtor = root::std::__enable_if_t;
364 pub type tuple__ExplicitDefaultCtor = root::std::__enable_if_t;
365 pub type tuple__ImplicitCtor = root::std::__enable_if_t;
366 pub type tuple__ExplicitCtor = root::std::__enable_if_t;
367 #[repr(C)]
368 #[derive(Debug, Copy, Clone)]
369 pub struct tuple__UseOtherCtor {
370 pub _base: root::std::false_type,
371 }
372 #[repr(C)]
373 #[derive(Debug, Copy, Clone)]
374 pub struct default_delete {
375 pub _address: u8,
376 }
377 #[repr(C)]
378 #[derive(Debug, Copy, Clone)]
379 pub struct __uniq_ptr_impl {
380 pub _M_t: root::std::tuple,
381 }
382 #[repr(C)]
383 #[derive(Debug, Copy, Clone)]
384 pub struct __uniq_ptr_impl__Ptr {
385 pub _address: u8,
386 }
387 pub type __uniq_ptr_impl__Ptr_type<_Up> = *mut _Up;
388 pub type __uniq_ptr_impl__DeleterConstraint = u8;
389 pub type __uniq_ptr_impl_pointer = root::std::__uniq_ptr_impl__Ptr;
390 #[repr(C)]
391 #[derive(Debug)]
392 pub struct unique_ptr {
393 pub _M_t: u8,
394 }
395 pub type unique_ptr__DeleterConstraint = root::std::__uniq_ptr_impl;
396 pub type unique_ptr_pointer = root::std::__uniq_ptr_impl;
397 pub type unique_ptr_element_type<_Tp> = _Tp;
398 pub type unique_ptr_deleter_type<_Dp> = _Dp;
399 pub type unique_ptr___safe_conversion_up = root::std::__and_;
400 pub type string = root::std::basic_string<::std::os::raw::c_char>;
401 pub type streamoff = ::std::os::raw::c_long;
402 #[repr(C)]
403 #[derive(Debug)]
404 pub struct fpos<_StateT> {
405 pub _M_off: root::std::streamoff,
406 pub _M_state: _StateT,
407 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_StateT>>,
408 }
409 pub type streampos = root::std::fpos<root::mbstate_t>;
410 extern "C" {
411 #[link_name = "\u{1}num"]
412 pub static ratio_num: root::intmax_t;
413 }
414 extern "C" {
415 #[link_name = "\u{1}den"]
416 pub static ratio_den: root::intmax_t;
417 }
418 #[repr(C)]
419 #[derive(Debug, Copy, Clone)]
420 pub struct __ratio_multiply {
421 pub _address: u8,
422 }
423 pub type __ratio_multiply_type = u8;
424 pub type ratio_multiply = root::std::__ratio_multiply;
425 pub type __ratio_add_impl___t = u8;
426 pub type __ratio_add_impl_type = u8;
427 #[repr(C)]
428 #[derive(Debug, Copy, Clone)]
429 pub struct __ratio_add {
430 pub _address: u8,
431 }
432 pub type __ratio_add_type = u8;
433 pub type ratio_add = root::std::__ratio_add;
434 pub mod chrono {
435 #[allow(unused_imports)]
436 use self::super::super::super::root;
437 }
438 #[repr(C)]
439 #[derive(Debug, Copy, Clone)]
440 pub struct char_traits {
441 pub _address: u8,
442 }
443 #[repr(C)]
444 #[derive(Debug, Copy, Clone)]
445 pub struct basic_string_view<_CharT> {
446 pub _M_len: root::std::size_t,
447 pub _M_str: *const _CharT,
448 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
449 }
450 pub type basic_string_view_traits_type<_Traits> = _Traits;
451 pub type basic_string_view_value_type<_CharT> = _CharT;
452 pub type basic_string_view_pointer<_CharT> =
453 *mut root::std::basic_string_view_value_type<_CharT>;
454 pub type basic_string_view_const_pointer<_CharT> =
455 *const root::std::basic_string_view_value_type<_CharT>;
456 pub type basic_string_view_reference<_CharT> =
457 *mut root::std::basic_string_view_value_type<_CharT>;
458 pub type basic_string_view_const_reference<_CharT> =
459 *const root::std::basic_string_view_value_type<_CharT>;
460 pub type basic_string_view_const_iterator<_CharT> =
461 *const root::std::basic_string_view_value_type<_CharT>;
462 pub type basic_string_view_iterator<_CharT> =
463 root::std::basic_string_view_const_iterator<_CharT>;
464 pub type basic_string_view_const_reverse_iterator<_CharT> =
465 root::std::reverse_iterator<root::std::basic_string_view_const_iterator<_CharT>>;
466 pub type basic_string_view_reverse_iterator<_CharT> =
467 root::std::basic_string_view_const_reverse_iterator<_CharT>;
468 pub type basic_string_view_size_type = root::std::size_t;
469 pub type basic_string_view_difference_type = isize;
470 }
471 pub mod __gnu_cxx {
472 #[allow(unused_imports)]
473 use self::super::super::root;
474 #[repr(C)]
475 #[derive(Debug, Copy, Clone)]
476 pub struct __normal_iterator<_Iterator> {
477 pub _M_current: _Iterator,
478 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>,
479 }
480 pub type __normal_iterator___traits_type = root::std::iterator_traits;
481 pub type __normal_iterator_iterator_type<_Iterator> = _Iterator;
482 pub type __normal_iterator_iterator_category =
483 root::__gnu_cxx::__normal_iterator___traits_type;
484 pub type __normal_iterator_value_type = root::__gnu_cxx::__normal_iterator___traits_type;
485 pub type __normal_iterator_difference_type =
486 root::__gnu_cxx::__normal_iterator___traits_type;
487 pub type __normal_iterator_reference = root::__gnu_cxx::__normal_iterator___traits_type;
488 pub type __normal_iterator_pointer = root::__gnu_cxx::__normal_iterator___traits_type;
489 #[repr(C)]
490 #[derive(Debug)]
491 pub struct new_allocator {
492 pub _address: u8,
493 }
494 pub type new_allocator_value_type<_Tp> = _Tp;
495 pub type new_allocator_size_type = root::std::size_t;
496 pub type new_allocator_difference_type = isize;
497 pub type new_allocator_pointer<_Tp> = *mut _Tp;
498 pub type new_allocator_const_pointer<_Tp> = *const _Tp;
499 pub type new_allocator_reference<_Tp> = *mut _Tp;
500 pub type new_allocator_const_reference<_Tp> = *const _Tp;
501 #[repr(C)]
502 #[derive(Debug, Copy, Clone)]
503 pub struct new_allocator_rebind {
504 pub _address: u8,
505 }
506 pub type new_allocator_propagate_on_container_move_assignment = root::std::true_type;
507 #[repr(C)]
508 #[derive(Debug, Copy, Clone)]
509 pub struct __alloc_traits {
510 pub _address: u8,
511 }
512 pub type __alloc_traits_allocator_type<_Alloc> = _Alloc;
513 pub type __alloc_traits__Base_type = root::std::allocator_traits;
514 pub type __alloc_traits_value_type = root::__gnu_cxx::__alloc_traits__Base_type;
515 pub type __alloc_traits_pointer = root::__gnu_cxx::__alloc_traits__Base_type;
516 pub type __alloc_traits_const_pointer = root::__gnu_cxx::__alloc_traits__Base_type;
517 pub type __alloc_traits_size_type = root::__gnu_cxx::__alloc_traits__Base_type;
518 pub type __alloc_traits_difference_type = root::__gnu_cxx::__alloc_traits__Base_type;
519 pub type __alloc_traits_reference = *mut root::__gnu_cxx::__alloc_traits_value_type;
520 pub type __alloc_traits_const_reference = *const root::__gnu_cxx::__alloc_traits_value_type;
521 pub type __alloc_traits___is_custom_pointer = root::std::__and_;
522 #[repr(C)]
523 #[derive(Debug, Copy, Clone)]
524 pub struct __alloc_traits_rebind {
525 pub _address: u8,
526 }
527 pub type __alloc_traits_rebind_other = root::__gnu_cxx::__alloc_traits__Base_type;
528 #[repr(C)]
529 #[derive(Debug, Copy, Clone)]
530 pub struct _Char_types {
531 pub _address: u8,
532 }
533 pub type _Char_types_int_type = ::std::os::raw::c_ulong;
534 pub type _Char_types_pos_type = root::std::streampos;
535 pub type _Char_types_off_type = root::std::streamoff;
536 pub type _Char_types_state_type = root::mbstate_t;
537 #[repr(C)]
538 #[derive(Debug, Copy, Clone)]
539 pub struct char_traits {
540 pub _address: u8,
541 }
542 pub type char_traits_char_type<_CharT> = _CharT;
543 pub type char_traits_int_type = root::__gnu_cxx::_Char_types;
544 pub type char_traits_pos_type = root::__gnu_cxx::_Char_types;
545 pub type char_traits_off_type = root::__gnu_cxx::_Char_types;
546 pub type char_traits_state_type = root::__gnu_cxx::_Char_types;
547 }
548 #[repr(C)]
549 #[derive(Copy, Clone)]
550 pub struct __mbstate_t {
551 pub __count: ::std::os::raw::c_int,
552 pub __value: root::__mbstate_t__bindgen_ty_1,
553 }
554 #[repr(C)]
555 #[derive(Copy, Clone)]
556 pub union __mbstate_t__bindgen_ty_1 {
557 pub __wch: ::std::os::raw::c_uint,
558 pub __wchb: [::std::os::raw::c_char; 4usize],
559 }
560 #[test]
561 fn bindgen_test_layout___mbstate_t__bindgen_ty_1() {
562 assert_eq!(
563 ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(),
564 4usize,
565 concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1))
566 );
567 assert_eq!(
568 ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(),
569 4usize,
570 concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1))
571 );
572 fn test_field___wch() {
573 assert_eq!(
574 unsafe {
575 let uninit = ::std::mem::MaybeUninit::<__mbstate_t__bindgen_ty_1>::uninit();
576 let ptr = uninit.as_ptr();
577 ::std::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize
578 },
579 0usize,
580 concat!(
581 "Offset of field: ",
582 stringify!(__mbstate_t__bindgen_ty_1),
583 "::",
584 stringify!(__wch)
585 )
586 );
587 }
588 test_field___wch();
589 fn test_field___wchb() {
590 assert_eq!(
591 unsafe {
592 let uninit = ::std::mem::MaybeUninit::<__mbstate_t__bindgen_ty_1>::uninit();
593 let ptr = uninit.as_ptr();
594 ::std::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize
595 },
596 0usize,
597 concat!(
598 "Offset of field: ",
599 stringify!(__mbstate_t__bindgen_ty_1),
600 "::",
601 stringify!(__wchb)
602 )
603 );
604 }
605 test_field___wchb();
606 }
607 #[test]
608 fn bindgen_test_layout___mbstate_t() {
609 assert_eq!(
610 ::std::mem::size_of::<__mbstate_t>(),
611 8usize,
612 concat!("Size of: ", stringify!(__mbstate_t))
613 );
614 assert_eq!(
615 ::std::mem::align_of::<__mbstate_t>(),
616 4usize,
617 concat!("Alignment of ", stringify!(__mbstate_t))
618 );
619 fn test_field___count() {
620 assert_eq!(
621 unsafe {
622 let uninit = ::std::mem::MaybeUninit::<__mbstate_t>::uninit();
623 let ptr = uninit.as_ptr();
624 ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize
625 },
626 0usize,
627 concat!(
628 "Offset of field: ",
629 stringify!(__mbstate_t),
630 "::",
631 stringify!(__count)
632 )
633 );
634 }
635 test_field___count();
636 fn test_field___value() {
637 assert_eq!(
638 unsafe {
639 let uninit = ::std::mem::MaybeUninit::<__mbstate_t>::uninit();
640 let ptr = uninit.as_ptr();
641 ::std::ptr::addr_of!((*ptr).__value) as usize - ptr as usize
642 },
643 4usize,
644 concat!(
645 "Offset of field: ",
646 stringify!(__mbstate_t),
647 "::",
648 stringify!(__value)
649 )
650 );
651 }
652 test_field___value();
653 }
654 pub type mbstate_t = root::__mbstate_t;
655 pub mod __pstl {
656 #[allow(unused_imports)]
657 use self::super::super::root;
658 pub mod execution {
659 #[allow(unused_imports)]
660 use self::super::super::super::root;
661 }
662 }
663 pub mod wpi {
664 #[allow(unused_imports)]
665 use self::super::super::root;
666 pub mod detail {
667 #[allow(unused_imports)]
668 use self::super::super::super::root;
669 }
670 pub type span_storage_type = u8;
671 pub type span_element_type<ElementType> = ElementType;
672 pub type span_value_type = root::std::remove_cv;
673 pub type span_size_type = root::std::size_t;
674 pub type span_difference_type = isize;
675 pub type span_pointer<ElementType> = *mut root::wpi::span_element_type<ElementType>;
676 pub type span_const_pointer<ElementType> = *const root::wpi::span_element_type<ElementType>;
677 pub type span_reference<ElementType> = *mut root::wpi::span_element_type<ElementType>;
678 pub type span_const_reference<ElementType> =
679 *const root::wpi::span_element_type<ElementType>;
680 pub type span_iterator<ElementType> = root::wpi::span_pointer<ElementType>;
681 pub type span_reverse_iterator<ElementType> =
682 root::std::reverse_iterator<root::wpi::span_iterator<ElementType>>;
683 pub type span_subspan_return_t = u8;
684 #[repr(C)]
685 #[derive(Debug, Copy, Clone)]
686 pub struct SendableBuilder {
687 _unused: [u8; 0],
688 }
689 #[repr(C)]
690 pub struct Sendable__bindgen_vtable(::std::os::raw::c_void);
691 #[doc = " Interface for Sendable objects."]
692 #[repr(C)]
693 #[derive(Debug)]
694 pub struct Sendable {
695 pub vtable_: *const Sendable__bindgen_vtable,
696 }
697 #[test]
698 fn bindgen_test_layout_Sendable() {
699 assert_eq!(
700 ::std::mem::size_of::<Sendable>(),
701 8usize,
702 concat!("Size of: ", stringify!(Sendable))
703 );
704 assert_eq!(
705 ::std::mem::align_of::<Sendable>(),
706 8usize,
707 concat!("Alignment of ", stringify!(Sendable))
708 );
709 }
710 #[doc = " A helper class for use with objects that add themselves to SendableRegistry."]
711 #[doc = " It takes care of properly calling Move() and Remove() on move and"]
712 #[doc = " destruction. No action is taken if the object is copied."]
713 #[doc = " Use public inheritance with CRTP when using this class."]
714 #[doc = " @tparam CRTP derived class"]
715 #[repr(C)]
716 #[derive(Debug)]
717 pub struct SendableHelper {
718 pub _address: u8,
719 }
720 pub mod support {
721 #[allow(unused_imports)]
722 use self::super::super::super::root;
723 }
724 pub mod hashing {
725 #[allow(unused_imports)]
726 use self::super::super::super::root;
727 }
728 }
729 pub type HAL_Handle = i32;
730 pub type HAL_PortHandle = root::HAL_Handle;
731 pub type HAL_AnalogInputHandle = root::HAL_Handle;
732 pub type HAL_AnalogOutputHandle = root::HAL_Handle;
733 pub type HAL_AnalogTriggerHandle = root::HAL_Handle;
734 pub type HAL_CompressorHandle = root::HAL_Handle;
735 pub type HAL_CounterHandle = root::HAL_Handle;
736 pub type HAL_DigitalHandle = root::HAL_Handle;
737 pub type HAL_DigitalPWMHandle = root::HAL_Handle;
738 pub type HAL_EncoderHandle = root::HAL_Handle;
739 pub type HAL_FPGAEncoderHandle = root::HAL_Handle;
740 pub type HAL_GyroHandle = root::HAL_Handle;
741 pub type HAL_InterruptHandle = root::HAL_Handle;
742 pub type HAL_NotifierHandle = root::HAL_Handle;
743 pub type HAL_RelayHandle = root::HAL_Handle;
744 pub type HAL_SolenoidHandle = root::HAL_Handle;
745 pub type HAL_SerialPortHandle = root::HAL_Handle;
746 pub type HAL_CANHandle = root::HAL_Handle;
747 pub type HAL_SimDeviceHandle = root::HAL_Handle;
748 pub type HAL_SimValueHandle = root::HAL_Handle;
749 pub type HAL_DMAHandle = root::HAL_Handle;
750 pub type HAL_DutyCycleHandle = root::HAL_Handle;
751 pub type HAL_AddressableLEDHandle = root::HAL_Handle;
752 pub type HAL_PDPHandle = root::HAL_CANHandle;
753 pub type HAL_PowerDistributionHandle = root::HAL_Handle;
754 pub type HAL_CTREPCMHandle = root::HAL_Handle;
755 pub type HAL_REVPDHHandle = root::HAL_Handle;
756 pub type HAL_REVPHHandle = root::HAL_Handle;
757 pub type HAL_Bool = i32;
758 pub mod hal {
759 #[allow(unused_imports)]
760 use self::super::super::root;
761 #[doc = " C++ wrapper around a HAL simulator value handle."]
762 #[repr(C)]
763 #[derive(Debug, Copy, Clone)]
764 pub struct SimValue {
765 pub m_handle: root::HAL_SimValueHandle,
766 }
767 #[test]
768 fn bindgen_test_layout_SimValue() {
769 assert_eq!(
770 ::std::mem::size_of::<SimValue>(),
771 4usize,
772 concat!("Size of: ", stringify!(SimValue))
773 );
774 assert_eq!(
775 ::std::mem::align_of::<SimValue>(),
776 4usize,
777 concat!("Alignment of ", stringify!(SimValue))
778 );
779 fn test_field_m_handle() {
780 assert_eq!(
781 unsafe {
782 let uninit = ::std::mem::MaybeUninit::<SimValue>::uninit();
783 let ptr = uninit.as_ptr();
784 ::std::ptr::addr_of!((*ptr).m_handle) as usize - ptr as usize
785 },
786 0usize,
787 concat!(
788 "Offset of field: ",
789 stringify!(SimValue),
790 "::",
791 stringify!(m_handle)
792 )
793 );
794 }
795 test_field_m_handle();
796 }
797 #[doc = " C++ wrapper around a HAL simulator double value handle."]
798 #[repr(C)]
799 #[derive(Debug, Copy, Clone)]
800 pub struct SimDouble {
801 pub _base: root::hal::SimValue,
802 }
803 #[test]
804 fn bindgen_test_layout_SimDouble() {
805 assert_eq!(
806 ::std::mem::size_of::<SimDouble>(),
807 4usize,
808 concat!("Size of: ", stringify!(SimDouble))
809 );
810 assert_eq!(
811 ::std::mem::align_of::<SimDouble>(),
812 4usize,
813 concat!("Alignment of ", stringify!(SimDouble))
814 );
815 }
816 #[doc = " A move-only C++ wrapper around a HAL simulator device handle."]
817 #[repr(C)]
818 #[derive(Debug)]
819 pub struct SimDevice {
820 pub m_handle: root::HAL_SimDeviceHandle,
821 }
822 pub const SimDevice_Direction_kInput: root::hal::SimDevice_Direction = 0;
823 pub const SimDevice_Direction_kOutput: root::hal::SimDevice_Direction = 1;
824 pub const SimDevice_Direction_kBidir: root::hal::SimDevice_Direction = 2;
825 #[doc = " Direction of a simulated value (from the perspective of user code)."]
826 pub type SimDevice_Direction = ::std::os::raw::c_uint;
827 #[test]
828 fn bindgen_test_layout_SimDevice() {
829 assert_eq!(
830 ::std::mem::size_of::<SimDevice>(),
831 4usize,
832 concat!("Size of: ", stringify!(SimDevice))
833 );
834 assert_eq!(
835 ::std::mem::align_of::<SimDevice>(),
836 4usize,
837 concat!("Alignment of ", stringify!(SimDevice))
838 );
839 fn test_field_m_handle() {
840 assert_eq!(
841 unsafe {
842 let uninit = ::std::mem::MaybeUninit::<SimDevice>::uninit();
843 let ptr = uninit.as_ptr();
844 ::std::ptr::addr_of!((*ptr).m_handle) as usize - ptr as usize
845 },
846 0usize,
847 concat!(
848 "Offset of field: ",
849 stringify!(SimDevice),
850 "::",
851 stringify!(m_handle)
852 )
853 );
854 }
855 test_field_m_handle();
856 }
857 extern "C" {
858 #[doc = " Creates a simulated device."]
859 #[doc = ""]
860 #[doc = " The device name must be unique. Returns null if the device name"]
861 #[doc = " already exists. This is a convenience method that appends index in"]
862 #[doc = " brackets to the device name, e.g. passing index=1 results in \"device[1]\""]
863 #[doc = " for the device name."]
864 #[doc = ""]
865 #[doc = " If not in simulation, results in an \"empty\" object that evaluates to false"]
866 #[doc = " in a boolean context."]
867 #[doc = ""]
868 #[doc = " @param name device name"]
869 #[doc = " @param index device index number to append to name"]
870 #[link_name = "\u{1}_ZN3hal9SimDeviceC1EPKci"]
871 pub fn SimDevice_SimDevice(
872 this: *mut root::hal::SimDevice,
873 name: *const ::std::os::raw::c_char,
874 index: ::std::os::raw::c_int,
875 );
876 }
877 extern "C" {
878 #[doc = " Creates a simulated device."]
879 #[doc = ""]
880 #[doc = " The device name must be unique. Returns null if the device name"]
881 #[doc = " already exists. This is a convenience method that appends index and"]
882 #[doc = " channel in brackets to the device name, e.g. passing index=1 and channel=2"]
883 #[doc = " results in \"device[1,2]\" for the device name."]
884 #[doc = ""]
885 #[doc = " If not in simulation, results in an \"empty\" object that evaluates to false"]
886 #[doc = " in a boolean context."]
887 #[doc = ""]
888 #[doc = " @param name device name"]
889 #[doc = " @param index device index number to append to name"]
890 #[doc = " @param channel device channel number to append to name"]
891 #[link_name = "\u{1}_ZN3hal9SimDeviceC1EPKcii"]
892 pub fn SimDevice_SimDevice1(
893 this: *mut root::hal::SimDevice,
894 name: *const ::std::os::raw::c_char,
895 index: ::std::os::raw::c_int,
896 channel: ::std::os::raw::c_int,
897 );
898 }
899 impl SimDevice {
900 #[inline]
901 pub unsafe fn new(
902 name: *const ::std::os::raw::c_char,
903 index: ::std::os::raw::c_int,
904 ) -> Self {
905 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
906 SimDevice_SimDevice(__bindgen_tmp.as_mut_ptr(), name, index);
907 __bindgen_tmp.assume_init()
908 }
909 #[inline]
910 pub unsafe fn new1(
911 name: *const ::std::os::raw::c_char,
912 index: ::std::os::raw::c_int,
913 channel: ::std::os::raw::c_int,
914 ) -> Self {
915 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
916 SimDevice_SimDevice1(__bindgen_tmp.as_mut_ptr(), name, index, channel);
917 __bindgen_tmp.assume_init()
918 }
919 }
920 #[doc = " A move-only C++ wrapper around a HAL handle."]
921 #[doc = " Does not ensure destruction."]
922 pub type SPIPort = u32;
923 }
924 pub const HAL_Type_HAL_UNASSIGNED: root::HAL_Type = 0;
925 pub const HAL_Type_HAL_BOOLEAN: root::HAL_Type = 1;
926 pub const HAL_Type_HAL_DOUBLE: root::HAL_Type = 2;
927 pub const HAL_Type_HAL_ENUM: root::HAL_Type = 4;
928 pub const HAL_Type_HAL_INT: root::HAL_Type = 8;
929 pub const HAL_Type_HAL_LONG: root::HAL_Type = 16;
930 #[doc = " HAL data types."]
931 pub type HAL_Type = ::std::os::raw::c_uint;
932 #[doc = " HAL Entry Value. Note this is a typed union."]
933 #[repr(C)]
934 #[derive(Copy, Clone)]
935 pub struct HAL_Value {
936 pub data: root::HAL_Value__bindgen_ty_1,
937 pub type_: root::HAL_Type,
938 }
939 #[repr(C)]
940 #[derive(Copy, Clone)]
941 pub union HAL_Value__bindgen_ty_1 {
942 pub v_boolean: root::HAL_Bool,
943 pub v_enum: i32,
944 pub v_int: i32,
945 pub v_long: i64,
946 pub v_double: f64,
947 }
948 #[test]
949 fn bindgen_test_layout_HAL_Value__bindgen_ty_1() {
950 assert_eq!(
951 ::std::mem::size_of::<HAL_Value__bindgen_ty_1>(),
952 8usize,
953 concat!("Size of: ", stringify!(HAL_Value__bindgen_ty_1))
954 );
955 assert_eq!(
956 ::std::mem::align_of::<HAL_Value__bindgen_ty_1>(),
957 8usize,
958 concat!("Alignment of ", stringify!(HAL_Value__bindgen_ty_1))
959 );
960 fn test_field_v_boolean() {
961 assert_eq!(
962 unsafe {
963 let uninit = ::std::mem::MaybeUninit::<HAL_Value__bindgen_ty_1>::uninit();
964 let ptr = uninit.as_ptr();
965 ::std::ptr::addr_of!((*ptr).v_boolean) as usize - ptr as usize
966 },
967 0usize,
968 concat!(
969 "Offset of field: ",
970 stringify!(HAL_Value__bindgen_ty_1),
971 "::",
972 stringify!(v_boolean)
973 )
974 );
975 }
976 test_field_v_boolean();
977 fn test_field_v_enum() {
978 assert_eq!(
979 unsafe {
980 let uninit = ::std::mem::MaybeUninit::<HAL_Value__bindgen_ty_1>::uninit();
981 let ptr = uninit.as_ptr();
982 ::std::ptr::addr_of!((*ptr).v_enum) as usize - ptr as usize
983 },
984 0usize,
985 concat!(
986 "Offset of field: ",
987 stringify!(HAL_Value__bindgen_ty_1),
988 "::",
989 stringify!(v_enum)
990 )
991 );
992 }
993 test_field_v_enum();
994 fn test_field_v_int() {
995 assert_eq!(
996 unsafe {
997 let uninit = ::std::mem::MaybeUninit::<HAL_Value__bindgen_ty_1>::uninit();
998 let ptr = uninit.as_ptr();
999 ::std::ptr::addr_of!((*ptr).v_int) as usize - ptr as usize
1000 },
1001 0usize,
1002 concat!(
1003 "Offset of field: ",
1004 stringify!(HAL_Value__bindgen_ty_1),
1005 "::",
1006 stringify!(v_int)
1007 )
1008 );
1009 }
1010 test_field_v_int();
1011 fn test_field_v_long() {
1012 assert_eq!(
1013 unsafe {
1014 let uninit = ::std::mem::MaybeUninit::<HAL_Value__bindgen_ty_1>::uninit();
1015 let ptr = uninit.as_ptr();
1016 ::std::ptr::addr_of!((*ptr).v_long) as usize - ptr as usize
1017 },
1018 0usize,
1019 concat!(
1020 "Offset of field: ",
1021 stringify!(HAL_Value__bindgen_ty_1),
1022 "::",
1023 stringify!(v_long)
1024 )
1025 );
1026 }
1027 test_field_v_long();
1028 fn test_field_v_double() {
1029 assert_eq!(
1030 unsafe {
1031 let uninit = ::std::mem::MaybeUninit::<HAL_Value__bindgen_ty_1>::uninit();
1032 let ptr = uninit.as_ptr();
1033 ::std::ptr::addr_of!((*ptr).v_double) as usize - ptr as usize
1034 },
1035 0usize,
1036 concat!(
1037 "Offset of field: ",
1038 stringify!(HAL_Value__bindgen_ty_1),
1039 "::",
1040 stringify!(v_double)
1041 )
1042 );
1043 }
1044 test_field_v_double();
1045 }
1046 #[test]
1047 fn bindgen_test_layout_HAL_Value() {
1048 assert_eq!(
1049 ::std::mem::size_of::<HAL_Value>(),
1050 16usize,
1051 concat!("Size of: ", stringify!(HAL_Value))
1052 );
1053 assert_eq!(
1054 ::std::mem::align_of::<HAL_Value>(),
1055 8usize,
1056 concat!("Alignment of ", stringify!(HAL_Value))
1057 );
1058 fn test_field_data() {
1059 assert_eq!(
1060 unsafe {
1061 let uninit = ::std::mem::MaybeUninit::<HAL_Value>::uninit();
1062 let ptr = uninit.as_ptr();
1063 ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize
1064 },
1065 0usize,
1066 concat!(
1067 "Offset of field: ",
1068 stringify!(HAL_Value),
1069 "::",
1070 stringify!(data)
1071 )
1072 );
1073 }
1074 test_field_data();
1075 fn test_field_type() {
1076 assert_eq!(
1077 unsafe {
1078 let uninit = ::std::mem::MaybeUninit::<HAL_Value>::uninit();
1079 let ptr = uninit.as_ptr();
1080 ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize
1081 },
1082 8usize,
1083 concat!(
1084 "Offset of field: ",
1085 stringify!(HAL_Value),
1086 "::",
1087 stringify!(type_)
1088 )
1089 );
1090 }
1091 test_field_type();
1092 }
1093 #[doc = "< input to user code from the simulator"]
1094 pub const HAL_SimValueDirection_HAL_SimValueInput: root::HAL_SimValueDirection = 0;
1095 #[doc = "< output from user code to the simulator"]
1096 pub const HAL_SimValueDirection_HAL_SimValueOutput: root::HAL_SimValueDirection = 1;
1097 #[doc = "< bidirectional between user code and simulator"]
1098 pub const HAL_SimValueDirection_HAL_SimValueBidir: root::HAL_SimValueDirection = 2;
1099 #[doc = " Direction of a simulated value (from the perspective of user code)."]
1100 pub type HAL_SimValueDirection = i32;
1101 extern "C" {
1102 #[doc = " Creates a simulated device."]
1103 #[doc = ""]
1104 #[doc = " The device name must be unique. 0 is returned if the device name already"]
1105 #[doc = " exists. If multiple instances of the same device are desired, recommend"]
1106 #[doc = " appending the instance/unique identifer in brackets to the base name,"]
1107 #[doc = " e.g. \"device[1]\"."]
1108 #[doc = ""]
1109 #[doc = " 0 is returned if not in simulation."]
1110 #[doc = ""]
1111 #[doc = " @param name device name"]
1112 #[doc = " @return simulated device handle"]
1113 pub fn HAL_CreateSimDevice(
1114 name: *const ::std::os::raw::c_char,
1115 ) -> root::HAL_SimDeviceHandle;
1116 }
1117 extern "C" {
1118 #[doc = " Frees a simulated device."]
1119 #[doc = ""]
1120 #[doc = " This also allows the same device name to be used again."]
1121 #[doc = " This also frees all the simulated values created on the device."]
1122 #[doc = ""]
1123 #[doc = " @param handle simulated device handle"]
1124 pub fn HAL_FreeSimDevice(handle: root::HAL_SimDeviceHandle);
1125 }
1126 extern "C" {
1127 #[doc = " Creates a value on a simulated device."]
1128 #[doc = ""]
1129 #[doc = " Returns 0 if not in simulation; this can be used to avoid calls"]
1130 #[doc = " to Set/Get functions."]
1131 #[doc = ""]
1132 #[doc = " @param device simulated device handle"]
1133 #[doc = " @param name value name"]
1134 #[doc = " @param direction input/output/bidir (from perspective of user code)"]
1135 #[doc = " @param initialValue initial value"]
1136 #[doc = " @return simulated value handle"]
1137 pub fn HAL_CreateSimValue(
1138 device: root::HAL_SimDeviceHandle,
1139 name: *const ::std::os::raw::c_char,
1140 direction: i32,
1141 initialValue: *const root::HAL_Value,
1142 ) -> root::HAL_SimValueHandle;
1143 }
1144 extern "C" {
1145 #[doc = " Creates an enumerated value on a simulated device."]
1146 #[doc = ""]
1147 #[doc = " Enumerated values are always in the range 0 to numOptions-1."]
1148 #[doc = ""]
1149 #[doc = " Returns 0 if not in simulation; this can be used to avoid calls"]
1150 #[doc = " to Set/Get functions."]
1151 #[doc = ""]
1152 #[doc = " @param device simulated device handle"]
1153 #[doc = " @param name value name"]
1154 #[doc = " @param direction input/output/bidir (from perspective of user code)"]
1155 #[doc = " @param numOptions number of enumerated value options (length of options)"]
1156 #[doc = " @param options array of option descriptions"]
1157 #[doc = " @param initialValue initial value (selection)"]
1158 #[doc = " @return simulated value handle"]
1159 pub fn HAL_CreateSimValueEnum(
1160 device: root::HAL_SimDeviceHandle,
1161 name: *const ::std::os::raw::c_char,
1162 direction: i32,
1163 numOptions: i32,
1164 options: *mut *const ::std::os::raw::c_char,
1165 initialValue: i32,
1166 ) -> root::HAL_SimValueHandle;
1167 }
1168 extern "C" {
1169 #[doc = " Creates an enumerated value on a simulated device with double values."]
1170 #[doc = ""]
1171 #[doc = " Enumerated values are always in the range 0 to numOptions-1."]
1172 #[doc = ""]
1173 #[doc = " Returns 0 if not in simulation; this can be used to avoid calls"]
1174 #[doc = " to Set/Get functions."]
1175 #[doc = ""]
1176 #[doc = " @param device simulated device handle"]
1177 #[doc = " @param name value name"]
1178 #[doc = " @param direction input/output/bidir (from perspective of user code)"]
1179 #[doc = " @param numOptions number of enumerated value options (length of options)"]
1180 #[doc = " @param options array of option descriptions"]
1181 #[doc = " @param optionValues array of option double values"]
1182 #[doc = " @param initialValue initial value (selection)"]
1183 #[doc = " @return simulated value handle"]
1184 pub fn HAL_CreateSimValueEnumDouble(
1185 device: root::HAL_SimDeviceHandle,
1186 name: *const ::std::os::raw::c_char,
1187 direction: i32,
1188 numOptions: i32,
1189 options: *mut *const ::std::os::raw::c_char,
1190 optionValues: *const f64,
1191 initialValue: i32,
1192 ) -> root::HAL_SimValueHandle;
1193 }
1194 extern "C" {
1195 #[doc = " Gets a simulated value."]
1196 #[doc = ""]
1197 #[doc = " @param handle simulated value handle"]
1198 #[doc = " @param value value (output parameter)"]
1199 pub fn HAL_GetSimValue(handle: root::HAL_SimValueHandle, value: *mut root::HAL_Value);
1200 }
1201 extern "C" {
1202 #[doc = " Sets a simulated value."]
1203 #[doc = ""]
1204 #[doc = " @param handle simulated value handle"]
1205 #[doc = " @param value the value to set"]
1206 pub fn HAL_SetSimValue(handle: root::HAL_SimValueHandle, value: *const root::HAL_Value);
1207 }
1208 extern "C" {
1209 #[doc = " Resets a simulated double or integral value to 0."]
1210 #[doc = " Has no effect on other value types."]
1211 #[doc = " Use this instead of Set(0) for resetting incremental sensor values like"]
1212 #[doc = " encoder counts or gyro accumulated angle to ensure correct behavior in a"]
1213 #[doc = " distributed system (e.g. WebSockets)."]
1214 #[doc = ""]
1215 #[doc = " @param handle simulated value handle"]
1216 pub fn HAL_ResetSimValue(handle: root::HAL_SimValueHandle);
1217 }
1218 pub mod fmt {
1219 #[allow(unused_imports)]
1220 use self::super::super::root;
1221 pub mod detail {
1222 #[allow(unused_imports)]
1223 use self::super::super::super::root;
1224 }
1225 }
1226 pub mod units {
1227 #[allow(unused_imports)]
1228 use self::super::super::root;
1229 pub mod detail {
1230 #[allow(unused_imports)]
1231 use self::super::super::super::root;
1232 #[doc = " @brief\t\thelper type to identify base units."]
1233 #[doc = " @details\t\tA non-templated base class for `base_unit` which enables RTTI testing."]
1234 #[repr(C)]
1235 #[derive(Debug, Copy, Clone)]
1236 pub struct _base_unit_t {
1237 pub _address: u8,
1238 }
1239 #[test]
1240 fn bindgen_test_layout__base_unit_t() {
1241 assert_eq!(
1242 ::std::mem::size_of::<_base_unit_t>(),
1243 1usize,
1244 concat!("Size of: ", stringify!(_base_unit_t))
1245 );
1246 assert_eq!(
1247 ::std::mem::align_of::<_base_unit_t>(),
1248 1usize,
1249 concat!("Alignment of ", stringify!(_base_unit_t))
1250 );
1251 }
1252 #[doc = " @brief\t\thelper type to identify units."]
1253 #[doc = " @details\t\tA non-templated base class for `unit` which enables RTTI testing."]
1254 #[repr(C)]
1255 #[derive(Debug, Copy, Clone)]
1256 pub struct _unit {
1257 pub _address: u8,
1258 }
1259 #[test]
1260 fn bindgen_test_layout__unit() {
1261 assert_eq!(
1262 ::std::mem::size_of::<_unit>(),
1263 1usize,
1264 concat!("Size of: ", stringify!(_unit))
1265 );
1266 assert_eq!(
1267 ::std::mem::align_of::<_unit>(),
1268 1usize,
1269 concat!("Alignment of ", stringify!(_unit))
1270 );
1271 }
1272 #[doc = " @brief\t\thelper type to identify units."]
1273 #[doc = " @details\t\tA non-templated base class for `unit` which enables RTTI testing."]
1274 #[repr(C)]
1275 #[derive(Debug, Copy, Clone)]
1276 pub struct _unit_t {
1277 pub _address: u8,
1278 }
1279 #[test]
1280 fn bindgen_test_layout__unit_t() {
1281 assert_eq!(
1282 ::std::mem::size_of::<_unit_t>(),
1283 1usize,
1284 concat!("Size of: ", stringify!(_unit_t))
1285 );
1286 assert_eq!(
1287 ::std::mem::align_of::<_unit_t>(),
1288 1usize,
1289 concat!("Alignment of ", stringify!(_unit_t))
1290 );
1291 }
1292 }
1293 pub mod constants {
1294 #[allow(unused_imports)]
1295 use self::super::super::super::root;
1296 }
1297 pub mod traits {
1298 #[allow(unused_imports)]
1299 use self::super::super::super::root;
1300 #[doc = " @brief\t\tunit traits implementation for classes which are not units."]
1301 #[repr(C)]
1302 #[derive(Debug, Copy, Clone)]
1303 pub struct unit_traits {
1304 pub _address: u8,
1305 }
1306 pub type unit_traits_base_unit_type = ::std::os::raw::c_void;
1307 pub type unit_traits_conversion_ratio = ::std::os::raw::c_void;
1308 pub type unit_traits_pi_exponent_ratio = ::std::os::raw::c_void;
1309 pub type unit_traits_translation_ratio = ::std::os::raw::c_void;
1310 }
1311 #[doc = " @ingroup\t\tUnitTypes"]
1312 #[doc = " @brief\t\tClass representing SI base unit types."]
1313 #[doc = " @details\t\tBase units are represented by a combination of `std::ratio` template parameters, each"]
1314 #[doc = "\t\t\t\tdescribing the exponent of the type of unit they represent. Example: meters per second"]
1315 #[doc = "\t\t\t\twould be described by a +1 exponent for meters, and a -1 exponent for seconds, thus:"]
1316 #[doc = "\t\t\t\t`base_unit<std::ratio<1>, std::ratio<0>, std::ratio<-1>>`"]
1317 #[doc = " @tparam\t\tMeter\t\t`std::ratio` representing the exponent value for meters."]
1318 #[doc = " @tparam\t\tKilogram\t`std::ratio` representing the exponent value for kilograms."]
1319 #[doc = " @tparam\t\tSecond\t\t`std::ratio` representing the exponent value for seconds."]
1320 #[doc = " @tparam\t\tRadian\t\t`std::ratio` representing the exponent value for radians. Although radians are not SI base units, they are included because radians are described by the SI as m * m^-1, which would make them indistinguishable from scalars."]
1321 #[doc = " @tparam\t\tAmpere\t\t`std::ratio` representing the exponent value for amperes."]
1322 #[doc = " @tparam\t\tKelvin\t\t`std::ratio` representing the exponent value for Kelvin."]
1323 #[doc = " @tparam\t\tMole\t\t`std::ratio` representing the exponent value for moles."]
1324 #[doc = " @tparam\t\tCandela\t\t`std::ratio` representing the exponent value for candelas."]
1325 #[doc = " @tparam\t\tByte\t\t`std::ratio` representing the exponent value for bytes."]
1326 #[doc = " @sa\t\t\tcategory\t for type aliases for SI base_unit types."]
1327 #[repr(C)]
1328 #[derive(Debug, Copy, Clone)]
1329 pub struct base_unit {
1330 pub _address: u8,
1331 }
1332 pub type base_unit_meter_ratio<Meter> = Meter;
1333 pub type base_unit_kilogram_ratio<Kilogram> = Kilogram;
1334 pub type base_unit_second_ratio<Second> = Second;
1335 pub type base_unit_radian_ratio<Radian> = Radian;
1336 pub type base_unit_ampere_ratio<Ampere> = Ampere;
1337 pub type base_unit_kelvin_ratio<Kelvin> = Kelvin;
1338 pub type base_unit_mole_ratio<Mole> = Mole;
1339 pub type base_unit_candela_ratio<Candela> = Candela;
1340 pub type base_unit_byte_ratio<Byte> = Byte;
1341 pub mod category {
1342 #[allow(unused_imports)]
1343 use self::super::super::super::root;
1344 #[doc = " @ingroup\t\tUnitTypes"]
1345 #[doc = " @brief\t\tClass representing SI base unit types."]
1346 #[doc = " @details\t\tBase units are represented by a combination of `std::ratio` template parameters, each"]
1347 #[doc = "\t\t\t\tdescribing the exponent of the type of unit they represent. Example: meters per second"]
1348 #[doc = "\t\t\t\twould be described by a +1 exponent for meters, and a -1 exponent for seconds, thus:"]
1349 #[doc = "\t\t\t\t`base_unit<std::ratio<1>, std::ratio<0>, std::ratio<-1>>`"]
1350 #[doc = " @tparam\t\tMeter\t\t`std::ratio` representing the exponent value for meters."]
1351 #[doc = " @tparam\t\tKilogram\t`std::ratio` representing the exponent value for kilograms."]
1352 #[doc = " @tparam\t\tSecond\t\t`std::ratio` representing the exponent value for seconds."]
1353 #[doc = " @tparam\t\tRadian\t\t`std::ratio` representing the exponent value for radians. Although radians are not SI base units, they are included because radians are described by the SI as m * m^-1, which would make them indistinguishable from scalars."]
1354 #[doc = " @tparam\t\tAmpere\t\t`std::ratio` representing the exponent value for amperes."]
1355 #[doc = " @tparam\t\tKelvin\t\t`std::ratio` representing the exponent value for Kelvin."]
1356 #[doc = " @tparam\t\tMole\t\t`std::ratio` representing the exponent value for moles."]
1357 #[doc = " @tparam\t\tCandela\t\t`std::ratio` representing the exponent value for candelas."]
1358 #[doc = " @tparam\t\tByte\t\t`std::ratio` representing the exponent value for bytes."]
1359 #[doc = " @sa\t\t\tcategory\t for type aliases for SI base_unit types."]
1360 pub type time_unit = root::units::base_unit;
1361 #[doc = " @ingroup\t\tUnitTypes"]
1362 #[doc = " @brief\t\tClass representing SI base unit types."]
1363 #[doc = " @details\t\tBase units are represented by a combination of `std::ratio` template parameters, each"]
1364 #[doc = "\t\t\t\tdescribing the exponent of the type of unit they represent. Example: meters per second"]
1365 #[doc = "\t\t\t\twould be described by a +1 exponent for meters, and a -1 exponent for seconds, thus:"]
1366 #[doc = "\t\t\t\t`base_unit<std::ratio<1>, std::ratio<0>, std::ratio<-1>>`"]
1367 #[doc = " @tparam\t\tMeter\t\t`std::ratio` representing the exponent value for meters."]
1368 #[doc = " @tparam\t\tKilogram\t`std::ratio` representing the exponent value for kilograms."]
1369 #[doc = " @tparam\t\tSecond\t\t`std::ratio` representing the exponent value for seconds."]
1370 #[doc = " @tparam\t\tRadian\t\t`std::ratio` representing the exponent value for radians. Although radians are not SI base units, they are included because radians are described by the SI as m * m^-1, which would make them indistinguishable from scalars."]
1371 #[doc = " @tparam\t\tAmpere\t\t`std::ratio` representing the exponent value for amperes."]
1372 #[doc = " @tparam\t\tKelvin\t\t`std::ratio` representing the exponent value for Kelvin."]
1373 #[doc = " @tparam\t\tMole\t\t`std::ratio` representing the exponent value for moles."]
1374 #[doc = " @tparam\t\tCandela\t\t`std::ratio` representing the exponent value for candelas."]
1375 #[doc = " @tparam\t\tByte\t\t`std::ratio` representing the exponent value for bytes."]
1376 #[doc = " @sa\t\t\tcategory\t for type aliases for SI base_unit types."]
1377 pub type angle_unit = root::units::base_unit;
1378 }
1379 #[doc = " @brief\t\tunit type template specialization for units derived from base units."]
1380 #[repr(C)]
1381 #[derive(Debug, Copy, Clone)]
1382 pub struct unit {
1383 pub _address: u8,
1384 }
1385 pub type unit_base_unit_type = root::units::traits::unit_traits;
1386 pub type unit_conversion_ratio = root::std::ratio_multiply;
1387 pub type unit_pi_exponent_ratio = root::std::ratio_add;
1388 pub type unit_translation_ratio = root::std::ratio_add;
1389 #[doc = " @ingroup\t\tUnitContainers"]
1390 #[doc = " @brief\t\tContainer for values which represent quantities of a given unit."]
1391 #[doc = " @details\t\tStores a value which represents a quantity in the given units. Unit containers"]
1392 #[doc = "\t\t\t\t(except scalar values) are *not* convertible to built-in c++ types, in order to"]
1393 #[doc = "\t\t\t\tprovide type safety in dimensional analysis. Unit containers *are* implicitly"]
1394 #[doc = "\t\t\t\tconvertible to other compatible unit container types. Unit containers support"]
1395 #[doc = "\t\t\t\tvarious types of arithmetic operations, depending on their scale type."]
1396 #[doc = ""]
1397 #[doc = "\t\t\t\tThe value of a `unit_t` can only be changed on construction, or by assignment"]
1398 #[doc = "\t\t\t\tfrom another `unit_t` type. If necessary, the underlying value can be accessed"]
1399 #[doc = "\t\t\t\tusing `operator()`: @code"]
1400 #[doc = "\t\t\t\tmeter_t m(5.0);"]
1401 #[doc = "\t\t\t\tdouble val = m(); // val == 5.0\t@endcode."]
1402 #[doc = " @tparam\t\tUnits unit tag for which type of units the `unit_t` represents (e.g. meters)"]
1403 #[doc = " @tparam\t\tT underlying type of the storage. Defaults to double."]
1404 #[doc = " @tparam\t\tNonLinearScale optional scale class for the units. Defaults to linear (i.e. does"]
1405 #[doc = "\t\t\t\tnot scale the unit value). Examples of non-linear scales could be logarithmic,"]
1406 #[doc = "\t\t\t\tdecibel, or richter scales. Non-linear scales must adhere to the non-linear-scale"]
1407 #[doc = "\t\t\t\tconcept, i.e. `is_nonlinear_scale<...>::value` must be `true`."]
1408 #[doc = " @sa"]
1409 #[doc = "\t\t\t\t- \\ref lengthContainers \"length unit containers\""]
1410 #[doc = "\t\t\t\t- \\ref massContainers \"mass unit containers\""]
1411 #[doc = "\t\t\t\t- \\ref timeContainers \"time unit containers\""]
1412 #[doc = "\t\t\t\t- \\ref angleContainers \"angle unit containers\""]
1413 #[doc = "\t\t\t\t- \\ref currentContainers \"current unit containers\""]
1414 #[doc = "\t\t\t\t- \\ref temperatureContainers \"temperature unit containers\""]
1415 #[doc = "\t\t\t\t- \\ref substanceContainers \"substance unit containers\""]
1416 #[doc = "\t\t\t\t- \\ref luminousIntensityContainers \"luminous intensity unit containers\""]
1417 #[doc = "\t\t\t\t- \\ref solidAngleContainers \"solid angle unit containers\""]
1418 #[doc = "\t\t\t\t- \\ref frequencyContainers \"frequency unit containers\""]
1419 #[doc = "\t\t\t\t- \\ref velocityContainers \"velocity unit containers\""]
1420 #[doc = "\t\t\t\t- \\ref angularVelocityContainers \"angular velocity unit containers\""]
1421 #[doc = "\t\t\t\t- \\ref accelerationContainers \"acceleration unit containers\""]
1422 #[doc = "\t\t\t\t- \\ref forceContainers \"force unit containers\""]
1423 #[doc = "\t\t\t\t- \\ref pressureContainers \"pressure unit containers\""]
1424 #[doc = "\t\t\t\t- \\ref chargeContainers \"charge unit containers\""]
1425 #[doc = "\t\t\t\t- \\ref energyContainers \"energy unit containers\""]
1426 #[doc = "\t\t\t\t- \\ref powerContainers \"power unit containers\""]
1427 #[doc = "\t\t\t\t- \\ref voltageContainers \"voltage unit containers\""]
1428 #[doc = "\t\t\t\t- \\ref capacitanceContainers \"capacitance unit containers\""]
1429 #[doc = "\t\t\t\t- \\ref impedanceContainers \"impedance unit containers\""]
1430 #[doc = "\t\t\t\t- \\ref magneticFluxContainers \"magnetic flux unit containers\""]
1431 #[doc = "\t\t\t\t- \\ref magneticFieldStrengthContainers \"magnetic field strength unit containers\""]
1432 #[doc = "\t\t\t\t- \\ref inductanceContainers \"inductance unit containers\""]
1433 #[doc = "\t\t\t\t- \\ref luminousFluxContainers \"luminous flux unit containers\""]
1434 #[doc = "\t\t\t\t- \\ref illuminanceContainers \"illuminance unit containers\""]
1435 #[doc = "\t\t\t\t- \\ref radiationContainers \"radiation unit containers\""]
1436 #[doc = "\t\t\t\t- \\ref torqueContainers \"torque unit containers\""]
1437 #[doc = "\t\t\t\t- \\ref areaContainers \"area unit containers\""]
1438 #[doc = "\t\t\t\t- \\ref volumeContainers \"volume unit containers\""]
1439 #[doc = "\t\t\t\t- \\ref densityContainers \"density unit containers\""]
1440 #[doc = "\t\t\t\t- \\ref concentrationContainers \"concentration unit containers\""]
1441 #[doc = "\t\t\t\t- \\ref constantContainers \"constant unit containers\""]
1442 #[repr(C)]
1443 pub struct unit_t {
1444 pub _base: root::units::linear_scale<[u8; 0usize]>,
1445 }
1446 pub type unit_t_nls = root::units::linear_scale<[u8; 0usize]>;
1447 pub type unit_t_non_linear_scale_type = root::units::linear_scale<[u8; 0usize]>;
1448 pub type unit_t_underlying_type<T> = T;
1449 pub type unit_t_value_type<T> = T;
1450 pub type unit_t_unit_type<Units> = Units;
1451 #[doc = " @cond"]
1452 #[repr(C)]
1453 #[derive(Debug)]
1454 pub struct linear_scale<T> {
1455 #[doc = "< linearized value."]
1456 pub m_value: T,
1457 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
1458 }
1459 pub mod time {
1460 #[allow(unused_imports)]
1461 use self::super::super::super::root;
1462 pub type seconds = u8;
1463 pub type second = root::units::time::seconds;
1464 #[doc = " @ingroup\t\tUnitContainers"]
1465 #[doc = " @brief\t\tContainer for values which represent quantities of a given unit."]
1466 #[doc = " @details\t\tStores a value which represents a quantity in the given units. Unit containers"]
1467 #[doc = "\t\t\t\t(except scalar values) are *not* convertible to built-in c++ types, in order to"]
1468 #[doc = "\t\t\t\tprovide type safety in dimensional analysis. Unit containers *are* implicitly"]
1469 #[doc = "\t\t\t\tconvertible to other compatible unit container types. Unit containers support"]
1470 #[doc = "\t\t\t\tvarious types of arithmetic operations, depending on their scale type."]
1471 #[doc = ""]
1472 #[doc = "\t\t\t\tThe value of a `unit_t` can only be changed on construction, or by assignment"]
1473 #[doc = "\t\t\t\tfrom another `unit_t` type. If necessary, the underlying value can be accessed"]
1474 #[doc = "\t\t\t\tusing `operator()`: @code"]
1475 #[doc = "\t\t\t\tmeter_t m(5.0);"]
1476 #[doc = "\t\t\t\tdouble val = m(); // val == 5.0\t@endcode."]
1477 #[doc = " @tparam\t\tUnits unit tag for which type of units the `unit_t` represents (e.g. meters)"]
1478 #[doc = " @tparam\t\tT underlying type of the storage. Defaults to double."]
1479 #[doc = " @tparam\t\tNonLinearScale optional scale class for the units. Defaults to linear (i.e. does"]
1480 #[doc = "\t\t\t\tnot scale the unit value). Examples of non-linear scales could be logarithmic,"]
1481 #[doc = "\t\t\t\tdecibel, or richter scales. Non-linear scales must adhere to the non-linear-scale"]
1482 #[doc = "\t\t\t\tconcept, i.e. `is_nonlinear_scale<...>::value` must be `true`."]
1483 #[doc = " @sa"]
1484 #[doc = "\t\t\t\t- \\ref lengthContainers \"length unit containers\""]
1485 #[doc = "\t\t\t\t- \\ref massContainers \"mass unit containers\""]
1486 #[doc = "\t\t\t\t- \\ref timeContainers \"time unit containers\""]
1487 #[doc = "\t\t\t\t- \\ref angleContainers \"angle unit containers\""]
1488 #[doc = "\t\t\t\t- \\ref currentContainers \"current unit containers\""]
1489 #[doc = "\t\t\t\t- \\ref temperatureContainers \"temperature unit containers\""]
1490 #[doc = "\t\t\t\t- \\ref substanceContainers \"substance unit containers\""]
1491 #[doc = "\t\t\t\t- \\ref luminousIntensityContainers \"luminous intensity unit containers\""]
1492 #[doc = "\t\t\t\t- \\ref solidAngleContainers \"solid angle unit containers\""]
1493 #[doc = "\t\t\t\t- \\ref frequencyContainers \"frequency unit containers\""]
1494 #[doc = "\t\t\t\t- \\ref velocityContainers \"velocity unit containers\""]
1495 #[doc = "\t\t\t\t- \\ref angularVelocityContainers \"angular velocity unit containers\""]
1496 #[doc = "\t\t\t\t- \\ref accelerationContainers \"acceleration unit containers\""]
1497 #[doc = "\t\t\t\t- \\ref forceContainers \"force unit containers\""]
1498 #[doc = "\t\t\t\t- \\ref pressureContainers \"pressure unit containers\""]
1499 #[doc = "\t\t\t\t- \\ref chargeContainers \"charge unit containers\""]
1500 #[doc = "\t\t\t\t- \\ref energyContainers \"energy unit containers\""]
1501 #[doc = "\t\t\t\t- \\ref powerContainers \"power unit containers\""]
1502 #[doc = "\t\t\t\t- \\ref voltageContainers \"voltage unit containers\""]
1503 #[doc = "\t\t\t\t- \\ref capacitanceContainers \"capacitance unit containers\""]
1504 #[doc = "\t\t\t\t- \\ref impedanceContainers \"impedance unit containers\""]
1505 #[doc = "\t\t\t\t- \\ref magneticFluxContainers \"magnetic flux unit containers\""]
1506 #[doc = "\t\t\t\t- \\ref magneticFieldStrengthContainers \"magnetic field strength unit containers\""]
1507 #[doc = "\t\t\t\t- \\ref inductanceContainers \"inductance unit containers\""]
1508 #[doc = "\t\t\t\t- \\ref luminousFluxContainers \"luminous flux unit containers\""]
1509 #[doc = "\t\t\t\t- \\ref illuminanceContainers \"illuminance unit containers\""]
1510 #[doc = "\t\t\t\t- \\ref radiationContainers \"radiation unit containers\""]
1511 #[doc = "\t\t\t\t- \\ref torqueContainers \"torque unit containers\""]
1512 #[doc = "\t\t\t\t- \\ref areaContainers \"area unit containers\""]
1513 #[doc = "\t\t\t\t- \\ref volumeContainers \"volume unit containers\""]
1514 #[doc = "\t\t\t\t- \\ref densityContainers \"density unit containers\""]
1515 #[doc = "\t\t\t\t- \\ref concentrationContainers \"concentration unit containers\""]
1516 #[doc = "\t\t\t\t- \\ref constantContainers \"constant unit containers\""]
1517 pub type second_t = root::units::unit_t;
1518 }
1519 pub mod angle {
1520 #[allow(unused_imports)]
1521 use self::super::super::super::root;
1522 pub type radians = u8;
1523 pub type radian = root::units::angle::radians;
1524 #[doc = " @ingroup\t\tUnitContainers"]
1525 #[doc = " @brief\t\tContainer for values which represent quantities of a given unit."]
1526 #[doc = " @details\t\tStores a value which represents a quantity in the given units. Unit containers"]
1527 #[doc = "\t\t\t\t(except scalar values) are *not* convertible to built-in c++ types, in order to"]
1528 #[doc = "\t\t\t\tprovide type safety in dimensional analysis. Unit containers *are* implicitly"]
1529 #[doc = "\t\t\t\tconvertible to other compatible unit container types. Unit containers support"]
1530 #[doc = "\t\t\t\tvarious types of arithmetic operations, depending on their scale type."]
1531 #[doc = ""]
1532 #[doc = "\t\t\t\tThe value of a `unit_t` can only be changed on construction, or by assignment"]
1533 #[doc = "\t\t\t\tfrom another `unit_t` type. If necessary, the underlying value can be accessed"]
1534 #[doc = "\t\t\t\tusing `operator()`: @code"]
1535 #[doc = "\t\t\t\tmeter_t m(5.0);"]
1536 #[doc = "\t\t\t\tdouble val = m(); // val == 5.0\t@endcode."]
1537 #[doc = " @tparam\t\tUnits unit tag for which type of units the `unit_t` represents (e.g. meters)"]
1538 #[doc = " @tparam\t\tT underlying type of the storage. Defaults to double."]
1539 #[doc = " @tparam\t\tNonLinearScale optional scale class for the units. Defaults to linear (i.e. does"]
1540 #[doc = "\t\t\t\tnot scale the unit value). Examples of non-linear scales could be logarithmic,"]
1541 #[doc = "\t\t\t\tdecibel, or richter scales. Non-linear scales must adhere to the non-linear-scale"]
1542 #[doc = "\t\t\t\tconcept, i.e. `is_nonlinear_scale<...>::value` must be `true`."]
1543 #[doc = " @sa"]
1544 #[doc = "\t\t\t\t- \\ref lengthContainers \"length unit containers\""]
1545 #[doc = "\t\t\t\t- \\ref massContainers \"mass unit containers\""]
1546 #[doc = "\t\t\t\t- \\ref timeContainers \"time unit containers\""]
1547 #[doc = "\t\t\t\t- \\ref angleContainers \"angle unit containers\""]
1548 #[doc = "\t\t\t\t- \\ref currentContainers \"current unit containers\""]
1549 #[doc = "\t\t\t\t- \\ref temperatureContainers \"temperature unit containers\""]
1550 #[doc = "\t\t\t\t- \\ref substanceContainers \"substance unit containers\""]
1551 #[doc = "\t\t\t\t- \\ref luminousIntensityContainers \"luminous intensity unit containers\""]
1552 #[doc = "\t\t\t\t- \\ref solidAngleContainers \"solid angle unit containers\""]
1553 #[doc = "\t\t\t\t- \\ref frequencyContainers \"frequency unit containers\""]
1554 #[doc = "\t\t\t\t- \\ref velocityContainers \"velocity unit containers\""]
1555 #[doc = "\t\t\t\t- \\ref angularVelocityContainers \"angular velocity unit containers\""]
1556 #[doc = "\t\t\t\t- \\ref accelerationContainers \"acceleration unit containers\""]
1557 #[doc = "\t\t\t\t- \\ref forceContainers \"force unit containers\""]
1558 #[doc = "\t\t\t\t- \\ref pressureContainers \"pressure unit containers\""]
1559 #[doc = "\t\t\t\t- \\ref chargeContainers \"charge unit containers\""]
1560 #[doc = "\t\t\t\t- \\ref energyContainers \"energy unit containers\""]
1561 #[doc = "\t\t\t\t- \\ref powerContainers \"power unit containers\""]
1562 #[doc = "\t\t\t\t- \\ref voltageContainers \"voltage unit containers\""]
1563 #[doc = "\t\t\t\t- \\ref capacitanceContainers \"capacitance unit containers\""]
1564 #[doc = "\t\t\t\t- \\ref impedanceContainers \"impedance unit containers\""]
1565 #[doc = "\t\t\t\t- \\ref magneticFluxContainers \"magnetic flux unit containers\""]
1566 #[doc = "\t\t\t\t- \\ref magneticFieldStrengthContainers \"magnetic field strength unit containers\""]
1567 #[doc = "\t\t\t\t- \\ref inductanceContainers \"inductance unit containers\""]
1568 #[doc = "\t\t\t\t- \\ref luminousFluxContainers \"luminous flux unit containers\""]
1569 #[doc = "\t\t\t\t- \\ref illuminanceContainers \"illuminance unit containers\""]
1570 #[doc = "\t\t\t\t- \\ref radiationContainers \"radiation unit containers\""]
1571 #[doc = "\t\t\t\t- \\ref torqueContainers \"torque unit containers\""]
1572 #[doc = "\t\t\t\t- \\ref areaContainers \"area unit containers\""]
1573 #[doc = "\t\t\t\t- \\ref volumeContainers \"volume unit containers\""]
1574 #[doc = "\t\t\t\t- \\ref densityContainers \"density unit containers\""]
1575 #[doc = "\t\t\t\t- \\ref concentrationContainers \"concentration unit containers\""]
1576 #[doc = "\t\t\t\t- \\ref constantContainers \"constant unit containers\""]
1577 pub type radian_t = root::units::unit_t;
1578 #[doc = " @brief\t\tunit type template specialization for units derived from base units."]
1579 pub type degrees = root::units::unit;
1580 #[doc = " @brief\t\tunit type template specialization for units derived from base units."]
1581 pub type degree = root::units::angle::degrees;
1582 #[doc = " @ingroup\t\tUnitContainers"]
1583 #[doc = " @brief\t\tContainer for values which represent quantities of a given unit."]
1584 #[doc = " @details\t\tStores a value which represents a quantity in the given units. Unit containers"]
1585 #[doc = "\t\t\t\t(except scalar values) are *not* convertible to built-in c++ types, in order to"]
1586 #[doc = "\t\t\t\tprovide type safety in dimensional analysis. Unit containers *are* implicitly"]
1587 #[doc = "\t\t\t\tconvertible to other compatible unit container types. Unit containers support"]
1588 #[doc = "\t\t\t\tvarious types of arithmetic operations, depending on their scale type."]
1589 #[doc = ""]
1590 #[doc = "\t\t\t\tThe value of a `unit_t` can only be changed on construction, or by assignment"]
1591 #[doc = "\t\t\t\tfrom another `unit_t` type. If necessary, the underlying value can be accessed"]
1592 #[doc = "\t\t\t\tusing `operator()`: @code"]
1593 #[doc = "\t\t\t\tmeter_t m(5.0);"]
1594 #[doc = "\t\t\t\tdouble val = m(); // val == 5.0\t@endcode."]
1595 #[doc = " @tparam\t\tUnits unit tag for which type of units the `unit_t` represents (e.g. meters)"]
1596 #[doc = " @tparam\t\tT underlying type of the storage. Defaults to double."]
1597 #[doc = " @tparam\t\tNonLinearScale optional scale class for the units. Defaults to linear (i.e. does"]
1598 #[doc = "\t\t\t\tnot scale the unit value). Examples of non-linear scales could be logarithmic,"]
1599 #[doc = "\t\t\t\tdecibel, or richter scales. Non-linear scales must adhere to the non-linear-scale"]
1600 #[doc = "\t\t\t\tconcept, i.e. `is_nonlinear_scale<...>::value` must be `true`."]
1601 #[doc = " @sa"]
1602 #[doc = "\t\t\t\t- \\ref lengthContainers \"length unit containers\""]
1603 #[doc = "\t\t\t\t- \\ref massContainers \"mass unit containers\""]
1604 #[doc = "\t\t\t\t- \\ref timeContainers \"time unit containers\""]
1605 #[doc = "\t\t\t\t- \\ref angleContainers \"angle unit containers\""]
1606 #[doc = "\t\t\t\t- \\ref currentContainers \"current unit containers\""]
1607 #[doc = "\t\t\t\t- \\ref temperatureContainers \"temperature unit containers\""]
1608 #[doc = "\t\t\t\t- \\ref substanceContainers \"substance unit containers\""]
1609 #[doc = "\t\t\t\t- \\ref luminousIntensityContainers \"luminous intensity unit containers\""]
1610 #[doc = "\t\t\t\t- \\ref solidAngleContainers \"solid angle unit containers\""]
1611 #[doc = "\t\t\t\t- \\ref frequencyContainers \"frequency unit containers\""]
1612 #[doc = "\t\t\t\t- \\ref velocityContainers \"velocity unit containers\""]
1613 #[doc = "\t\t\t\t- \\ref angularVelocityContainers \"angular velocity unit containers\""]
1614 #[doc = "\t\t\t\t- \\ref accelerationContainers \"acceleration unit containers\""]
1615 #[doc = "\t\t\t\t- \\ref forceContainers \"force unit containers\""]
1616 #[doc = "\t\t\t\t- \\ref pressureContainers \"pressure unit containers\""]
1617 #[doc = "\t\t\t\t- \\ref chargeContainers \"charge unit containers\""]
1618 #[doc = "\t\t\t\t- \\ref energyContainers \"energy unit containers\""]
1619 #[doc = "\t\t\t\t- \\ref powerContainers \"power unit containers\""]
1620 #[doc = "\t\t\t\t- \\ref voltageContainers \"voltage unit containers\""]
1621 #[doc = "\t\t\t\t- \\ref capacitanceContainers \"capacitance unit containers\""]
1622 #[doc = "\t\t\t\t- \\ref impedanceContainers \"impedance unit containers\""]
1623 #[doc = "\t\t\t\t- \\ref magneticFluxContainers \"magnetic flux unit containers\""]
1624 #[doc = "\t\t\t\t- \\ref magneticFieldStrengthContainers \"magnetic field strength unit containers\""]
1625 #[doc = "\t\t\t\t- \\ref inductanceContainers \"inductance unit containers\""]
1626 #[doc = "\t\t\t\t- \\ref luminousFluxContainers \"luminous flux unit containers\""]
1627 #[doc = "\t\t\t\t- \\ref illuminanceContainers \"illuminance unit containers\""]
1628 #[doc = "\t\t\t\t- \\ref radiationContainers \"radiation unit containers\""]
1629 #[doc = "\t\t\t\t- \\ref torqueContainers \"torque unit containers\""]
1630 #[doc = "\t\t\t\t- \\ref areaContainers \"area unit containers\""]
1631 #[doc = "\t\t\t\t- \\ref volumeContainers \"volume unit containers\""]
1632 #[doc = "\t\t\t\t- \\ref densityContainers \"density unit containers\""]
1633 #[doc = "\t\t\t\t- \\ref concentrationContainers \"concentration unit containers\""]
1634 #[doc = "\t\t\t\t- \\ref constantContainers \"constant unit containers\""]
1635 pub type degree_t = root::units::unit_t;
1636 }
1637 }
1638 pub mod frc {
1639 #[allow(unused_imports)]
1640 use self::super::super::root;
1641 pub const AnalogTriggerType_kInWindow: root::frc::AnalogTriggerType = 0;
1642 pub const AnalogTriggerType_kState: root::frc::AnalogTriggerType = 1;
1643 pub const AnalogTriggerType_kRisingPulse: root::frc::AnalogTriggerType = 2;
1644 pub const AnalogTriggerType_kFallingPulse: root::frc::AnalogTriggerType = 3;
1645 pub type AnalogTriggerType = ::std::os::raw::c_int;
1646 #[repr(C)]
1647 pub struct DigitalSource__bindgen_vtable(::std::os::raw::c_void);
1648 #[doc = " DigitalSource Interface."]
1649 #[doc = ""]
1650 #[doc = " The DigitalSource represents all the possible inputs for a counter or a"]
1651 #[doc = " quadrature encoder. The source may be either a digital input or an analog"]
1652 #[doc = " input. If the caller just provides a channel, then a digital input will be"]
1653 #[doc = " constructed and freed when finished for the source. The source can either be"]
1654 #[doc = " a digital input or analog trigger but not both."]
1655 #[repr(C)]
1656 #[derive(Debug, Copy, Clone)]
1657 pub struct DigitalSource {
1658 pub vtable_: *const DigitalSource__bindgen_vtable,
1659 }
1660 #[test]
1661 fn bindgen_test_layout_DigitalSource() {
1662 assert_eq!(
1663 ::std::mem::size_of::<DigitalSource>(),
1664 8usize,
1665 concat!("Size of: ", stringify!(DigitalSource))
1666 );
1667 assert_eq!(
1668 ::std::mem::align_of::<DigitalSource>(),
1669 8usize,
1670 concat!("Alignment of ", stringify!(DigitalSource))
1671 );
1672 }
1673 #[repr(C)]
1674 pub struct SPI__bindgen_vtable(::std::os::raw::c_void);
1675 #[doc = " SPI bus interface class."]
1676 #[doc = ""]
1677 #[doc = " This class is intended to be used by sensor (and other SPI device) drivers."]
1678 #[doc = " It probably should not be used directly."]
1679 #[doc = ""]
1680 #[repr(C)]
1681 #[derive(Debug)]
1682 pub struct SPI {
1683 pub vtable_: *const SPI__bindgen_vtable,
1684 pub m_port: root::hal::SPIPort,
1685 pub m_msbFirst: bool,
1686 pub m_sampleOnTrailing: bool,
1687 pub m_clockIdleHigh: bool,
1688 pub m_accum: root::std::unique_ptr,
1689 }
1690 pub const SPI_Port_kOnboardCS0: root::frc::SPI_Port = 0;
1691 pub const SPI_Port_kOnboardCS1: root::frc::SPI_Port = 1;
1692 pub const SPI_Port_kOnboardCS2: root::frc::SPI_Port = 2;
1693 pub const SPI_Port_kOnboardCS3: root::frc::SPI_Port = 3;
1694 pub const SPI_Port_kMXP: root::frc::SPI_Port = 4;
1695 pub type SPI_Port = ::std::os::raw::c_uint;
1696 #[repr(C)]
1697 #[derive(Debug, Copy, Clone)]
1698 pub struct SPI_Accumulator {
1699 _unused: [u8; 0],
1700 }
1701 #[test]
1702 fn bindgen_test_layout_SPI() {
1703 assert_eq!(
1704 ::std::mem::size_of::<SPI>(),
1705 24usize,
1706 concat!("Size of: ", stringify!(SPI))
1707 );
1708 assert_eq!(
1709 ::std::mem::align_of::<SPI>(),
1710 8usize,
1711 concat!("Alignment of ", stringify!(SPI))
1712 );
1713 fn test_field_m_port() {
1714 assert_eq!(
1715 unsafe {
1716 let uninit = ::std::mem::MaybeUninit::<SPI>::uninit();
1717 let ptr = uninit.as_ptr();
1718 ::std::ptr::addr_of!((*ptr).m_port) as usize - ptr as usize
1719 },
1720 8usize,
1721 concat!(
1722 "Offset of field: ",
1723 stringify!(SPI),
1724 "::",
1725 stringify!(m_port)
1726 )
1727 );
1728 }
1729 test_field_m_port();
1730 fn test_field_m_msbFirst() {
1731 assert_eq!(
1732 unsafe {
1733 let uninit = ::std::mem::MaybeUninit::<SPI>::uninit();
1734 let ptr = uninit.as_ptr();
1735 ::std::ptr::addr_of!((*ptr).m_msbFirst) as usize - ptr as usize
1736 },
1737 12usize,
1738 concat!(
1739 "Offset of field: ",
1740 stringify!(SPI),
1741 "::",
1742 stringify!(m_msbFirst)
1743 )
1744 );
1745 }
1746 test_field_m_msbFirst();
1747 fn test_field_m_sampleOnTrailing() {
1748 assert_eq!(
1749 unsafe {
1750 let uninit = ::std::mem::MaybeUninit::<SPI>::uninit();
1751 let ptr = uninit.as_ptr();
1752 ::std::ptr::addr_of!((*ptr).m_sampleOnTrailing) as usize - ptr as usize
1753 },
1754 13usize,
1755 concat!(
1756 "Offset of field: ",
1757 stringify!(SPI),
1758 "::",
1759 stringify!(m_sampleOnTrailing)
1760 )
1761 );
1762 }
1763 test_field_m_sampleOnTrailing();
1764 fn test_field_m_clockIdleHigh() {
1765 assert_eq!(
1766 unsafe {
1767 let uninit = ::std::mem::MaybeUninit::<SPI>::uninit();
1768 let ptr = uninit.as_ptr();
1769 ::std::ptr::addr_of!((*ptr).m_clockIdleHigh) as usize - ptr as usize
1770 },
1771 14usize,
1772 concat!(
1773 "Offset of field: ",
1774 stringify!(SPI),
1775 "::",
1776 stringify!(m_clockIdleHigh)
1777 )
1778 );
1779 }
1780 test_field_m_clockIdleHigh();
1781 fn test_field_m_accum() {
1782 assert_eq!(
1783 unsafe {
1784 let uninit = ::std::mem::MaybeUninit::<SPI>::uninit();
1785 let ptr = uninit.as_ptr();
1786 ::std::ptr::addr_of!((*ptr).m_accum) as usize - ptr as usize
1787 },
1788 16usize,
1789 concat!(
1790 "Offset of field: ",
1791 stringify!(SPI),
1792 "::",
1793 stringify!(m_accum)
1794 )
1795 );
1796 }
1797 test_field_m_accum();
1798 }
1799 extern "C" {
1800 #[link_name = "\u{1}_ZNK3frc3SPI7GetPortEv"]
1801 pub fn SPI_GetPort(this: *const root::frc::SPI) -> root::frc::SPI_Port;
1802 }
1803 extern "C" {
1804 #[doc = " Configure the rate of the generated clock signal."]
1805 #[doc = ""]
1806 #[doc = " The default value is 500,000Hz."]
1807 #[doc = " The maximum value is 4,000,000Hz."]
1808 #[doc = ""]
1809 #[doc = " @param hz The clock rate in Hertz."]
1810 #[link_name = "\u{1}_ZN3frc3SPI12SetClockRateEi"]
1811 pub fn SPI_SetClockRate(this: *mut root::frc::SPI, hz: ::std::os::raw::c_int);
1812 }
1813 extern "C" {
1814 #[doc = " Configure the order that bits are sent and received on the wire"]
1815 #[doc = " to be most significant bit first."]
1816 #[link_name = "\u{1}_ZN3frc3SPI11SetMSBFirstEv"]
1817 pub fn SPI_SetMSBFirst(this: *mut root::frc::SPI);
1818 }
1819 extern "C" {
1820 #[doc = " Configure the order that bits are sent and received on the wire"]
1821 #[doc = " to be least significant bit first."]
1822 #[link_name = "\u{1}_ZN3frc3SPI11SetLSBFirstEv"]
1823 pub fn SPI_SetLSBFirst(this: *mut root::frc::SPI);
1824 }
1825 extern "C" {
1826 #[doc = " Configure that the data is stable on the leading edge and the data"]
1827 #[doc = " changes on the trailing edge."]
1828 #[link_name = "\u{1}_ZN3frc3SPI26SetSampleDataOnLeadingEdgeEv"]
1829 pub fn SPI_SetSampleDataOnLeadingEdge(this: *mut root::frc::SPI);
1830 }
1831 extern "C" {
1832 #[doc = " Configure that the data is stable on the trailing edge and the data"]
1833 #[doc = " changes on the leading edge."]
1834 #[link_name = "\u{1}_ZN3frc3SPI27SetSampleDataOnTrailingEdgeEv"]
1835 pub fn SPI_SetSampleDataOnTrailingEdge(this: *mut root::frc::SPI);
1836 }
1837 extern "C" {
1838 #[doc = " Configure that the data is stable on the falling edge and the data"]
1839 #[doc = " changes on the rising edge."]
1840 #[doc = ""]
1841 #[doc = " @deprecated Use SetSampleDataOnTrailingEdge() instead."]
1842 #[doc = ""]
1843 #[link_name = "\u{1}_ZN3frc3SPI22SetSampleDataOnFallingEv"]
1844 pub fn SPI_SetSampleDataOnFalling(this: *mut root::frc::SPI);
1845 }
1846 extern "C" {
1847 #[doc = " Configure that the data is stable on the rising edge and the data"]
1848 #[doc = " changes on the falling edge."]
1849 #[doc = ""]
1850 #[doc = " @deprecated Use SetSampleDataOnLeadingEdge() instead."]
1851 #[doc = ""]
1852 #[link_name = "\u{1}_ZN3frc3SPI21SetSampleDataOnRisingEv"]
1853 pub fn SPI_SetSampleDataOnRising(this: *mut root::frc::SPI);
1854 }
1855 extern "C" {
1856 #[doc = " Configure the clock output line to be active low."]
1857 #[doc = " This is sometimes called clock polarity high or clock idle high."]
1858 #[link_name = "\u{1}_ZN3frc3SPI17SetClockActiveLowEv"]
1859 pub fn SPI_SetClockActiveLow(this: *mut root::frc::SPI);
1860 }
1861 extern "C" {
1862 #[doc = " Configure the clock output line to be active high."]
1863 #[doc = " This is sometimes called clock polarity low or clock idle low."]
1864 #[link_name = "\u{1}_ZN3frc3SPI18SetClockActiveHighEv"]
1865 pub fn SPI_SetClockActiveHigh(this: *mut root::frc::SPI);
1866 }
1867 extern "C" {
1868 #[doc = " Configure the chip select line to be active high."]
1869 #[link_name = "\u{1}_ZN3frc3SPI23SetChipSelectActiveHighEv"]
1870 pub fn SPI_SetChipSelectActiveHigh(this: *mut root::frc::SPI);
1871 }
1872 extern "C" {
1873 #[doc = " Configure the chip select line to be active low."]
1874 #[link_name = "\u{1}_ZN3frc3SPI22SetChipSelectActiveLowEv"]
1875 pub fn SPI_SetChipSelectActiveLow(this: *mut root::frc::SPI);
1876 }
1877 extern "C" {
1878 #[doc = " Initialize automatic SPI transfer engine."]
1879 #[doc = ""]
1880 #[doc = " Only a single engine is available, and use of it blocks use of all other"]
1881 #[doc = " chip select usage on the same physical SPI port while it is running."]
1882 #[doc = ""]
1883 #[doc = " @param bufferSize buffer size in bytes"]
1884 #[link_name = "\u{1}_ZN3frc3SPI8InitAutoEi"]
1885 pub fn SPI_InitAuto(this: *mut root::frc::SPI, bufferSize: ::std::os::raw::c_int);
1886 }
1887 extern "C" {
1888 #[doc = " Frees the automatic SPI transfer engine."]
1889 #[link_name = "\u{1}_ZN3frc3SPI8FreeAutoEv"]
1890 pub fn SPI_FreeAuto(this: *mut root::frc::SPI);
1891 }
1892 extern "C" {
1893 #[doc = " Set the data to be transmitted by the engine."]
1894 #[doc = ""]
1895 #[doc = " Up to 16 bytes are configurable, and may be followed by up to 127 zero"]
1896 #[doc = " bytes."]
1897 #[doc = ""]
1898 #[doc = " @param dataToSend data to send (maximum 16 bytes)"]
1899 #[doc = " @param zeroSize number of zeros to send after the data"]
1900 #[link_name = "\u{1}_ZN3frc3SPI19SetAutoTransmitDataEN3wpi4spanIKhLm18446744073709551615EEEi"]
1901 pub fn SPI_SetAutoTransmitData(
1902 this: *mut root::frc::SPI,
1903 dataToSend: u8,
1904 zeroSize: ::std::os::raw::c_int,
1905 );
1906 }
1907 extern "C" {
1908 #[doc = " Start running the automatic SPI transfer engine at a periodic rate."]
1909 #[doc = ""]
1910 #[doc = " InitAuto() and SetAutoTransmitData() must be called before calling this"]
1911 #[doc = " function."]
1912 #[doc = ""]
1913 #[doc = " @param period period between transfers (us resolution)"]
1914 #[link_name = "\u{1}_ZN3frc3SPI13StartAutoRateEN5units6unit_tINS1_4unitISt5ratioILl1ELl1EENS1_9base_unitIS4_ILl0ELl1EES7_S5_S7_S7_S7_S7_S7_S7_EES7_S7_EEdNS1_12linear_scaleEEE"]
1915 pub fn SPI_StartAutoRate(
1916 this: *mut root::frc::SPI,
1917 period: root::units::time::second_t,
1918 );
1919 }
1920 extern "C" {
1921 #[doc = " Start running the automatic SPI transfer engine at a periodic rate."]
1922 #[doc = ""]
1923 #[doc = " InitAuto() and SetAutoTransmitData() must be called before calling this"]
1924 #[doc = " function."]
1925 #[doc = ""]
1926 #[doc = " @deprecated use unit-safe StartAutoRate(units::second_t period) instead."]
1927 #[doc = ""]
1928 #[doc = " @param period period between transfers, in seconds (us resolution)"]
1929 #[link_name = "\u{1}_ZN3frc3SPI13StartAutoRateEd"]
1930 pub fn SPI_StartAutoRate1(this: *mut root::frc::SPI, period: f64);
1931 }
1932 extern "C" {
1933 #[doc = " Start running the automatic SPI transfer engine when a trigger occurs."]
1934 #[doc = ""]
1935 #[doc = " InitAuto() and SetAutoTransmitData() must be called before calling this"]
1936 #[doc = " function."]
1937 #[doc = ""]
1938 #[doc = " @param source digital source for the trigger (may be an analog trigger)"]
1939 #[doc = " @param rising trigger on the rising edge"]
1940 #[doc = " @param falling trigger on the falling edge"]
1941 #[link_name = "\u{1}_ZN3frc3SPI16StartAutoTriggerERNS_13DigitalSourceEbb"]
1942 pub fn SPI_StartAutoTrigger(
1943 this: *mut root::frc::SPI,
1944 source: *mut root::frc::DigitalSource,
1945 rising: bool,
1946 falling: bool,
1947 );
1948 }
1949 extern "C" {
1950 #[doc = " Stop running the automatic SPI transfer engine."]
1951 #[link_name = "\u{1}_ZN3frc3SPI8StopAutoEv"]
1952 pub fn SPI_StopAuto(this: *mut root::frc::SPI);
1953 }
1954 extern "C" {
1955 #[doc = " Force the engine to make a single transfer."]
1956 #[link_name = "\u{1}_ZN3frc3SPI13ForceAutoReadEv"]
1957 pub fn SPI_ForceAutoRead(this: *mut root::frc::SPI);
1958 }
1959 extern "C" {
1960 #[doc = " Read data that has been transferred by the automatic SPI transfer engine."]
1961 #[doc = ""]
1962 #[doc = " Transfers may be made a byte at a time, so it's necessary for the caller"]
1963 #[doc = " to handle cases where an entire transfer has not been completed."]
1964 #[doc = ""]
1965 #[doc = " Each received data sequence consists of a timestamp followed by the"]
1966 #[doc = " received data bytes, one byte per word (in the least significant byte)."]
1967 #[doc = " The length of each received data sequence is the same as the combined"]
1968 #[doc = " size of the data and zeroSize set in SetAutoTransmitData()."]
1969 #[doc = ""]
1970 #[doc = " Blocks until numToRead words have been read or timeout expires."]
1971 #[doc = " May be called with numToRead=0 to retrieve how many words are available."]
1972 #[doc = ""]
1973 #[doc = " @param buffer buffer where read words are stored"]
1974 #[doc = " @param numToRead number of words to read"]
1975 #[doc = " @param timeout timeout (ms resolution)"]
1976 #[doc = " @return Number of words remaining to be read"]
1977 #[link_name = "\u{1}_ZN3frc3SPI20ReadAutoReceivedDataEPjiN5units6unit_tINS2_4unitISt5ratioILl1ELl1EENS2_9base_unitIS5_ILl0ELl1EES8_S6_S8_S8_S8_S8_S8_S8_EES8_S8_EEdNS2_12linear_scaleEEE"]
1978 pub fn SPI_ReadAutoReceivedData(
1979 this: *mut root::frc::SPI,
1980 buffer: *mut u32,
1981 numToRead: ::std::os::raw::c_int,
1982 timeout: root::units::time::second_t,
1983 ) -> ::std::os::raw::c_int;
1984 }
1985 extern "C" {
1986 #[doc = " Get the number of bytes dropped by the automatic SPI transfer engine due"]
1987 #[doc = " to the receive buffer being full."]
1988 #[doc = ""]
1989 #[doc = " @return Number of bytes dropped"]
1990 #[link_name = "\u{1}_ZN3frc3SPI19GetAutoDroppedCountEv"]
1991 pub fn SPI_GetAutoDroppedCount(this: *mut root::frc::SPI) -> ::std::os::raw::c_int;
1992 }
1993 extern "C" {
1994 #[doc = " Configure the Auto SPI Stall time between reads."]
1995 #[doc = ""]
1996 #[doc = " @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for"]
1997 #[doc = " MXP."]
1998 #[doc = " @param csToSclkTicks the number of ticks to wait before asserting the cs"]
1999 #[doc = " pin"]
2000 #[doc = " @param stallTicks the number of ticks to stall for"]
2001 #[doc = " @param pow2BytesPerRead the number of bytes to read before stalling"]
2002 #[link_name = "\u{1}_ZN3frc3SPI18ConfigureAutoStallE11HAL_SPIPortiii"]
2003 pub fn SPI_ConfigureAutoStall(
2004 this: *mut root::frc::SPI,
2005 port: root::HAL_SPIPort,
2006 csToSclkTicks: ::std::os::raw::c_int,
2007 stallTicks: ::std::os::raw::c_int,
2008 pow2BytesPerRead: ::std::os::raw::c_int,
2009 );
2010 }
2011 extern "C" {
2012 #[doc = " Initialize the accumulator."]
2013 #[doc = ""]
2014 #[doc = " @param period Time between reads"]
2015 #[doc = " @param cmd SPI command to send to request data"]
2016 #[doc = " @param xferSize SPI transfer size, in bytes"]
2017 #[doc = " @param validMask Mask to apply to received data for validity checking"]
2018 #[doc = " @param validValue After valid_mask is applied, required matching value for"]
2019 #[doc = " validity checking"]
2020 #[doc = " @param dataShift Bit shift to apply to received data to get actual data"]
2021 #[doc = " value"]
2022 #[doc = " @param dataSize Size (in bits) of data field"]
2023 #[doc = " @param isSigned Is data field signed?"]
2024 #[doc = " @param bigEndian Is device big endian?"]
2025 #[link_name = "\u{1}_ZN3frc3SPI15InitAccumulatorEN5units6unit_tINS1_4unitISt5ratioILl1ELl1EENS1_9base_unitIS4_ILl0ELl1EES7_S5_S7_S7_S7_S7_S7_S7_EES7_S7_EEdNS1_12linear_scaleEEEiiiiiibb"]
2026 pub fn SPI_InitAccumulator(
2027 this: *mut root::frc::SPI,
2028 period: root::units::time::second_t,
2029 cmd: ::std::os::raw::c_int,
2030 xferSize: ::std::os::raw::c_int,
2031 validMask: ::std::os::raw::c_int,
2032 validValue: ::std::os::raw::c_int,
2033 dataShift: ::std::os::raw::c_int,
2034 dataSize: ::std::os::raw::c_int,
2035 isSigned: bool,
2036 bigEndian: bool,
2037 );
2038 }
2039 extern "C" {
2040 #[doc = " Initialize the accumulator."]
2041 #[doc = ""]
2042 #[doc = " @deprecated Use unit-safe version instead."]
2043 #[doc = " InitAccumulator(units::second_t period, int cmd, int <!--"]
2044 #[doc = " --> xferSize, int validMask, int validValue, int dataShift, <!--"]
2045 #[doc = " --> int dataSize, bool isSigned, bool bigEndian)"]
2046 #[doc = ""]
2047 #[doc = " @param period Time between reads"]
2048 #[doc = " @param cmd SPI command to send to request data"]
2049 #[doc = " @param xferSize SPI transfer size, in bytes"]
2050 #[doc = " @param validMask Mask to apply to received data for validity checking"]
2051 #[doc = " @param validValue After valid_mask is applied, required matching value for"]
2052 #[doc = " validity checking"]
2053 #[doc = " @param dataShift Bit shift to apply to received data to get actual data"]
2054 #[doc = " value"]
2055 #[doc = " @param dataSize Size (in bits) of data field"]
2056 #[doc = " @param isSigned Is data field signed?"]
2057 #[doc = " @param bigEndian Is device big endian?"]
2058 #[link_name = "\u{1}_ZN3frc3SPI15InitAccumulatorEdiiiiiibb"]
2059 pub fn SPI_InitAccumulator1(
2060 this: *mut root::frc::SPI,
2061 period: f64,
2062 cmd: ::std::os::raw::c_int,
2063 xferSize: ::std::os::raw::c_int,
2064 validMask: ::std::os::raw::c_int,
2065 validValue: ::std::os::raw::c_int,
2066 dataShift: ::std::os::raw::c_int,
2067 dataSize: ::std::os::raw::c_int,
2068 isSigned: bool,
2069 bigEndian: bool,
2070 );
2071 }
2072 extern "C" {
2073 #[doc = " Frees the accumulator."]
2074 #[link_name = "\u{1}_ZN3frc3SPI15FreeAccumulatorEv"]
2075 pub fn SPI_FreeAccumulator(this: *mut root::frc::SPI);
2076 }
2077 extern "C" {
2078 #[doc = " Resets the accumulator to zero."]
2079 #[link_name = "\u{1}_ZN3frc3SPI16ResetAccumulatorEv"]
2080 pub fn SPI_ResetAccumulator(this: *mut root::frc::SPI);
2081 }
2082 extern "C" {
2083 #[doc = " Set the center value of the accumulator."]
2084 #[doc = ""]
2085 #[doc = " The center value is subtracted from each value before it is added to the"]
2086 #[doc = " accumulator. This is used for the center value of devices like gyros and"]
2087 #[doc = " accelerometers to make integration work and to take the device offset into"]
2088 #[doc = " account when integrating."]
2089 #[link_name = "\u{1}_ZN3frc3SPI20SetAccumulatorCenterEi"]
2090 pub fn SPI_SetAccumulatorCenter(
2091 this: *mut root::frc::SPI,
2092 center: ::std::os::raw::c_int,
2093 );
2094 }
2095 extern "C" {
2096 #[doc = " Set the accumulator's deadband."]
2097 #[link_name = "\u{1}_ZN3frc3SPI22SetAccumulatorDeadbandEi"]
2098 pub fn SPI_SetAccumulatorDeadband(
2099 this: *mut root::frc::SPI,
2100 deadband: ::std::os::raw::c_int,
2101 );
2102 }
2103 extern "C" {
2104 #[doc = " Read the last value read by the accumulator engine."]
2105 #[link_name = "\u{1}_ZNK3frc3SPI23GetAccumulatorLastValueEv"]
2106 pub fn SPI_GetAccumulatorLastValue(
2107 this: *const root::frc::SPI,
2108 ) -> ::std::os::raw::c_int;
2109 }
2110 extern "C" {
2111 #[doc = " Read the accumulated value."]
2112 #[doc = ""]
2113 #[doc = " @return The 64-bit value accumulated since the last Reset()."]
2114 #[link_name = "\u{1}_ZNK3frc3SPI19GetAccumulatorValueEv"]
2115 pub fn SPI_GetAccumulatorValue(this: *const root::frc::SPI) -> i64;
2116 }
2117 extern "C" {
2118 #[doc = " Read the number of accumulated values."]
2119 #[doc = ""]
2120 #[doc = " Read the count of the accumulated values since the accumulator was last"]
2121 #[doc = " Reset()."]
2122 #[doc = ""]
2123 #[doc = " @return The number of times samples from the channel were accumulated."]
2124 #[link_name = "\u{1}_ZNK3frc3SPI19GetAccumulatorCountEv"]
2125 pub fn SPI_GetAccumulatorCount(this: *const root::frc::SPI) -> i64;
2126 }
2127 extern "C" {
2128 #[doc = " Read the average of the accumulated value."]
2129 #[doc = ""]
2130 #[doc = " @return The accumulated average value (value / count)."]
2131 #[link_name = "\u{1}_ZNK3frc3SPI21GetAccumulatorAverageEv"]
2132 pub fn SPI_GetAccumulatorAverage(this: *const root::frc::SPI) -> f64;
2133 }
2134 extern "C" {
2135 #[doc = " Read the accumulated value and the number of accumulated values atomically."]
2136 #[doc = ""]
2137 #[doc = " This function reads the value and count atomically."]
2138 #[doc = " This can be used for averaging."]
2139 #[doc = ""]
2140 #[doc = " @param value Pointer to the 64-bit accumulated output."]
2141 #[doc = " @param count Pointer to the number of accumulation cycles."]
2142 #[link_name = "\u{1}_ZNK3frc3SPI20GetAccumulatorOutputERlS1_"]
2143 pub fn SPI_GetAccumulatorOutput(
2144 this: *const root::frc::SPI,
2145 value: *mut i64,
2146 count: *mut i64,
2147 );
2148 }
2149 extern "C" {
2150 #[doc = " Set the center value of the accumulator integrator."]
2151 #[doc = ""]
2152 #[doc = " The center value is subtracted from each value*dt before it is added to the"]
2153 #[doc = " integrated value. This is used for the center value of devices like gyros"]
2154 #[doc = " and accelerometers to take the device offset into account when integrating."]
2155 #[link_name = "\u{1}_ZN3frc3SPI30SetAccumulatorIntegratedCenterEd"]
2156 pub fn SPI_SetAccumulatorIntegratedCenter(this: *mut root::frc::SPI, center: f64);
2157 }
2158 extern "C" {
2159 #[doc = " Read the integrated value. This is the sum of (each value * time between"]
2160 #[doc = " values)."]
2161 #[doc = ""]
2162 #[doc = " @return The integrated value accumulated since the last Reset()."]
2163 #[link_name = "\u{1}_ZNK3frc3SPI29GetAccumulatorIntegratedValueEv"]
2164 pub fn SPI_GetAccumulatorIntegratedValue(this: *const root::frc::SPI) -> f64;
2165 }
2166 extern "C" {
2167 #[doc = " Read the average of the integrated value. This is the sum of (each value"]
2168 #[doc = " times the time between values), divided by the count."]
2169 #[doc = ""]
2170 #[doc = " @return The average of the integrated value accumulated since the last"]
2171 #[doc = " Reset()."]
2172 #[link_name = "\u{1}_ZNK3frc3SPI31GetAccumulatorIntegratedAverageEv"]
2173 pub fn SPI_GetAccumulatorIntegratedAverage(this: *const root::frc::SPI) -> f64;
2174 }
2175 extern "C" {
2176 #[doc = " Constructor"]
2177 #[doc = ""]
2178 #[doc = " @param port the physical SPI port"]
2179 #[link_name = "\u{1}_ZN3frc3SPIC1ENS0_4PortE"]
2180 pub fn SPI_SPI(this: *mut root::frc::SPI, port: root::frc::SPI_Port);
2181 }
2182 impl SPI {
2183 #[inline]
2184 pub unsafe fn GetPort(&self) -> root::frc::SPI_Port {
2185 SPI_GetPort(self)
2186 }
2187 #[inline]
2188 pub unsafe fn SetClockRate(&mut self, hz: ::std::os::raw::c_int) {
2189 SPI_SetClockRate(self, hz)
2190 }
2191 #[inline]
2192 pub unsafe fn SetMSBFirst(&mut self) {
2193 SPI_SetMSBFirst(self)
2194 }
2195 #[inline]
2196 pub unsafe fn SetLSBFirst(&mut self) {
2197 SPI_SetLSBFirst(self)
2198 }
2199 #[inline]
2200 pub unsafe fn SetSampleDataOnLeadingEdge(&mut self) {
2201 SPI_SetSampleDataOnLeadingEdge(self)
2202 }
2203 #[inline]
2204 pub unsafe fn SetSampleDataOnTrailingEdge(&mut self) {
2205 SPI_SetSampleDataOnTrailingEdge(self)
2206 }
2207 #[inline]
2208 pub unsafe fn SetSampleDataOnFalling(&mut self) {
2209 SPI_SetSampleDataOnFalling(self)
2210 }
2211 #[inline]
2212 pub unsafe fn SetSampleDataOnRising(&mut self) {
2213 SPI_SetSampleDataOnRising(self)
2214 }
2215 #[inline]
2216 pub unsafe fn SetClockActiveLow(&mut self) {
2217 SPI_SetClockActiveLow(self)
2218 }
2219 #[inline]
2220 pub unsafe fn SetClockActiveHigh(&mut self) {
2221 SPI_SetClockActiveHigh(self)
2222 }
2223 #[inline]
2224 pub unsafe fn SetChipSelectActiveHigh(&mut self) {
2225 SPI_SetChipSelectActiveHigh(self)
2226 }
2227 #[inline]
2228 pub unsafe fn SetChipSelectActiveLow(&mut self) {
2229 SPI_SetChipSelectActiveLow(self)
2230 }
2231 #[inline]
2232 pub unsafe fn InitAuto(&mut self, bufferSize: ::std::os::raw::c_int) {
2233 SPI_InitAuto(self, bufferSize)
2234 }
2235 #[inline]
2236 pub unsafe fn FreeAuto(&mut self) {
2237 SPI_FreeAuto(self)
2238 }
2239 #[inline]
2240 pub unsafe fn SetAutoTransmitData(
2241 &mut self,
2242 dataToSend: u8,
2243 zeroSize: ::std::os::raw::c_int,
2244 ) {
2245 SPI_SetAutoTransmitData(self, dataToSend, zeroSize)
2246 }
2247 #[inline]
2248 pub unsafe fn StartAutoRate(&mut self, period: root::units::time::second_t) {
2249 SPI_StartAutoRate(self, period)
2250 }
2251 #[inline]
2252 pub unsafe fn StartAutoRate1(&mut self, period: f64) {
2253 SPI_StartAutoRate1(self, period)
2254 }
2255 #[inline]
2256 pub unsafe fn StartAutoTrigger(
2257 &mut self,
2258 source: *mut root::frc::DigitalSource,
2259 rising: bool,
2260 falling: bool,
2261 ) {
2262 SPI_StartAutoTrigger(self, source, rising, falling)
2263 }
2264 #[inline]
2265 pub unsafe fn StopAuto(&mut self) {
2266 SPI_StopAuto(self)
2267 }
2268 #[inline]
2269 pub unsafe fn ForceAutoRead(&mut self) {
2270 SPI_ForceAutoRead(self)
2271 }
2272 #[inline]
2273 pub unsafe fn ReadAutoReceivedData(
2274 &mut self,
2275 buffer: *mut u32,
2276 numToRead: ::std::os::raw::c_int,
2277 timeout: root::units::time::second_t,
2278 ) -> ::std::os::raw::c_int {
2279 SPI_ReadAutoReceivedData(self, buffer, numToRead, timeout)
2280 }
2281 #[inline]
2282 pub unsafe fn GetAutoDroppedCount(&mut self) -> ::std::os::raw::c_int {
2283 SPI_GetAutoDroppedCount(self)
2284 }
2285 #[inline]
2286 pub unsafe fn ConfigureAutoStall(
2287 &mut self,
2288 port: root::HAL_SPIPort,
2289 csToSclkTicks: ::std::os::raw::c_int,
2290 stallTicks: ::std::os::raw::c_int,
2291 pow2BytesPerRead: ::std::os::raw::c_int,
2292 ) {
2293 SPI_ConfigureAutoStall(self, port, csToSclkTicks, stallTicks, pow2BytesPerRead)
2294 }
2295 #[inline]
2296 pub unsafe fn InitAccumulator(
2297 &mut self,
2298 period: root::units::time::second_t,
2299 cmd: ::std::os::raw::c_int,
2300 xferSize: ::std::os::raw::c_int,
2301 validMask: ::std::os::raw::c_int,
2302 validValue: ::std::os::raw::c_int,
2303 dataShift: ::std::os::raw::c_int,
2304 dataSize: ::std::os::raw::c_int,
2305 isSigned: bool,
2306 bigEndian: bool,
2307 ) {
2308 SPI_InitAccumulator(
2309 self, period, cmd, xferSize, validMask, validValue, dataShift, dataSize,
2310 isSigned, bigEndian,
2311 )
2312 }
2313 #[inline]
2314 pub unsafe fn InitAccumulator1(
2315 &mut self,
2316 period: f64,
2317 cmd: ::std::os::raw::c_int,
2318 xferSize: ::std::os::raw::c_int,
2319 validMask: ::std::os::raw::c_int,
2320 validValue: ::std::os::raw::c_int,
2321 dataShift: ::std::os::raw::c_int,
2322 dataSize: ::std::os::raw::c_int,
2323 isSigned: bool,
2324 bigEndian: bool,
2325 ) {
2326 SPI_InitAccumulator1(
2327 self, period, cmd, xferSize, validMask, validValue, dataShift, dataSize,
2328 isSigned, bigEndian,
2329 )
2330 }
2331 #[inline]
2332 pub unsafe fn FreeAccumulator(&mut self) {
2333 SPI_FreeAccumulator(self)
2334 }
2335 #[inline]
2336 pub unsafe fn ResetAccumulator(&mut self) {
2337 SPI_ResetAccumulator(self)
2338 }
2339 #[inline]
2340 pub unsafe fn SetAccumulatorCenter(&mut self, center: ::std::os::raw::c_int) {
2341 SPI_SetAccumulatorCenter(self, center)
2342 }
2343 #[inline]
2344 pub unsafe fn SetAccumulatorDeadband(&mut self, deadband: ::std::os::raw::c_int) {
2345 SPI_SetAccumulatorDeadband(self, deadband)
2346 }
2347 #[inline]
2348 pub unsafe fn GetAccumulatorLastValue(&self) -> ::std::os::raw::c_int {
2349 SPI_GetAccumulatorLastValue(self)
2350 }
2351 #[inline]
2352 pub unsafe fn GetAccumulatorValue(&self) -> i64 {
2353 SPI_GetAccumulatorValue(self)
2354 }
2355 #[inline]
2356 pub unsafe fn GetAccumulatorCount(&self) -> i64 {
2357 SPI_GetAccumulatorCount(self)
2358 }
2359 #[inline]
2360 pub unsafe fn GetAccumulatorAverage(&self) -> f64 {
2361 SPI_GetAccumulatorAverage(self)
2362 }
2363 #[inline]
2364 pub unsafe fn GetAccumulatorOutput(&self, value: *mut i64, count: *mut i64) {
2365 SPI_GetAccumulatorOutput(self, value, count)
2366 }
2367 #[inline]
2368 pub unsafe fn SetAccumulatorIntegratedCenter(&mut self, center: f64) {
2369 SPI_SetAccumulatorIntegratedCenter(self, center)
2370 }
2371 #[inline]
2372 pub unsafe fn GetAccumulatorIntegratedValue(&self) -> f64 {
2373 SPI_GetAccumulatorIntegratedValue(self)
2374 }
2375 #[inline]
2376 pub unsafe fn GetAccumulatorIntegratedAverage(&self) -> f64 {
2377 SPI_GetAccumulatorIntegratedAverage(self)
2378 }
2379 #[inline]
2380 pub unsafe fn new(port: root::frc::SPI_Port) -> Self {
2381 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
2382 SPI_SPI(__bindgen_tmp.as_mut_ptr(), port);
2383 __bindgen_tmp.assume_init()
2384 }
2385 }
2386 extern "C" {
2387 #[link_name = "\u{1}_ZN3frc3SPID1Ev"]
2388 pub fn SPI_SPI_destructor(this: *mut root::frc::SPI);
2389 }
2390 extern "C" {
2391 #[doc = " Write data to the peripheral device. Blocks until there is space in the"]
2392 #[doc = " output FIFO."]
2393 #[doc = ""]
2394 #[doc = " If not running in output only mode, also saves the data received"]
2395 #[doc = " on the CIPO input during the transfer into the receive FIFO."]
2396 #[link_name = "\u{1}_ZN3frc3SPI5WriteEPhi"]
2397 pub fn SPI_Write(
2398 this: *mut ::std::os::raw::c_void,
2399 data: *mut u8,
2400 size: ::std::os::raw::c_int,
2401 ) -> ::std::os::raw::c_int;
2402 }
2403 extern "C" {
2404 #[doc = " Read a word from the receive FIFO."]
2405 #[doc = ""]
2406 #[doc = " Waits for the current transfer to complete if the receive FIFO is empty."]
2407 #[doc = ""]
2408 #[doc = " If the receive FIFO is empty, there is no active transfer, and initiate"]
2409 #[doc = " is false, errors."]
2410 #[doc = ""]
2411 #[doc = " @param initiate If true, this function pushes \"0\" into the transmit"]
2412 #[doc = " buffer and initiates a transfer. If false, this"]
2413 #[doc = " function assumes that data is already in the receive"]
2414 #[doc = " FIFO from a previous write."]
2415 #[doc = " @param dataReceived Buffer to receive data from the device"]
2416 #[doc = " @param size The length of the transaction, in bytes"]
2417 #[link_name = "\u{1}_ZN3frc3SPI4ReadEbPhi"]
2418 pub fn SPI_Read(
2419 this: *mut ::std::os::raw::c_void,
2420 initiate: bool,
2421 dataReceived: *mut u8,
2422 size: ::std::os::raw::c_int,
2423 ) -> ::std::os::raw::c_int;
2424 }
2425 extern "C" {
2426 #[doc = " Perform a simultaneous read/write transaction with the device"]
2427 #[doc = ""]
2428 #[doc = " @param dataToSend The data to be written out to the device"]
2429 #[doc = " @param dataReceived Buffer to receive data from the device"]
2430 #[doc = " @param size The length of the transaction, in bytes"]
2431 #[link_name = "\u{1}_ZN3frc3SPI11TransactionEPhS1_i"]
2432 pub fn SPI_Transaction(
2433 this: *mut ::std::os::raw::c_void,
2434 dataToSend: *mut u8,
2435 dataReceived: *mut u8,
2436 size: ::std::os::raw::c_int,
2437 ) -> ::std::os::raw::c_int;
2438 }
2439 #[doc = " A rotation in a 2d coordinate frame represented a point on the unit circle"]
2440 #[doc = " (cosine and sine)."]
2441 #[repr(C)]
2442 pub struct Rotation2d {
2443 pub m_value: root::units::angle::radian_t,
2444 pub m_cos: f64,
2445 pub m_sin: f64,
2446 }
2447 #[test]
2448 fn bindgen_test_layout_Rotation2d() {
2449 assert_eq!(
2450 ::std::mem::size_of::<Rotation2d>(),
2451 24usize,
2452 concat!("Size of: ", stringify!(Rotation2d))
2453 );
2454 assert_eq!(
2455 ::std::mem::align_of::<Rotation2d>(),
2456 8usize,
2457 concat!("Alignment of ", stringify!(Rotation2d))
2458 );
2459 fn test_field_m_value() {
2460 assert_eq!(
2461 unsafe {
2462 let uninit = ::std::mem::MaybeUninit::<Rotation2d>::uninit();
2463 let ptr = uninit.as_ptr();
2464 ::std::ptr::addr_of!((*ptr).m_value) as usize - ptr as usize
2465 },
2466 0usize,
2467 concat!(
2468 "Offset of field: ",
2469 stringify!(Rotation2d),
2470 "::",
2471 stringify!(m_value)
2472 )
2473 );
2474 }
2475 test_field_m_value();
2476 fn test_field_m_cos() {
2477 assert_eq!(
2478 unsafe {
2479 let uninit = ::std::mem::MaybeUninit::<Rotation2d>::uninit();
2480 let ptr = uninit.as_ptr();
2481 ::std::ptr::addr_of!((*ptr).m_cos) as usize - ptr as usize
2482 },
2483 8usize,
2484 concat!(
2485 "Offset of field: ",
2486 stringify!(Rotation2d),
2487 "::",
2488 stringify!(m_cos)
2489 )
2490 );
2491 }
2492 test_field_m_cos();
2493 fn test_field_m_sin() {
2494 assert_eq!(
2495 unsafe {
2496 let uninit = ::std::mem::MaybeUninit::<Rotation2d>::uninit();
2497 let ptr = uninit.as_ptr();
2498 ::std::ptr::addr_of!((*ptr).m_sin) as usize - ptr as usize
2499 },
2500 16usize,
2501 concat!(
2502 "Offset of field: ",
2503 stringify!(Rotation2d),
2504 "::",
2505 stringify!(m_sin)
2506 )
2507 );
2508 }
2509 test_field_m_sin();
2510 }
2511 extern "C" {
2512 #[doc = " Adds the new rotation to the current rotation using a rotation matrix."]
2513 #[doc = ""]
2514 #[doc = " <pre>"]
2515 #[doc = " [cos_new] [other.cos, -other.sin][cos]"]
2516 #[doc = " [sin_new] = [other.sin, other.cos][sin]"]
2517 #[doc = " value_new = std::atan2(sin_new, cos_new)"]
2518 #[doc = " </pre>"]
2519 #[doc = ""]
2520 #[doc = " @param other The rotation to rotate by."]
2521 #[doc = ""]
2522 #[doc = " @return The new rotated Rotation2d."]
2523 #[link_name = "\u{1}_ZNK3frc10Rotation2d8RotateByERKS0_"]
2524 pub fn Rotation2d_RotateBy(
2525 this: *const root::frc::Rotation2d,
2526 other: *const root::frc::Rotation2d,
2527 ) -> root::frc::Rotation2d;
2528 }
2529 extern "C" {
2530 #[doc = " Constructs a Rotation2d with the given radian value."]
2531 #[doc = ""]
2532 #[doc = " @param value The value of the angle in radians."]
2533 #[link_name = "\u{1}_ZN3frc10Rotation2dC1EN5units6unit_tINS1_4unitISt5ratioILl1ELl1EENS1_9base_unitIS4_ILl0ELl1EES7_S7_S5_S7_S7_S7_S7_S7_EES7_S7_EEdNS1_12linear_scaleEEE"]
2534 pub fn Rotation2d_Rotation2d(
2535 this: *mut root::frc::Rotation2d,
2536 value: root::units::angle::radian_t,
2537 );
2538 }
2539 extern "C" {
2540 #[doc = " Constructs a Rotation2d with the given degree value."]
2541 #[doc = ""]
2542 #[doc = " @param value The value of the angle in degrees."]
2543 #[link_name = "\u{1}_ZN3frc10Rotation2dC1EN5units6unit_tINS1_4unitISt5ratioILl1ELl180EENS3_IS4_ILl1ELl1EENS1_9base_unitIS4_ILl0ELl1EES8_S8_S6_S8_S8_S8_S8_S8_EES8_S8_EES6_S8_EEdNS1_12linear_scaleEEE"]
2544 pub fn Rotation2d_Rotation2d1(
2545 this: *mut root::frc::Rotation2d,
2546 value: root::units::angle::degree_t,
2547 );
2548 }
2549 extern "C" {
2550 #[doc = " Constructs a Rotation2d with the given x and y (cosine and sine)"]
2551 #[doc = " components. The x and y don't have to be normalized."]
2552 #[doc = ""]
2553 #[doc = " @param x The x component or cosine of the rotation."]
2554 #[doc = " @param y The y component or sine of the rotation."]
2555 #[link_name = "\u{1}_ZN3frc10Rotation2dC1Edd"]
2556 pub fn Rotation2d_Rotation2d2(this: *mut root::frc::Rotation2d, x: f64, y: f64);
2557 }
2558 impl Rotation2d {
2559 #[inline]
2560 pub unsafe fn RotateBy(
2561 &self,
2562 other: *const root::frc::Rotation2d,
2563 ) -> root::frc::Rotation2d {
2564 Rotation2d_RotateBy(self, other)
2565 }
2566 #[inline]
2567 pub unsafe fn new(value: root::units::angle::radian_t) -> Self {
2568 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
2569 Rotation2d_Rotation2d(__bindgen_tmp.as_mut_ptr(), value);
2570 __bindgen_tmp.assume_init()
2571 }
2572 #[inline]
2573 pub unsafe fn new1(value: root::units::angle::degree_t) -> Self {
2574 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
2575 Rotation2d_Rotation2d1(__bindgen_tmp.as_mut_ptr(), value);
2576 __bindgen_tmp.assume_init()
2577 }
2578 #[inline]
2579 pub unsafe fn new2(x: f64, y: f64) -> Self {
2580 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
2581 Rotation2d_Rotation2d2(__bindgen_tmp.as_mut_ptr(), x, y);
2582 __bindgen_tmp.assume_init()
2583 }
2584 }
2585 #[repr(C)]
2586 pub struct Gyro__bindgen_vtable(::std::os::raw::c_void);
2587 #[doc = " Interface for yaw rate gyros."]
2588 #[repr(C)]
2589 #[derive(Debug)]
2590 pub struct Gyro {
2591 pub vtable_: *const Gyro__bindgen_vtable,
2592 }
2593 #[test]
2594 fn bindgen_test_layout_Gyro() {
2595 assert_eq!(
2596 ::std::mem::size_of::<Gyro>(),
2597 8usize,
2598 concat!("Size of: ", stringify!(Gyro))
2599 );
2600 assert_eq!(
2601 ::std::mem::align_of::<Gyro>(),
2602 8usize,
2603 concat!("Alignment of ", stringify!(Gyro))
2604 );
2605 }
2606 #[doc = " Use a rate gyro to return the robots heading relative to a starting position."]
2607 #[doc = ""]
2608 #[doc = " The %Gyro class tracks the robots heading based on the starting position. As"]
2609 #[doc = " the robot rotates the new heading is computed by integrating the rate of"]
2610 #[doc = " rotation returned by the sensor. When the class is instantiated, it does a"]
2611 #[doc = " short calibration routine where it samples the gyro while at rest to"]
2612 #[doc = " determine the default offset. This is subtracted from each sample to"]
2613 #[doc = " determine the heading."]
2614 #[doc = ""]
2615 #[doc = " This class is for the digital ADXRS450 gyro sensor that connects via SPI."]
2616 #[doc = " Only one instance of an ADXRS %Gyro is supported."]
2617 #[repr(C)]
2618 #[derive(Debug)]
2619 pub struct ADXRS450_Gyro {
2620 pub _base: root::frc::Gyro,
2621 pub _base_1: root::wpi::Sendable,
2622 pub m_spi: root::frc::SPI,
2623 pub m_port: root::frc::SPI_Port,
2624 pub m_simDevice: root::hal::SimDevice,
2625 pub m_simAngle: root::hal::SimDouble,
2626 pub m_simRate: root::hal::SimDouble,
2627 }
2628 #[test]
2629 fn bindgen_test_layout_ADXRS450_Gyro() {
2630 assert_eq!(
2631 ::std::mem::size_of::<ADXRS450_Gyro>(),
2632 56usize,
2633 concat!("Size of: ", stringify!(ADXRS450_Gyro))
2634 );
2635 assert_eq!(
2636 ::std::mem::align_of::<ADXRS450_Gyro>(),
2637 8usize,
2638 concat!("Alignment of ", stringify!(ADXRS450_Gyro))
2639 );
2640 }
2641 extern "C" {
2642 #[doc = " Get the SPI port number."]
2643 #[doc = ""]
2644 #[doc = " @return The SPI port number."]
2645 #[link_name = "\u{1}_ZNK3frc13ADXRS450_Gyro7GetPortEv"]
2646 pub fn ADXRS450_Gyro_GetPort(
2647 this: *const root::frc::ADXRS450_Gyro,
2648 ) -> ::std::os::raw::c_int;
2649 }
2650 extern "C" {
2651 #[doc = " %Gyro constructor on onboard CS0."]
2652 #[link_name = "\u{1}_ZN3frc13ADXRS450_GyroC1Ev"]
2653 pub fn ADXRS450_Gyro_ADXRS450_Gyro(this: *mut root::frc::ADXRS450_Gyro);
2654 }
2655 extern "C" {
2656 #[doc = " %Gyro constructor on the specified SPI port."]
2657 #[doc = ""]
2658 #[doc = " @param port The SPI port the gyro is attached to."]
2659 #[link_name = "\u{1}_ZN3frc13ADXRS450_GyroC1ENS_3SPI4PortE"]
2660 pub fn ADXRS450_Gyro_ADXRS450_Gyro1(
2661 this: *mut root::frc::ADXRS450_Gyro,
2662 port: root::frc::SPI_Port,
2663 );
2664 }
2665 impl ADXRS450_Gyro {
2666 #[inline]
2667 pub unsafe fn GetPort(&self) -> ::std::os::raw::c_int {
2668 ADXRS450_Gyro_GetPort(self)
2669 }
2670 #[inline]
2671 pub unsafe fn new() -> Self {
2672 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
2673 ADXRS450_Gyro_ADXRS450_Gyro(__bindgen_tmp.as_mut_ptr());
2674 __bindgen_tmp.assume_init()
2675 }
2676 #[inline]
2677 pub unsafe fn new1(port: root::frc::SPI_Port) -> Self {
2678 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
2679 ADXRS450_Gyro_ADXRS450_Gyro1(__bindgen_tmp.as_mut_ptr(), port);
2680 __bindgen_tmp.assume_init()
2681 }
2682 }
2683 extern "C" {
2684 #[doc = " Return the actual angle in degrees that the robot is currently facing."]
2685 #[doc = ""]
2686 #[doc = " The angle is based on integration of the returned rate from the gyro."]
2687 #[doc = " The angle is continuous, that is it will continue from 360->361 degrees."]
2688 #[doc = " This allows algorithms that wouldn't want to see a discontinuity in the"]
2689 #[doc = " gyro output as it sweeps from 360 to 0 on the second time around."]
2690 #[doc = ""]
2691 #[doc = " @return the current heading of the robot in degrees."]
2692 #[link_name = "\u{1}_ZNK3frc13ADXRS450_Gyro8GetAngleEv"]
2693 pub fn ADXRS450_Gyro_GetAngle(this: *mut ::std::os::raw::c_void) -> f64;
2694 }
2695 extern "C" {
2696 #[doc = " Return the rate of rotation of the gyro"]
2697 #[doc = ""]
2698 #[doc = " The rate is based on the most recent reading of the gyro."]
2699 #[doc = ""]
2700 #[doc = " @return the current rate in degrees per second"]
2701 #[link_name = "\u{1}_ZNK3frc13ADXRS450_Gyro7GetRateEv"]
2702 pub fn ADXRS450_Gyro_GetRate(this: *mut ::std::os::raw::c_void) -> f64;
2703 }
2704 extern "C" {
2705 #[doc = " Reset the gyro."]
2706 #[doc = ""]
2707 #[doc = " Resets the gyro to a heading of zero. This can be used if there is"]
2708 #[doc = " significant drift in the gyro and it needs to be recalibrated after it has"]
2709 #[doc = " been running."]
2710 #[link_name = "\u{1}_ZN3frc13ADXRS450_Gyro5ResetEv"]
2711 pub fn ADXRS450_Gyro_Reset(this: *mut ::std::os::raw::c_void);
2712 }
2713 extern "C" {
2714 #[doc = " Initialize the gyro."]
2715 #[doc = ""]
2716 #[doc = " Calibrate the gyro by running for a number of samples and computing the"]
2717 #[doc = " center value. Then use the center value as the Accumulator center value for"]
2718 #[doc = " subsequent measurements."]
2719 #[doc = ""]
2720 #[doc = " It's important to make sure that the robot is not moving while the"]
2721 #[doc = " centering calculations are in progress, this is typically done when the"]
2722 #[doc = " robot is first turned on while it's sitting at rest before the competition"]
2723 #[doc = " starts."]
2724 #[link_name = "\u{1}_ZN3frc13ADXRS450_Gyro9CalibrateEv"]
2725 pub fn ADXRS450_Gyro_Calibrate(this: *mut ::std::os::raw::c_void);
2726 }
2727 extern "C" {
2728 #[link_name = "\u{1}_ZThn8_N3frc13ADXRS450_Gyro12InitSendableERN3wpi15SendableBuilderE"]
2729 pub fn ADXRS450_Gyro_InitSendable(
2730 this: *mut ::std::os::raw::c_void,
2731 builder: *mut root::wpi::SendableBuilder,
2732 );
2733 }
2734 #[repr(C)]
2735 pub struct GenericHID__bindgen_vtable(::std::os::raw::c_void);
2736 #[doc = " Handle input from standard HID devices connected to the Driver Station."]
2737 #[doc = ""]
2738 #[doc = " <p>This class handles standard input that comes from the Driver Station. Each"]
2739 #[doc = " time a value is requested the most recent value is returned. There is a"]
2740 #[doc = " single class instance for each device and the mapping of ports to hardware"]
2741 #[doc = " buttons depends on the code in the Driver Station."]
2742 #[repr(C)]
2743 #[derive(Debug)]
2744 pub struct GenericHID {
2745 pub vtable_: *const GenericHID__bindgen_vtable,
2746 pub m_port: ::std::os::raw::c_int,
2747 pub m_outputs: ::std::os::raw::c_int,
2748 pub m_leftRumble: u16,
2749 pub m_rightRumble: u16,
2750 }
2751 pub const GenericHID_RumbleType_kLeftRumble: root::frc::GenericHID_RumbleType = 0;
2752 pub const GenericHID_RumbleType_kRightRumble: root::frc::GenericHID_RumbleType = 1;
2753 pub type GenericHID_RumbleType = ::std::os::raw::c_uint;
2754 pub const GenericHID_HIDType_kUnknown: root::frc::GenericHID_HIDType = -1;
2755 pub const GenericHID_HIDType_kXInputUnknown: root::frc::GenericHID_HIDType = 0;
2756 pub const GenericHID_HIDType_kXInputGamepad: root::frc::GenericHID_HIDType = 1;
2757 pub const GenericHID_HIDType_kXInputWheel: root::frc::GenericHID_HIDType = 2;
2758 pub const GenericHID_HIDType_kXInputArcadeStick: root::frc::GenericHID_HIDType = 3;
2759 pub const GenericHID_HIDType_kXInputFlightStick: root::frc::GenericHID_HIDType = 4;
2760 pub const GenericHID_HIDType_kXInputDancePad: root::frc::GenericHID_HIDType = 5;
2761 pub const GenericHID_HIDType_kXInputGuitar: root::frc::GenericHID_HIDType = 6;
2762 pub const GenericHID_HIDType_kXInputGuitar2: root::frc::GenericHID_HIDType = 7;
2763 pub const GenericHID_HIDType_kXInputDrumKit: root::frc::GenericHID_HIDType = 8;
2764 pub const GenericHID_HIDType_kXInputGuitar3: root::frc::GenericHID_HIDType = 11;
2765 pub const GenericHID_HIDType_kXInputArcadePad: root::frc::GenericHID_HIDType = 19;
2766 pub const GenericHID_HIDType_kHIDJoystick: root::frc::GenericHID_HIDType = 20;
2767 pub const GenericHID_HIDType_kHIDGamepad: root::frc::GenericHID_HIDType = 21;
2768 pub const GenericHID_HIDType_kHIDDriving: root::frc::GenericHID_HIDType = 22;
2769 pub const GenericHID_HIDType_kHIDFlight: root::frc::GenericHID_HIDType = 23;
2770 pub const GenericHID_HIDType_kHID1stPerson: root::frc::GenericHID_HIDType = 24;
2771 pub type GenericHID_HIDType = ::std::os::raw::c_int;
2772 #[test]
2773 fn bindgen_test_layout_GenericHID() {
2774 assert_eq!(
2775 ::std::mem::size_of::<GenericHID>(),
2776 24usize,
2777 concat!("Size of: ", stringify!(GenericHID))
2778 );
2779 assert_eq!(
2780 ::std::mem::align_of::<GenericHID>(),
2781 8usize,
2782 concat!("Alignment of ", stringify!(GenericHID))
2783 );
2784 fn test_field_m_port() {
2785 assert_eq!(
2786 unsafe {
2787 let uninit = ::std::mem::MaybeUninit::<GenericHID>::uninit();
2788 let ptr = uninit.as_ptr();
2789 ::std::ptr::addr_of!((*ptr).m_port) as usize - ptr as usize
2790 },
2791 8usize,
2792 concat!(
2793 "Offset of field: ",
2794 stringify!(GenericHID),
2795 "::",
2796 stringify!(m_port)
2797 )
2798 );
2799 }
2800 test_field_m_port();
2801 fn test_field_m_outputs() {
2802 assert_eq!(
2803 unsafe {
2804 let uninit = ::std::mem::MaybeUninit::<GenericHID>::uninit();
2805 let ptr = uninit.as_ptr();
2806 ::std::ptr::addr_of!((*ptr).m_outputs) as usize - ptr as usize
2807 },
2808 12usize,
2809 concat!(
2810 "Offset of field: ",
2811 stringify!(GenericHID),
2812 "::",
2813 stringify!(m_outputs)
2814 )
2815 );
2816 }
2817 test_field_m_outputs();
2818 fn test_field_m_leftRumble() {
2819 assert_eq!(
2820 unsafe {
2821 let uninit = ::std::mem::MaybeUninit::<GenericHID>::uninit();
2822 let ptr = uninit.as_ptr();
2823 ::std::ptr::addr_of!((*ptr).m_leftRumble) as usize - ptr as usize
2824 },
2825 16usize,
2826 concat!(
2827 "Offset of field: ",
2828 stringify!(GenericHID),
2829 "::",
2830 stringify!(m_leftRumble)
2831 )
2832 );
2833 }
2834 test_field_m_leftRumble();
2835 fn test_field_m_rightRumble() {
2836 assert_eq!(
2837 unsafe {
2838 let uninit = ::std::mem::MaybeUninit::<GenericHID>::uninit();
2839 let ptr = uninit.as_ptr();
2840 ::std::ptr::addr_of!((*ptr).m_rightRumble) as usize - ptr as usize
2841 },
2842 18usize,
2843 concat!(
2844 "Offset of field: ",
2845 stringify!(GenericHID),
2846 "::",
2847 stringify!(m_rightRumble)
2848 )
2849 );
2850 }
2851 test_field_m_rightRumble();
2852 }
2853 extern "C" {
2854 #[doc = " Get the button value (starting at button 1)."]
2855 #[doc = ""]
2856 #[doc = " The buttons are returned in a single 16 bit value with one bit representing"]
2857 #[doc = " the state of each button. The appropriate button is returned as a boolean"]
2858 #[doc = " value."]
2859 #[doc = ""]
2860 #[doc = " This method returns true if the button is being held down at the time"]
2861 #[doc = " that this method is being called."]
2862 #[doc = ""]
2863 #[doc = " @param button The button number to be read (starting at 1)"]
2864 #[doc = " @return The state of the button."]
2865 #[link_name = "\u{1}_ZNK3frc10GenericHID12GetRawButtonEi"]
2866 pub fn GenericHID_GetRawButton(
2867 this: *const root::frc::GenericHID,
2868 button: ::std::os::raw::c_int,
2869 ) -> bool;
2870 }
2871 extern "C" {
2872 #[doc = " Whether the button was pressed since the last check. %Button indexes begin"]
2873 #[doc = " at 1."]
2874 #[doc = ""]
2875 #[doc = " This method returns true if the button went from not pressed to held down"]
2876 #[doc = " since the last time this method was called. This is useful if you only"]
2877 #[doc = " want to call a function once when you press the button."]
2878 #[doc = ""]
2879 #[doc = " @param button The button index, beginning at 1."]
2880 #[doc = " @return Whether the button was pressed since the last check."]
2881 #[link_name = "\u{1}_ZN3frc10GenericHID19GetRawButtonPressedEi"]
2882 pub fn GenericHID_GetRawButtonPressed(
2883 this: *mut root::frc::GenericHID,
2884 button: ::std::os::raw::c_int,
2885 ) -> bool;
2886 }
2887 extern "C" {
2888 #[doc = " Whether the button was released since the last check. %Button indexes begin"]
2889 #[doc = " at 1."]
2890 #[doc = ""]
2891 #[doc = " This method returns true if the button went from held down to not pressed"]
2892 #[doc = " since the last time this method was called. This is useful if you only"]
2893 #[doc = " want to call a function once when you release the button."]
2894 #[doc = ""]
2895 #[doc = " @param button The button index, beginning at 1."]
2896 #[doc = " @return Whether the button was released since the last check."]
2897 #[link_name = "\u{1}_ZN3frc10GenericHID20GetRawButtonReleasedEi"]
2898 pub fn GenericHID_GetRawButtonReleased(
2899 this: *mut root::frc::GenericHID,
2900 button: ::std::os::raw::c_int,
2901 ) -> bool;
2902 }
2903 extern "C" {
2904 #[doc = " Get the value of the axis."]
2905 #[doc = ""]
2906 #[doc = " @param axis The axis to read, starting at 0."]
2907 #[doc = " @return The value of the axis."]
2908 #[link_name = "\u{1}_ZNK3frc10GenericHID10GetRawAxisEi"]
2909 pub fn GenericHID_GetRawAxis(
2910 this: *const root::frc::GenericHID,
2911 axis: ::std::os::raw::c_int,
2912 ) -> f64;
2913 }
2914 extern "C" {
2915 #[doc = " Get the angle in degrees of a POV on the HID."]
2916 #[doc = ""]
2917 #[doc = " The POV angles start at 0 in the up direction, and increase clockwise"]
2918 #[doc = " (e.g. right is 90, upper-left is 315)."]
2919 #[doc = ""]
2920 #[doc = " @param pov The index of the POV to read (starting at 0)"]
2921 #[doc = " @return the angle of the POV in degrees, or -1 if the POV is not pressed."]
2922 #[link_name = "\u{1}_ZNK3frc10GenericHID6GetPOVEi"]
2923 pub fn GenericHID_GetPOV(
2924 this: *const root::frc::GenericHID,
2925 pov: ::std::os::raw::c_int,
2926 ) -> ::std::os::raw::c_int;
2927 }
2928 extern "C" {
2929 #[doc = " Get the number of axes for the HID."]
2930 #[doc = ""]
2931 #[doc = " @return the number of axis for the current HID"]
2932 #[link_name = "\u{1}_ZNK3frc10GenericHID12GetAxisCountEv"]
2933 pub fn GenericHID_GetAxisCount(
2934 this: *const root::frc::GenericHID,
2935 ) -> ::std::os::raw::c_int;
2936 }
2937 extern "C" {
2938 #[doc = " Get the number of POVs for the HID."]
2939 #[doc = ""]
2940 #[doc = " @return the number of POVs for the current HID"]
2941 #[link_name = "\u{1}_ZNK3frc10GenericHID11GetPOVCountEv"]
2942 pub fn GenericHID_GetPOVCount(
2943 this: *const root::frc::GenericHID,
2944 ) -> ::std::os::raw::c_int;
2945 }
2946 extern "C" {
2947 #[doc = " Get the number of buttons for the HID."]
2948 #[doc = ""]
2949 #[doc = " @return the number of buttons on the current HID"]
2950 #[link_name = "\u{1}_ZNK3frc10GenericHID14GetButtonCountEv"]
2951 pub fn GenericHID_GetButtonCount(
2952 this: *const root::frc::GenericHID,
2953 ) -> ::std::os::raw::c_int;
2954 }
2955 extern "C" {
2956 #[doc = " Get if the HID is connected."]
2957 #[doc = ""]
2958 #[doc = " @return true if the HID is connected"]
2959 #[link_name = "\u{1}_ZNK3frc10GenericHID11IsConnectedEv"]
2960 pub fn GenericHID_IsConnected(this: *const root::frc::GenericHID) -> bool;
2961 }
2962 extern "C" {
2963 #[doc = " Get the type of the HID."]
2964 #[doc = ""]
2965 #[doc = " @return the type of the HID."]
2966 #[link_name = "\u{1}_ZNK3frc10GenericHID7GetTypeEv"]
2967 pub fn GenericHID_GetType(
2968 this: *const root::frc::GenericHID,
2969 ) -> root::frc::GenericHID_HIDType;
2970 }
2971 extern "C" {
2972 #[doc = " Get the name of the HID."]
2973 #[doc = ""]
2974 #[doc = " @return the name of the HID."]
2975 #[link_name = "\u{1}_ZNK3frc10GenericHID7GetNameB5cxx11Ev"]
2976 pub fn GenericHID_GetName(this: *const root::frc::GenericHID) -> root::std::string;
2977 }
2978 extern "C" {
2979 #[doc = " Get the axis type of a joystick axis."]
2980 #[doc = ""]
2981 #[doc = " @return the axis type of a joystick axis."]
2982 #[link_name = "\u{1}_ZNK3frc10GenericHID11GetAxisTypeEi"]
2983 pub fn GenericHID_GetAxisType(
2984 this: *const root::frc::GenericHID,
2985 axis: ::std::os::raw::c_int,
2986 ) -> ::std::os::raw::c_int;
2987 }
2988 extern "C" {
2989 #[doc = " Get the port number of the HID."]
2990 #[doc = ""]
2991 #[doc = " @return The port number of the HID."]
2992 #[link_name = "\u{1}_ZNK3frc10GenericHID7GetPortEv"]
2993 pub fn GenericHID_GetPort(this: *const root::frc::GenericHID) -> ::std::os::raw::c_int;
2994 }
2995 extern "C" {
2996 #[doc = " Set a single HID output value for the HID."]
2997 #[doc = ""]
2998 #[doc = " @param outputNumber The index of the output to set (1-32)"]
2999 #[doc = " @param value The value to set the output to"]
3000 #[link_name = "\u{1}_ZN3frc10GenericHID9SetOutputEib"]
3001 pub fn GenericHID_SetOutput(
3002 this: *mut root::frc::GenericHID,
3003 outputNumber: ::std::os::raw::c_int,
3004 value: bool,
3005 );
3006 }
3007 extern "C" {
3008 #[doc = " Set all output values for the HID."]
3009 #[doc = ""]
3010 #[doc = " @param value The 32 bit output value (1 bit for each output)"]
3011 #[link_name = "\u{1}_ZN3frc10GenericHID10SetOutputsEi"]
3012 pub fn GenericHID_SetOutputs(
3013 this: *mut root::frc::GenericHID,
3014 value: ::std::os::raw::c_int,
3015 );
3016 }
3017 extern "C" {
3018 #[doc = " Set the rumble output for the HID."]
3019 #[doc = ""]
3020 #[doc = " The DS currently supports 2 rumble values, left rumble and right rumble."]
3021 #[doc = ""]
3022 #[doc = " @param type Which rumble value to set"]
3023 #[doc = " @param value The normalized value (0 to 1) to set the rumble to"]
3024 #[link_name = "\u{1}_ZN3frc10GenericHID9SetRumbleENS0_10RumbleTypeEd"]
3025 pub fn GenericHID_SetRumble(
3026 this: *mut root::frc::GenericHID,
3027 type_: root::frc::GenericHID_RumbleType,
3028 value: f64,
3029 );
3030 }
3031 extern "C" {
3032 #[link_name = "\u{1}_ZN3frc10GenericHIDC1Ei"]
3033 pub fn GenericHID_GenericHID(
3034 this: *mut root::frc::GenericHID,
3035 port: ::std::os::raw::c_int,
3036 );
3037 }
3038 impl GenericHID {
3039 #[inline]
3040 pub unsafe fn GetRawButton(&self, button: ::std::os::raw::c_int) -> bool {
3041 GenericHID_GetRawButton(self, button)
3042 }
3043 #[inline]
3044 pub unsafe fn GetRawButtonPressed(&mut self, button: ::std::os::raw::c_int) -> bool {
3045 GenericHID_GetRawButtonPressed(self, button)
3046 }
3047 #[inline]
3048 pub unsafe fn GetRawButtonReleased(&mut self, button: ::std::os::raw::c_int) -> bool {
3049 GenericHID_GetRawButtonReleased(self, button)
3050 }
3051 #[inline]
3052 pub unsafe fn GetRawAxis(&self, axis: ::std::os::raw::c_int) -> f64 {
3053 GenericHID_GetRawAxis(self, axis)
3054 }
3055 #[inline]
3056 pub unsafe fn GetPOV(&self, pov: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
3057 GenericHID_GetPOV(self, pov)
3058 }
3059 #[inline]
3060 pub unsafe fn GetAxisCount(&self) -> ::std::os::raw::c_int {
3061 GenericHID_GetAxisCount(self)
3062 }
3063 #[inline]
3064 pub unsafe fn GetPOVCount(&self) -> ::std::os::raw::c_int {
3065 GenericHID_GetPOVCount(self)
3066 }
3067 #[inline]
3068 pub unsafe fn GetButtonCount(&self) -> ::std::os::raw::c_int {
3069 GenericHID_GetButtonCount(self)
3070 }
3071 #[inline]
3072 pub unsafe fn IsConnected(&self) -> bool {
3073 GenericHID_IsConnected(self)
3074 }
3075 #[inline]
3076 pub unsafe fn GetType(&self) -> root::frc::GenericHID_HIDType {
3077 GenericHID_GetType(self)
3078 }
3079 #[inline]
3080 pub unsafe fn GetName(&self) -> root::std::string {
3081 GenericHID_GetName(self)
3082 }
3083 #[inline]
3084 pub unsafe fn GetAxisType(&self, axis: ::std::os::raw::c_int) -> ::std::os::raw::c_int {
3085 GenericHID_GetAxisType(self, axis)
3086 }
3087 #[inline]
3088 pub unsafe fn GetPort(&self) -> ::std::os::raw::c_int {
3089 GenericHID_GetPort(self)
3090 }
3091 #[inline]
3092 pub unsafe fn SetOutput(&mut self, outputNumber: ::std::os::raw::c_int, value: bool) {
3093 GenericHID_SetOutput(self, outputNumber, value)
3094 }
3095 #[inline]
3096 pub unsafe fn SetOutputs(&mut self, value: ::std::os::raw::c_int) {
3097 GenericHID_SetOutputs(self, value)
3098 }
3099 #[inline]
3100 pub unsafe fn SetRumble(
3101 &mut self,
3102 type_: root::frc::GenericHID_RumbleType,
3103 value: f64,
3104 ) {
3105 GenericHID_SetRumble(self, type_, value)
3106 }
3107 #[inline]
3108 pub unsafe fn new(port: ::std::os::raw::c_int) -> Self {
3109 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
3110 GenericHID_GenericHID(__bindgen_tmp.as_mut_ptr(), port);
3111 __bindgen_tmp.assume_init()
3112 }
3113 }
3114 #[doc = " Handle input from Xbox 360 or Xbox One controllers connected to the Driver"]
3115 #[doc = " Station."]
3116 #[doc = ""]
3117 #[doc = " This class handles Xbox input that comes from the Driver Station. Each time a"]
3118 #[doc = " value is requested the most recent value is returned. There is a single class"]
3119 #[doc = " instance for each controller and the mapping of ports to hardware buttons"]
3120 #[doc = " depends on the code in the Driver Station."]
3121 #[repr(C)]
3122 #[derive(Debug)]
3123 pub struct XboxController {
3124 pub _base: root::frc::GenericHID,
3125 }
3126 #[repr(C)]
3127 #[derive(Debug, Copy, Clone)]
3128 pub struct XboxController_Button {
3129 pub _address: u8,
3130 }
3131 pub const XboxController_Button_kLeftBumper: ::std::os::raw::c_int = 5;
3132 pub const XboxController_Button_kRightBumper: ::std::os::raw::c_int = 6;
3133 pub const XboxController_Button_kLeftStick: ::std::os::raw::c_int = 9;
3134 pub const XboxController_Button_kRightStick: ::std::os::raw::c_int = 10;
3135 pub const XboxController_Button_kA: ::std::os::raw::c_int = 1;
3136 pub const XboxController_Button_kB: ::std::os::raw::c_int = 2;
3137 pub const XboxController_Button_kX: ::std::os::raw::c_int = 3;
3138 pub const XboxController_Button_kY: ::std::os::raw::c_int = 4;
3139 pub const XboxController_Button_kBack: ::std::os::raw::c_int = 7;
3140 pub const XboxController_Button_kStart: ::std::os::raw::c_int = 8;
3141 #[test]
3142 fn bindgen_test_layout_XboxController_Button() {
3143 assert_eq!(
3144 ::std::mem::size_of::<XboxController_Button>(),
3145 1usize,
3146 concat!("Size of: ", stringify!(XboxController_Button))
3147 );
3148 assert_eq!(
3149 ::std::mem::align_of::<XboxController_Button>(),
3150 1usize,
3151 concat!("Alignment of ", stringify!(XboxController_Button))
3152 );
3153 }
3154 #[repr(C)]
3155 #[derive(Debug, Copy, Clone)]
3156 pub struct XboxController_Axis {
3157 pub _address: u8,
3158 }
3159 pub const XboxController_Axis_kLeftX: ::std::os::raw::c_int = 0;
3160 pub const XboxController_Axis_kRightX: ::std::os::raw::c_int = 4;
3161 pub const XboxController_Axis_kLeftY: ::std::os::raw::c_int = 1;
3162 pub const XboxController_Axis_kRightY: ::std::os::raw::c_int = 5;
3163 pub const XboxController_Axis_kLeftTrigger: ::std::os::raw::c_int = 2;
3164 pub const XboxController_Axis_kRightTrigger: ::std::os::raw::c_int = 3;
3165 #[test]
3166 fn bindgen_test_layout_XboxController_Axis() {
3167 assert_eq!(
3168 ::std::mem::size_of::<XboxController_Axis>(),
3169 1usize,
3170 concat!("Size of: ", stringify!(XboxController_Axis))
3171 );
3172 assert_eq!(
3173 ::std::mem::align_of::<XboxController_Axis>(),
3174 1usize,
3175 concat!("Alignment of ", stringify!(XboxController_Axis))
3176 );
3177 }
3178 #[test]
3179 fn bindgen_test_layout_XboxController() {
3180 assert_eq!(
3181 ::std::mem::size_of::<XboxController>(),
3182 24usize,
3183 concat!("Size of: ", stringify!(XboxController))
3184 );
3185 assert_eq!(
3186 ::std::mem::align_of::<XboxController>(),
3187 8usize,
3188 concat!("Alignment of ", stringify!(XboxController))
3189 );
3190 }
3191 extern "C" {
3192 #[doc = " Get the X axis value of left side of the controller."]
3193 #[link_name = "\u{1}_ZNK3frc14XboxController8GetLeftXEv"]
3194 pub fn XboxController_GetLeftX(this: *const root::frc::XboxController) -> f64;
3195 }
3196 extern "C" {
3197 #[doc = " Get the X axis value of right side of the controller."]
3198 #[link_name = "\u{1}_ZNK3frc14XboxController9GetRightXEv"]
3199 pub fn XboxController_GetRightX(this: *const root::frc::XboxController) -> f64;
3200 }
3201 extern "C" {
3202 #[doc = " Get the Y axis value of left side of the controller."]
3203 #[link_name = "\u{1}_ZNK3frc14XboxController8GetLeftYEv"]
3204 pub fn XboxController_GetLeftY(this: *const root::frc::XboxController) -> f64;
3205 }
3206 extern "C" {
3207 #[doc = " Get the Y axis value of right side of the controller."]
3208 #[link_name = "\u{1}_ZNK3frc14XboxController9GetRightYEv"]
3209 pub fn XboxController_GetRightY(this: *const root::frc::XboxController) -> f64;
3210 }
3211 extern "C" {
3212 #[doc = " Get the left trigger (LT) axis value of the controller. Note that this axis"]
3213 #[doc = " is bound to the range of [0, 1] as opposed to the usual [-1, 1]."]
3214 #[link_name = "\u{1}_ZNK3frc14XboxController18GetLeftTriggerAxisEv"]
3215 pub fn XboxController_GetLeftTriggerAxis(this: *const root::frc::XboxController)
3216 -> f64;
3217 }
3218 extern "C" {
3219 #[doc = " Get the right trigger (RT) axis value of the controller. Note that this"]
3220 #[doc = " axis is bound to the range of [0, 1] as opposed to the usual [-1, 1]."]
3221 #[link_name = "\u{1}_ZNK3frc14XboxController19GetRightTriggerAxisEv"]
3222 pub fn XboxController_GetRightTriggerAxis(
3223 this: *const root::frc::XboxController,
3224 ) -> f64;
3225 }
3226 extern "C" {
3227 #[doc = " Read the value of the left bumper (LB) button on the controller."]
3228 #[link_name = "\u{1}_ZNK3frc14XboxController13GetLeftBumperEv"]
3229 pub fn XboxController_GetLeftBumper(this: *const root::frc::XboxController) -> bool;
3230 }
3231 extern "C" {
3232 #[doc = " Read the value of the right bumper (RB) button on the controller."]
3233 #[link_name = "\u{1}_ZNK3frc14XboxController14GetRightBumperEv"]
3234 pub fn XboxController_GetRightBumper(this: *const root::frc::XboxController) -> bool;
3235 }
3236 extern "C" {
3237 #[doc = " Whether the left bumper (LB) was pressed since the last check."]
3238 #[link_name = "\u{1}_ZN3frc14XboxController20GetLeftBumperPressedEv"]
3239 pub fn XboxController_GetLeftBumperPressed(
3240 this: *mut root::frc::XboxController,
3241 ) -> bool;
3242 }
3243 extern "C" {
3244 #[doc = " Whether the right bumper (RB) was pressed since the last check."]
3245 #[link_name = "\u{1}_ZN3frc14XboxController21GetRightBumperPressedEv"]
3246 pub fn XboxController_GetRightBumperPressed(
3247 this: *mut root::frc::XboxController,
3248 ) -> bool;
3249 }
3250 extern "C" {
3251 #[doc = " Whether the left bumper (LB) was released since the last check."]
3252 #[link_name = "\u{1}_ZN3frc14XboxController21GetLeftBumperReleasedEv"]
3253 pub fn XboxController_GetLeftBumperReleased(
3254 this: *mut root::frc::XboxController,
3255 ) -> bool;
3256 }
3257 extern "C" {
3258 #[doc = " Whether the right bumper (RB) was released since the last check."]
3259 #[link_name = "\u{1}_ZN3frc14XboxController22GetRightBumperReleasedEv"]
3260 pub fn XboxController_GetRightBumperReleased(
3261 this: *mut root::frc::XboxController,
3262 ) -> bool;
3263 }
3264 extern "C" {
3265 #[doc = " Read the value of the left stick button (LSB) on the controller."]
3266 #[link_name = "\u{1}_ZNK3frc14XboxController18GetLeftStickButtonEv"]
3267 pub fn XboxController_GetLeftStickButton(
3268 this: *const root::frc::XboxController,
3269 ) -> bool;
3270 }
3271 extern "C" {
3272 #[doc = " Read the value of the right stick button (RSB) on the controller."]
3273 #[link_name = "\u{1}_ZNK3frc14XboxController19GetRightStickButtonEv"]
3274 pub fn XboxController_GetRightStickButton(
3275 this: *const root::frc::XboxController,
3276 ) -> bool;
3277 }
3278 extern "C" {
3279 #[doc = " Whether the left stick button (LSB) was pressed since the last check."]
3280 #[link_name = "\u{1}_ZN3frc14XboxController25GetLeftStickButtonPressedEv"]
3281 pub fn XboxController_GetLeftStickButtonPressed(
3282 this: *mut root::frc::XboxController,
3283 ) -> bool;
3284 }
3285 extern "C" {
3286 #[doc = " Whether the right stick button (RSB) was pressed since the last check."]
3287 #[link_name = "\u{1}_ZN3frc14XboxController26GetRightStickButtonPressedEv"]
3288 pub fn XboxController_GetRightStickButtonPressed(
3289 this: *mut root::frc::XboxController,
3290 ) -> bool;
3291 }
3292 extern "C" {
3293 #[doc = " Whether the left stick button (LSB) was released since the last check."]
3294 #[link_name = "\u{1}_ZN3frc14XboxController26GetLeftStickButtonReleasedEv"]
3295 pub fn XboxController_GetLeftStickButtonReleased(
3296 this: *mut root::frc::XboxController,
3297 ) -> bool;
3298 }
3299 extern "C" {
3300 #[doc = " Whether the right stick button (RSB) was released since the last check."]
3301 #[link_name = "\u{1}_ZN3frc14XboxController27GetRightStickButtonReleasedEv"]
3302 pub fn XboxController_GetRightStickButtonReleased(
3303 this: *mut root::frc::XboxController,
3304 ) -> bool;
3305 }
3306 extern "C" {
3307 #[doc = " Read the value of the A button on the controller."]
3308 #[doc = ""]
3309 #[doc = " @return The state of the button."]
3310 #[link_name = "\u{1}_ZNK3frc14XboxController10GetAButtonEv"]
3311 pub fn XboxController_GetAButton(this: *const root::frc::XboxController) -> bool;
3312 }
3313 extern "C" {
3314 #[doc = " Whether the A button was pressed since the last check."]
3315 #[doc = ""]
3316 #[doc = " @return Whether the button was pressed since the last check."]
3317 #[link_name = "\u{1}_ZN3frc14XboxController17GetAButtonPressedEv"]
3318 pub fn XboxController_GetAButtonPressed(this: *mut root::frc::XboxController) -> bool;
3319 }
3320 extern "C" {
3321 #[doc = " Whether the A button was released since the last check."]
3322 #[doc = ""]
3323 #[doc = " @return Whether the button was released since the last check."]
3324 #[link_name = "\u{1}_ZN3frc14XboxController18GetAButtonReleasedEv"]
3325 pub fn XboxController_GetAButtonReleased(this: *mut root::frc::XboxController) -> bool;
3326 }
3327 extern "C" {
3328 #[doc = " Read the value of the B button on the controller."]
3329 #[doc = ""]
3330 #[doc = " @return The state of the button."]
3331 #[link_name = "\u{1}_ZNK3frc14XboxController10GetBButtonEv"]
3332 pub fn XboxController_GetBButton(this: *const root::frc::XboxController) -> bool;
3333 }
3334 extern "C" {
3335 #[doc = " Whether the B button was pressed since the last check."]
3336 #[doc = ""]
3337 #[doc = " @return Whether the button was pressed since the last check."]
3338 #[link_name = "\u{1}_ZN3frc14XboxController17GetBButtonPressedEv"]
3339 pub fn XboxController_GetBButtonPressed(this: *mut root::frc::XboxController) -> bool;
3340 }
3341 extern "C" {
3342 #[doc = " Whether the B button was released since the last check."]
3343 #[doc = ""]
3344 #[doc = " @return Whether the button was released since the last check."]
3345 #[link_name = "\u{1}_ZN3frc14XboxController18GetBButtonReleasedEv"]
3346 pub fn XboxController_GetBButtonReleased(this: *mut root::frc::XboxController) -> bool;
3347 }
3348 extern "C" {
3349 #[doc = " Read the value of the X button on the controller."]
3350 #[doc = ""]
3351 #[doc = " @return The state of the button."]
3352 #[link_name = "\u{1}_ZNK3frc14XboxController10GetXButtonEv"]
3353 pub fn XboxController_GetXButton(this: *const root::frc::XboxController) -> bool;
3354 }
3355 extern "C" {
3356 #[doc = " Whether the X button was pressed since the last check."]
3357 #[doc = ""]
3358 #[doc = " @return Whether the button was pressed since the last check."]
3359 #[link_name = "\u{1}_ZN3frc14XboxController17GetXButtonPressedEv"]
3360 pub fn XboxController_GetXButtonPressed(this: *mut root::frc::XboxController) -> bool;
3361 }
3362 extern "C" {
3363 #[doc = " Whether the X button was released since the last check."]
3364 #[doc = ""]
3365 #[doc = " @return Whether the button was released since the last check."]
3366 #[link_name = "\u{1}_ZN3frc14XboxController18GetXButtonReleasedEv"]
3367 pub fn XboxController_GetXButtonReleased(this: *mut root::frc::XboxController) -> bool;
3368 }
3369 extern "C" {
3370 #[doc = " Read the value of the Y button on the controller."]
3371 #[doc = ""]
3372 #[doc = " @return The state of the button."]
3373 #[link_name = "\u{1}_ZNK3frc14XboxController10GetYButtonEv"]
3374 pub fn XboxController_GetYButton(this: *const root::frc::XboxController) -> bool;
3375 }
3376 extern "C" {
3377 #[doc = " Whether the Y button was pressed since the last check."]
3378 #[doc = ""]
3379 #[doc = " @return Whether the button was pressed since the last check."]
3380 #[link_name = "\u{1}_ZN3frc14XboxController17GetYButtonPressedEv"]
3381 pub fn XboxController_GetYButtonPressed(this: *mut root::frc::XboxController) -> bool;
3382 }
3383 extern "C" {
3384 #[doc = " Whether the Y button was released since the last check."]
3385 #[doc = ""]
3386 #[doc = " @return Whether the button was released since the last check."]
3387 #[link_name = "\u{1}_ZN3frc14XboxController18GetYButtonReleasedEv"]
3388 pub fn XboxController_GetYButtonReleased(this: *mut root::frc::XboxController) -> bool;
3389 }
3390 extern "C" {
3391 #[doc = " Whether the Y button was released since the last check."]
3392 #[doc = ""]
3393 #[doc = " @return Whether the button was released since the last check."]
3394 #[link_name = "\u{1}_ZNK3frc14XboxController13GetBackButtonEv"]
3395 pub fn XboxController_GetBackButton(this: *const root::frc::XboxController) -> bool;
3396 }
3397 extern "C" {
3398 #[doc = " Whether the back button was pressed since the last check."]
3399 #[doc = ""]
3400 #[doc = " @return Whether the button was pressed since the last check."]
3401 #[link_name = "\u{1}_ZN3frc14XboxController20GetBackButtonPressedEv"]
3402 pub fn XboxController_GetBackButtonPressed(
3403 this: *mut root::frc::XboxController,
3404 ) -> bool;
3405 }
3406 extern "C" {
3407 #[doc = " Whether the back button was released since the last check."]
3408 #[doc = ""]
3409 #[doc = " @return Whether the button was released since the last check."]
3410 #[link_name = "\u{1}_ZN3frc14XboxController21GetBackButtonReleasedEv"]
3411 pub fn XboxController_GetBackButtonReleased(
3412 this: *mut root::frc::XboxController,
3413 ) -> bool;
3414 }
3415 extern "C" {
3416 #[doc = " Read the value of the start button on the controller."]
3417 #[doc = ""]
3418 #[doc = " @return The state of the button."]
3419 #[link_name = "\u{1}_ZNK3frc14XboxController14GetStartButtonEv"]
3420 pub fn XboxController_GetStartButton(this: *const root::frc::XboxController) -> bool;
3421 }
3422 extern "C" {
3423 #[doc = " Whether the start button was pressed since the last check."]
3424 #[doc = ""]
3425 #[doc = " @return Whether the button was pressed since the last check."]
3426 #[link_name = "\u{1}_ZN3frc14XboxController21GetStartButtonPressedEv"]
3427 pub fn XboxController_GetStartButtonPressed(
3428 this: *mut root::frc::XboxController,
3429 ) -> bool;
3430 }
3431 extern "C" {
3432 #[doc = " Whether the start button was released since the last check."]
3433 #[doc = ""]
3434 #[doc = " @return Whether the button was released since the last check."]
3435 #[link_name = "\u{1}_ZN3frc14XboxController22GetStartButtonReleasedEv"]
3436 pub fn XboxController_GetStartButtonReleased(
3437 this: *mut root::frc::XboxController,
3438 ) -> bool;
3439 }
3440 extern "C" {
3441 #[doc = " Construct an instance of an Xbox controller."]
3442 #[doc = ""]
3443 #[doc = " The controller index is the USB port on the Driver Station."]
3444 #[doc = ""]
3445 #[doc = " @param port The port on the Driver Station that the controller is plugged"]
3446 #[doc = " into (0-5)."]
3447 #[link_name = "\u{1}_ZN3frc14XboxControllerC1Ei"]
3448 pub fn XboxController_XboxController(
3449 this: *mut root::frc::XboxController,
3450 port: ::std::os::raw::c_int,
3451 );
3452 }
3453 impl XboxController {
3454 #[inline]
3455 pub unsafe fn GetLeftX(&self) -> f64 {
3456 XboxController_GetLeftX(self)
3457 }
3458 #[inline]
3459 pub unsafe fn GetRightX(&self) -> f64 {
3460 XboxController_GetRightX(self)
3461 }
3462 #[inline]
3463 pub unsafe fn GetLeftY(&self) -> f64 {
3464 XboxController_GetLeftY(self)
3465 }
3466 #[inline]
3467 pub unsafe fn GetRightY(&self) -> f64 {
3468 XboxController_GetRightY(self)
3469 }
3470 #[inline]
3471 pub unsafe fn GetLeftTriggerAxis(&self) -> f64 {
3472 XboxController_GetLeftTriggerAxis(self)
3473 }
3474 #[inline]
3475 pub unsafe fn GetRightTriggerAxis(&self) -> f64 {
3476 XboxController_GetRightTriggerAxis(self)
3477 }
3478 #[inline]
3479 pub unsafe fn GetLeftBumper(&self) -> bool {
3480 XboxController_GetLeftBumper(self)
3481 }
3482 #[inline]
3483 pub unsafe fn GetRightBumper(&self) -> bool {
3484 XboxController_GetRightBumper(self)
3485 }
3486 #[inline]
3487 pub unsafe fn GetLeftBumperPressed(&mut self) -> bool {
3488 XboxController_GetLeftBumperPressed(self)
3489 }
3490 #[inline]
3491 pub unsafe fn GetRightBumperPressed(&mut self) -> bool {
3492 XboxController_GetRightBumperPressed(self)
3493 }
3494 #[inline]
3495 pub unsafe fn GetLeftBumperReleased(&mut self) -> bool {
3496 XboxController_GetLeftBumperReleased(self)
3497 }
3498 #[inline]
3499 pub unsafe fn GetRightBumperReleased(&mut self) -> bool {
3500 XboxController_GetRightBumperReleased(self)
3501 }
3502 #[inline]
3503 pub unsafe fn GetLeftStickButton(&self) -> bool {
3504 XboxController_GetLeftStickButton(self)
3505 }
3506 #[inline]
3507 pub unsafe fn GetRightStickButton(&self) -> bool {
3508 XboxController_GetRightStickButton(self)
3509 }
3510 #[inline]
3511 pub unsafe fn GetLeftStickButtonPressed(&mut self) -> bool {
3512 XboxController_GetLeftStickButtonPressed(self)
3513 }
3514 #[inline]
3515 pub unsafe fn GetRightStickButtonPressed(&mut self) -> bool {
3516 XboxController_GetRightStickButtonPressed(self)
3517 }
3518 #[inline]
3519 pub unsafe fn GetLeftStickButtonReleased(&mut self) -> bool {
3520 XboxController_GetLeftStickButtonReleased(self)
3521 }
3522 #[inline]
3523 pub unsafe fn GetRightStickButtonReleased(&mut self) -> bool {
3524 XboxController_GetRightStickButtonReleased(self)
3525 }
3526 #[inline]
3527 pub unsafe fn GetAButton(&self) -> bool {
3528 XboxController_GetAButton(self)
3529 }
3530 #[inline]
3531 pub unsafe fn GetAButtonPressed(&mut self) -> bool {
3532 XboxController_GetAButtonPressed(self)
3533 }
3534 #[inline]
3535 pub unsafe fn GetAButtonReleased(&mut self) -> bool {
3536 XboxController_GetAButtonReleased(self)
3537 }
3538 #[inline]
3539 pub unsafe fn GetBButton(&self) -> bool {
3540 XboxController_GetBButton(self)
3541 }
3542 #[inline]
3543 pub unsafe fn GetBButtonPressed(&mut self) -> bool {
3544 XboxController_GetBButtonPressed(self)
3545 }
3546 #[inline]
3547 pub unsafe fn GetBButtonReleased(&mut self) -> bool {
3548 XboxController_GetBButtonReleased(self)
3549 }
3550 #[inline]
3551 pub unsafe fn GetXButton(&self) -> bool {
3552 XboxController_GetXButton(self)
3553 }
3554 #[inline]
3555 pub unsafe fn GetXButtonPressed(&mut self) -> bool {
3556 XboxController_GetXButtonPressed(self)
3557 }
3558 #[inline]
3559 pub unsafe fn GetXButtonReleased(&mut self) -> bool {
3560 XboxController_GetXButtonReleased(self)
3561 }
3562 #[inline]
3563 pub unsafe fn GetYButton(&self) -> bool {
3564 XboxController_GetYButton(self)
3565 }
3566 #[inline]
3567 pub unsafe fn GetYButtonPressed(&mut self) -> bool {
3568 XboxController_GetYButtonPressed(self)
3569 }
3570 #[inline]
3571 pub unsafe fn GetYButtonReleased(&mut self) -> bool {
3572 XboxController_GetYButtonReleased(self)
3573 }
3574 #[inline]
3575 pub unsafe fn GetBackButton(&self) -> bool {
3576 XboxController_GetBackButton(self)
3577 }
3578 #[inline]
3579 pub unsafe fn GetBackButtonPressed(&mut self) -> bool {
3580 XboxController_GetBackButtonPressed(self)
3581 }
3582 #[inline]
3583 pub unsafe fn GetBackButtonReleased(&mut self) -> bool {
3584 XboxController_GetBackButtonReleased(self)
3585 }
3586 #[inline]
3587 pub unsafe fn GetStartButton(&self) -> bool {
3588 XboxController_GetStartButton(self)
3589 }
3590 #[inline]
3591 pub unsafe fn GetStartButtonPressed(&mut self) -> bool {
3592 XboxController_GetStartButtonPressed(self)
3593 }
3594 #[inline]
3595 pub unsafe fn GetStartButtonReleased(&mut self) -> bool {
3596 XboxController_GetStartButtonReleased(self)
3597 }
3598 #[inline]
3599 pub unsafe fn new(port: ::std::os::raw::c_int) -> Self {
3600 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
3601 XboxController_XboxController(__bindgen_tmp.as_mut_ptr(), port);
3602 __bindgen_tmp.assume_init()
3603 }
3604 }
3605 }
3606 pub const HAL_SPIPort_HAL_SPI_kInvalid: root::HAL_SPIPort = -1;
3607 pub const HAL_SPIPort_HAL_SPI_kOnboardCS0: root::HAL_SPIPort = 0;
3608 pub const HAL_SPIPort_HAL_SPI_kOnboardCS1: root::HAL_SPIPort = 1;
3609 pub const HAL_SPIPort_HAL_SPI_kOnboardCS2: root::HAL_SPIPort = 2;
3610 pub const HAL_SPIPort_HAL_SPI_kOnboardCS3: root::HAL_SPIPort = 3;
3611 pub const HAL_SPIPort_HAL_SPI_kMXP: root::HAL_SPIPort = 4;
3612 #[doc = " @defgroup hal_spi SPI Functions"]
3613 #[doc = " @ingroup hal_capi"]
3614 #[doc = " @{"]
3615 pub type HAL_SPIPort = i32;
3616 pub const HAL_I2CPort_HAL_I2C_kInvalid: root::HAL_I2CPort = -1;
3617 pub const HAL_I2CPort_HAL_I2C_kOnboard: root::HAL_I2CPort = 0;
3618 pub const HAL_I2CPort_HAL_I2C_kMXP: root::HAL_I2CPort = 1;
3619 #[doc = " @defgroup hal_i2c I2C Functions"]
3620 #[doc = " @ingroup hal_capi"]
3621 #[doc = " @{"]
3622 pub type HAL_I2CPort = i32;
3623 pub const HAL_CANDeviceType_HAL_CAN_Dev_kBroadcast: root::HAL_CANDeviceType = 0;
3624 pub const HAL_CANDeviceType_HAL_CAN_Dev_kRobotController: root::HAL_CANDeviceType = 1;
3625 pub const HAL_CANDeviceType_HAL_CAN_Dev_kMotorController: root::HAL_CANDeviceType = 2;
3626 pub const HAL_CANDeviceType_HAL_CAN_Dev_kRelayController: root::HAL_CANDeviceType = 3;
3627 pub const HAL_CANDeviceType_HAL_CAN_Dev_kGyroSensor: root::HAL_CANDeviceType = 4;
3628 pub const HAL_CANDeviceType_HAL_CAN_Dev_kAccelerometer: root::HAL_CANDeviceType = 5;
3629 pub const HAL_CANDeviceType_HAL_CAN_Dev_kUltrasonicSensor: root::HAL_CANDeviceType = 6;
3630 pub const HAL_CANDeviceType_HAL_CAN_Dev_kGearToothSensor: root::HAL_CANDeviceType = 7;
3631 pub const HAL_CANDeviceType_HAL_CAN_Dev_kPowerDistribution: root::HAL_CANDeviceType = 8;
3632 pub const HAL_CANDeviceType_HAL_CAN_Dev_kPneumatics: root::HAL_CANDeviceType = 9;
3633 pub const HAL_CANDeviceType_HAL_CAN_Dev_kMiscellaneous: root::HAL_CANDeviceType = 10;
3634 pub const HAL_CANDeviceType_HAL_CAN_Dev_kIOBreakout: root::HAL_CANDeviceType = 11;
3635 pub const HAL_CANDeviceType_HAL_CAN_Dev_kFirmwareUpdate: root::HAL_CANDeviceType = 31;
3636 #[doc = " The CAN device type."]
3637 #[doc = ""]
3638 #[doc = " Teams should use HAL_CAN_Dev_kMiscellaneous"]
3639 pub type HAL_CANDeviceType = i32;
3640 pub const HAL_CANManufacturer_HAL_CAN_Man_kBroadcast: root::HAL_CANManufacturer = 0;
3641 pub const HAL_CANManufacturer_HAL_CAN_Man_kNI: root::HAL_CANManufacturer = 1;
3642 pub const HAL_CANManufacturer_HAL_CAN_Man_kLM: root::HAL_CANManufacturer = 2;
3643 pub const HAL_CANManufacturer_HAL_CAN_Man_kDEKA: root::HAL_CANManufacturer = 3;
3644 pub const HAL_CANManufacturer_HAL_CAN_Man_kCTRE: root::HAL_CANManufacturer = 4;
3645 pub const HAL_CANManufacturer_HAL_CAN_Man_kREV: root::HAL_CANManufacturer = 5;
3646 pub const HAL_CANManufacturer_HAL_CAN_Man_kGrapple: root::HAL_CANManufacturer = 6;
3647 pub const HAL_CANManufacturer_HAL_CAN_Man_kMS: root::HAL_CANManufacturer = 7;
3648 pub const HAL_CANManufacturer_HAL_CAN_Man_kTeamUse: root::HAL_CANManufacturer = 8;
3649 pub const HAL_CANManufacturer_HAL_CAN_Man_kKauaiLabs: root::HAL_CANManufacturer = 9;
3650 pub const HAL_CANManufacturer_HAL_CAN_Man_kCopperforge: root::HAL_CANManufacturer = 10;
3651 pub const HAL_CANManufacturer_HAL_CAN_Man_kPWF: root::HAL_CANManufacturer = 11;
3652 pub const HAL_CANManufacturer_HAL_CAN_Man_kStudica: root::HAL_CANManufacturer = 12;
3653 #[doc = " The CAN manufacturer ID."]
3654 #[doc = ""]
3655 #[doc = " Teams should use HAL_CAN_Man_kTeamUse."]
3656 pub type HAL_CANManufacturer = i32;
3657 #[repr(C)]
3658 #[repr(align(4))]
3659 #[derive(Debug, Copy, Clone)]
3660 pub struct HAL_ControlWord {
3661 pub _bitfield_align_1: [u32; 0],
3662 pub _bitfield_1: root::__BindgenBitfieldUnit<[u8; 4usize]>,
3663 }
3664 #[test]
3665 fn bindgen_test_layout_HAL_ControlWord() {
3666 assert_eq!(
3667 ::std::mem::size_of::<HAL_ControlWord>(),
3668 4usize,
3669 concat!("Size of: ", stringify!(HAL_ControlWord))
3670 );
3671 assert_eq!(
3672 ::std::mem::align_of::<HAL_ControlWord>(),
3673 4usize,
3674 concat!("Alignment of ", stringify!(HAL_ControlWord))
3675 );
3676 }
3677 impl HAL_ControlWord {
3678 #[inline]
3679 pub fn enabled(&self) -> u32 {
3680 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
3681 }
3682 #[inline]
3683 pub fn set_enabled(&mut self, val: u32) {
3684 unsafe {
3685 let val: u32 = ::std::mem::transmute(val);
3686 self._bitfield_1.set(0usize, 1u8, val as u64)
3687 }
3688 }
3689 #[inline]
3690 pub fn autonomous(&self) -> u32 {
3691 unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
3692 }
3693 #[inline]
3694 pub fn set_autonomous(&mut self, val: u32) {
3695 unsafe {
3696 let val: u32 = ::std::mem::transmute(val);
3697 self._bitfield_1.set(1usize, 1u8, val as u64)
3698 }
3699 }
3700 #[inline]
3701 pub fn test(&self) -> u32 {
3702 unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
3703 }
3704 #[inline]
3705 pub fn set_test(&mut self, val: u32) {
3706 unsafe {
3707 let val: u32 = ::std::mem::transmute(val);
3708 self._bitfield_1.set(2usize, 1u8, val as u64)
3709 }
3710 }
3711 #[inline]
3712 pub fn eStop(&self) -> u32 {
3713 unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
3714 }
3715 #[inline]
3716 pub fn set_eStop(&mut self, val: u32) {
3717 unsafe {
3718 let val: u32 = ::std::mem::transmute(val);
3719 self._bitfield_1.set(3usize, 1u8, val as u64)
3720 }
3721 }
3722 #[inline]
3723 pub fn fmsAttached(&self) -> u32 {
3724 unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
3725 }
3726 #[inline]
3727 pub fn set_fmsAttached(&mut self, val: u32) {
3728 unsafe {
3729 let val: u32 = ::std::mem::transmute(val);
3730 self._bitfield_1.set(4usize, 1u8, val as u64)
3731 }
3732 }
3733 #[inline]
3734 pub fn dsAttached(&self) -> u32 {
3735 unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
3736 }
3737 #[inline]
3738 pub fn set_dsAttached(&mut self, val: u32) {
3739 unsafe {
3740 let val: u32 = ::std::mem::transmute(val);
3741 self._bitfield_1.set(5usize, 1u8, val as u64)
3742 }
3743 }
3744 #[inline]
3745 pub fn control_reserved(&self) -> u32 {
3746 unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 26u8) as u32) }
3747 }
3748 #[inline]
3749 pub fn set_control_reserved(&mut self, val: u32) {
3750 unsafe {
3751 let val: u32 = ::std::mem::transmute(val);
3752 self._bitfield_1.set(6usize, 26u8, val as u64)
3753 }
3754 }
3755 #[inline]
3756 pub fn new_bitfield_1(
3757 enabled: u32,
3758 autonomous: u32,
3759 test: u32,
3760 eStop: u32,
3761 fmsAttached: u32,
3762 dsAttached: u32,
3763 control_reserved: u32,
3764 ) -> root::__BindgenBitfieldUnit<[u8; 4usize]> {
3765 let mut __bindgen_bitfield_unit: root::__BindgenBitfieldUnit<[u8; 4usize]> =
3766 Default::default();
3767 __bindgen_bitfield_unit.set(0usize, 1u8, {
3768 let enabled: u32 = unsafe { ::std::mem::transmute(enabled) };
3769 enabled as u64
3770 });
3771 __bindgen_bitfield_unit.set(1usize, 1u8, {
3772 let autonomous: u32 = unsafe { ::std::mem::transmute(autonomous) };
3773 autonomous as u64
3774 });
3775 __bindgen_bitfield_unit.set(2usize, 1u8, {
3776 let test: u32 = unsafe { ::std::mem::transmute(test) };
3777 test as u64
3778 });
3779 __bindgen_bitfield_unit.set(3usize, 1u8, {
3780 let eStop: u32 = unsafe { ::std::mem::transmute(eStop) };
3781 eStop as u64
3782 });
3783 __bindgen_bitfield_unit.set(4usize, 1u8, {
3784 let fmsAttached: u32 = unsafe { ::std::mem::transmute(fmsAttached) };
3785 fmsAttached as u64
3786 });
3787 __bindgen_bitfield_unit.set(5usize, 1u8, {
3788 let dsAttached: u32 = unsafe { ::std::mem::transmute(dsAttached) };
3789 dsAttached as u64
3790 });
3791 __bindgen_bitfield_unit.set(6usize, 26u8, {
3792 let control_reserved: u32 = unsafe { ::std::mem::transmute(control_reserved) };
3793 control_reserved as u64
3794 });
3795 __bindgen_bitfield_unit
3796 }
3797 }
3798 pub const HAL_AllianceStationID_HAL_AllianceStationID_kRed1: root::HAL_AllianceStationID = 0;
3799 pub const HAL_AllianceStationID_HAL_AllianceStationID_kRed2: root::HAL_AllianceStationID = 1;
3800 pub const HAL_AllianceStationID_HAL_AllianceStationID_kRed3: root::HAL_AllianceStationID = 2;
3801 pub const HAL_AllianceStationID_HAL_AllianceStationID_kBlue1: root::HAL_AllianceStationID = 3;
3802 pub const HAL_AllianceStationID_HAL_AllianceStationID_kBlue2: root::HAL_AllianceStationID = 4;
3803 pub const HAL_AllianceStationID_HAL_AllianceStationID_kBlue3: root::HAL_AllianceStationID = 5;
3804 pub type HAL_AllianceStationID = i32;
3805 pub const HAL_MatchType_HAL_kMatchType_none: root::HAL_MatchType = 0;
3806 pub const HAL_MatchType_HAL_kMatchType_practice: root::HAL_MatchType = 1;
3807 pub const HAL_MatchType_HAL_kMatchType_qualification: root::HAL_MatchType = 2;
3808 pub const HAL_MatchType_HAL_kMatchType_elimination: root::HAL_MatchType = 3;
3809 pub type HAL_MatchType = i32;
3810 #[repr(C)]
3811 #[derive(Debug, Copy, Clone)]
3812 pub struct HAL_JoystickAxes {
3813 pub count: i16,
3814 pub axes: [f32; 12usize],
3815 }
3816 #[test]
3817 fn bindgen_test_layout_HAL_JoystickAxes() {
3818 assert_eq!(
3819 ::std::mem::size_of::<HAL_JoystickAxes>(),
3820 52usize,
3821 concat!("Size of: ", stringify!(HAL_JoystickAxes))
3822 );
3823 assert_eq!(
3824 ::std::mem::align_of::<HAL_JoystickAxes>(),
3825 4usize,
3826 concat!("Alignment of ", stringify!(HAL_JoystickAxes))
3827 );
3828 fn test_field_count() {
3829 assert_eq!(
3830 unsafe {
3831 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickAxes>::uninit();
3832 let ptr = uninit.as_ptr();
3833 ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize
3834 },
3835 0usize,
3836 concat!(
3837 "Offset of field: ",
3838 stringify!(HAL_JoystickAxes),
3839 "::",
3840 stringify!(count)
3841 )
3842 );
3843 }
3844 test_field_count();
3845 fn test_field_axes() {
3846 assert_eq!(
3847 unsafe {
3848 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickAxes>::uninit();
3849 let ptr = uninit.as_ptr();
3850 ::std::ptr::addr_of!((*ptr).axes) as usize - ptr as usize
3851 },
3852 4usize,
3853 concat!(
3854 "Offset of field: ",
3855 stringify!(HAL_JoystickAxes),
3856 "::",
3857 stringify!(axes)
3858 )
3859 );
3860 }
3861 test_field_axes();
3862 }
3863 #[repr(C)]
3864 #[derive(Debug, Copy, Clone)]
3865 pub struct HAL_JoystickPOVs {
3866 pub count: i16,
3867 pub povs: [i16; 12usize],
3868 }
3869 #[test]
3870 fn bindgen_test_layout_HAL_JoystickPOVs() {
3871 assert_eq!(
3872 ::std::mem::size_of::<HAL_JoystickPOVs>(),
3873 26usize,
3874 concat!("Size of: ", stringify!(HAL_JoystickPOVs))
3875 );
3876 assert_eq!(
3877 ::std::mem::align_of::<HAL_JoystickPOVs>(),
3878 2usize,
3879 concat!("Alignment of ", stringify!(HAL_JoystickPOVs))
3880 );
3881 fn test_field_count() {
3882 assert_eq!(
3883 unsafe {
3884 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickPOVs>::uninit();
3885 let ptr = uninit.as_ptr();
3886 ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize
3887 },
3888 0usize,
3889 concat!(
3890 "Offset of field: ",
3891 stringify!(HAL_JoystickPOVs),
3892 "::",
3893 stringify!(count)
3894 )
3895 );
3896 }
3897 test_field_count();
3898 fn test_field_povs() {
3899 assert_eq!(
3900 unsafe {
3901 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickPOVs>::uninit();
3902 let ptr = uninit.as_ptr();
3903 ::std::ptr::addr_of!((*ptr).povs) as usize - ptr as usize
3904 },
3905 2usize,
3906 concat!(
3907 "Offset of field: ",
3908 stringify!(HAL_JoystickPOVs),
3909 "::",
3910 stringify!(povs)
3911 )
3912 );
3913 }
3914 test_field_povs();
3915 }
3916 #[repr(C)]
3917 #[derive(Debug, Copy, Clone)]
3918 pub struct HAL_JoystickButtons {
3919 pub buttons: u32,
3920 pub count: u8,
3921 }
3922 #[test]
3923 fn bindgen_test_layout_HAL_JoystickButtons() {
3924 assert_eq!(
3925 ::std::mem::size_of::<HAL_JoystickButtons>(),
3926 8usize,
3927 concat!("Size of: ", stringify!(HAL_JoystickButtons))
3928 );
3929 assert_eq!(
3930 ::std::mem::align_of::<HAL_JoystickButtons>(),
3931 4usize,
3932 concat!("Alignment of ", stringify!(HAL_JoystickButtons))
3933 );
3934 fn test_field_buttons() {
3935 assert_eq!(
3936 unsafe {
3937 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickButtons>::uninit();
3938 let ptr = uninit.as_ptr();
3939 ::std::ptr::addr_of!((*ptr).buttons) as usize - ptr as usize
3940 },
3941 0usize,
3942 concat!(
3943 "Offset of field: ",
3944 stringify!(HAL_JoystickButtons),
3945 "::",
3946 stringify!(buttons)
3947 )
3948 );
3949 }
3950 test_field_buttons();
3951 fn test_field_count() {
3952 assert_eq!(
3953 unsafe {
3954 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickButtons>::uninit();
3955 let ptr = uninit.as_ptr();
3956 ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize
3957 },
3958 4usize,
3959 concat!(
3960 "Offset of field: ",
3961 stringify!(HAL_JoystickButtons),
3962 "::",
3963 stringify!(count)
3964 )
3965 );
3966 }
3967 test_field_count();
3968 }
3969 #[repr(C)]
3970 #[derive(Debug, Copy, Clone)]
3971 pub struct HAL_JoystickDescriptor {
3972 pub isXbox: u8,
3973 pub type_: u8,
3974 pub name: [::std::os::raw::c_char; 256usize],
3975 pub axisCount: u8,
3976 pub axisTypes: [u8; 12usize],
3977 pub buttonCount: u8,
3978 pub povCount: u8,
3979 }
3980 #[test]
3981 fn bindgen_test_layout_HAL_JoystickDescriptor() {
3982 assert_eq!(
3983 ::std::mem::size_of::<HAL_JoystickDescriptor>(),
3984 273usize,
3985 concat!("Size of: ", stringify!(HAL_JoystickDescriptor))
3986 );
3987 assert_eq!(
3988 ::std::mem::align_of::<HAL_JoystickDescriptor>(),
3989 1usize,
3990 concat!("Alignment of ", stringify!(HAL_JoystickDescriptor))
3991 );
3992 fn test_field_isXbox() {
3993 assert_eq!(
3994 unsafe {
3995 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
3996 let ptr = uninit.as_ptr();
3997 ::std::ptr::addr_of!((*ptr).isXbox) as usize - ptr as usize
3998 },
3999 0usize,
4000 concat!(
4001 "Offset of field: ",
4002 stringify!(HAL_JoystickDescriptor),
4003 "::",
4004 stringify!(isXbox)
4005 )
4006 );
4007 }
4008 test_field_isXbox();
4009 fn test_field_type() {
4010 assert_eq!(
4011 unsafe {
4012 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
4013 let ptr = uninit.as_ptr();
4014 ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize
4015 },
4016 1usize,
4017 concat!(
4018 "Offset of field: ",
4019 stringify!(HAL_JoystickDescriptor),
4020 "::",
4021 stringify!(type_)
4022 )
4023 );
4024 }
4025 test_field_type();
4026 fn test_field_name() {
4027 assert_eq!(
4028 unsafe {
4029 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
4030 let ptr = uninit.as_ptr();
4031 ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize
4032 },
4033 2usize,
4034 concat!(
4035 "Offset of field: ",
4036 stringify!(HAL_JoystickDescriptor),
4037 "::",
4038 stringify!(name)
4039 )
4040 );
4041 }
4042 test_field_name();
4043 fn test_field_axisCount() {
4044 assert_eq!(
4045 unsafe {
4046 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
4047 let ptr = uninit.as_ptr();
4048 ::std::ptr::addr_of!((*ptr).axisCount) as usize - ptr as usize
4049 },
4050 258usize,
4051 concat!(
4052 "Offset of field: ",
4053 stringify!(HAL_JoystickDescriptor),
4054 "::",
4055 stringify!(axisCount)
4056 )
4057 );
4058 }
4059 test_field_axisCount();
4060 fn test_field_axisTypes() {
4061 assert_eq!(
4062 unsafe {
4063 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
4064 let ptr = uninit.as_ptr();
4065 ::std::ptr::addr_of!((*ptr).axisTypes) as usize - ptr as usize
4066 },
4067 259usize,
4068 concat!(
4069 "Offset of field: ",
4070 stringify!(HAL_JoystickDescriptor),
4071 "::",
4072 stringify!(axisTypes)
4073 )
4074 );
4075 }
4076 test_field_axisTypes();
4077 fn test_field_buttonCount() {
4078 assert_eq!(
4079 unsafe {
4080 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
4081 let ptr = uninit.as_ptr();
4082 ::std::ptr::addr_of!((*ptr).buttonCount) as usize - ptr as usize
4083 },
4084 271usize,
4085 concat!(
4086 "Offset of field: ",
4087 stringify!(HAL_JoystickDescriptor),
4088 "::",
4089 stringify!(buttonCount)
4090 )
4091 );
4092 }
4093 test_field_buttonCount();
4094 fn test_field_povCount() {
4095 assert_eq!(
4096 unsafe {
4097 let uninit = ::std::mem::MaybeUninit::<HAL_JoystickDescriptor>::uninit();
4098 let ptr = uninit.as_ptr();
4099 ::std::ptr::addr_of!((*ptr).povCount) as usize - ptr as usize
4100 },
4101 272usize,
4102 concat!(
4103 "Offset of field: ",
4104 stringify!(HAL_JoystickDescriptor),
4105 "::",
4106 stringify!(povCount)
4107 )
4108 );
4109 }
4110 test_field_povCount();
4111 }
4112 #[repr(C)]
4113 #[derive(Debug, Copy, Clone)]
4114 pub struct HAL_MatchInfo {
4115 pub eventName: [::std::os::raw::c_char; 64usize],
4116 pub matchType: root::HAL_MatchType,
4117 pub matchNumber: u16,
4118 pub replayNumber: u8,
4119 pub gameSpecificMessage: [u8; 64usize],
4120 pub gameSpecificMessageSize: u16,
4121 }
4122 #[test]
4123 fn bindgen_test_layout_HAL_MatchInfo() {
4124 assert_eq!(
4125 ::std::mem::size_of::<HAL_MatchInfo>(),
4126 140usize,
4127 concat!("Size of: ", stringify!(HAL_MatchInfo))
4128 );
4129 assert_eq!(
4130 ::std::mem::align_of::<HAL_MatchInfo>(),
4131 4usize,
4132 concat!("Alignment of ", stringify!(HAL_MatchInfo))
4133 );
4134 fn test_field_eventName() {
4135 assert_eq!(
4136 unsafe {
4137 let uninit = ::std::mem::MaybeUninit::<HAL_MatchInfo>::uninit();
4138 let ptr = uninit.as_ptr();
4139 ::std::ptr::addr_of!((*ptr).eventName) as usize - ptr as usize
4140 },
4141 0usize,
4142 concat!(
4143 "Offset of field: ",
4144 stringify!(HAL_MatchInfo),
4145 "::",
4146 stringify!(eventName)
4147 )
4148 );
4149 }
4150 test_field_eventName();
4151 fn test_field_matchType() {
4152 assert_eq!(
4153 unsafe {
4154 let uninit = ::std::mem::MaybeUninit::<HAL_MatchInfo>::uninit();
4155 let ptr = uninit.as_ptr();
4156 ::std::ptr::addr_of!((*ptr).matchType) as usize - ptr as usize
4157 },
4158 64usize,
4159 concat!(
4160 "Offset of field: ",
4161 stringify!(HAL_MatchInfo),
4162 "::",
4163 stringify!(matchType)
4164 )
4165 );
4166 }
4167 test_field_matchType();
4168 fn test_field_matchNumber() {
4169 assert_eq!(
4170 unsafe {
4171 let uninit = ::std::mem::MaybeUninit::<HAL_MatchInfo>::uninit();
4172 let ptr = uninit.as_ptr();
4173 ::std::ptr::addr_of!((*ptr).matchNumber) as usize - ptr as usize
4174 },
4175 68usize,
4176 concat!(
4177 "Offset of field: ",
4178 stringify!(HAL_MatchInfo),
4179 "::",
4180 stringify!(matchNumber)
4181 )
4182 );
4183 }
4184 test_field_matchNumber();
4185 fn test_field_replayNumber() {
4186 assert_eq!(
4187 unsafe {
4188 let uninit = ::std::mem::MaybeUninit::<HAL_MatchInfo>::uninit();
4189 let ptr = uninit.as_ptr();
4190 ::std::ptr::addr_of!((*ptr).replayNumber) as usize - ptr as usize
4191 },
4192 70usize,
4193 concat!(
4194 "Offset of field: ",
4195 stringify!(HAL_MatchInfo),
4196 "::",
4197 stringify!(replayNumber)
4198 )
4199 );
4200 }
4201 test_field_replayNumber();
4202 fn test_field_gameSpecificMessage() {
4203 assert_eq!(
4204 unsafe {
4205 let uninit = ::std::mem::MaybeUninit::<HAL_MatchInfo>::uninit();
4206 let ptr = uninit.as_ptr();
4207 ::std::ptr::addr_of!((*ptr).gameSpecificMessage) as usize - ptr as usize
4208 },
4209 71usize,
4210 concat!(
4211 "Offset of field: ",
4212 stringify!(HAL_MatchInfo),
4213 "::",
4214 stringify!(gameSpecificMessage)
4215 )
4216 );
4217 }
4218 test_field_gameSpecificMessage();
4219 fn test_field_gameSpecificMessageSize() {
4220 assert_eq!(
4221 unsafe {
4222 let uninit = ::std::mem::MaybeUninit::<HAL_MatchInfo>::uninit();
4223 let ptr = uninit.as_ptr();
4224 ::std::ptr::addr_of!((*ptr).gameSpecificMessageSize) as usize - ptr as usize
4225 },
4226 136usize,
4227 concat!(
4228 "Offset of field: ",
4229 stringify!(HAL_MatchInfo),
4230 "::",
4231 stringify!(gameSpecificMessageSize)
4232 )
4233 );
4234 }
4235 test_field_gameSpecificMessageSize();
4236 }
4237 extern "C" {
4238 #[doc = " Sends an error to the driver station."]
4239 #[doc = ""]
4240 #[doc = " @param isError true for error, false for warning"]
4241 #[doc = " @param errorCode the error code"]
4242 #[doc = " @param isLVCode true for a LV error code, false for a standard error code"]
4243 #[doc = " @param details the details of the error"]
4244 #[doc = " @param location the file location of the errror"]
4245 #[doc = " @param callStack the callstack of the error"]
4246 #[doc = " @param printMsg true to print the error message to stdout as well as to the"]
4247 #[doc = " DS"]
4248 pub fn HAL_SendError(
4249 isError: root::HAL_Bool,
4250 errorCode: i32,
4251 isLVCode: root::HAL_Bool,
4252 details: *const ::std::os::raw::c_char,
4253 location: *const ::std::os::raw::c_char,
4254 callStack: *const ::std::os::raw::c_char,
4255 printMsg: root::HAL_Bool,
4256 ) -> i32;
4257 }
4258 extern "C" {
4259 #[doc = " Sends a line to the driver station console."]
4260 #[doc = ""]
4261 #[doc = " @param line the line to send (null terminated)"]
4262 pub fn HAL_SendConsoleLine(line: *const ::std::os::raw::c_char) -> i32;
4263 }
4264 extern "C" {
4265 #[doc = " Gets the current control word of the driver station."]
4266 #[doc = ""]
4267 #[doc = " The control work contains the robot state."]
4268 #[doc = ""]
4269 #[doc = " @param controlWord the control word (out)"]
4270 #[doc = " @return the error code, or 0 for success"]
4271 pub fn HAL_GetControlWord(controlWord: *mut root::HAL_ControlWord) -> i32;
4272 }
4273 extern "C" {
4274 #[doc = " Gets the current alliance station ID."]
4275 #[doc = ""]
4276 #[doc = " @param[out] status the error code, or 0 for success"]
4277 #[doc = " @return the alliance station ID"]
4278 pub fn HAL_GetAllianceStation(status: *mut i32) -> root::HAL_AllianceStationID;
4279 }
4280 extern "C" {
4281 #[doc = " Gets the axes of a specific joystick."]
4282 #[doc = ""]
4283 #[doc = " @param joystickNum the joystick number"]
4284 #[doc = " @param axes the axes values (output)"]
4285 #[doc = " @return the error code, or 0 for success"]
4286 pub fn HAL_GetJoystickAxes(joystickNum: i32, axes: *mut root::HAL_JoystickAxes) -> i32;
4287 }
4288 extern "C" {
4289 #[doc = " Gets the POVs of a specific joystick."]
4290 #[doc = ""]
4291 #[doc = " @param joystickNum the joystick number"]
4292 #[doc = " @param povs the POV values (output)"]
4293 #[doc = " @return the error code, or 0 for success"]
4294 pub fn HAL_GetJoystickPOVs(joystickNum: i32, povs: *mut root::HAL_JoystickPOVs) -> i32;
4295 }
4296 extern "C" {
4297 #[doc = " Gets the buttons of a specific joystick."]
4298 #[doc = ""]
4299 #[doc = " @param joystickNum the joystick number"]
4300 #[doc = " @param buttons the button values (output)"]
4301 #[doc = " @return the error code, or 0 for success"]
4302 pub fn HAL_GetJoystickButtons(
4303 joystickNum: i32,
4304 buttons: *mut root::HAL_JoystickButtons,
4305 ) -> i32;
4306 }
4307 extern "C" {
4308 #[doc = " Retrieves the Joystick Descriptor for particular slot."]
4309 #[doc = ""]
4310 #[doc = " @param joystickNum the joystick number"]
4311 #[doc = " @param[out] desc descriptor (data transfer object) to fill in. desc is"]
4312 #[doc = " filled in regardless of success. In other words, if"]
4313 #[doc = " descriptor is not available, desc is filled in with"]
4314 #[doc = " default values matching the init-values in Java and C++"]
4315 #[doc = " Driver Station for when caller requests a too-large"]
4316 #[doc = " joystick index."]
4317 #[doc = " @return error code reported from Network Comm back-end. Zero is good,"]
4318 #[doc = " nonzero is bad."]
4319 pub fn HAL_GetJoystickDescriptor(
4320 joystickNum: i32,
4321 desc: *mut root::HAL_JoystickDescriptor,
4322 ) -> i32;
4323 }
4324 extern "C" {
4325 #[doc = " Gets is a specific joystick is considered to be an XBox controller."]
4326 #[doc = ""]
4327 #[doc = " @param joystickNum the joystick number"]
4328 #[doc = " @return true if xbox, false otherwise"]
4329 pub fn HAL_GetJoystickIsXbox(joystickNum: i32) -> root::HAL_Bool;
4330 }
4331 extern "C" {
4332 #[doc = " Gets the type of joystick connected."]
4333 #[doc = ""]
4334 #[doc = " This is device specific, and different depending on what system input type"]
4335 #[doc = " the joystick uses."]
4336 #[doc = ""]
4337 #[doc = " @param joystickNum the joystick number"]
4338 #[doc = " @return the enumerated joystick type"]
4339 pub fn HAL_GetJoystickType(joystickNum: i32) -> i32;
4340 }
4341 extern "C" {
4342 #[doc = " Gets the name of a joystick."]
4343 #[doc = ""]
4344 #[doc = " The returned array must be freed with HAL_FreeJoystickName."]
4345 #[doc = ""]
4346 #[doc = " Will be null terminated."]
4347 #[doc = ""]
4348 #[doc = " @param joystickNum the joystick number"]
4349 #[doc = " @return the joystick name"]
4350 pub fn HAL_GetJoystickName(joystickNum: i32) -> *mut ::std::os::raw::c_char;
4351 }
4352 extern "C" {
4353 #[doc = " Frees a joystick name received with HAL_GetJoystickName"]
4354 #[doc = ""]
4355 #[doc = " @param name the name storage"]
4356 pub fn HAL_FreeJoystickName(name: *mut ::std::os::raw::c_char);
4357 }
4358 extern "C" {
4359 #[doc = " Gets the type of a specific joystick axis."]
4360 #[doc = ""]
4361 #[doc = " This is device specific, and different depending on what system input type"]
4362 #[doc = " the joystick uses."]
4363 #[doc = ""]
4364 #[doc = " @param joystickNum the joystick number"]
4365 #[doc = " @param axis the axis number"]
4366 #[doc = " @return the enumerated axis type"]
4367 pub fn HAL_GetJoystickAxisType(joystickNum: i32, axis: i32) -> i32;
4368 }
4369 extern "C" {
4370 #[doc = " Set joystick outputs."]
4371 #[doc = ""]
4372 #[doc = " @param joystickNum the joystick number"]
4373 #[doc = " @param outputs bitmask of outputs, 1 for on 0 for off"]
4374 #[doc = " @param leftRumble the left rumble value (0-FFFF)"]
4375 #[doc = " @param rightRumble the right rumble value (0-FFFF)"]
4376 #[doc = " @return the error code, or 0 for success"]
4377 pub fn HAL_SetJoystickOutputs(
4378 joystickNum: i32,
4379 outputs: i64,
4380 leftRumble: i32,
4381 rightRumble: i32,
4382 ) -> i32;
4383 }
4384 extern "C" {
4385 #[doc = " Returns the approximate match time."]
4386 #[doc = ""]
4387 #[doc = " The FMS does not send an official match time to the robots, but does send"]
4388 #[doc = " an approximate match time. The value will count down the time remaining in"]
4389 #[doc = " the current period (auto or teleop)."]
4390 #[doc = ""]
4391 #[doc = " Warning: This is not an official time (so it cannot be used to dispute ref"]
4392 #[doc = " calls or guarantee that a function will trigger before the match ends)."]
4393 #[doc = ""]
4394 #[doc = " The Practice Match function of the DS approximates the behavior seen on"]
4395 #[doc = " the field."]
4396 #[doc = ""]
4397 #[doc = " @param[out] status the error code, or 0 for success"]
4398 #[doc = " @return time remaining in current match period (auto or teleop)"]
4399 pub fn HAL_GetMatchTime(status: *mut i32) -> f64;
4400 }
4401 extern "C" {
4402 #[doc = " Gets info about a specific match."]
4403 #[doc = ""]
4404 #[doc = " @param[in] info the match info (output)"]
4405 #[doc = " @return the error code, or 0 for success"]
4406 pub fn HAL_GetMatchInfo(info: *mut root::HAL_MatchInfo) -> i32;
4407 }
4408 extern "C" {
4409 #[doc = " Releases the DS Mutex to allow proper shutdown of any threads that are"]
4410 #[doc = " waiting on it."]
4411 pub fn HAL_ReleaseDSMutex();
4412 }
4413 extern "C" {
4414 #[doc = " Has a new control packet from the driver station arrived since the last"]
4415 #[doc = " time this function was called?"]
4416 #[doc = ""]
4417 #[doc = " @return true if the control data has been updated since the last call"]
4418 pub fn HAL_IsNewControlData() -> root::HAL_Bool;
4419 }
4420 extern "C" {
4421 #[doc = " Waits for the newest DS packet to arrive. Note that this is a blocking call."]
4422 #[doc = " Checks if new control data has arrived since the last HAL_WaitForDSData or"]
4423 #[doc = " HAL_IsNewControlData call. If new data has not arrived, waits for new data"]
4424 #[doc = " to arrive. Otherwise, returns immediately."]
4425 pub fn HAL_WaitForDSData();
4426 }
4427 extern "C" {
4428 #[doc = " Waits for the newest DS packet to arrive. If timeout is <= 0, this will wait"]
4429 #[doc = " forever. Otherwise, it will wait until either a new packet, or the timeout"]
4430 #[doc = " time has passed."]
4431 #[doc = ""]
4432 #[doc = " @param[in] timeout timeout in seconds"]
4433 #[doc = " @return true for new data, false for timeout"]
4434 pub fn HAL_WaitForDSDataTimeout(timeout: f64) -> root::HAL_Bool;
4435 }
4436 extern "C" {
4437 #[doc = " Initializes the driver station communication. This will properly"]
4438 #[doc = " handle multiple calls. However note that this CANNOT be called from a library"]
4439 #[doc = " that interfaces with LabVIEW."]
4440 pub fn HAL_InitializeDriverStation();
4441 }
4442 extern "C" {
4443 #[doc = " Sets the program starting flag in the DS."]
4444 #[doc = ""]
4445 #[doc = " This is what changes the DS to showing robot code ready."]
4446 pub fn HAL_ObserveUserProgramStarting();
4447 }
4448 extern "C" {
4449 #[doc = " Sets the disabled flag in the DS."]
4450 #[doc = ""]
4451 #[doc = " This is used for the DS to ensure the robot is properly responding to its"]
4452 #[doc = " state request. Ensure this gets called about every 50ms, or the robot will be"]
4453 #[doc = " disabled by the DS."]
4454 pub fn HAL_ObserveUserProgramDisabled();
4455 }
4456 extern "C" {
4457 #[doc = " Sets the autonomous enabled flag in the DS."]
4458 #[doc = ""]
4459 #[doc = " This is used for the DS to ensure the robot is properly responding to its"]
4460 #[doc = " state request. Ensure this gets called about every 50ms, or the robot will be"]
4461 #[doc = " disabled by the DS."]
4462 pub fn HAL_ObserveUserProgramAutonomous();
4463 }
4464 extern "C" {
4465 #[doc = " Sets the teleoperated enabled flag in the DS."]
4466 #[doc = ""]
4467 #[doc = " This is used for the DS to ensure the robot is properly responding to its"]
4468 #[doc = " state request. Ensure this gets called about every 50ms, or the robot will be"]
4469 #[doc = " disabled by the DS."]
4470 pub fn HAL_ObserveUserProgramTeleop();
4471 }
4472 extern "C" {
4473 #[doc = " Sets the test mode flag in the DS."]
4474 #[doc = ""]
4475 #[doc = " This is used for the DS to ensure the robot is properly responding to its"]
4476 #[doc = " state request. Ensure this gets called about every 50ms, or the robot will be"]
4477 #[doc = " disabled by the DS."]
4478 pub fn HAL_ObserveUserProgramTest();
4479 }
4480 pub const HAL_RuntimeType_HAL_Runtime_RoboRIO: root::HAL_RuntimeType = 0;
4481 pub const HAL_RuntimeType_HAL_Runtime_RoboRIO2: root::HAL_RuntimeType = 1;
4482 pub const HAL_RuntimeType_HAL_Runtime_Simulation: root::HAL_RuntimeType = 2;
4483 #[doc = " @defgroup hal_capi WPILib HAL API"]
4484 #[doc = " Hardware Abstraction Layer to hardware or simulator"]
4485 #[doc = " @{"]
4486 pub type HAL_RuntimeType = i32;
4487 extern "C" {
4488 #[doc = " Gets the last error set on this thread, or the message for the status code."]
4489 #[doc = ""]
4490 #[doc = " If passed HAL_USE_LAST_ERROR, the last error set on the thread will be"]
4491 #[doc = " returned."]
4492 #[doc = ""]
4493 #[doc = " @param[out] status the status code, set to the error status code if input is"]
4494 #[doc = " HAL_USE_LAST_ERROR"]
4495 #[doc = " @return the error message for the code. This does not need to be freed,"]
4496 #[doc = " but can be overwritten by another hal call on the same thread."]
4497 pub fn HAL_GetLastError(status: *mut i32) -> *const ::std::os::raw::c_char;
4498 }
4499 extern "C" {
4500 #[doc = " Gets the error message for a specific status code."]
4501 #[doc = ""]
4502 #[doc = " @param code the status code"]
4503 #[doc = " @return the error message for the code. This does not need to be freed."]
4504 pub fn HAL_GetErrorMessage(code: i32) -> *const ::std::os::raw::c_char;
4505 }
4506 extern "C" {
4507 #[doc = " Returns the FPGA Version number."]
4508 #[doc = ""]
4509 #[doc = " For now, expect this to be competition year."]
4510 #[doc = ""]
4511 #[doc = " @param[out] status the error code, or 0 for success"]
4512 #[doc = " @return FPGA Version number."]
4513 pub fn HAL_GetFPGAVersion(status: *mut i32) -> i32;
4514 }
4515 extern "C" {
4516 #[doc = " Returns the FPGA Revision number."]
4517 #[doc = ""]
4518 #[doc = " The format of the revision is 3 numbers."]
4519 #[doc = " The 12 most significant bits are the Major Revision."]
4520 #[doc = " the next 8 bits are the Minor Revision."]
4521 #[doc = " The 12 least significant bits are the Build Number."]
4522 #[doc = ""]
4523 #[doc = " @param[out] status the error code, or 0 for success"]
4524 #[doc = " @return FPGA Revision number."]
4525 pub fn HAL_GetFPGARevision(status: *mut i32) -> i64;
4526 }
4527 extern "C" {
4528 #[doc = " Returns the runtime type of the HAL."]
4529 #[doc = ""]
4530 #[doc = " @return HAL Runtime Type"]
4531 pub fn HAL_GetRuntimeType() -> root::HAL_RuntimeType;
4532 }
4533 extern "C" {
4534 #[doc = " Gets the state of the \"USER\" button on the roboRIO."]
4535 #[doc = ""]
4536 #[doc = " @param[out] status the error code, or 0 for success"]
4537 #[doc = " @return true if the button is currently pressed down"]
4538 pub fn HAL_GetFPGAButton(status: *mut i32) -> root::HAL_Bool;
4539 }
4540 extern "C" {
4541 #[doc = " Gets if the system outputs are currently active"]
4542 #[doc = ""]
4543 #[doc = " @param[out] status the error code, or 0 for success"]
4544 #[doc = " @return true if the system outputs are active, false if disabled"]
4545 pub fn HAL_GetSystemActive(status: *mut i32) -> root::HAL_Bool;
4546 }
4547 extern "C" {
4548 #[doc = " Gets if the system is in a browned out state."]
4549 #[doc = ""]
4550 #[doc = " @param[out] status the error code, or 0 for success"]
4551 #[doc = " @return true if the system is in a low voltage brown out, false otherwise"]
4552 pub fn HAL_GetBrownedOut(status: *mut i32) -> root::HAL_Bool;
4553 }
4554 extern "C" {
4555 #[doc = " Gets a port handle for a specific channel."]
4556 #[doc = ""]
4557 #[doc = " The created handle does not need to be freed."]
4558 #[doc = ""]
4559 #[doc = " @param channel the channel number"]
4560 #[doc = " @return the created port"]
4561 pub fn HAL_GetPort(channel: i32) -> root::HAL_PortHandle;
4562 }
4563 extern "C" {
4564 #[doc = " Gets a port handle for a specific channel and module."]
4565 #[doc = ""]
4566 #[doc = " This is expected to be used for PCMs, as the roboRIO does not work with"]
4567 #[doc = " modules anymore."]
4568 #[doc = ""]
4569 #[doc = " The created handle does not need to be freed."]
4570 #[doc = ""]
4571 #[doc = " @param module the module number"]
4572 #[doc = " @param channel the channel number"]
4573 #[doc = " @return the created port"]
4574 pub fn HAL_GetPortWithModule(module: i32, channel: i32) -> root::HAL_PortHandle;
4575 }
4576 extern "C" {
4577 #[doc = " Reads the microsecond-resolution timer on the FPGA."]
4578 #[doc = ""]
4579 #[doc = " @param[out] status the error code, or 0 for success"]
4580 #[doc = " @return The current time in microseconds according to the FPGA (since FPGA"]
4581 #[doc = " reset)."]
4582 pub fn HAL_GetFPGATime(status: *mut i32) -> u64;
4583 }
4584 extern "C" {
4585 #[doc = " Given an 32 bit FPGA time, expand it to the nearest likely 64 bit FPGA time."]
4586 #[doc = ""]
4587 #[doc = " Note: This is making the assumption that the timestamp being converted is"]
4588 #[doc = " always in the past. If you call this with a future timestamp, it probably"]
4589 #[doc = " will make it in the past. If you wait over 70 minutes between capturing the"]
4590 #[doc = " bottom 32 bits of the timestamp and expanding it, you will be off by"]
4591 #[doc = " multiples of 1<<32 microseconds."]
4592 #[doc = ""]
4593 #[doc = " @param[in] unexpandedLower 32 bit FPGA time"]
4594 #[doc = " @param[out] status the error code, or 0 for success"]
4595 #[doc = " @return The current time in microseconds according to the FPGA (since FPGA"]
4596 #[doc = " reset) as a 64 bit number."]
4597 pub fn HAL_ExpandFPGATime(unexpandedLower: u32, status: *mut i32) -> u64;
4598 }
4599 extern "C" {
4600 #[doc = " Call this to start up HAL. This is required for robot programs."]
4601 #[doc = ""]
4602 #[doc = " This must be called before any other HAL functions. Failure to do so will"]
4603 #[doc = " result in undefined behavior, and likely segmentation faults. This means that"]
4604 #[doc = " any statically initialized variables in a program MUST call this function in"]
4605 #[doc = " their constructors if they want to use other HAL calls."]
4606 #[doc = ""]
4607 #[doc = " The common parameters are 500 for timeout and 0 for mode."]
4608 #[doc = ""]
4609 #[doc = " This function is safe to call from any thread, and as many times as you wish."]
4610 #[doc = " It internally guards from any reentrancy."]
4611 #[doc = ""]
4612 #[doc = " The applicable modes are:"]
4613 #[doc = " 0: Try to kill an existing HAL from another program, if not successful,"]
4614 #[doc = " error."]
4615 #[doc = " 1: Force kill a HAL from another program."]
4616 #[doc = " 2: Just warn if another hal exists and cannot be killed. Will likely result"]
4617 #[doc = " in undefined behavior."]
4618 #[doc = ""]
4619 #[doc = " @param timeout the initialization timeout (ms)"]
4620 #[doc = " @param mode the initialization mode (see remarks)"]
4621 #[doc = " @return true if initialization was successful, otherwise false."]
4622 pub fn HAL_Initialize(timeout: i32, mode: i32) -> root::HAL_Bool;
4623 }
4624 extern "C" {
4625 #[doc = " Call this to shut down HAL."]
4626 #[doc = ""]
4627 #[doc = " This must be called at termination of the robot program to avoid potential"]
4628 #[doc = " segmentation faults with simulation extensions at exit."]
4629 pub fn HAL_Shutdown();
4630 }
4631 extern "C" {
4632 #[doc = " Calls registered SimPeriodic \"before\" callbacks (only in simulation mode)."]
4633 #[doc = " This should be called prior to user code periodic simulation functions."]
4634 pub fn HAL_SimPeriodicBefore();
4635 }
4636 extern "C" {
4637 #[doc = " Calls registered SimPeriodic \"after\" callbacks (only in simulation mode)."]
4638 #[doc = " This should be called after user code periodic simulation functions."]
4639 pub fn HAL_SimPeriodicAfter();
4640 }
4641 extern "C" {
4642 #[doc = " Sets up the system to run the provided main loop in the main thread (e.g."]
4643 #[doc = " the thread in which main() starts execution) and run the robot code in a"]
4644 #[doc = " separate thread."]
4645 #[doc = ""]
4646 #[doc = " Normally the robot code runs in the main thread, but some GUI systems"]
4647 #[doc = " require the GUI be run in the main thread."]
4648 #[doc = ""]
4649 #[doc = " To be effective, this function must be called before the robot code starts"]
4650 #[doc = " the main loop (e.g. by frc::StartRobot())."]
4651 #[doc = ""]
4652 #[doc = " @param param parameter data to pass to mainFunc and exitFunc"]
4653 #[doc = " @param mainFunc the function to be run when HAL_RunMain() is called."]
4654 #[doc = " @param exitFunc the function to be run when HAL_ExitMain() is called."]
4655 pub fn HAL_SetMain(
4656 param: *mut ::std::os::raw::c_void,
4657 mainFunc: ::std::option::Option<
4658 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void),
4659 >,
4660 exitFunc: ::std::option::Option<
4661 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void),
4662 >,
4663 );
4664 }
4665 extern "C" {
4666 #[doc = " Returns true if HAL_SetMain() has been called."]
4667 #[doc = ""]
4668 #[doc = " @return True if HAL_SetMain() has been called, false otherwise."]
4669 pub fn HAL_HasMain() -> root::HAL_Bool;
4670 }
4671 extern "C" {
4672 #[doc = " Runs the main function provided to HAL_SetMain()."]
4673 #[doc = ""]
4674 #[doc = " If HAL_SetMain() has not been called, simply sleeps until HAL_ExitMain()"]
4675 #[doc = " is called."]
4676 pub fn HAL_RunMain();
4677 }
4678 extern "C" {
4679 #[doc = " Causes HAL_RunMain() to exit."]
4680 #[doc = ""]
4681 #[doc = " If HAL_SetMain() has been called, this calls the exit function provided"]
4682 #[doc = " to that function."]
4683 pub fn HAL_ExitMain();
4684 }
4685 #[test]
4686 fn __bindgen_test_layout_basic_string_open0_char_char_traits_open1_char_close1_allocator_open1_char_close1_close0_instantiation(
4687 ) {
4688 assert_eq!(
4689 ::std::mem::size_of::<root::std::basic_string<::std::os::raw::c_char>>(),
4690 32usize,
4691 concat!(
4692 "Size of template specialization: ",
4693 stringify!(root::std::basic_string<::std::os::raw::c_char>)
4694 )
4695 );
4696 assert_eq!(
4697 ::std::mem::align_of::<root::std::basic_string<::std::os::raw::c_char>>(),
4698 8usize,
4699 concat!(
4700 "Alignment of template specialization: ",
4701 stringify!(root::std::basic_string<::std::os::raw::c_char>)
4702 )
4703 );
4704 }
4705 #[test]
4706 fn __bindgen_test_layout_char_traits_open0_char_close0_instantiation() {
4707 assert_eq!(
4708 ::std::mem::size_of::<root::std::char_traits>(),
4709 1usize,
4710 concat!(
4711 "Size of template specialization: ",
4712 stringify!(root::std::char_traits)
4713 )
4714 );
4715 assert_eq!(
4716 ::std::mem::align_of::<root::std::char_traits>(),
4717 1usize,
4718 concat!(
4719 "Alignment of template specialization: ",
4720 stringify!(root::std::char_traits)
4721 )
4722 );
4723 }
4724 #[test]
4725 fn __bindgen_test_layout_allocator_open0_char_close0_instantiation() {
4726 assert_eq!(
4727 ::std::mem::size_of::<root::std::allocator>(),
4728 1usize,
4729 concat!(
4730 "Size of template specialization: ",
4731 stringify!(root::std::allocator)
4732 )
4733 );
4734 assert_eq!(
4735 ::std::mem::align_of::<root::std::allocator>(),
4736 1usize,
4737 concat!(
4738 "Alignment of template specialization: ",
4739 stringify!(root::std::allocator)
4740 )
4741 );
4742 }
4743 #[test]
4744 fn __bindgen_test_layout_base_unit_open0_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_close0_instantiation(
4745 ) {
4746 assert_eq!(
4747 ::std::mem::size_of::<root::units::base_unit>(),
4748 1usize,
4749 concat!(
4750 "Size of template specialization: ",
4751 stringify!(root::units::base_unit)
4752 )
4753 );
4754 assert_eq!(
4755 ::std::mem::align_of::<root::units::base_unit>(),
4756 1usize,
4757 concat!(
4758 "Alignment of template specialization: ",
4759 stringify!(root::units::base_unit)
4760 )
4761 );
4762 }
4763 #[test]
4764 fn __bindgen_test_layout_base_unit_open0_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_ratio_open1_close1_close0_instantiation_1(
4765 ) {
4766 assert_eq!(
4767 ::std::mem::size_of::<root::units::base_unit>(),
4768 1usize,
4769 concat!(
4770 "Size of template specialization: ",
4771 stringify!(root::units::base_unit)
4772 )
4773 );
4774 assert_eq!(
4775 ::std::mem::align_of::<root::units::base_unit>(),
4776 1usize,
4777 concat!(
4778 "Alignment of template specialization: ",
4779 stringify!(root::units::base_unit)
4780 )
4781 );
4782 }
4783 #[test]
4784 fn __bindgen_test_layout_unit_t_open0_second_double_close0_instantiation() {
4785 assert_eq!(
4786 ::std::mem::size_of::<root::units::unit_t>(),
4787 8usize,
4788 concat!(
4789 "Size of template specialization: ",
4790 stringify!(root::units::unit_t)
4791 )
4792 );
4793 assert_eq!(
4794 ::std::mem::align_of::<root::units::unit_t>(),
4795 8usize,
4796 concat!(
4797 "Alignment of template specialization: ",
4798 stringify!(root::units::unit_t)
4799 )
4800 );
4801 }
4802 #[test]
4803 fn __bindgen_test_layout_unit_t_open0_radian_double_close0_instantiation() {
4804 assert_eq!(
4805 ::std::mem::size_of::<root::units::unit_t>(),
4806 8usize,
4807 concat!(
4808 "Size of template specialization: ",
4809 stringify!(root::units::unit_t)
4810 )
4811 );
4812 assert_eq!(
4813 ::std::mem::align_of::<root::units::unit_t>(),
4814 8usize,
4815 concat!(
4816 "Alignment of template specialization: ",
4817 stringify!(root::units::unit_t)
4818 )
4819 );
4820 }
4821 #[test]
4822 fn __bindgen_test_layout_unit_open0_ratio_open1_close1_radians_ratio_open1_close1_ratio_open1_close1_close0_instantiation(
4823 ) {
4824 assert_eq!(
4825 ::std::mem::size_of::<root::units::unit>(),
4826 1usize,
4827 concat!(
4828 "Size of template specialization: ",
4829 stringify!(root::units::unit)
4830 )
4831 );
4832 assert_eq!(
4833 ::std::mem::align_of::<root::units::unit>(),
4834 1usize,
4835 concat!(
4836 "Alignment of template specialization: ",
4837 stringify!(root::units::unit)
4838 )
4839 );
4840 }
4841 #[test]
4842 fn __bindgen_test_layout_unit_t_open0_degree_double_close0_instantiation() {
4843 assert_eq!(
4844 ::std::mem::size_of::<root::units::unit_t>(),
4845 8usize,
4846 concat!(
4847 "Size of template specialization: ",
4848 stringify!(root::units::unit_t)
4849 )
4850 );
4851 assert_eq!(
4852 ::std::mem::align_of::<root::units::unit_t>(),
4853 8usize,
4854 concat!(
4855 "Alignment of template specialization: ",
4856 stringify!(root::units::unit_t)
4857 )
4858 );
4859 }
4860 #[test]
4861 fn __bindgen_test_layout_unique_ptr_open0_SPI_Accumulator_default_delete_open1_SPI_Accumulator_close1_close0_instantiation(
4862 ) {
4863 assert_eq!(
4864 ::std::mem::size_of::<root::std::unique_ptr>(),
4865 8usize,
4866 concat!(
4867 "Size of template specialization: ",
4868 stringify!(root::std::unique_ptr)
4869 )
4870 );
4871 assert_eq!(
4872 ::std::mem::align_of::<root::std::unique_ptr>(),
4873 8usize,
4874 concat!(
4875 "Alignment of template specialization: ",
4876 stringify!(root::std::unique_ptr)
4877 )
4878 );
4879 }
4880 #[test]
4881 fn __bindgen_test_layout_default_delete_open0_SPI_Accumulator_close0_instantiation() {
4882 assert_eq!(
4883 ::std::mem::size_of::<root::std::default_delete>(),
4884 1usize,
4885 concat!(
4886 "Size of template specialization: ",
4887 stringify!(root::std::default_delete)
4888 )
4889 );
4890 assert_eq!(
4891 ::std::mem::align_of::<root::std::default_delete>(),
4892 1usize,
4893 concat!(
4894 "Alignment of template specialization: ",
4895 stringify!(root::std::default_delete)
4896 )
4897 );
4898 }
4899 #[test]
4900 fn __bindgen_test_layout_SendableHelper_open0_ADXRS450_Gyro_close0_instantiation() {
4901 assert_eq!(
4902 ::std::mem::size_of::<root::wpi::SendableHelper>(),
4903 1usize,
4904 concat!(
4905 "Size of template specialization: ",
4906 stringify!(root::wpi::SendableHelper)
4907 )
4908 );
4909 assert_eq!(
4910 ::std::mem::align_of::<root::wpi::SendableHelper>(),
4911 1usize,
4912 concat!(
4913 "Alignment of template specialization: ",
4914 stringify!(root::wpi::SendableHelper)
4915 )
4916 );
4917 }
4918}