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 type __uint8_t = ::std::os::raw::c_uchar;
88 pub type __uint16_t = ::std::os::raw::c_ushort;
89 pub type __int32_t = ::std::os::raw::c_int;
90 pub type __uint32_t = ::std::os::raw::c_uint;
91 pub type __uint64_t = ::std::os::raw::c_ulong;
92 pub type __intmax_t = ::std::os::raw::c_long;
93 pub type intmax_t = root::__intmax_t;
94 pub mod rev {
95 #[allow(unused_imports)]
96 use self::super::super::root;
97 pub const REVLibError_kOk: root::rev::REVLibError = 0;
98 pub const REVLibError_kError: root::rev::REVLibError = 1;
99 pub const REVLibError_kTimeout: root::rev::REVLibError = 2;
100 pub const REVLibError_kNotImplemented: root::rev::REVLibError = 3;
101 pub const REVLibError_kHALError: root::rev::REVLibError = 4;
102 pub const REVLibError_kCantFindFirmware: root::rev::REVLibError = 5;
103 pub const REVLibError_kFirmwareTooOld: root::rev::REVLibError = 6;
104 pub const REVLibError_kFirmwareTooNew: root::rev::REVLibError = 7;
105 pub const REVLibError_kParamInvalidID: root::rev::REVLibError = 8;
106 pub const REVLibError_kParamMismatchType: root::rev::REVLibError = 9;
107 pub const REVLibError_kParamAccessMode: root::rev::REVLibError = 10;
108 pub const REVLibError_kParamInvalid: root::rev::REVLibError = 11;
109 pub const REVLibError_kParamNotImplementedDeprecated: root::rev::REVLibError = 12;
110 pub const REVLibError_kFollowConfigMismatch: root::rev::REVLibError = 13;
111 pub const REVLibError_kInvalid: root::rev::REVLibError = 14;
112 pub const REVLibError_kSetpointOutOfRange: root::rev::REVLibError = 15;
113 pub const REVLibError_kUnknown: root::rev::REVLibError = 16;
114 pub const REVLibError_kCANDisconnected: root::rev::REVLibError = 17;
115 pub const REVLibError_kDuplicateCANId: root::rev::REVLibError = 18;
116 pub const REVLibError_kInvalidCANId: root::rev::REVLibError = 19;
117 pub const REVLibError_kSparkMaxDataPortAlreadyConfiguredDifferently:
118 root::rev::REVLibError = 20;
119 pub type REVLibError = ::std::os::raw::c_int;
120 #[repr(C)]
121 pub struct AnalogInput__bindgen_vtable(::std::os::raw::c_void);
122 #[doc = " Get an instance of AnalogInput by using"]
123 #[doc = " CANSparkMax::GetAnalog(SparkMaxAnalogSensor::Mode)}."]
124 #[repr(C)]
125 #[derive(Debug)]
126 pub struct AnalogInput {
127 pub vtable_: *const AnalogInput__bindgen_vtable,
128 }
129 #[test]
130 fn bindgen_test_layout_AnalogInput() {
131 assert_eq!(
132 ::std::mem::size_of::<AnalogInput>(),
133 8usize,
134 concat!("Size of: ", stringify!(AnalogInput))
135 );
136 assert_eq!(
137 ::std::mem::align_of::<AnalogInput>(),
138 8usize,
139 concat!("Alignment of ", stringify!(AnalogInput))
140 );
141 }
142 #[repr(C)]
143 pub struct CANSensor__bindgen_vtable(::std::os::raw::c_void);
144 #[doc = " @deprecated Use MotorFeedbackSensor instead"]
145 #[repr(C)]
146 #[derive(Debug)]
147 pub struct CANSensor {
148 pub vtable_: *const CANSensor__bindgen_vtable,
149 }
150 #[test]
151 fn bindgen_test_layout_CANSensor() {
152 assert_eq!(
153 ::std::mem::size_of::<CANSensor>(),
154 8usize,
155 concat!("Size of: ", stringify!(CANSensor))
156 );
157 assert_eq!(
158 ::std::mem::align_of::<CANSensor>(),
159 8usize,
160 concat!("Alignment of ", stringify!(CANSensor))
161 );
162 }
163 #[doc = " A sensor that can be used to provide rotational feedback to a motor"]
164 #[doc = " controller"]
165 #[repr(C)]
166 #[derive(Debug)]
167 pub struct MotorFeedbackSensor {
168 pub _base: root::rev::CANSensor,
169 }
170 #[test]
171 fn bindgen_test_layout_MotorFeedbackSensor() {
172 assert_eq!(
173 ::std::mem::size_of::<MotorFeedbackSensor>(),
174 8usize,
175 concat!("Size of: ", stringify!(MotorFeedbackSensor))
176 );
177 assert_eq!(
178 ::std::mem::align_of::<MotorFeedbackSensor>(),
179 8usize,
180 concat!("Alignment of ", stringify!(MotorFeedbackSensor))
181 );
182 }
183 #[doc = " @deprecated Use SparkMaxAnalogSensor instead."]
184 #[repr(C)]
185 #[derive(Debug)]
186 pub struct CANAnalog {
187 pub _base: root::rev::MotorFeedbackSensor,
188 }
189 pub const CANAnalog_AnalogMode_kAbsolute: root::rev::CANAnalog_AnalogMode = 0;
190 pub const CANAnalog_AnalogMode_kRelative: root::rev::CANAnalog_AnalogMode = 1;
191 #[doc = " Analog sensors have the ability to either be absolute or relative."]
192 #[doc = " By default, GetAnalog() will return an absolute analog sensor, but"]
193 #[doc = " it can also be configured to be a relative sensor instead."]
194 #[doc = ""]
195 #[doc = " @deprecated Use SparkMaxAnalogSensor::Mode instead"]
196 pub type CANAnalog_AnalogMode = ::std::os::raw::c_int;
197 #[test]
198 fn bindgen_test_layout_CANAnalog() {
199 assert_eq!(
200 ::std::mem::size_of::<CANAnalog>(),
201 8usize,
202 concat!("Size of: ", stringify!(CANAnalog))
203 );
204 assert_eq!(
205 ::std::mem::align_of::<CANAnalog>(),
206 8usize,
207 concat!("Alignment of ", stringify!(CANAnalog))
208 );
209 }
210 #[repr(C)]
211 pub struct CANDigitalInput__bindgen_vtable(::std::os::raw::c_void);
212 #[doc = " @deprecated Use SparkMaxLimitSwitch instead"]
213 #[repr(C)]
214 #[derive(Debug)]
215 pub struct CANDigitalInput {
216 pub vtable_: *const CANDigitalInput__bindgen_vtable,
217 }
218 pub const CANDigitalInput_LimitSwitchPolarity_kNormallyOpen:
219 root::rev::CANDigitalInput_LimitSwitchPolarity = 0;
220 pub const CANDigitalInput_LimitSwitchPolarity_kNormallyClosed:
221 root::rev::CANDigitalInput_LimitSwitchPolarity = 1;
222 #[doc = " @deprecated Use SparkMaxLimitSwitch::Type instead"]
223 pub type CANDigitalInput_LimitSwitchPolarity = ::std::os::raw::c_int;
224 #[test]
225 fn bindgen_test_layout_CANDigitalInput() {
226 assert_eq!(
227 ::std::mem::size_of::<CANDigitalInput>(),
228 8usize,
229 concat!("Size of: ", stringify!(CANDigitalInput))
230 );
231 assert_eq!(
232 ::std::mem::align_of::<CANDigitalInput>(),
233 8usize,
234 concat!("Alignment of ", stringify!(CANDigitalInput))
235 );
236 }
237 #[doc = " @deprecated Use SparkMaxRelativeEncoder or SparkMaxAlternateEncoder instead"]
238 #[repr(C)]
239 #[derive(Debug)]
240 pub struct CANEncoder {
241 pub _base: root::rev::MotorFeedbackSensor,
242 }
243 pub const CANEncoder_EncoderType_kNoSensor: root::rev::CANEncoder_EncoderType = 0;
244 pub const CANEncoder_EncoderType_kHallSensor: root::rev::CANEncoder_EncoderType = 1;
245 pub const CANEncoder_EncoderType_kQuadrature: root::rev::CANEncoder_EncoderType = 2;
246 #[doc = " @deprecated Use SparkMaxRelativeEncoder::Type instead"]
247 pub type CANEncoder_EncoderType = ::std::os::raw::c_int;
248 pub const CANEncoder_AlternateEncoderType_kQuadrature:
249 root::rev::CANEncoder_AlternateEncoderType = 0;
250 #[doc = " @deprecated Use SparkMaxAlternateEncoder::Type instead"]
251 pub type CANEncoder_AlternateEncoderType = ::std::os::raw::c_int;
252 #[test]
253 fn bindgen_test_layout_CANEncoder() {
254 assert_eq!(
255 ::std::mem::size_of::<CANEncoder>(),
256 8usize,
257 concat!("Size of: ", stringify!(CANEncoder))
258 );
259 assert_eq!(
260 ::std::mem::align_of::<CANEncoder>(),
261 8usize,
262 concat!("Alignment of ", stringify!(CANEncoder))
263 );
264 }
265 pub const ControlType_kDutyCycle: root::rev::ControlType = 0;
266 pub const ControlType_kVelocity: root::rev::ControlType = 1;
267 pub const ControlType_kVoltage: root::rev::ControlType = 2;
268 pub const ControlType_kPosition: root::rev::ControlType = 3;
269 pub const ControlType_kSmartMotion: root::rev::ControlType = 4;
270 pub const ControlType_kCurrent: root::rev::ControlType = 5;
271 pub const ControlType_kSmartVelocity: root::rev::ControlType = 6;
272 #[doc = " @deprecated Use CANSparkMax::ControlType instead"]
273 pub type ControlType = ::std::os::raw::c_int;
274 #[repr(C)]
275 pub struct CANPIDController__bindgen_vtable(::std::os::raw::c_void);
276 #[doc = " @deprecated Use SparkMaxPIDController instead"]
277 #[repr(C)]
278 #[derive(Debug)]
279 pub struct CANPIDController {
280 pub vtable_: *const CANPIDController__bindgen_vtable,
281 }
282 pub const CANPIDController_AccelStrategy_kTrapezoidal:
283 root::rev::CANPIDController_AccelStrategy = 0;
284 pub const CANPIDController_AccelStrategy_kSCurve:
285 root::rev::CANPIDController_AccelStrategy = 1;
286 #[doc = " @deprecated Use SparkMaxPIDController::AccelStrategy instead"]
287 pub type CANPIDController_AccelStrategy = ::std::os::raw::c_int;
288 pub const CANPIDController_ArbFFUnits_kVoltage: root::rev::CANPIDController_ArbFFUnits = 0;
289 pub const CANPIDController_ArbFFUnits_kPercentOut: root::rev::CANPIDController_ArbFFUnits =
290 1;
291 #[doc = " @deprecated Use SparkMaxPIDController::ArbFFUnits instead"]
292 pub type CANPIDController_ArbFFUnits = ::std::os::raw::c_int;
293 #[test]
294 fn bindgen_test_layout_CANPIDController() {
295 assert_eq!(
296 ::std::mem::size_of::<CANPIDController>(),
297 8usize,
298 concat!("Size of: ", stringify!(CANPIDController))
299 );
300 assert_eq!(
301 ::std::mem::align_of::<CANPIDController>(),
302 8usize,
303 concat!("Alignment of ", stringify!(CANPIDController))
304 );
305 }
306 #[repr(C)]
307 #[derive(Debug)]
308 pub struct CANSparkMaxLowLevel {
309 pub _base: root::frc::MotorController,
310 pub m_motorType: root::rev::CANSparkMaxLowLevel_MotorType,
311 pub m_sparkMaxHandle: *mut ::std::os::raw::c_void,
312 pub m_deviceID: ::std::os::raw::c_int,
313 }
314 pub const CANSparkMaxLowLevel_MotorType_kBrushed: root::rev::CANSparkMaxLowLevel_MotorType =
315 0;
316 pub const CANSparkMaxLowLevel_MotorType_kBrushless:
317 root::rev::CANSparkMaxLowLevel_MotorType = 1;
318 pub type CANSparkMaxLowLevel_MotorType = ::std::os::raw::c_int;
319 pub const CANSparkMaxLowLevel_ControlType_kDutyCycle:
320 root::rev::CANSparkMaxLowLevel_ControlType = 0;
321 pub const CANSparkMaxLowLevel_ControlType_kVelocity:
322 root::rev::CANSparkMaxLowLevel_ControlType = 1;
323 pub const CANSparkMaxLowLevel_ControlType_kVoltage:
324 root::rev::CANSparkMaxLowLevel_ControlType = 2;
325 pub const CANSparkMaxLowLevel_ControlType_kPosition:
326 root::rev::CANSparkMaxLowLevel_ControlType = 3;
327 pub const CANSparkMaxLowLevel_ControlType_kSmartMotion:
328 root::rev::CANSparkMaxLowLevel_ControlType = 4;
329 pub const CANSparkMaxLowLevel_ControlType_kCurrent:
330 root::rev::CANSparkMaxLowLevel_ControlType = 5;
331 pub const CANSparkMaxLowLevel_ControlType_kSmartVelocity:
332 root::rev::CANSparkMaxLowLevel_ControlType = 6;
333 pub type CANSparkMaxLowLevel_ControlType = ::std::os::raw::c_int;
334 pub const CANSparkMaxLowLevel_ParameterStatus_kOK:
335 root::rev::CANSparkMaxLowLevel_ParameterStatus = 0;
336 pub const CANSparkMaxLowLevel_ParameterStatus_kInvalidID:
337 root::rev::CANSparkMaxLowLevel_ParameterStatus = 1;
338 pub const CANSparkMaxLowLevel_ParameterStatus_kMismatchType:
339 root::rev::CANSparkMaxLowLevel_ParameterStatus = 2;
340 pub const CANSparkMaxLowLevel_ParameterStatus_kAccessMode:
341 root::rev::CANSparkMaxLowLevel_ParameterStatus = 3;
342 pub const CANSparkMaxLowLevel_ParameterStatus_kInvalid:
343 root::rev::CANSparkMaxLowLevel_ParameterStatus = 4;
344 pub const CANSparkMaxLowLevel_ParameterStatus_kNotImplementedDeprecated:
345 root::rev::CANSparkMaxLowLevel_ParameterStatus = 5;
346 pub type CANSparkMaxLowLevel_ParameterStatus = ::std::os::raw::c_int;
347 pub const CANSparkMaxLowLevel_PeriodicFrame_kStatus0:
348 root::rev::CANSparkMaxLowLevel_PeriodicFrame = 0;
349 pub const CANSparkMaxLowLevel_PeriodicFrame_kStatus1:
350 root::rev::CANSparkMaxLowLevel_PeriodicFrame = 1;
351 pub const CANSparkMaxLowLevel_PeriodicFrame_kStatus2:
352 root::rev::CANSparkMaxLowLevel_PeriodicFrame = 2;
353 pub const CANSparkMaxLowLevel_PeriodicFrame_kStatus3:
354 root::rev::CANSparkMaxLowLevel_PeriodicFrame = 3;
355 pub type CANSparkMaxLowLevel_PeriodicFrame = ::std::os::raw::c_int;
356 #[repr(C)]
357 #[derive(Debug, Copy, Clone)]
358 pub struct CANSparkMaxLowLevel_PeriodicStatus0 {
359 pub appliedOutput: f64,
360 pub faults: u16,
361 pub stickyFaults: u16,
362 pub motorType: root::rev::CANSparkMaxLowLevel_MotorType,
363 pub isFollower: bool,
364 pub lock: u8,
365 pub roboRIO: u8,
366 pub isInverted: u8,
367 pub timestamp: u64,
368 }
369 #[test]
370 fn bindgen_test_layout_CANSparkMaxLowLevel_PeriodicStatus0() {
371 assert_eq!(
372 ::std::mem::size_of::<CANSparkMaxLowLevel_PeriodicStatus0>(),
373 32usize,
374 concat!("Size of: ", stringify!(CANSparkMaxLowLevel_PeriodicStatus0))
375 );
376 assert_eq!(
377 ::std::mem::align_of::<CANSparkMaxLowLevel_PeriodicStatus0>(),
378 8usize,
379 concat!(
380 "Alignment of ",
381 stringify!(CANSparkMaxLowLevel_PeriodicStatus0)
382 )
383 );
384 fn test_field_appliedOutput() {
385 assert_eq!(
386 unsafe {
387 let uninit =
388 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
389 );
390 let ptr = uninit.as_ptr();
391 ::std::ptr::addr_of!((*ptr).appliedOutput) as usize - ptr as usize
392 },
393 0usize,
394 concat!(
395 "Offset of field: ",
396 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
397 "::",
398 stringify!(appliedOutput)
399 )
400 );
401 }
402 test_field_appliedOutput();
403 fn test_field_faults() {
404 assert_eq!(
405 unsafe {
406 let uninit =
407 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
408 );
409 let ptr = uninit.as_ptr();
410 ::std::ptr::addr_of!((*ptr).faults) as usize - ptr as usize
411 },
412 8usize,
413 concat!(
414 "Offset of field: ",
415 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
416 "::",
417 stringify!(faults)
418 )
419 );
420 }
421 test_field_faults();
422 fn test_field_stickyFaults() {
423 assert_eq!(
424 unsafe {
425 let uninit =
426 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
427 );
428 let ptr = uninit.as_ptr();
429 ::std::ptr::addr_of!((*ptr).stickyFaults) as usize - ptr as usize
430 },
431 10usize,
432 concat!(
433 "Offset of field: ",
434 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
435 "::",
436 stringify!(stickyFaults)
437 )
438 );
439 }
440 test_field_stickyFaults();
441 fn test_field_motorType() {
442 assert_eq!(
443 unsafe {
444 let uninit =
445 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
446 );
447 let ptr = uninit.as_ptr();
448 ::std::ptr::addr_of!((*ptr).motorType) as usize - ptr as usize
449 },
450 12usize,
451 concat!(
452 "Offset of field: ",
453 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
454 "::",
455 stringify!(motorType)
456 )
457 );
458 }
459 test_field_motorType();
460 fn test_field_isFollower() {
461 assert_eq!(
462 unsafe {
463 let uninit =
464 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
465 );
466 let ptr = uninit.as_ptr();
467 ::std::ptr::addr_of!((*ptr).isFollower) as usize - ptr as usize
468 },
469 16usize,
470 concat!(
471 "Offset of field: ",
472 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
473 "::",
474 stringify!(isFollower)
475 )
476 );
477 }
478 test_field_isFollower();
479 fn test_field_lock() {
480 assert_eq!(
481 unsafe {
482 let uninit =
483 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
484 );
485 let ptr = uninit.as_ptr();
486 ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize
487 },
488 17usize,
489 concat!(
490 "Offset of field: ",
491 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
492 "::",
493 stringify!(lock)
494 )
495 );
496 }
497 test_field_lock();
498 fn test_field_roboRIO() {
499 assert_eq!(
500 unsafe {
501 let uninit =
502 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
503 );
504 let ptr = uninit.as_ptr();
505 ::std::ptr::addr_of!((*ptr).roboRIO) as usize - ptr as usize
506 },
507 18usize,
508 concat!(
509 "Offset of field: ",
510 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
511 "::",
512 stringify!(roboRIO)
513 )
514 );
515 }
516 test_field_roboRIO();
517 fn test_field_isInverted() {
518 assert_eq!(
519 unsafe {
520 let uninit =
521 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
522 );
523 let ptr = uninit.as_ptr();
524 ::std::ptr::addr_of!((*ptr).isInverted) as usize - ptr as usize
525 },
526 19usize,
527 concat!(
528 "Offset of field: ",
529 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
530 "::",
531 stringify!(isInverted)
532 )
533 );
534 }
535 test_field_isInverted();
536 fn test_field_timestamp() {
537 assert_eq!(
538 unsafe {
539 let uninit =
540 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus0>::uninit(
541 );
542 let ptr = uninit.as_ptr();
543 ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize
544 },
545 24usize,
546 concat!(
547 "Offset of field: ",
548 stringify!(CANSparkMaxLowLevel_PeriodicStatus0),
549 "::",
550 stringify!(timestamp)
551 )
552 );
553 }
554 test_field_timestamp();
555 }
556 #[repr(C)]
557 #[derive(Debug, Copy, Clone)]
558 pub struct CANSparkMaxLowLevel_PeriodicStatus1 {
559 pub sensorVelocity: f64,
560 pub motorTemperature: u8,
561 pub busVoltage: f64,
562 pub outputCurrent: f64,
563 pub timestamp: u64,
564 }
565 #[test]
566 fn bindgen_test_layout_CANSparkMaxLowLevel_PeriodicStatus1() {
567 assert_eq!(
568 ::std::mem::size_of::<CANSparkMaxLowLevel_PeriodicStatus1>(),
569 40usize,
570 concat!("Size of: ", stringify!(CANSparkMaxLowLevel_PeriodicStatus1))
571 );
572 assert_eq!(
573 ::std::mem::align_of::<CANSparkMaxLowLevel_PeriodicStatus1>(),
574 8usize,
575 concat!(
576 "Alignment of ",
577 stringify!(CANSparkMaxLowLevel_PeriodicStatus1)
578 )
579 );
580 fn test_field_sensorVelocity() {
581 assert_eq!(
582 unsafe {
583 let uninit =
584 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus1>::uninit(
585 );
586 let ptr = uninit.as_ptr();
587 ::std::ptr::addr_of!((*ptr).sensorVelocity) as usize - ptr as usize
588 },
589 0usize,
590 concat!(
591 "Offset of field: ",
592 stringify!(CANSparkMaxLowLevel_PeriodicStatus1),
593 "::",
594 stringify!(sensorVelocity)
595 )
596 );
597 }
598 test_field_sensorVelocity();
599 fn test_field_motorTemperature() {
600 assert_eq!(
601 unsafe {
602 let uninit =
603 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus1>::uninit(
604 );
605 let ptr = uninit.as_ptr();
606 ::std::ptr::addr_of!((*ptr).motorTemperature) as usize - ptr as usize
607 },
608 8usize,
609 concat!(
610 "Offset of field: ",
611 stringify!(CANSparkMaxLowLevel_PeriodicStatus1),
612 "::",
613 stringify!(motorTemperature)
614 )
615 );
616 }
617 test_field_motorTemperature();
618 fn test_field_busVoltage() {
619 assert_eq!(
620 unsafe {
621 let uninit =
622 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus1>::uninit(
623 );
624 let ptr = uninit.as_ptr();
625 ::std::ptr::addr_of!((*ptr).busVoltage) as usize - ptr as usize
626 },
627 16usize,
628 concat!(
629 "Offset of field: ",
630 stringify!(CANSparkMaxLowLevel_PeriodicStatus1),
631 "::",
632 stringify!(busVoltage)
633 )
634 );
635 }
636 test_field_busVoltage();
637 fn test_field_outputCurrent() {
638 assert_eq!(
639 unsafe {
640 let uninit =
641 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus1>::uninit(
642 );
643 let ptr = uninit.as_ptr();
644 ::std::ptr::addr_of!((*ptr).outputCurrent) as usize - ptr as usize
645 },
646 24usize,
647 concat!(
648 "Offset of field: ",
649 stringify!(CANSparkMaxLowLevel_PeriodicStatus1),
650 "::",
651 stringify!(outputCurrent)
652 )
653 );
654 }
655 test_field_outputCurrent();
656 fn test_field_timestamp() {
657 assert_eq!(
658 unsafe {
659 let uninit =
660 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus1>::uninit(
661 );
662 let ptr = uninit.as_ptr();
663 ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize
664 },
665 32usize,
666 concat!(
667 "Offset of field: ",
668 stringify!(CANSparkMaxLowLevel_PeriodicStatus1),
669 "::",
670 stringify!(timestamp)
671 )
672 );
673 }
674 test_field_timestamp();
675 }
676 #[repr(C)]
677 #[derive(Debug, Copy, Clone)]
678 pub struct CANSparkMaxLowLevel_PeriodicStatus2 {
679 pub sensorPosition: f64,
680 pub iAccum: f64,
681 pub timestamp: u64,
682 }
683 #[test]
684 fn bindgen_test_layout_CANSparkMaxLowLevel_PeriodicStatus2() {
685 assert_eq!(
686 ::std::mem::size_of::<CANSparkMaxLowLevel_PeriodicStatus2>(),
687 24usize,
688 concat!("Size of: ", stringify!(CANSparkMaxLowLevel_PeriodicStatus2))
689 );
690 assert_eq!(
691 ::std::mem::align_of::<CANSparkMaxLowLevel_PeriodicStatus2>(),
692 8usize,
693 concat!(
694 "Alignment of ",
695 stringify!(CANSparkMaxLowLevel_PeriodicStatus2)
696 )
697 );
698 fn test_field_sensorPosition() {
699 assert_eq!(
700 unsafe {
701 let uninit =
702 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus2>::uninit(
703 );
704 let ptr = uninit.as_ptr();
705 ::std::ptr::addr_of!((*ptr).sensorPosition) as usize - ptr as usize
706 },
707 0usize,
708 concat!(
709 "Offset of field: ",
710 stringify!(CANSparkMaxLowLevel_PeriodicStatus2),
711 "::",
712 stringify!(sensorPosition)
713 )
714 );
715 }
716 test_field_sensorPosition();
717 fn test_field_iAccum() {
718 assert_eq!(
719 unsafe {
720 let uninit =
721 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus2>::uninit(
722 );
723 let ptr = uninit.as_ptr();
724 ::std::ptr::addr_of!((*ptr).iAccum) as usize - ptr as usize
725 },
726 8usize,
727 concat!(
728 "Offset of field: ",
729 stringify!(CANSparkMaxLowLevel_PeriodicStatus2),
730 "::",
731 stringify!(iAccum)
732 )
733 );
734 }
735 test_field_iAccum();
736 fn test_field_timestamp() {
737 assert_eq!(
738 unsafe {
739 let uninit =
740 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_PeriodicStatus2>::uninit(
741 );
742 let ptr = uninit.as_ptr();
743 ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize
744 },
745 16usize,
746 concat!(
747 "Offset of field: ",
748 stringify!(CANSparkMaxLowLevel_PeriodicStatus2),
749 "::",
750 stringify!(timestamp)
751 )
752 );
753 }
754 test_field_timestamp();
755 }
756 pub const CANSparkMaxLowLevel_TelemetryID_kBusVoltage:
757 root::rev::CANSparkMaxLowLevel_TelemetryID = 0;
758 pub const CANSparkMaxLowLevel_TelemetryID_kOutputCurrent:
759 root::rev::CANSparkMaxLowLevel_TelemetryID = 1;
760 pub const CANSparkMaxLowLevel_TelemetryID_kVelocity:
761 root::rev::CANSparkMaxLowLevel_TelemetryID = 2;
762 pub const CANSparkMaxLowLevel_TelemetryID_kPosition:
763 root::rev::CANSparkMaxLowLevel_TelemetryID = 3;
764 pub const CANSparkMaxLowLevel_TelemetryID_kIAccum:
765 root::rev::CANSparkMaxLowLevel_TelemetryID = 4;
766 pub const CANSparkMaxLowLevel_TelemetryID_kAppliedOutput:
767 root::rev::CANSparkMaxLowLevel_TelemetryID = 5;
768 pub const CANSparkMaxLowLevel_TelemetryID_kMotorTemp:
769 root::rev::CANSparkMaxLowLevel_TelemetryID = 6;
770 pub const CANSparkMaxLowLevel_TelemetryID_kFaults:
771 root::rev::CANSparkMaxLowLevel_TelemetryID = 7;
772 pub const CANSparkMaxLowLevel_TelemetryID_kStickyFaults:
773 root::rev::CANSparkMaxLowLevel_TelemetryID = 8;
774 pub const CANSparkMaxLowLevel_TelemetryID_kAnalogVoltage:
775 root::rev::CANSparkMaxLowLevel_TelemetryID = 9;
776 pub const CANSparkMaxLowLevel_TelemetryID_kAnalogPosition:
777 root::rev::CANSparkMaxLowLevel_TelemetryID = 10;
778 pub const CANSparkMaxLowLevel_TelemetryID_kAnalogVelocity:
779 root::rev::CANSparkMaxLowLevel_TelemetryID = 11;
780 pub const CANSparkMaxLowLevel_TelemetryID_kAltEncPosition:
781 root::rev::CANSparkMaxLowLevel_TelemetryID = 12;
782 pub const CANSparkMaxLowLevel_TelemetryID_kAltEncVelocity:
783 root::rev::CANSparkMaxLowLevel_TelemetryID = 13;
784 pub const CANSparkMaxLowLevel_TelemetryID_kTotalStreams:
785 root::rev::CANSparkMaxLowLevel_TelemetryID = 14;
786 pub type CANSparkMaxLowLevel_TelemetryID = ::std::os::raw::c_int;
787 #[repr(C)]
788 #[derive(Debug, Copy, Clone)]
789 pub struct CANSparkMaxLowLevel_TelemetryMessage {
790 pub id: root::rev::CANSparkMaxLowLevel_TelemetryID,
791 pub value: f32,
792 pub timestamp: u64,
793 pub name: *const ::std::os::raw::c_char,
794 pub units: *const ::std::os::raw::c_char,
795 pub lowerBnd: f32,
796 pub upperBnd: f32,
797 }
798 #[test]
799 fn bindgen_test_layout_CANSparkMaxLowLevel_TelemetryMessage() {
800 assert_eq!(
801 ::std::mem::size_of::<CANSparkMaxLowLevel_TelemetryMessage>(),
802 40usize,
803 concat!(
804 "Size of: ",
805 stringify!(CANSparkMaxLowLevel_TelemetryMessage)
806 )
807 );
808 assert_eq!(
809 ::std::mem::align_of::<CANSparkMaxLowLevel_TelemetryMessage>(),
810 8usize,
811 concat!(
812 "Alignment of ",
813 stringify!(CANSparkMaxLowLevel_TelemetryMessage)
814 )
815 );
816 fn test_field_id() {
817 assert_eq!(
818 unsafe {
819 let uninit =
820 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
821 );
822 let ptr = uninit.as_ptr();
823 ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize
824 },
825 0usize,
826 concat!(
827 "Offset of field: ",
828 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
829 "::",
830 stringify!(id)
831 )
832 );
833 }
834 test_field_id();
835 fn test_field_value() {
836 assert_eq!(
837 unsafe {
838 let uninit =
839 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
840 );
841 let ptr = uninit.as_ptr();
842 ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize
843 },
844 4usize,
845 concat!(
846 "Offset of field: ",
847 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
848 "::",
849 stringify!(value)
850 )
851 );
852 }
853 test_field_value();
854 fn test_field_timestamp() {
855 assert_eq!(
856 unsafe {
857 let uninit =
858 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
859 );
860 let ptr = uninit.as_ptr();
861 ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize
862 },
863 8usize,
864 concat!(
865 "Offset of field: ",
866 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
867 "::",
868 stringify!(timestamp)
869 )
870 );
871 }
872 test_field_timestamp();
873 fn test_field_name() {
874 assert_eq!(
875 unsafe {
876 let uninit =
877 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
878 );
879 let ptr = uninit.as_ptr();
880 ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize
881 },
882 16usize,
883 concat!(
884 "Offset of field: ",
885 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
886 "::",
887 stringify!(name)
888 )
889 );
890 }
891 test_field_name();
892 fn test_field_units() {
893 assert_eq!(
894 unsafe {
895 let uninit =
896 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
897 );
898 let ptr = uninit.as_ptr();
899 ::std::ptr::addr_of!((*ptr).units) as usize - ptr as usize
900 },
901 24usize,
902 concat!(
903 "Offset of field: ",
904 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
905 "::",
906 stringify!(units)
907 )
908 );
909 }
910 test_field_units();
911 fn test_field_lowerBnd() {
912 assert_eq!(
913 unsafe {
914 let uninit =
915 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
916 );
917 let ptr = uninit.as_ptr();
918 ::std::ptr::addr_of!((*ptr).lowerBnd) as usize - ptr as usize
919 },
920 32usize,
921 concat!(
922 "Offset of field: ",
923 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
924 "::",
925 stringify!(lowerBnd)
926 )
927 );
928 }
929 test_field_lowerBnd();
930 fn test_field_upperBnd() {
931 assert_eq!(
932 unsafe {
933 let uninit =
934 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_TelemetryMessage>::uninit(
935 );
936 let ptr = uninit.as_ptr();
937 ::std::ptr::addr_of!((*ptr).upperBnd) as usize - ptr as usize
938 },
939 36usize,
940 concat!(
941 "Offset of field: ",
942 stringify!(CANSparkMaxLowLevel_TelemetryMessage),
943 "::",
944 stringify!(upperBnd)
945 )
946 );
947 }
948 test_field_upperBnd();
949 }
950 pub const CANSparkMaxLowLevel_FeedbackSensorType_kNoSensor:
951 root::rev::CANSparkMaxLowLevel_FeedbackSensorType = 0;
952 pub const CANSparkMaxLowLevel_FeedbackSensorType_kHallSensor:
953 root::rev::CANSparkMaxLowLevel_FeedbackSensorType = 1;
954 pub const CANSparkMaxLowLevel_FeedbackSensorType_kQuadrature:
955 root::rev::CANSparkMaxLowLevel_FeedbackSensorType = 2;
956 pub const CANSparkMaxLowLevel_FeedbackSensorType_kSensorless:
957 root::rev::CANSparkMaxLowLevel_FeedbackSensorType = 3;
958 pub const CANSparkMaxLowLevel_FeedbackSensorType_kAnalog:
959 root::rev::CANSparkMaxLowLevel_FeedbackSensorType = 4;
960 pub const CANSparkMaxLowLevel_FeedbackSensorType_kAltQuadrature:
961 root::rev::CANSparkMaxLowLevel_FeedbackSensorType = 5;
962 pub type CANSparkMaxLowLevel_FeedbackSensorType = ::std::os::raw::c_int;
963 #[repr(C)]
964 #[repr(align(4))]
965 #[derive(Debug, Copy, Clone)]
966 pub struct CANSparkMaxLowLevel_FollowConfigBits {
967 pub _bitfield_align_1: [u32; 0],
968 pub _bitfield_1: root::__BindgenBitfieldUnit<[u8; 4usize]>,
969 }
970 #[test]
971 fn bindgen_test_layout_CANSparkMaxLowLevel_FollowConfigBits() {
972 assert_eq!(
973 ::std::mem::size_of::<CANSparkMaxLowLevel_FollowConfigBits>(),
974 4usize,
975 concat!(
976 "Size of: ",
977 stringify!(CANSparkMaxLowLevel_FollowConfigBits)
978 )
979 );
980 assert_eq!(
981 ::std::mem::align_of::<CANSparkMaxLowLevel_FollowConfigBits>(),
982 4usize,
983 concat!(
984 "Alignment of ",
985 stringify!(CANSparkMaxLowLevel_FollowConfigBits)
986 )
987 );
988 }
989 impl CANSparkMaxLowLevel_FollowConfigBits {
990 #[inline]
991 pub fn rsvd1(&self) -> u32 {
992 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 18u8) as u32) }
993 }
994 #[inline]
995 pub fn set_rsvd1(&mut self, val: u32) {
996 unsafe {
997 let val: u32 = ::std::mem::transmute(val);
998 self._bitfield_1.set(0usize, 18u8, val as u64)
999 }
1000 }
1001 #[inline]
1002 pub fn invert(&self) -> u32 {
1003 unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) }
1004 }
1005 #[inline]
1006 pub fn set_invert(&mut self, val: u32) {
1007 unsafe {
1008 let val: u32 = ::std::mem::transmute(val);
1009 self._bitfield_1.set(18usize, 1u8, val as u64)
1010 }
1011 }
1012 #[inline]
1013 pub fn rsvd2(&self) -> u32 {
1014 unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 5u8) as u32) }
1015 }
1016 #[inline]
1017 pub fn set_rsvd2(&mut self, val: u32) {
1018 unsafe {
1019 let val: u32 = ::std::mem::transmute(val);
1020 self._bitfield_1.set(19usize, 5u8, val as u64)
1021 }
1022 }
1023 #[inline]
1024 pub fn predefined(&self) -> u32 {
1025 unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) }
1026 }
1027 #[inline]
1028 pub fn set_predefined(&mut self, val: u32) {
1029 unsafe {
1030 let val: u32 = ::std::mem::transmute(val);
1031 self._bitfield_1.set(24usize, 8u8, val as u64)
1032 }
1033 }
1034 #[inline]
1035 pub fn new_bitfield_1(
1036 rsvd1: u32,
1037 invert: u32,
1038 rsvd2: u32,
1039 predefined: u32,
1040 ) -> root::__BindgenBitfieldUnit<[u8; 4usize]> {
1041 let mut __bindgen_bitfield_unit: root::__BindgenBitfieldUnit<[u8; 4usize]> =
1042 Default::default();
1043 __bindgen_bitfield_unit.set(0usize, 18u8, {
1044 let rsvd1: u32 = unsafe { ::std::mem::transmute(rsvd1) };
1045 rsvd1 as u64
1046 });
1047 __bindgen_bitfield_unit.set(18usize, 1u8, {
1048 let invert: u32 = unsafe { ::std::mem::transmute(invert) };
1049 invert as u64
1050 });
1051 __bindgen_bitfield_unit.set(19usize, 5u8, {
1052 let rsvd2: u32 = unsafe { ::std::mem::transmute(rsvd2) };
1053 rsvd2 as u64
1054 });
1055 __bindgen_bitfield_unit.set(24usize, 8u8, {
1056 let predefined: u32 = unsafe { ::std::mem::transmute(predefined) };
1057 predefined as u64
1058 });
1059 __bindgen_bitfield_unit
1060 }
1061 }
1062 #[repr(C)]
1063 #[derive(Copy, Clone)]
1064 pub struct CANSparkMaxLowLevel_FollowConfig {
1065 pub leaderArbId: u32,
1066 pub config: root::rev::CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion,
1067 }
1068 #[repr(C)]
1069 #[derive(Copy, Clone)]
1070 pub union CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion {
1071 pub value: u32,
1072 pub bits: root::rev::CANSparkMaxLowLevel_FollowConfigBits,
1073 }
1074 #[test]
1075 fn bindgen_test_layout_CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion() {
1076 assert_eq!(
1077 ::std::mem::size_of::<CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion>(),
1078 4usize,
1079 concat!(
1080 "Size of: ",
1081 stringify!(CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion)
1082 )
1083 );
1084 assert_eq!(
1085 ::std::mem::align_of::<CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion>(),
1086 4usize,
1087 concat!(
1088 "Alignment of ",
1089 stringify!(CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion)
1090 )
1091 );
1092 fn test_field_value() {
1093 assert_eq!(
1094 unsafe {
1095 let uninit = ::std::mem::MaybeUninit::<
1096 CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion,
1097 >::uninit();
1098 let ptr = uninit.as_ptr();
1099 ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize
1100 },
1101 0usize,
1102 concat!(
1103 "Offset of field: ",
1104 stringify!(CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion),
1105 "::",
1106 stringify!(value)
1107 )
1108 );
1109 }
1110 test_field_value();
1111 fn test_field_bits() {
1112 assert_eq!(
1113 unsafe {
1114 let uninit = ::std::mem::MaybeUninit::<
1115 CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion,
1116 >::uninit();
1117 let ptr = uninit.as_ptr();
1118 ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize
1119 },
1120 0usize,
1121 concat!(
1122 "Offset of field: ",
1123 stringify!(CANSparkMaxLowLevel_FollowConfig_FollowConfigUnion),
1124 "::",
1125 stringify!(bits)
1126 )
1127 );
1128 }
1129 test_field_bits();
1130 }
1131 #[test]
1132 fn bindgen_test_layout_CANSparkMaxLowLevel_FollowConfig() {
1133 assert_eq!(
1134 ::std::mem::size_of::<CANSparkMaxLowLevel_FollowConfig>(),
1135 8usize,
1136 concat!("Size of: ", stringify!(CANSparkMaxLowLevel_FollowConfig))
1137 );
1138 assert_eq!(
1139 ::std::mem::align_of::<CANSparkMaxLowLevel_FollowConfig>(),
1140 4usize,
1141 concat!(
1142 "Alignment of ",
1143 stringify!(CANSparkMaxLowLevel_FollowConfig)
1144 )
1145 );
1146 fn test_field_leaderArbId() {
1147 assert_eq!(
1148 unsafe {
1149 let uninit =
1150 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_FollowConfig>::uninit();
1151 let ptr = uninit.as_ptr();
1152 ::std::ptr::addr_of!((*ptr).leaderArbId) as usize - ptr as usize
1153 },
1154 0usize,
1155 concat!(
1156 "Offset of field: ",
1157 stringify!(CANSparkMaxLowLevel_FollowConfig),
1158 "::",
1159 stringify!(leaderArbId)
1160 )
1161 );
1162 }
1163 test_field_leaderArbId();
1164 fn test_field_config() {
1165 assert_eq!(
1166 unsafe {
1167 let uninit =
1168 ::std::mem::MaybeUninit::<CANSparkMaxLowLevel_FollowConfig>::uninit();
1169 let ptr = uninit.as_ptr();
1170 ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize
1171 },
1172 4usize,
1173 concat!(
1174 "Offset of field: ",
1175 stringify!(CANSparkMaxLowLevel_FollowConfig),
1176 "::",
1177 stringify!(config)
1178 )
1179 );
1180 }
1181 test_field_config();
1182 }
1183 extern "C" {
1184 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel16kAPIMajorVersionE"]
1185 pub static CANSparkMaxLowLevel_kAPIMajorVersion: u8;
1186 }
1187 extern "C" {
1188 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel16kAPIMinorVersionE"]
1189 pub static CANSparkMaxLowLevel_kAPIMinorVersion: u8;
1190 }
1191 extern "C" {
1192 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel16kAPIBuildVersionE"]
1193 pub static CANSparkMaxLowLevel_kAPIBuildVersion: u8;
1194 }
1195 extern "C" {
1196 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel11kAPIVersionE"]
1197 pub static CANSparkMaxLowLevel_kAPIVersion: u32;
1198 }
1199 #[test]
1200 fn bindgen_test_layout_CANSparkMaxLowLevel() {
1201 assert_eq!(
1202 ::std::mem::size_of::<CANSparkMaxLowLevel>(),
1203 32usize,
1204 concat!("Size of: ", stringify!(CANSparkMaxLowLevel))
1205 );
1206 assert_eq!(
1207 ::std::mem::align_of::<CANSparkMaxLowLevel>(),
1208 8usize,
1209 concat!("Alignment of ", stringify!(CANSparkMaxLowLevel))
1210 );
1211 fn test_field_m_motorType() {
1212 assert_eq!(
1213 unsafe {
1214 let uninit = ::std::mem::MaybeUninit::<CANSparkMaxLowLevel>::uninit();
1215 let ptr = uninit.as_ptr();
1216 ::std::ptr::addr_of!((*ptr).m_motorType) as usize - ptr as usize
1217 },
1218 8usize,
1219 concat!(
1220 "Offset of field: ",
1221 stringify!(CANSparkMaxLowLevel),
1222 "::",
1223 stringify!(m_motorType)
1224 )
1225 );
1226 }
1227 test_field_m_motorType();
1228 fn test_field_m_sparkMaxHandle() {
1229 assert_eq!(
1230 unsafe {
1231 let uninit = ::std::mem::MaybeUninit::<CANSparkMaxLowLevel>::uninit();
1232 let ptr = uninit.as_ptr();
1233 ::std::ptr::addr_of!((*ptr).m_sparkMaxHandle) as usize - ptr as usize
1234 },
1235 16usize,
1236 concat!(
1237 "Offset of field: ",
1238 stringify!(CANSparkMaxLowLevel),
1239 "::",
1240 stringify!(m_sparkMaxHandle)
1241 )
1242 );
1243 }
1244 test_field_m_sparkMaxHandle();
1245 fn test_field_m_deviceID() {
1246 assert_eq!(
1247 unsafe {
1248 let uninit = ::std::mem::MaybeUninit::<CANSparkMaxLowLevel>::uninit();
1249 let ptr = uninit.as_ptr();
1250 ::std::ptr::addr_of!((*ptr).m_deviceID) as usize - ptr as usize
1251 },
1252 24usize,
1253 concat!(
1254 "Offset of field: ",
1255 stringify!(CANSparkMaxLowLevel),
1256 "::",
1257 stringify!(m_deviceID)
1258 )
1259 );
1260 }
1261 test_field_m_deviceID();
1262 }
1263 extern "C" {
1264 #[doc = " Get the firmware version of the SPARK MAX."]
1265 #[doc = ""]
1266 #[doc = " @return uint32_t Firmware version integer. Value is represented as 4"]
1267 #[doc = " bytes, Major.Minor.Build H.Build L"]
1268 #[doc = ""]
1269 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel18GetFirmwareVersionEv"]
1270 pub fn CANSparkMaxLowLevel_GetFirmwareVersion(
1271 this: *mut root::rev::CANSparkMaxLowLevel,
1272 ) -> u32;
1273 }
1274 extern "C" {
1275 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel18GetFirmwareVersionERb"]
1276 pub fn CANSparkMaxLowLevel_GetFirmwareVersion1(
1277 this: *mut root::rev::CANSparkMaxLowLevel,
1278 isDebugBuild: *mut bool,
1279 ) -> u32;
1280 }
1281 extern "C" {
1282 #[doc = " Get the firmware version of the SPARK MAX as a string."]
1283 #[doc = ""]
1284 #[doc = " @return std::string Human readable firmware version string"]
1285 #[doc = ""]
1286 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel17GetFirmwareStringB5cxx11Ev"]
1287 pub fn CANSparkMaxLowLevel_GetFirmwareString(
1288 this: *mut root::rev::CANSparkMaxLowLevel,
1289 ) -> root::std::string;
1290 }
1291 extern "C" {
1292 #[doc = " Get the unique serial number of the SPARK MAX. Currently not implemented."]
1293 #[doc = ""]
1294 #[doc = " @return std::vector<uint8_t> Vector of bytes representig the unique"]
1295 #[doc = " serial number"]
1296 #[doc = ""]
1297 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel15GetSerialNumberEv"]
1298 pub fn CANSparkMaxLowLevel_GetSerialNumber(
1299 this: *mut root::rev::CANSparkMaxLowLevel,
1300 ) -> root::std::vector;
1301 }
1302 extern "C" {
1303 #[doc = " Get the configured Device ID of the SPARK MAX."]
1304 #[doc = ""]
1305 #[doc = " @return int device ID"]
1306 #[doc = ""]
1307 #[link_name = "\u{1}_ZNK3rev19CANSparkMaxLowLevel11GetDeviceIdEv"]
1308 pub fn CANSparkMaxLowLevel_GetDeviceId(
1309 this: *const root::rev::CANSparkMaxLowLevel,
1310 ) -> ::std::os::raw::c_int;
1311 }
1312 extern "C" {
1313 #[doc = " Get the motor type setting from when the SparkMax was created."]
1314 #[doc = ""]
1315 #[doc = " This does not use the Get Parameter API which means it does not read"]
1316 #[doc = " what motor type is stored on the SparkMax itself. Instead, it reads"]
1317 #[doc = " the stored motor type from when the SparkMax object was first created."]
1318 #[doc = ""]
1319 #[doc = " @return MotorType Motor type setting"]
1320 #[doc = ""]
1321 #[doc = " @deprecated Use GetMotorType() instead"]
1322 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel19GetInitialMotorTypeEv"]
1323 pub fn CANSparkMaxLowLevel_GetInitialMotorType(
1324 this: *mut root::rev::CANSparkMaxLowLevel,
1325 ) -> root::rev::CANSparkMaxLowLevel_MotorType;
1326 }
1327 extern "C" {
1328 #[doc = " Get the motor type setting for the SPARK MAX."]
1329 #[doc = ""]
1330 #[doc = " @return MotorType Motor type setting"]
1331 #[doc = ""]
1332 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel12GetMotorTypeEv"]
1333 pub fn CANSparkMaxLowLevel_GetMotorType(
1334 this: *mut root::rev::CANSparkMaxLowLevel,
1335 ) -> root::rev::CANSparkMaxLowLevel_MotorType;
1336 }
1337 extern "C" {
1338 #[doc = " Set the rate of transmission for periodic frames from the SPARK MAX"]
1339 #[doc = ""]
1340 #[doc = " Each motor controller sends back three status frames with different"]
1341 #[doc = " data at set rates. Use this function to change the default rates."]
1342 #[doc = ""]
1343 #[doc = " Defaults:"]
1344 #[doc = " Status0 - 10ms"]
1345 #[doc = " Status1 - 20ms"]
1346 #[doc = " Status2 - 50ms"]
1347 #[doc = ""]
1348 #[doc = " This value is not stored in the FLASH after calling burnFlash()"]
1349 #[doc = " and is reset on powerup."]
1350 #[doc = ""]
1351 #[doc = " Refer to the SPARK MAX reference manual on details for how and when"]
1352 #[doc = " to configure this parameter."]
1353 #[doc = ""]
1354 #[doc = " @param frame Which periodic frame to change the period of"]
1355 #[doc = " @param periodMs The rate the controller sends the frame to the"]
1356 #[doc = " controller."]
1357 #[doc = ""]
1358 #[doc = " @return REVLibError::kOk if successful"]
1359 #[doc = ""]
1360 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel22SetPeriodicFramePeriodENS0_13PeriodicFrameEi"]
1361 pub fn CANSparkMaxLowLevel_SetPeriodicFramePeriod(
1362 this: *mut root::rev::CANSparkMaxLowLevel,
1363 frame: root::rev::CANSparkMaxLowLevel_PeriodicFrame,
1364 periodMs: ::std::os::raw::c_int,
1365 ) -> root::rev::REVLibError;
1366 }
1367 extern "C" {
1368 #[doc = " Set the control frame send period for the native CAN Send thread. To"]
1369 #[doc = " disable periodic sends, set periodMs to 0."]
1370 #[doc = ""]
1371 #[doc = " @param periodMs The send period in milliseconds between 1ms and 100ms"]
1372 #[doc = " or set to 0 to disable periodic sends. Note this is not updated until"]
1373 #[doc = " the next call to Set() or SetReference()."]
1374 #[doc = ""]
1375 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel23SetControlFramePeriodMsEi"]
1376 pub fn CANSparkMaxLowLevel_SetControlFramePeriodMs(
1377 this: *mut root::rev::CANSparkMaxLowLevel,
1378 periodMs: ::std::os::raw::c_int,
1379 );
1380 }
1381 extern "C" {
1382 #[doc = " Restore motor controller parameters to factory default"]
1383 #[doc = ""]
1384 #[doc = " @param persist If true, burn the flash with the factory default"]
1385 #[doc = " parameters"]
1386 #[doc = ""]
1387 #[doc = " @return REVLibError::kOk if successful"]
1388 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel22RestoreFactoryDefaultsEb"]
1389 pub fn CANSparkMaxLowLevel_RestoreFactoryDefaults(
1390 this: *mut root::rev::CANSparkMaxLowLevel,
1391 persist: bool,
1392 ) -> root::rev::REVLibError;
1393 }
1394 extern "C" {
1395 #[doc = " Allow external controllers to recieve control commands over USB."]
1396 #[doc = " For example, a configuration where the heartbeat (and enable/disable)"]
1397 #[doc = " is sent by the main controller, but control frames are sent by"]
1398 #[doc = " other CAN devices over USB."]
1399 #[doc = ""]
1400 #[doc = " This is global for all controllers on the same bus."]
1401 #[doc = ""]
1402 #[doc = " This does not disable sending control frames from this device. To prevent"]
1403 #[doc = " conflicts, do not enable this feature and also send Set() for"]
1404 #[doc = " SetReference() from the controllers you wish to control."]
1405 #[doc = ""]
1406 #[doc = " @param enable Enable or disable external control"]
1407 #[doc = ""]
1408 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel24EnableExternalUSBControlEb"]
1409 pub fn CANSparkMaxLowLevel_EnableExternalUSBControl(enable: bool);
1410 }
1411 extern "C" {
1412 #[doc = " Send enabled or disabled command to controllers. This is global for all"]
1413 #[doc = " controllers on the same bus, and will only work for non-roboRIO targets"]
1414 #[doc = " in non-competiton use. This function will also not work if a roboRIO is"]
1415 #[doc = " present on the CAN bus."]
1416 #[doc = ""]
1417 #[doc = " This does not disable sending control frames from this device. To prevent"]
1418 #[doc = " conflicts, do not enable this feature and also send Set() for"]
1419 #[doc = " SetReference() from the controllers you wish to control."]
1420 #[doc = ""]
1421 #[doc = " @param enable Enable or disable external control"]
1422 #[doc = ""]
1423 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel9SetEnableEb"]
1424 pub fn CANSparkMaxLowLevel_SetEnable(enable: bool);
1425 }
1426 extern "C" {
1427 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel18GetPeriodicStatus0Ev"]
1428 pub fn CANSparkMaxLowLevel_GetPeriodicStatus0(
1429 this: *mut root::rev::CANSparkMaxLowLevel,
1430 ) -> root::rev::CANSparkMaxLowLevel_PeriodicStatus0;
1431 }
1432 extern "C" {
1433 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel18GetPeriodicStatus1Ev"]
1434 pub fn CANSparkMaxLowLevel_GetPeriodicStatus1(
1435 this: *mut root::rev::CANSparkMaxLowLevel,
1436 ) -> root::rev::CANSparkMaxLowLevel_PeriodicStatus1;
1437 }
1438 extern "C" {
1439 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel18GetPeriodicStatus2Ev"]
1440 pub fn CANSparkMaxLowLevel_GetPeriodicStatus2(
1441 this: *mut root::rev::CANSparkMaxLowLevel,
1442 ) -> root::rev::CANSparkMaxLowLevel_PeriodicStatus2;
1443 }
1444 extern "C" {
1445 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel9SetFollowENS0_12FollowConfigE"]
1446 pub fn CANSparkMaxLowLevel_SetFollow(
1447 this: *mut root::rev::CANSparkMaxLowLevel,
1448 config: root::rev::CANSparkMaxLowLevel_FollowConfig,
1449 ) -> root::rev::REVLibError;
1450 }
1451 extern "C" {
1452 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel15SetpointCommandEdNS0_11ControlTypeEidi"]
1453 pub fn CANSparkMaxLowLevel_SetpointCommand(
1454 this: *mut root::rev::CANSparkMaxLowLevel,
1455 value: f64,
1456 ctrl: root::rev::CANSparkMaxLowLevel_ControlType,
1457 pidSlot: ::std::os::raw::c_int,
1458 arbFeedforward: f64,
1459 arbFFUnits: ::std::os::raw::c_int,
1460 ) -> root::rev::REVLibError;
1461 }
1462 extern "C" {
1463 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevel12GetSafeFloatEf"]
1464 pub fn CANSparkMaxLowLevel_GetSafeFloat(
1465 this: *mut root::rev::CANSparkMaxLowLevel,
1466 f: f32,
1467 ) -> f32;
1468 }
1469 impl CANSparkMaxLowLevel {
1470 #[inline]
1471 pub unsafe fn GetFirmwareVersion(&mut self) -> u32 {
1472 CANSparkMaxLowLevel_GetFirmwareVersion(self)
1473 }
1474 #[inline]
1475 pub unsafe fn GetFirmwareVersion1(&mut self, isDebugBuild: *mut bool) -> u32 {
1476 CANSparkMaxLowLevel_GetFirmwareVersion1(self, isDebugBuild)
1477 }
1478 #[inline]
1479 pub unsafe fn GetFirmwareString(&mut self) -> root::std::string {
1480 CANSparkMaxLowLevel_GetFirmwareString(self)
1481 }
1482 #[inline]
1483 pub unsafe fn GetSerialNumber(&mut self) -> root::std::vector {
1484 CANSparkMaxLowLevel_GetSerialNumber(self)
1485 }
1486 #[inline]
1487 pub unsafe fn GetDeviceId(&self) -> ::std::os::raw::c_int {
1488 CANSparkMaxLowLevel_GetDeviceId(self)
1489 }
1490 #[inline]
1491 pub unsafe fn GetInitialMotorType(
1492 &mut self,
1493 ) -> root::rev::CANSparkMaxLowLevel_MotorType {
1494 CANSparkMaxLowLevel_GetInitialMotorType(self)
1495 }
1496 #[inline]
1497 pub unsafe fn GetMotorType(&mut self) -> root::rev::CANSparkMaxLowLevel_MotorType {
1498 CANSparkMaxLowLevel_GetMotorType(self)
1499 }
1500 #[inline]
1501 pub unsafe fn SetPeriodicFramePeriod(
1502 &mut self,
1503 frame: root::rev::CANSparkMaxLowLevel_PeriodicFrame,
1504 periodMs: ::std::os::raw::c_int,
1505 ) -> root::rev::REVLibError {
1506 CANSparkMaxLowLevel_SetPeriodicFramePeriod(self, frame, periodMs)
1507 }
1508 #[inline]
1509 pub unsafe fn SetControlFramePeriodMs(&mut self, periodMs: ::std::os::raw::c_int) {
1510 CANSparkMaxLowLevel_SetControlFramePeriodMs(self, periodMs)
1511 }
1512 #[inline]
1513 pub unsafe fn RestoreFactoryDefaults(
1514 &mut self,
1515 persist: bool,
1516 ) -> root::rev::REVLibError {
1517 CANSparkMaxLowLevel_RestoreFactoryDefaults(self, persist)
1518 }
1519 #[inline]
1520 pub unsafe fn EnableExternalUSBControl(enable: bool) {
1521 CANSparkMaxLowLevel_EnableExternalUSBControl(enable)
1522 }
1523 #[inline]
1524 pub unsafe fn SetEnable(enable: bool) {
1525 CANSparkMaxLowLevel_SetEnable(enable)
1526 }
1527 #[inline]
1528 pub unsafe fn GetPeriodicStatus0(
1529 &mut self,
1530 ) -> root::rev::CANSparkMaxLowLevel_PeriodicStatus0 {
1531 CANSparkMaxLowLevel_GetPeriodicStatus0(self)
1532 }
1533 #[inline]
1534 pub unsafe fn GetPeriodicStatus1(
1535 &mut self,
1536 ) -> root::rev::CANSparkMaxLowLevel_PeriodicStatus1 {
1537 CANSparkMaxLowLevel_GetPeriodicStatus1(self)
1538 }
1539 #[inline]
1540 pub unsafe fn GetPeriodicStatus2(
1541 &mut self,
1542 ) -> root::rev::CANSparkMaxLowLevel_PeriodicStatus2 {
1543 CANSparkMaxLowLevel_GetPeriodicStatus2(self)
1544 }
1545 #[inline]
1546 pub unsafe fn SetFollow(
1547 &mut self,
1548 config: root::rev::CANSparkMaxLowLevel_FollowConfig,
1549 ) -> root::rev::REVLibError {
1550 CANSparkMaxLowLevel_SetFollow(self, config)
1551 }
1552 #[inline]
1553 pub unsafe fn SetpointCommand(
1554 &mut self,
1555 value: f64,
1556 ctrl: root::rev::CANSparkMaxLowLevel_ControlType,
1557 pidSlot: ::std::os::raw::c_int,
1558 arbFeedforward: f64,
1559 arbFFUnits: ::std::os::raw::c_int,
1560 ) -> root::rev::REVLibError {
1561 CANSparkMaxLowLevel_SetpointCommand(
1562 self,
1563 value,
1564 ctrl,
1565 pidSlot,
1566 arbFeedforward,
1567 arbFFUnits,
1568 )
1569 }
1570 #[inline]
1571 pub unsafe fn GetSafeFloat(&mut self, f: f32) -> f32 {
1572 CANSparkMaxLowLevel_GetSafeFloat(self, f)
1573 }
1574 }
1575 extern "C" {
1576 #[doc = " Closes the SPARK MAX Controller"]
1577 #[link_name = "\u{1}_ZN3rev19CANSparkMaxLowLevelD1Ev"]
1578 pub fn CANSparkMaxLowLevel_CANSparkMaxLowLevel_destructor(
1579 this: *mut root::rev::CANSparkMaxLowLevel,
1580 );
1581 }
1582 #[repr(C)]
1583 #[derive(Debug)]
1584 pub struct RelativeEncoder {
1585 pub _base: root::rev::CANEncoder,
1586 }
1587 #[test]
1588 fn bindgen_test_layout_RelativeEncoder() {
1589 assert_eq!(
1590 ::std::mem::size_of::<RelativeEncoder>(),
1591 8usize,
1592 concat!("Size of: ", stringify!(RelativeEncoder))
1593 );
1594 assert_eq!(
1595 ::std::mem::align_of::<RelativeEncoder>(),
1596 8usize,
1597 concat!("Alignment of ", stringify!(RelativeEncoder))
1598 );
1599 }
1600 #[doc = " Get an instance of this class by using CANSparkMax::GetEncoder() or"]
1601 #[doc = " CANSparkMax::GetEncoder(CANSparkMax::EncoderType, int)."]
1602 #[repr(C)]
1603 #[derive(Debug)]
1604 pub struct SparkMaxAlternateEncoder {
1605 pub _base: root::rev::RelativeEncoder,
1606 pub m_device: *mut root::rev::CANSparkMax,
1607 pub m_countsPerRev: ::std::os::raw::c_int,
1608 }
1609 pub const SparkMaxAlternateEncoder_Type_kQuadrature:
1610 root::rev::SparkMaxAlternateEncoder_Type = 0;
1611 #[doc = " The type of encoder wired as an Alternate Encoder on a SPARK MAX"]
1612 pub type SparkMaxAlternateEncoder_Type = ::std::os::raw::c_int;
1613 #[test]
1614 fn bindgen_test_layout_SparkMaxAlternateEncoder() {
1615 assert_eq!(
1616 ::std::mem::size_of::<SparkMaxAlternateEncoder>(),
1617 24usize,
1618 concat!("Size of: ", stringify!(SparkMaxAlternateEncoder))
1619 );
1620 assert_eq!(
1621 ::std::mem::align_of::<SparkMaxAlternateEncoder>(),
1622 8usize,
1623 concat!("Alignment of ", stringify!(SparkMaxAlternateEncoder))
1624 );
1625 fn test_field_m_device() {
1626 assert_eq!(
1627 unsafe {
1628 let uninit = ::std::mem::MaybeUninit::<SparkMaxAlternateEncoder>::uninit();
1629 let ptr = uninit.as_ptr();
1630 ::std::ptr::addr_of!((*ptr).m_device) as usize - ptr as usize
1631 },
1632 8usize,
1633 concat!(
1634 "Offset of field: ",
1635 stringify!(SparkMaxAlternateEncoder),
1636 "::",
1637 stringify!(m_device)
1638 )
1639 );
1640 }
1641 test_field_m_device();
1642 fn test_field_m_countsPerRev() {
1643 assert_eq!(
1644 unsafe {
1645 let uninit = ::std::mem::MaybeUninit::<SparkMaxAlternateEncoder>::uninit();
1646 let ptr = uninit.as_ptr();
1647 ::std::ptr::addr_of!((*ptr).m_countsPerRev) as usize - ptr as usize
1648 },
1649 16usize,
1650 concat!(
1651 "Offset of field: ",
1652 stringify!(SparkMaxAlternateEncoder),
1653 "::",
1654 stringify!(m_countsPerRev)
1655 )
1656 );
1657 }
1658 test_field_m_countsPerRev();
1659 }
1660 extern "C" {
1661 #[doc = " Get the position of the motor. This returns the native units"]
1662 #[doc = " of 'rotations' by default, and can be changed by a scale factor"]
1663 #[doc = " using setPositionConversionFactor()."]
1664 #[doc = ""]
1665 #[doc = " @return Number of rotations of the motor"]
1666 #[doc = ""]
1667 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder11GetPositionEv"]
1668 pub fn SparkMaxAlternateEncoder_GetPosition(this: *mut ::std::os::raw::c_void) -> f64;
1669 }
1670 extern "C" {
1671 #[doc = " Get the velocity of the motor. This returns the native units"]
1672 #[doc = " of 'RPM' by default, and can be changed by a scale factor"]
1673 #[doc = " using setVelocityConversionFactor()."]
1674 #[doc = ""]
1675 #[doc = " @return Number the RPM of the motor"]
1676 #[doc = ""]
1677 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder11GetVelocityEv"]
1678 pub fn SparkMaxAlternateEncoder_GetVelocity(this: *mut ::std::os::raw::c_void) -> f64;
1679 }
1680 extern "C" {
1681 #[doc = " Set the position of the encoder."]
1682 #[doc = ""]
1683 #[doc = " @param position Number of rotations of the motor"]
1684 #[doc = ""]
1685 #[doc = " @return REVLibError::kOk if successful"]
1686 #[link_name = "\u{1}_ZN3rev24SparkMaxAlternateEncoder11SetPositionEd"]
1687 pub fn SparkMaxAlternateEncoder_SetPosition(
1688 this: *mut ::std::os::raw::c_void,
1689 position: f64,
1690 ) -> root::rev::REVLibError;
1691 }
1692 extern "C" {
1693 #[doc = " Set the conversion factor for position of the encoder. Multiplied by the"]
1694 #[doc = " native output units to give you position"]
1695 #[doc = ""]
1696 #[doc = " @param factor The conversion factor to multiply the native units by"]
1697 #[doc = ""]
1698 #[doc = " @return REVLibError::kOk if successful"]
1699 #[link_name = "\u{1}_ZN3rev24SparkMaxAlternateEncoder27SetPositionConversionFactorEd"]
1700 pub fn SparkMaxAlternateEncoder_SetPositionConversionFactor(
1701 this: *mut ::std::os::raw::c_void,
1702 factor: f64,
1703 ) -> root::rev::REVLibError;
1704 }
1705 extern "C" {
1706 #[doc = " Set the conversion factor for velocity of the encoder. Multiplied by the"]
1707 #[doc = " native output units to give you velocity"]
1708 #[doc = ""]
1709 #[doc = " @param factor The conversion factor to multiply the native units by"]
1710 #[doc = ""]
1711 #[doc = " @return REVLibError::kOk if successful"]
1712 #[link_name = "\u{1}_ZN3rev24SparkMaxAlternateEncoder27SetVelocityConversionFactorEd"]
1713 pub fn SparkMaxAlternateEncoder_SetVelocityConversionFactor(
1714 this: *mut ::std::os::raw::c_void,
1715 factor: f64,
1716 ) -> root::rev::REVLibError;
1717 }
1718 extern "C" {
1719 #[doc = " Get the conversion factor for position of the encoder. Multiplied by the"]
1720 #[doc = " native output units to give you position"]
1721 #[doc = ""]
1722 #[doc = " @return The conversion factor for position"]
1723 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder27GetPositionConversionFactorEv"]
1724 pub fn SparkMaxAlternateEncoder_GetPositionConversionFactor(
1725 this: *mut ::std::os::raw::c_void,
1726 ) -> f64;
1727 }
1728 extern "C" {
1729 #[doc = " Get the conversion factor for velocity of the encoder. Multiplied by the"]
1730 #[doc = " native output units to give you velocity"]
1731 #[doc = ""]
1732 #[doc = " @return The conversion factor for velocity"]
1733 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder27GetVelocityConversionFactorEv"]
1734 pub fn SparkMaxAlternateEncoder_GetVelocityConversionFactor(
1735 this: *mut ::std::os::raw::c_void,
1736 ) -> f64;
1737 }
1738 extern "C" {
1739 #[doc = " Set the average sampling depth for a quadrature encoder. This value"]
1740 #[doc = " sets the number of samples in the average for velocity readings. This"]
1741 #[doc = " can be any value from 1 to 64."]
1742 #[doc = ""]
1743 #[doc = " @param depth The average sampling depth between 1 and 64 (default)"]
1744 #[doc = ""]
1745 #[doc = " @return REVLibError::kOk if successful"]
1746 #[link_name = "\u{1}_ZN3rev24SparkMaxAlternateEncoder15SetAverageDepthEj"]
1747 pub fn SparkMaxAlternateEncoder_SetAverageDepth(
1748 this: *mut ::std::os::raw::c_void,
1749 depth: u32,
1750 ) -> root::rev::REVLibError;
1751 }
1752 extern "C" {
1753 #[doc = " Set the measurement period for velocity measurements of a quadrature"]
1754 #[doc = " encoder."]
1755 #[doc = ""]
1756 #[doc = " The basic formula to calculate velocity is change in position / change in"]
1757 #[doc = " time. This parameter sets the change in time for measurement."]
1758 #[doc = ""]
1759 #[doc = " @param period_ms Measurement period in milliseconds. This number may be"]
1760 #[doc = " between 1 and 100 (default)."]
1761 #[doc = ""]
1762 #[doc = " @return REVLibError::kOk if successful"]
1763 #[link_name = "\u{1}_ZN3rev24SparkMaxAlternateEncoder20SetMeasurementPeriodEj"]
1764 pub fn SparkMaxAlternateEncoder_SetMeasurementPeriod(
1765 this: *mut ::std::os::raw::c_void,
1766 period_ms: u32,
1767 ) -> root::rev::REVLibError;
1768 }
1769 extern "C" {
1770 #[doc = " Get the average sampling depth for a quadrature encoder."]
1771 #[doc = ""]
1772 #[doc = " @return The average sampling depth"]
1773 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder15GetAverageDepthEv"]
1774 pub fn SparkMaxAlternateEncoder_GetAverageDepth(
1775 this: *mut ::std::os::raw::c_void,
1776 ) -> u32;
1777 }
1778 extern "C" {
1779 #[doc = " Get the number of samples for reading from a quadrature encoder. This"]
1780 #[doc = " value sets the number of samples in the average for velocity readings."]
1781 #[doc = ""]
1782 #[doc = " @return Measurement period in microseconds"]
1783 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder20GetMeasurementPeriodEv"]
1784 pub fn SparkMaxAlternateEncoder_GetMeasurementPeriod(
1785 this: *mut ::std::os::raw::c_void,
1786 ) -> u32;
1787 }
1788 extern "C" {
1789 #[doc = " Get the counts per revolution of the quadrature encoder."]
1790 #[doc = ""]
1791 #[doc = " For a description on the difference between CPR, PPR, etc. go to"]
1792 #[doc = " https://www.cuidevices.com/blog/what-is-encoder-ppr-cpr-and-lpr"]
1793 #[doc = ""]
1794 #[doc = " @return Counts per revolution"]
1795 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder22GetCountsPerRevolutionEv"]
1796 pub fn SparkMaxAlternateEncoder_GetCountsPerRevolution(
1797 this: *mut ::std::os::raw::c_void,
1798 ) -> u32;
1799 }
1800 extern "C" {
1801 #[doc = " Set the phase of the MotorFeedbackSensor so that it is set to be in"]
1802 #[doc = " phase with the motor itself. This only works for quadrature"]
1803 #[doc = " encoders."]
1804 #[doc = ""]
1805 #[doc = " @param inverted The phase of the encoder"]
1806 #[doc = ""]
1807 #[doc = " @return REVLibError::kOk if successful"]
1808 #[link_name = "\u{1}_ZN3rev24SparkMaxAlternateEncoder11SetInvertedEb"]
1809 pub fn SparkMaxAlternateEncoder_SetInverted(
1810 this: *mut ::std::os::raw::c_void,
1811 inverted: bool,
1812 ) -> root::rev::REVLibError;
1813 }
1814 extern "C" {
1815 #[doc = " Get the phase of the MotorFeedbackSensor. This will just return false"]
1816 #[doc = " if the user tries to get inverted while the SparkMax is"]
1817 #[doc = " Brushless and using the hall effect sensor."]
1818 #[doc = ""]
1819 #[doc = " @return The phase of the encoder"]
1820 #[link_name = "\u{1}_ZNK3rev24SparkMaxAlternateEncoder11GetInvertedEv"]
1821 pub fn SparkMaxAlternateEncoder_GetInverted(this: *mut ::std::os::raw::c_void) -> bool;
1822 }
1823 #[repr(C)]
1824 #[derive(Debug)]
1825 pub struct SparkMaxAnalogSensor {
1826 pub _base: root::rev::AnalogInput,
1827 pub _base_1: root::rev::CANAnalog,
1828 pub m_device: *mut root::rev::CANSparkMax,
1829 pub m_mode: root::rev::SparkMaxAnalogSensor_Mode,
1830 }
1831 pub const SparkMaxAnalogSensor_Mode_kAbsolute: root::rev::SparkMaxAnalogSensor_Mode = 0;
1832 pub const SparkMaxAnalogSensor_Mode_kRelative: root::rev::SparkMaxAnalogSensor_Mode = 1;
1833 #[doc = " Analog sensors have the ability to either be absolute or relative."]
1834 #[doc = " By default, CANSparkMax::GetAnalog() will return an absolute analog"]
1835 #[doc = " sensor, but it can also be configured to be a relative sensor instead."]
1836 pub type SparkMaxAnalogSensor_Mode = ::std::os::raw::c_int;
1837 #[test]
1838 fn bindgen_test_layout_SparkMaxAnalogSensor() {
1839 assert_eq!(
1840 ::std::mem::size_of::<SparkMaxAnalogSensor>(),
1841 32usize,
1842 concat!("Size of: ", stringify!(SparkMaxAnalogSensor))
1843 );
1844 assert_eq!(
1845 ::std::mem::align_of::<SparkMaxAnalogSensor>(),
1846 8usize,
1847 concat!("Alignment of ", stringify!(SparkMaxAnalogSensor))
1848 );
1849 }
1850 extern "C" {
1851 #[doc = " Get the voltage of the analog sensor."]
1852 #[doc = ""]
1853 #[doc = " @return Voltage of the sensor"]
1854 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor10GetVoltageEv"]
1855 pub fn SparkMaxAnalogSensor_GetVoltage(this: *mut ::std::os::raw::c_void) -> f64;
1856 }
1857 extern "C" {
1858 #[doc = " Get the position of the sensor. Returns value in the native unit"]
1859 #[doc = " of 'volt' by default, and can be changed by a scale factor"]
1860 #[doc = " using setPositionConversionFactor()."]
1861 #[doc = ""]
1862 #[doc = " @return Position of the sensor in volts"]
1863 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor11GetPositionEv"]
1864 pub fn SparkMaxAnalogSensor_GetPosition(this: *mut ::std::os::raw::c_void) -> f64;
1865 }
1866 extern "C" {
1867 #[doc = " Get the velocity of the sensor. Returns value in the native units of"]
1868 #[doc = " 'volts per second' by default, and can be changed by a"]
1869 #[doc = " scale factor using setVelocityConversionFactor()."]
1870 #[doc = ""]
1871 #[doc = " @return Velocity of the sensor in volts per second"]
1872 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor11GetVelocityEv"]
1873 pub fn SparkMaxAnalogSensor_GetVelocity(this: *mut ::std::os::raw::c_void) -> f64;
1874 }
1875 extern "C" {
1876 #[doc = " Set the conversion factor for the position of the analog sensor."]
1877 #[doc = " By default, revolutions per volt is 1. Changing the position conversion"]
1878 #[doc = " factor will also change the position units."]
1879 #[doc = ""]
1880 #[doc = " @param factor The conversion factor which will be multiplied by volts"]
1881 #[doc = ""]
1882 #[doc = " @return REVLibError::kOk if successful"]
1883 #[link_name = "\u{1}_ZThn8_N3rev20SparkMaxAnalogSensor27SetPositionConversionFactorEd"]
1884 pub fn SparkMaxAnalogSensor_SetPositionConversionFactor(
1885 this: *mut ::std::os::raw::c_void,
1886 factor: f64,
1887 ) -> root::rev::REVLibError;
1888 }
1889 extern "C" {
1890 #[doc = " Get the current conversion factor for the position of the analog"]
1891 #[doc = " sensor."]
1892 #[doc = ""]
1893 #[doc = " @return Analog position conversion factor"]
1894 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor27GetPositionConversionFactorEv"]
1895 pub fn SparkMaxAnalogSensor_GetPositionConversionFactor(
1896 this: *mut ::std::os::raw::c_void,
1897 ) -> f64;
1898 }
1899 extern "C" {
1900 #[doc = " Set the conversion factor for the velocity of the analog sensor."]
1901 #[doc = " By default, revolutions per volt second is 1. Changing the velocity"]
1902 #[doc = " conversion factor will also change the velocity units."]
1903 #[doc = ""]
1904 #[doc = " @param factor The conversion factor which will be multipled by volts per"]
1905 #[doc = " second"]
1906 #[doc = ""]
1907 #[doc = " @return REVLibError::kOk is successful"]
1908 #[link_name = "\u{1}_ZThn8_N3rev20SparkMaxAnalogSensor27SetVelocityConversionFactorEd"]
1909 pub fn SparkMaxAnalogSensor_SetVelocityConversionFactor(
1910 this: *mut ::std::os::raw::c_void,
1911 factor: f64,
1912 ) -> root::rev::REVLibError;
1913 }
1914 extern "C" {
1915 #[doc = " Get the current conversion factor for the velocity of the analog"]
1916 #[doc = " sensor."]
1917 #[doc = ""]
1918 #[doc = " @return Analog velocity conversion factor"]
1919 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor27GetVelocityConversionFactorEv"]
1920 pub fn SparkMaxAnalogSensor_GetVelocityConversionFactor(
1921 this: *mut ::std::os::raw::c_void,
1922 ) -> f64;
1923 }
1924 extern "C" {
1925 #[doc = " Set the number of samples in the average for velocity readings. This"]
1926 #[doc = " can be any value from 1 to 64."]
1927 #[doc = ""]
1928 #[doc = " When the SparkMax controller is in Brushless mode, this"]
1929 #[doc = " will not change any behavior."]
1930 #[doc = ""]
1931 #[doc = " @param depth The average sampling depth between 1 and 64 (default)"]
1932 #[doc = ""]
1933 #[doc = " @return REVLibError::kOk if successful"]
1934 #[link_name = "\u{1}_ZThn8_N3rev20SparkMaxAnalogSensor15SetAverageDepthEj"]
1935 pub fn SparkMaxAnalogSensor_SetAverageDepth(
1936 this: *mut ::std::os::raw::c_void,
1937 depth: u32,
1938 ) -> root::rev::REVLibError;
1939 }
1940 extern "C" {
1941 #[doc = " Set the measurement period for velocity readings."]
1942 #[doc = ""]
1943 #[doc = " The basic formula to calculate velocity is change in position / change in"]
1944 #[doc = " time. This parameter sets the change in time for measurement."]
1945 #[doc = ""]
1946 #[doc = " @param period_ms Measurement period in milliseconds. This number may be"]
1947 #[doc = " between 1 and 100 (default)."]
1948 #[doc = ""]
1949 #[doc = " @return REVLibError::kOk if successful"]
1950 #[link_name = "\u{1}_ZThn8_N3rev20SparkMaxAnalogSensor20SetMeasurementPeriodEj"]
1951 pub fn SparkMaxAnalogSensor_SetMeasurementPeriod(
1952 this: *mut ::std::os::raw::c_void,
1953 period_ms: u32,
1954 ) -> root::rev::REVLibError;
1955 }
1956 extern "C" {
1957 #[doc = " Get the number of samples included in the average for velocity readings."]
1958 #[doc = ""]
1959 #[doc = " @return The average sampling depth"]
1960 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor15GetAverageDepthEv"]
1961 pub fn SparkMaxAnalogSensor_GetAverageDepth(this: *mut ::std::os::raw::c_void) -> u32;
1962 }
1963 extern "C" {
1964 #[doc = " Get the measurement period used for velocity readings."]
1965 #[doc = ""]
1966 #[doc = " @return Measurement period in microseconds"]
1967 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor20GetMeasurementPeriodEv"]
1968 pub fn SparkMaxAnalogSensor_GetMeasurementPeriod(
1969 this: *mut ::std::os::raw::c_void,
1970 ) -> u32;
1971 }
1972 extern "C" {
1973 #[doc = " Set the phase of the MotorFeedbackSensor so that it is set to be in"]
1974 #[doc = " phase with the motor itself. This only works for quadrature"]
1975 #[doc = " encoders. This will throw an error if the user tries to set"]
1976 #[doc = " inverted while the SparkMax is Brushless and using the hall"]
1977 #[doc = " effect sensor."]
1978 #[doc = ""]
1979 #[doc = " @param inverted The phase of the encoder"]
1980 #[doc = ""]
1981 #[doc = " @return REVLibError::kOk if successful"]
1982 #[link_name = "\u{1}_ZThn8_N3rev20SparkMaxAnalogSensor11SetInvertedEb"]
1983 pub fn SparkMaxAnalogSensor_SetInverted(
1984 this: *mut ::std::os::raw::c_void,
1985 inverted: bool,
1986 ) -> root::rev::REVLibError;
1987 }
1988 extern "C" {
1989 #[doc = " Get the phase of the MotorFeedbackSensor. This will just return false"]
1990 #[doc = " if the user tries to get inverted while the SparkMax is"]
1991 #[doc = " Brushless and using the hall effect sensor."]
1992 #[doc = ""]
1993 #[doc = " @return The phase of the encoder"]
1994 #[link_name = "\u{1}_ZThn8_NK3rev20SparkMaxAnalogSensor11GetInvertedEv"]
1995 pub fn SparkMaxAnalogSensor_GetInverted(this: *mut ::std::os::raw::c_void) -> bool;
1996 }
1997 #[repr(C)]
1998 #[derive(Debug)]
1999 pub struct SparkMaxLimitSwitch {
2000 pub _base: root::rev::CANDigitalInput,
2001 pub m_device: *mut root::rev::CANSparkMax,
2002 pub m_direction: root::rev::SparkMaxLimitSwitch_Direction,
2003 }
2004 pub const SparkMaxLimitSwitch_Type_kNormallyOpen: root::rev::SparkMaxLimitSwitch_Type = 0;
2005 pub const SparkMaxLimitSwitch_Type_kNormallyClosed: root::rev::SparkMaxLimitSwitch_Type = 1;
2006 #[doc = " Represents whether the circuit is open or closed when the switch is not"]
2007 #[doc = " being pressed"]
2008 pub type SparkMaxLimitSwitch_Type = ::std::os::raw::c_int;
2009 pub const SparkMaxLimitSwitch_Direction_kForward: root::rev::SparkMaxLimitSwitch_Direction =
2010 0;
2011 pub const SparkMaxLimitSwitch_Direction_kReverse: root::rev::SparkMaxLimitSwitch_Direction =
2012 1;
2013 pub type SparkMaxLimitSwitch_Direction = ::std::os::raw::c_int;
2014 #[test]
2015 fn bindgen_test_layout_SparkMaxLimitSwitch() {
2016 assert_eq!(
2017 ::std::mem::size_of::<SparkMaxLimitSwitch>(),
2018 24usize,
2019 concat!("Size of: ", stringify!(SparkMaxLimitSwitch))
2020 );
2021 assert_eq!(
2022 ::std::mem::align_of::<SparkMaxLimitSwitch>(),
2023 8usize,
2024 concat!("Alignment of ", stringify!(SparkMaxLimitSwitch))
2025 );
2026 fn test_field_m_device() {
2027 assert_eq!(
2028 unsafe {
2029 let uninit = ::std::mem::MaybeUninit::<SparkMaxLimitSwitch>::uninit();
2030 let ptr = uninit.as_ptr();
2031 ::std::ptr::addr_of!((*ptr).m_device) as usize - ptr as usize
2032 },
2033 8usize,
2034 concat!(
2035 "Offset of field: ",
2036 stringify!(SparkMaxLimitSwitch),
2037 "::",
2038 stringify!(m_device)
2039 )
2040 );
2041 }
2042 test_field_m_device();
2043 fn test_field_m_direction() {
2044 assert_eq!(
2045 unsafe {
2046 let uninit = ::std::mem::MaybeUninit::<SparkMaxLimitSwitch>::uninit();
2047 let ptr = uninit.as_ptr();
2048 ::std::ptr::addr_of!((*ptr).m_direction) as usize - ptr as usize
2049 },
2050 16usize,
2051 concat!(
2052 "Offset of field: ",
2053 stringify!(SparkMaxLimitSwitch),
2054 "::",
2055 stringify!(m_direction)
2056 )
2057 );
2058 }
2059 test_field_m_direction();
2060 }
2061 extern "C" {
2062 #[doc = " Get the state of the limit switch, whether or not it is enabled"]
2063 #[doc = " (limiting the rotation of the motor)."]
2064 #[link_name = "\u{1}_ZNK3rev19SparkMaxLimitSwitch3GetEv"]
2065 pub fn SparkMaxLimitSwitch_Get(this: *mut ::std::os::raw::c_void) -> bool;
2066 }
2067 extern "C" {
2068 #[doc = " Enables or disables controller shutdown based on limit switch."]
2069 #[link_name = "\u{1}_ZN3rev19SparkMaxLimitSwitch17EnableLimitSwitchEb"]
2070 pub fn SparkMaxLimitSwitch_EnableLimitSwitch(
2071 this: *mut ::std::os::raw::c_void,
2072 enable: bool,
2073 ) -> root::rev::REVLibError;
2074 }
2075 extern "C" {
2076 #[doc = " Returns true if limit switch is enabled."]
2077 #[link_name = "\u{1}_ZNK3rev19SparkMaxLimitSwitch20IsLimitSwitchEnabledEv"]
2078 pub fn SparkMaxLimitSwitch_IsLimitSwitchEnabled(
2079 this: *mut ::std::os::raw::c_void,
2080 ) -> bool;
2081 }
2082 #[repr(C)]
2083 #[derive(Debug)]
2084 pub struct SparkMaxPIDController {
2085 pub _base: root::rev::CANPIDController,
2086 pub m_device: *mut root::rev::CANSparkMax,
2087 }
2088 pub const SparkMaxPIDController_AccelStrategy_kTrapezoidal:
2089 root::rev::SparkMaxPIDController_AccelStrategy = 0;
2090 pub const SparkMaxPIDController_AccelStrategy_kSCurve:
2091 root::rev::SparkMaxPIDController_AccelStrategy = 1;
2092 #[doc = " Acceleration strategy used by Smart Motion"]
2093 pub type SparkMaxPIDController_AccelStrategy = ::std::os::raw::c_int;
2094 pub const SparkMaxPIDController_ArbFFUnits_kVoltage:
2095 root::rev::SparkMaxPIDController_ArbFFUnits = 0;
2096 pub const SparkMaxPIDController_ArbFFUnits_kPercentOut:
2097 root::rev::SparkMaxPIDController_ArbFFUnits = 1;
2098 #[doc = " Units for arbitrary feed-forward"]
2099 pub type SparkMaxPIDController_ArbFFUnits = ::std::os::raw::c_int;
2100 #[test]
2101 fn bindgen_test_layout_SparkMaxPIDController() {
2102 assert_eq!(
2103 ::std::mem::size_of::<SparkMaxPIDController>(),
2104 16usize,
2105 concat!("Size of: ", stringify!(SparkMaxPIDController))
2106 );
2107 assert_eq!(
2108 ::std::mem::align_of::<SparkMaxPIDController>(),
2109 8usize,
2110 concat!("Alignment of ", stringify!(SparkMaxPIDController))
2111 );
2112 fn test_field_m_device() {
2113 assert_eq!(
2114 unsafe {
2115 let uninit = ::std::mem::MaybeUninit::<SparkMaxPIDController>::uninit();
2116 let ptr = uninit.as_ptr();
2117 ::std::ptr::addr_of!((*ptr).m_device) as usize - ptr as usize
2118 },
2119 8usize,
2120 concat!(
2121 "Offset of field: ",
2122 stringify!(SparkMaxPIDController),
2123 "::",
2124 stringify!(m_device)
2125 )
2126 );
2127 }
2128 test_field_m_device();
2129 }
2130 extern "C" {
2131 #[doc = " Set the controller reference value based on the selected control mode."]
2132 #[doc = ""]
2133 #[doc = " @param value The value to set depending on the control mode. For basic"]
2134 #[doc = " duty cycle control this should be a value between -1 and 1"]
2135 #[doc = " Otherwise: Voltage Control: Voltage (volts) Velocity Control: Velocity"]
2136 #[doc = " (RPM) Position Control: Position (Rotations) Current Control: Current"]
2137 #[doc = " (Amps). The units can be changed for position and velocity by a scale"]
2138 #[doc = " factor using setPositionConversionFactor()."]
2139 #[doc = ""]
2140 #[doc = " @param ctrl Is the control type"]
2141 #[doc = ""]
2142 #[doc = " @param pidSlot for this command"]
2143 #[doc = ""]
2144 #[doc = " @param arbFeedforward A value from -32.0 to 32.0 which is a voltage"]
2145 #[doc = " applied to the motor after the result of the specified control mode. The"]
2146 #[doc = " units for the parameter is Volts. This value is set after the control"]
2147 #[doc = " mode, but before any current limits or ramp rates."]
2148 #[doc = ""]
2149 #[doc = " @return REVLibError::kOk if successful"]
2150 #[doc = ""]
2151 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController12SetReferenceEdNS_19CANSparkMaxLowLevel11ControlTypeEidNS0_10ArbFFUnitsE"]
2152 pub fn SparkMaxPIDController_SetReference(
2153 this: *mut root::rev::SparkMaxPIDController,
2154 value: f64,
2155 ctrl: root::rev::CANSparkMaxLowLevel_ControlType,
2156 pidSlot: ::std::os::raw::c_int,
2157 arbFeedforward: f64,
2158 arbFFUnits: root::rev::SparkMaxPIDController_ArbFFUnits,
2159 ) -> root::rev::REVLibError;
2160 }
2161 extern "C" {
2162 #[doc = " NOTE: As of the 2022 FRC season, the firmware only supports the"]
2163 #[doc = " trapezoidal motion profiling acceleration strategy."]
2164 #[doc = ""]
2165 #[doc = " Configure the acceleration strategy used to control acceleration on the"]
2166 #[doc = " motor."]
2167 #[doc = ""]
2168 #[doc = " @param accelStrategy The acceleration strategy to use for the"]
2169 #[doc = " automatically generated motion profile"]
2170 #[doc = ""]
2171 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2172 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2173 #[doc = " can be changed in each control frame using SetReference()."]
2174 #[doc = ""]
2175 #[doc = " @return REVLibError::kOk if successful"]
2176 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController27SetSmartMotionAccelStrategyENS0_13AccelStrategyEi"]
2177 pub fn SparkMaxPIDController_SetSmartMotionAccelStrategy(
2178 this: *mut root::rev::SparkMaxPIDController,
2179 accelStrategy: root::rev::SparkMaxPIDController_AccelStrategy,
2180 slotID: ::std::os::raw::c_int,
2181 ) -> root::rev::REVLibError;
2182 }
2183 extern "C" {
2184 #[doc = " Get the acceleration strategy used to control acceleration on the motor."]
2185 #[doc = " The current strategy is trapezoidal motion profiling."]
2186 #[doc = ""]
2187 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2188 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2189 #[doc = " can be changed in each control frame using SetReference()."]
2190 #[doc = ""]
2191 #[doc = " @return The acceleration strategy to use for the automatically generated"]
2192 #[doc = " motion profile"]
2193 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController27GetSmartMotionAccelStrategyEi"]
2194 pub fn SparkMaxPIDController_GetSmartMotionAccelStrategy(
2195 this: *const root::rev::SparkMaxPIDController,
2196 slotID: ::std::os::raw::c_int,
2197 ) -> root::rev::SparkMaxPIDController_AccelStrategy;
2198 }
2199 impl SparkMaxPIDController {
2200 #[inline]
2201 pub unsafe fn SetReference(
2202 &mut self,
2203 value: f64,
2204 ctrl: root::rev::CANSparkMaxLowLevel_ControlType,
2205 pidSlot: ::std::os::raw::c_int,
2206 arbFeedforward: f64,
2207 arbFFUnits: root::rev::SparkMaxPIDController_ArbFFUnits,
2208 ) -> root::rev::REVLibError {
2209 SparkMaxPIDController_SetReference(
2210 self,
2211 value,
2212 ctrl,
2213 pidSlot,
2214 arbFeedforward,
2215 arbFFUnits,
2216 )
2217 }
2218 #[inline]
2219 pub unsafe fn SetSmartMotionAccelStrategy(
2220 &mut self,
2221 accelStrategy: root::rev::SparkMaxPIDController_AccelStrategy,
2222 slotID: ::std::os::raw::c_int,
2223 ) -> root::rev::REVLibError {
2224 SparkMaxPIDController_SetSmartMotionAccelStrategy(self, accelStrategy, slotID)
2225 }
2226 #[inline]
2227 pub unsafe fn GetSmartMotionAccelStrategy(
2228 &self,
2229 slotID: ::std::os::raw::c_int,
2230 ) -> root::rev::SparkMaxPIDController_AccelStrategy {
2231 SparkMaxPIDController_GetSmartMotionAccelStrategy(self, slotID)
2232 }
2233 }
2234 extern "C" {
2235 #[doc = " Set the controller reference value based on the selected control mode."]
2236 #[doc = ""]
2237 #[doc = " @param value The value to set depending on the control mode. For basic"]
2238 #[doc = " duty cycle control this should be a value between -1 and 1"]
2239 #[doc = " Otherwise: Voltage Control: Voltage (volts) Velocity Control: Velocity"]
2240 #[doc = " (RPM) Position Control: Position (Rotations) Current Control: Current"]
2241 #[doc = " (Amps). The units can be changed for position and velocity by a scale"]
2242 #[doc = " factor using setPositionConversionFactor()."]
2243 #[doc = ""]
2244 #[doc = " @param ctrl Is the control type"]
2245 #[doc = ""]
2246 #[doc = " @param pidSlot for this command"]
2247 #[doc = ""]
2248 #[doc = " @param arbFeedforward A value from -32.0 to 32.0 which is a voltage"]
2249 #[doc = " applied to the motor after the result of the specified control mode. The"]
2250 #[doc = " units for the parameter is Volts. This value is set after the control"]
2251 #[doc = " mode, but before any current limits or ramp rates."]
2252 #[doc = ""]
2253 #[doc = " @return REVLibError::kOk if successful"]
2254 #[doc = ""]
2255 #[doc = " @deprecated Use SparkMaxPIDController::SetReference(double,"]
2256 #[doc = " CANSparkMax::ControlType, int, double, SparkMaxPIDController::ArbFFUnits)"]
2257 #[doc = " instead"]
2258 #[doc = ""]
2259 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController12SetReferenceEdNS_11ControlTypeEidNS_16CANPIDController10ArbFFUnitsE"]
2260 pub fn SparkMaxPIDController_SetReference1(
2261 this: *mut ::std::os::raw::c_void,
2262 value: f64,
2263 ctrl: root::rev::ControlType,
2264 pidSlot: ::std::os::raw::c_int,
2265 arbFeedforward: f64,
2266 arbFFUnits: root::rev::CANPIDController_ArbFFUnits,
2267 ) -> root::rev::REVLibError;
2268 }
2269 extern "C" {
2270 #[doc = " Set the Proportional Gain constant of the PIDF controller on the SPARK"]
2271 #[doc = " MAX. This uses the Set Parameter API and should be used infrequently. The"]
2272 #[doc = " parameter does not presist unless burnFlash() is called. The recommended"]
2273 #[doc = " method to configure this parameter is use to SPARK MAX GUI to tune and"]
2274 #[doc = " save parameters."]
2275 #[doc = ""]
2276 #[doc = " @param gain The proportional gain value, must be positive"]
2277 #[doc = ""]
2278 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2279 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2280 #[doc = " can be changed in each control frame using SetReference()."]
2281 #[doc = ""]
2282 #[doc = " @return REVLibError::kOk if successful"]
2283 #[doc = ""]
2284 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController4SetPEdi"]
2285 pub fn SparkMaxPIDController_SetP(
2286 this: *mut ::std::os::raw::c_void,
2287 gain: f64,
2288 slotID: ::std::os::raw::c_int,
2289 ) -> root::rev::REVLibError;
2290 }
2291 extern "C" {
2292 #[doc = " Set the Integral Gain constant of the PIDF controller on the SPARK MAX."]
2293 #[doc = " This uses the Set Parameter API and should be used infrequently. The"]
2294 #[doc = " parameter does not presist unless burnFlash() is called. The recommended"]
2295 #[doc = " method to configure this parameter is use to SPARK MAX GUI to tune and"]
2296 #[doc = " save parameters."]
2297 #[doc = ""]
2298 #[doc = " @param gain The integral gain value, must be positive"]
2299 #[doc = ""]
2300 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2301 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2302 #[doc = " can be changed in each control frame using SetReference()."]
2303 #[doc = ""]
2304 #[doc = " @return REVLibError::kOk if successful"]
2305 #[doc = ""]
2306 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController4SetIEdi"]
2307 pub fn SparkMaxPIDController_SetI(
2308 this: *mut ::std::os::raw::c_void,
2309 gain: f64,
2310 slotID: ::std::os::raw::c_int,
2311 ) -> root::rev::REVLibError;
2312 }
2313 extern "C" {
2314 #[doc = " Set the Derivative Gain constant of the PIDF controller on the SPARK MAX."]
2315 #[doc = " This uses the Set Parameter API and should be used infrequently. The"]
2316 #[doc = " parameter does not presist unless burnFlash() is called. The recommended"]
2317 #[doc = " method to configure this parameter is use to SPARK MAX GUI to tune and"]
2318 #[doc = " save parameters."]
2319 #[doc = ""]
2320 #[doc = " @param gain The derivative gain value, must be positive"]
2321 #[doc = ""]
2322 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2323 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2324 #[doc = " can be changed in each control frame using SetReference()."]
2325 #[doc = ""]
2326 #[doc = " @return REVLibError::kOk if successful"]
2327 #[doc = ""]
2328 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController4SetDEdi"]
2329 pub fn SparkMaxPIDController_SetD(
2330 this: *mut ::std::os::raw::c_void,
2331 gain: f64,
2332 slotID: ::std::os::raw::c_int,
2333 ) -> root::rev::REVLibError;
2334 }
2335 extern "C" {
2336 #[doc = " Set the Derivative Filter constant of the PIDF controller on the SPARK"]
2337 #[doc = " MAX. This uses the Set Parameter API and should be used infrequently. The"]
2338 #[doc = " parameter does not presist unless burnFlash() is called."]
2339 #[doc = ""]
2340 #[doc = " @param gain The derivative filter value, must be a positive number"]
2341 #[doc = " between 0 and 1"]
2342 #[doc = ""]
2343 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2344 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2345 #[doc = " can be changed in each control frame using SetReference()."]
2346 #[doc = ""]
2347 #[doc = " @return REVLibError::kOk if successful"]
2348 #[doc = ""]
2349 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController10SetDFilterEdi"]
2350 pub fn SparkMaxPIDController_SetDFilter(
2351 this: *mut ::std::os::raw::c_void,
2352 gain: f64,
2353 slotID: ::std::os::raw::c_int,
2354 ) -> root::rev::REVLibError;
2355 }
2356 extern "C" {
2357 #[doc = " Set the Feed-froward Gain constant of the PIDF controller on the SPARK"]
2358 #[doc = " MAX. This uses the Set Parameter API and should be used infrequently. The"]
2359 #[doc = " parameter does not presist unless burnFlash() is called. The recommended"]
2360 #[doc = " method to configure this parameter is use to SPARK MAX GUI to tune and"]
2361 #[doc = " save parameters."]
2362 #[doc = ""]
2363 #[doc = " @param gain The feed-forward gain value"]
2364 #[doc = ""]
2365 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2366 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2367 #[doc = " can be changed in each control frame using SetReference()."]
2368 #[doc = ""]
2369 #[doc = " @return REVLibError::kOk if successful"]
2370 #[doc = ""]
2371 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController5SetFFEdi"]
2372 pub fn SparkMaxPIDController_SetFF(
2373 this: *mut ::std::os::raw::c_void,
2374 gain: f64,
2375 slotID: ::std::os::raw::c_int,
2376 ) -> root::rev::REVLibError;
2377 }
2378 extern "C" {
2379 #[doc = " Set the IZone range of the PIDF controller on the SPARK MAX. This value"]
2380 #[doc = " specifies the range the |error| must be within for the integral constant"]
2381 #[doc = " to take effect."]
2382 #[doc = ""]
2383 #[doc = " This uses the Set Parameter API and should be used infrequently."]
2384 #[doc = " The parameter does not presist unless burnFlash() is called."]
2385 #[doc = " The recommended method to configure this parameter is to use the"]
2386 #[doc = " SPARK MAX GUI to tune and save parameters."]
2387 #[doc = ""]
2388 #[doc = " @param IZone The IZone value, must be positive. Set to 0 to disable"]
2389 #[doc = ""]
2390 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2391 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2392 #[doc = " can be changed in each control frame using SetReference()."]
2393 #[doc = ""]
2394 #[doc = " @return REVLibError::kOk if successful"]
2395 #[doc = ""]
2396 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController8SetIZoneEdi"]
2397 pub fn SparkMaxPIDController_SetIZone(
2398 this: *mut ::std::os::raw::c_void,
2399 IZone: f64,
2400 slotID: ::std::os::raw::c_int,
2401 ) -> root::rev::REVLibError;
2402 }
2403 extern "C" {
2404 #[doc = " Set the min amd max output for the closed loop mode."]
2405 #[doc = ""]
2406 #[doc = " This uses the Set Parameter API and should be used infrequently."]
2407 #[doc = " The parameter does not presist unless burnFlash() is called."]
2408 #[doc = " The recommended method to configure this parameter is to use the"]
2409 #[doc = " SPARK MAX GUI to tune and save parameters."]
2410 #[doc = ""]
2411 #[doc = " @param min Reverse power minimum to allow the controller to output"]
2412 #[doc = ""]
2413 #[doc = " @param max Forward power maximum to allow the controller to output"]
2414 #[doc = ""]
2415 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2416 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2417 #[doc = " can be changed in each control frame using SetReference()."]
2418 #[doc = ""]
2419 #[doc = " @return REVLibError::kOk if successful"]
2420 #[doc = ""]
2421 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController14SetOutputRangeEddi"]
2422 pub fn SparkMaxPIDController_SetOutputRange(
2423 this: *mut ::std::os::raw::c_void,
2424 min: f64,
2425 max: f64,
2426 slotID: ::std::os::raw::c_int,
2427 ) -> root::rev::REVLibError;
2428 }
2429 extern "C" {
2430 #[doc = " Get the Proportional Gain constant of the PIDF controller on the SPARK"]
2431 #[doc = " MAX."]
2432 #[doc = ""]
2433 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2434 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2435 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2436 #[doc = " calling SetCANTimeout(int milliseconds)"]
2437 #[doc = ""]
2438 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2439 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2440 #[doc = " can be changed in each control frame using SetReference()."]
2441 #[doc = ""]
2442 #[doc = " @return double P Gain value"]
2443 #[doc = ""]
2444 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController4GetPEi"]
2445 pub fn SparkMaxPIDController_GetP(
2446 this: *mut ::std::os::raw::c_void,
2447 slotID: ::std::os::raw::c_int,
2448 ) -> f64;
2449 }
2450 extern "C" {
2451 #[doc = " Get the Integral Gain constant of the PIDF controller on the SPARK MAX."]
2452 #[doc = ""]
2453 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2454 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2455 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2456 #[doc = " calling SetCANTimeout(int milliseconds)"]
2457 #[doc = ""]
2458 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2459 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2460 #[doc = " can be changed in each control frame using SetReference()."]
2461 #[doc = ""]
2462 #[doc = " @return double I Gain value"]
2463 #[doc = ""]
2464 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController4GetIEi"]
2465 pub fn SparkMaxPIDController_GetI(
2466 this: *mut ::std::os::raw::c_void,
2467 slotID: ::std::os::raw::c_int,
2468 ) -> f64;
2469 }
2470 extern "C" {
2471 #[doc = " Get the Derivative Gain constant of the PIDF controller on the SPARK MAX."]
2472 #[doc = ""]
2473 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2474 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2475 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2476 #[doc = " calling SetCANTimeout(int milliseconds)"]
2477 #[doc = ""]
2478 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2479 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2480 #[doc = " can be changed in each control frame using SetReference()."]
2481 #[doc = ""]
2482 #[doc = " @return double D Gain value"]
2483 #[doc = ""]
2484 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController4GetDEi"]
2485 pub fn SparkMaxPIDController_GetD(
2486 this: *mut ::std::os::raw::c_void,
2487 slotID: ::std::os::raw::c_int,
2488 ) -> f64;
2489 }
2490 extern "C" {
2491 #[doc = " Get the Derivative Filter constant of the PIDF controller on the SPARK"]
2492 #[doc = " MAX."]
2493 #[doc = ""]
2494 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2495 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2496 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2497 #[doc = " calling SetCANTimeout(int milliseconds)"]
2498 #[doc = ""]
2499 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2500 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2501 #[doc = " can be changed in each control frame using SetReference()."]
2502 #[doc = ""]
2503 #[doc = " @return double D Filter value"]
2504 #[doc = ""]
2505 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController10GetDFilterEi"]
2506 pub fn SparkMaxPIDController_GetDFilter(
2507 this: *mut ::std::os::raw::c_void,
2508 slotID: ::std::os::raw::c_int,
2509 ) -> f64;
2510 }
2511 extern "C" {
2512 #[doc = " Get the Feed-forward Gain constant of the PIDF controller on the SPARK"]
2513 #[doc = " MAX."]
2514 #[doc = ""]
2515 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2516 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2517 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2518 #[doc = " calling SetCANTimeout(int milliseconds)"]
2519 #[doc = ""]
2520 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2521 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2522 #[doc = " can be changed in each control frame using SetReference()."]
2523 #[doc = ""]
2524 #[doc = " @return double F Gain value"]
2525 #[doc = ""]
2526 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController5GetFFEi"]
2527 pub fn SparkMaxPIDController_GetFF(
2528 this: *mut ::std::os::raw::c_void,
2529 slotID: ::std::os::raw::c_int,
2530 ) -> f64;
2531 }
2532 extern "C" {
2533 #[doc = " Get the IZone constant of the PIDF controller on the SPARK MAX."]
2534 #[doc = ""]
2535 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2536 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2537 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2538 #[doc = " calling SetCANTimeout(int milliseconds)"]
2539 #[doc = ""]
2540 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2541 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2542 #[doc = " can be changed in each control frame using SetReference()."]
2543 #[doc = ""]
2544 #[doc = " @return double IZone value"]
2545 #[doc = ""]
2546 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController8GetIZoneEi"]
2547 pub fn SparkMaxPIDController_GetIZone(
2548 this: *mut ::std::os::raw::c_void,
2549 slotID: ::std::os::raw::c_int,
2550 ) -> f64;
2551 }
2552 extern "C" {
2553 #[doc = " Get the min output of the PIDF controller on the SPARK MAX."]
2554 #[doc = ""]
2555 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2556 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2557 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2558 #[doc = " calling SetCANTimeout(int milliseconds)"]
2559 #[doc = ""]
2560 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2561 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2562 #[doc = " can be changed in each control frame using SetReference()."]
2563 #[doc = ""]
2564 #[doc = " @return double min value"]
2565 #[doc = ""]
2566 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController12GetOutputMinEi"]
2567 pub fn SparkMaxPIDController_GetOutputMin(
2568 this: *mut ::std::os::raw::c_void,
2569 slotID: ::std::os::raw::c_int,
2570 ) -> f64;
2571 }
2572 extern "C" {
2573 #[doc = " Get the max output of the PIDF controller on the SPARK MAX."]
2574 #[doc = ""]
2575 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
2576 #[doc = " function uses a non-blocking call and will return a cached value if the"]
2577 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
2578 #[doc = " calling SetCANTimeout(int milliseconds)"]
2579 #[doc = ""]
2580 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2581 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2582 #[doc = " can be changed in each control frame using SetReference()."]
2583 #[doc = ""]
2584 #[doc = " @return double max value"]
2585 #[doc = ""]
2586 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController12GetOutputMaxEi"]
2587 pub fn SparkMaxPIDController_GetOutputMax(
2588 this: *mut ::std::os::raw::c_void,
2589 slotID: ::std::os::raw::c_int,
2590 ) -> f64;
2591 }
2592 extern "C" {
2593 #[doc = " Configure the maximum velocity of the SmartMotion mode. This is the"]
2594 #[doc = " velocity that is reached in the middle of the profile and is what the"]
2595 #[doc = " motor should spend most of its time at"]
2596 #[doc = ""]
2597 #[doc = " @param maxVel The maxmimum cruise velocity for the motion profile in RPM"]
2598 #[doc = ""]
2599 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2600 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2601 #[doc = " can be changed in each control frame using SetReference()."]
2602 #[doc = ""]
2603 #[doc = " @return REVLibError::kOk if successful"]
2604 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController25SetSmartMotionMaxVelocityEdi"]
2605 pub fn SparkMaxPIDController_SetSmartMotionMaxVelocity(
2606 this: *mut ::std::os::raw::c_void,
2607 maxVel: f64,
2608 slotID: ::std::os::raw::c_int,
2609 ) -> root::rev::REVLibError;
2610 }
2611 extern "C" {
2612 #[doc = " Configure the maximum acceleration of the SmartMotion mode. This is the"]
2613 #[doc = " accleration that the motor velocity will increase at until the max"]
2614 #[doc = " velocity is reached"]
2615 #[doc = ""]
2616 #[doc = " @param maxAccel The maxmimum acceleration for the motion profile in RPM"]
2617 #[doc = " per second"]
2618 #[doc = ""]
2619 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2620 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2621 #[doc = " can be changed in each control frame using SetReference()."]
2622 #[doc = ""]
2623 #[doc = " @return REVLibError::kOk if successful"]
2624 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController22SetSmartMotionMaxAccelEdi"]
2625 pub fn SparkMaxPIDController_SetSmartMotionMaxAccel(
2626 this: *mut ::std::os::raw::c_void,
2627 maxAccel: f64,
2628 slotID: ::std::os::raw::c_int,
2629 ) -> root::rev::REVLibError;
2630 }
2631 extern "C" {
2632 #[doc = " Configure the mimimum velocity of the SmartMotion mode. Any requested"]
2633 #[doc = " velocities below this value will be set to 0."]
2634 #[doc = ""]
2635 #[doc = " @param minVel The minimum velocity for the motion profile in RPM"]
2636 #[doc = ""]
2637 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2638 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2639 #[doc = " can be changed in each control frame using SetReference()."]
2640 #[doc = ""]
2641 #[doc = " @return REVLibError::kOk if successful"]
2642 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController31SetSmartMotionMinOutputVelocityEdi"]
2643 pub fn SparkMaxPIDController_SetSmartMotionMinOutputVelocity(
2644 this: *mut ::std::os::raw::c_void,
2645 minVel: f64,
2646 slotID: ::std::os::raw::c_int,
2647 ) -> root::rev::REVLibError;
2648 }
2649 extern "C" {
2650 #[doc = " Configure the allowed closed loop error of SmartMotion mode. This value"]
2651 #[doc = " is how much deviation from your setpoint is tolerated and is useful in"]
2652 #[doc = " preventing oscillation around your setpoint."]
2653 #[doc = ""]
2654 #[doc = " @param allowedErr The allowed deviation for your setpoint vs actual"]
2655 #[doc = " position in rotations"]
2656 #[doc = ""]
2657 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2658 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2659 #[doc = " can be changed in each control frame using SetReference()."]
2660 #[doc = ""]
2661 #[doc = " @return REVLibError::kOk if successful"]
2662 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController36SetSmartMotionAllowedClosedLoopErrorEdi"]
2663 pub fn SparkMaxPIDController_SetSmartMotionAllowedClosedLoopError(
2664 this: *mut ::std::os::raw::c_void,
2665 allowedErr: f64,
2666 slotID: ::std::os::raw::c_int,
2667 ) -> root::rev::REVLibError;
2668 }
2669 extern "C" {
2670 #[doc = " NOTE: As of the 2022 FRC season, the firmware only supports the"]
2671 #[doc = " trapezoidal motion profiling acceleration strategy."]
2672 #[doc = ""]
2673 #[doc = " Configure the acceleration strategy used to control acceleration on the"]
2674 #[doc = " motor."]
2675 #[doc = ""]
2676 #[doc = " @param accelStrategy The acceleration strategy to use for the"]
2677 #[doc = " automatically generated motion profile"]
2678 #[doc = ""]
2679 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2680 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2681 #[doc = " can be changed in each control frame using SetReference()."]
2682 #[doc = ""]
2683 #[doc = " @return REVLibError::kOk if successful"]
2684 #[doc = ""]
2685 #[doc = " @deprecated Use"]
2686 #[doc = " SetSmartMotionAccelStrategy(SparkMaxPIDController::AccelStrategy, int)"]
2687 #[doc = " instead"]
2688 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController27SetSmartMotionAccelStrategyENS_16CANPIDController13AccelStrategyEi"]
2689 pub fn SparkMaxPIDController_SetSmartMotionAccelStrategy1(
2690 this: *mut ::std::os::raw::c_void,
2691 accelStrategy: root::rev::CANPIDController_AccelStrategy,
2692 slotID: ::std::os::raw::c_int,
2693 ) -> root::rev::REVLibError;
2694 }
2695 extern "C" {
2696 #[doc = " Get the maximum velocity of the SmartMotion mode. This is the velocity"]
2697 #[doc = " that is reached in the middle of the profile and is what the motor should"]
2698 #[doc = " spend most of its time at"]
2699 #[doc = ""]
2700 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2701 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2702 #[doc = " can be changed in each control frame using SetReference()."]
2703 #[doc = ""]
2704 #[doc = " @return The maxmimum cruise velocity for the motion profile in RPM"]
2705 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController25GetSmartMotionMaxVelocityEi"]
2706 pub fn SparkMaxPIDController_GetSmartMotionMaxVelocity(
2707 this: *mut ::std::os::raw::c_void,
2708 slotID: ::std::os::raw::c_int,
2709 ) -> f64;
2710 }
2711 extern "C" {
2712 #[doc = " Get the maximum acceleration of the SmartMotion mode. This is the"]
2713 #[doc = " accleration that the motor velocity will increase at until the max"]
2714 #[doc = " velocity is reached"]
2715 #[doc = ""]
2716 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2717 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2718 #[doc = " can be changed in each control frame using SetReference()."]
2719 #[doc = ""]
2720 #[doc = " @return The maxmimum acceleration for the motion profile in RPM per"]
2721 #[doc = " second"]
2722 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController22GetSmartMotionMaxAccelEi"]
2723 pub fn SparkMaxPIDController_GetSmartMotionMaxAccel(
2724 this: *mut ::std::os::raw::c_void,
2725 slotID: ::std::os::raw::c_int,
2726 ) -> f64;
2727 }
2728 extern "C" {
2729 #[doc = " Get the mimimum velocity of the SmartMotion mode. Any requested"]
2730 #[doc = " velocities below this value will be set to 0."]
2731 #[doc = ""]
2732 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2733 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2734 #[doc = " can be changed in each control frame using SetReference()."]
2735 #[doc = ""]
2736 #[doc = " @return The minimum velocity for the motion profile in RPM"]
2737 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController31GetSmartMotionMinOutputVelocityEi"]
2738 pub fn SparkMaxPIDController_GetSmartMotionMinOutputVelocity(
2739 this: *mut ::std::os::raw::c_void,
2740 slotID: ::std::os::raw::c_int,
2741 ) -> f64;
2742 }
2743 extern "C" {
2744 #[doc = " Get the allowed closed loop error of SmartMotion mode. This value is how"]
2745 #[doc = " much deviation from your setpoint is tolerated and is useful in"]
2746 #[doc = " preventing oscillation around your setpoint."]
2747 #[doc = ""]
2748 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2749 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2750 #[doc = " can be changed in each control frame using SetReference()."]
2751 #[doc = ""]
2752 #[doc = " @return The allowed deviation for your setpoint vs actual position in"]
2753 #[doc = " rotations"]
2754 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController36GetSmartMotionAllowedClosedLoopErrorEi"]
2755 pub fn SparkMaxPIDController_GetSmartMotionAllowedClosedLoopError(
2756 this: *mut ::std::os::raw::c_void,
2757 slotID: ::std::os::raw::c_int,
2758 ) -> f64;
2759 }
2760 extern "C" {
2761 #[doc = " Configure the maximum I accumulator of the PID controller. This value is"]
2762 #[doc = " used to constrain the I accumulator to help manage integral wind-up"]
2763 #[doc = ""]
2764 #[doc = " @param iMaxAccum The max value to contrain the I accumulator to"]
2765 #[doc = ""]
2766 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2767 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2768 #[doc = " can be changed in each control frame using SetReference()."]
2769 #[doc = ""]
2770 #[doc = " @return REVLibError::kOk if successful"]
2771 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController12SetIMaxAccumEdi"]
2772 pub fn SparkMaxPIDController_SetIMaxAccum(
2773 this: *mut ::std::os::raw::c_void,
2774 iMaxAccum: f64,
2775 slotID: ::std::os::raw::c_int,
2776 ) -> root::rev::REVLibError;
2777 }
2778 extern "C" {
2779 #[doc = " Get the maximum I accumulator of the PID controller. This value is used"]
2780 #[doc = " to constrain the I accumulator to help manage integral wind-up"]
2781 #[doc = ""]
2782 #[doc = " @param slotID Is the gain schedule slot, the value is a number"]
2783 #[doc = " between 0 and 3. Each slot has its own set of gain values and"]
2784 #[doc = " can be changed in each control frame using SetReference()."]
2785 #[doc = ""]
2786 #[doc = " @return The max value to contrain the I accumulator to"]
2787 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController12GetIMaxAccumEi"]
2788 pub fn SparkMaxPIDController_GetIMaxAccum(
2789 this: *mut ::std::os::raw::c_void,
2790 slotID: ::std::os::raw::c_int,
2791 ) -> f64;
2792 }
2793 extern "C" {
2794 #[doc = " Set the I accumulator of the PID controller. This is useful when wishing"]
2795 #[doc = " to force a reset on the I accumulator of the PID controller. You can also"]
2796 #[doc = " preset values to see how it will respond to certain I characteristics"]
2797 #[doc = ""]
2798 #[doc = " To use this function, the controller must be in a closed loop control"]
2799 #[doc = " mode by calling setReference()"]
2800 #[doc = ""]
2801 #[doc = " @param iAccum The value to set the I accumulator to"]
2802 #[doc = ""]
2803 #[doc = " @return REVLibError::kOk if successful"]
2804 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController9SetIAccumEd"]
2805 pub fn SparkMaxPIDController_SetIAccum(
2806 this: *mut ::std::os::raw::c_void,
2807 iAccum: f64,
2808 ) -> root::rev::REVLibError;
2809 }
2810 extern "C" {
2811 #[doc = " Get the I accumulator of the PID controller. This is useful when wishing"]
2812 #[doc = " to see what the I accumulator value is to help with PID tuning"]
2813 #[doc = ""]
2814 #[doc = " @return The value of the I accumulator"]
2815 #[link_name = "\u{1}_ZNK3rev21SparkMaxPIDController9GetIAccumEv"]
2816 pub fn SparkMaxPIDController_GetIAccum(this: *mut ::std::os::raw::c_void) -> f64;
2817 }
2818 extern "C" {
2819 #[doc = " Set the controller's feedback device."]
2820 #[doc = ""]
2821 #[doc = " The default feedback device is assumed to be the integrated encoder."]
2822 #[doc = " This is used to changed to another feedback device for the controller,"]
2823 #[doc = " such as an analog sensor."]
2824 #[doc = ""]
2825 #[doc = " If there is a limited range on the feedback sensor that should be"]
2826 #[doc = " observed by the PIDController, it can be set by calling"]
2827 #[doc = " SetFeedbackSensorRange() on the sensor object."]
2828 #[doc = ""]
2829 #[doc = " @param sensor The sensor to be used as a feedback device"]
2830 #[doc = ""]
2831 #[doc = " @return REVLibError::kOk if successful"]
2832 #[link_name = "\u{1}_ZN3rev21SparkMaxPIDController17SetFeedbackDeviceERKNS_9CANSensorE"]
2833 pub fn SparkMaxPIDController_SetFeedbackDevice(
2834 this: *mut ::std::os::raw::c_void,
2835 sensor: *const root::rev::CANSensor,
2836 ) -> root::rev::REVLibError;
2837 }
2838 #[doc = " Get an instance of this class by using CANSparkMax::GetEncoder() or"]
2839 #[doc = " CANSparkMax::GetEncoder(SparkMaxRelativeEncoder::Type, int)."]
2840 #[repr(C)]
2841 #[derive(Debug)]
2842 pub struct SparkMaxRelativeEncoder {
2843 pub _base: root::rev::RelativeEncoder,
2844 pub m_device: *mut root::rev::CANSparkMax,
2845 pub m_countsPerRev: ::std::os::raw::c_int,
2846 }
2847 pub const SparkMaxRelativeEncoder_Type_kNoSensor: root::rev::SparkMaxRelativeEncoder_Type =
2848 0;
2849 pub const SparkMaxRelativeEncoder_Type_kHallSensor:
2850 root::rev::SparkMaxRelativeEncoder_Type = 1;
2851 pub const SparkMaxRelativeEncoder_Type_kQuadrature:
2852 root::rev::SparkMaxRelativeEncoder_Type = 2;
2853 #[doc = " The type of encoder connected to a SPARK MAX"]
2854 pub type SparkMaxRelativeEncoder_Type = ::std::os::raw::c_int;
2855 #[test]
2856 fn bindgen_test_layout_SparkMaxRelativeEncoder() {
2857 assert_eq!(
2858 ::std::mem::size_of::<SparkMaxRelativeEncoder>(),
2859 24usize,
2860 concat!("Size of: ", stringify!(SparkMaxRelativeEncoder))
2861 );
2862 assert_eq!(
2863 ::std::mem::align_of::<SparkMaxRelativeEncoder>(),
2864 8usize,
2865 concat!("Alignment of ", stringify!(SparkMaxRelativeEncoder))
2866 );
2867 fn test_field_m_device() {
2868 assert_eq!(
2869 unsafe {
2870 let uninit = ::std::mem::MaybeUninit::<SparkMaxRelativeEncoder>::uninit();
2871 let ptr = uninit.as_ptr();
2872 ::std::ptr::addr_of!((*ptr).m_device) as usize - ptr as usize
2873 },
2874 8usize,
2875 concat!(
2876 "Offset of field: ",
2877 stringify!(SparkMaxRelativeEncoder),
2878 "::",
2879 stringify!(m_device)
2880 )
2881 );
2882 }
2883 test_field_m_device();
2884 fn test_field_m_countsPerRev() {
2885 assert_eq!(
2886 unsafe {
2887 let uninit = ::std::mem::MaybeUninit::<SparkMaxRelativeEncoder>::uninit();
2888 let ptr = uninit.as_ptr();
2889 ::std::ptr::addr_of!((*ptr).m_countsPerRev) as usize - ptr as usize
2890 },
2891 16usize,
2892 concat!(
2893 "Offset of field: ",
2894 stringify!(SparkMaxRelativeEncoder),
2895 "::",
2896 stringify!(m_countsPerRev)
2897 )
2898 );
2899 }
2900 test_field_m_countsPerRev();
2901 }
2902 extern "C" {
2903 #[doc = " Get the position of the motor. This returns the native units"]
2904 #[doc = " of 'rotations' by default, and can be changed by a scale factor"]
2905 #[doc = " using setPositionConversionFactor()."]
2906 #[doc = ""]
2907 #[doc = " @return Number of rotations of the motor"]
2908 #[doc = ""]
2909 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder11GetPositionEv"]
2910 pub fn SparkMaxRelativeEncoder_GetPosition(this: *mut ::std::os::raw::c_void) -> f64;
2911 }
2912 extern "C" {
2913 #[doc = " Get the velocity of the motor. This returns the native units"]
2914 #[doc = " of 'RPM' by default, and can be changed by a scale factor"]
2915 #[doc = " using setVelocityConversionFactor()."]
2916 #[doc = ""]
2917 #[doc = " @return Number the RPM of the motor"]
2918 #[doc = ""]
2919 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder11GetVelocityEv"]
2920 pub fn SparkMaxRelativeEncoder_GetVelocity(this: *mut ::std::os::raw::c_void) -> f64;
2921 }
2922 extern "C" {
2923 #[doc = " Set the position of the encoder."]
2924 #[doc = ""]
2925 #[doc = " @param position Number of rotations of the motor"]
2926 #[doc = ""]
2927 #[doc = " @return REVLibError::kOk if successful"]
2928 #[link_name = "\u{1}_ZN3rev23SparkMaxRelativeEncoder11SetPositionEd"]
2929 pub fn SparkMaxRelativeEncoder_SetPosition(
2930 this: *mut ::std::os::raw::c_void,
2931 position: f64,
2932 ) -> root::rev::REVLibError;
2933 }
2934 extern "C" {
2935 #[doc = " Set the conversion factor for position of the encoder. Multiplied by the"]
2936 #[doc = " native output units to give you position"]
2937 #[doc = ""]
2938 #[doc = " @param factor The conversion factor to multiply the native units by"]
2939 #[doc = ""]
2940 #[doc = " @return REVLibError::kOk if successful"]
2941 #[link_name = "\u{1}_ZN3rev23SparkMaxRelativeEncoder27SetPositionConversionFactorEd"]
2942 pub fn SparkMaxRelativeEncoder_SetPositionConversionFactor(
2943 this: *mut ::std::os::raw::c_void,
2944 factor: f64,
2945 ) -> root::rev::REVLibError;
2946 }
2947 extern "C" {
2948 #[doc = " Set the conversion factor for velocity of the encoder. Multiplied by the"]
2949 #[doc = " native output units to give you velocity"]
2950 #[doc = ""]
2951 #[doc = " @param factor The conversion factor to multiply the native units by"]
2952 #[doc = ""]
2953 #[doc = " @return REVLibError::kOk if successful"]
2954 #[link_name = "\u{1}_ZN3rev23SparkMaxRelativeEncoder27SetVelocityConversionFactorEd"]
2955 pub fn SparkMaxRelativeEncoder_SetVelocityConversionFactor(
2956 this: *mut ::std::os::raw::c_void,
2957 factor: f64,
2958 ) -> root::rev::REVLibError;
2959 }
2960 extern "C" {
2961 #[doc = " Get the conversion factor for position of the encoder. Multiplied by the"]
2962 #[doc = " native output units to give you position"]
2963 #[doc = ""]
2964 #[doc = " @return The conversion factor for position"]
2965 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder27GetPositionConversionFactorEv"]
2966 pub fn SparkMaxRelativeEncoder_GetPositionConversionFactor(
2967 this: *mut ::std::os::raw::c_void,
2968 ) -> f64;
2969 }
2970 extern "C" {
2971 #[doc = " Get the conversion factor for velocity of the encoder. Multiplied by the"]
2972 #[doc = " native output units to give you velocity"]
2973 #[doc = ""]
2974 #[doc = " @return The conversion factor for velocity"]
2975 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder27GetVelocityConversionFactorEv"]
2976 pub fn SparkMaxRelativeEncoder_GetVelocityConversionFactor(
2977 this: *mut ::std::os::raw::c_void,
2978 ) -> f64;
2979 }
2980 extern "C" {
2981 #[doc = " Set the average sampling depth for a quadrature encoder. This value"]
2982 #[doc = " sets the number of samples in the average for velocity readings. This"]
2983 #[doc = " can be any value from 1 to 64."]
2984 #[doc = ""]
2985 #[doc = " When the SparkMax controller is in Brushless mode, this"]
2986 #[doc = " will not change any behavior."]
2987 #[doc = ""]
2988 #[doc = " @param depth The average sampling depth between 1 and 64 (default)"]
2989 #[doc = ""]
2990 #[doc = " @return REVLibError::kOk if successful"]
2991 #[link_name = "\u{1}_ZN3rev23SparkMaxRelativeEncoder15SetAverageDepthEj"]
2992 pub fn SparkMaxRelativeEncoder_SetAverageDepth(
2993 this: *mut ::std::os::raw::c_void,
2994 depth: u32,
2995 ) -> root::rev::REVLibError;
2996 }
2997 extern "C" {
2998 #[doc = " Set the measurement period for velocity measurements of a quadrature"]
2999 #[doc = " encoder. When the SparkMax controller is in Brushless mode, this will not"]
3000 #[doc = " change any behavior."]
3001 #[doc = ""]
3002 #[doc = " The basic formula to calculate velocity is change in positon / change in"]
3003 #[doc = " time. This parameter sets the change in time for measurement."]
3004 #[doc = ""]
3005 #[doc = " @param period_ms Measurement period in milliseconds. This number may be"]
3006 #[doc = " between 1 and 100 (default)."]
3007 #[doc = ""]
3008 #[doc = " @return REVLibError::kOk if successful"]
3009 #[link_name = "\u{1}_ZN3rev23SparkMaxRelativeEncoder20SetMeasurementPeriodEj"]
3010 pub fn SparkMaxRelativeEncoder_SetMeasurementPeriod(
3011 this: *mut ::std::os::raw::c_void,
3012 period_ms: u32,
3013 ) -> root::rev::REVLibError;
3014 }
3015 extern "C" {
3016 #[doc = " Get the average sampling depth for a quadrature encoder."]
3017 #[doc = ""]
3018 #[doc = " @return The average sampling depth"]
3019 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder15GetAverageDepthEv"]
3020 pub fn SparkMaxRelativeEncoder_GetAverageDepth(
3021 this: *mut ::std::os::raw::c_void,
3022 ) -> u32;
3023 }
3024 extern "C" {
3025 #[doc = " Get the number of samples for reading from a quadrature encoder. This"]
3026 #[doc = " value sets the number of samples in the average for velocity readings."]
3027 #[doc = ""]
3028 #[doc = " @return Measurement period in microseconds"]
3029 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder20GetMeasurementPeriodEv"]
3030 pub fn SparkMaxRelativeEncoder_GetMeasurementPeriod(
3031 this: *mut ::std::os::raw::c_void,
3032 ) -> u32;
3033 }
3034 extern "C" {
3035 #[doc = " Get the counts per revolution of the quadrature encoder."]
3036 #[doc = ""]
3037 #[doc = " For a description on the difference between CPR, PPR, etc. go to"]
3038 #[doc = " https://www.cuidevices.com/blog/what-is-encoder-ppr-cpr-and-lpr"]
3039 #[doc = ""]
3040 #[doc = " @return Counts per revolution"]
3041 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder22GetCountsPerRevolutionEv"]
3042 pub fn SparkMaxRelativeEncoder_GetCountsPerRevolution(
3043 this: *mut ::std::os::raw::c_void,
3044 ) -> u32;
3045 }
3046 extern "C" {
3047 #[doc = " Set the phase of the MotorFeedbackSensor so that it is set to be in"]
3048 #[doc = " phase with the motor itself. This only works for quadrature"]
3049 #[doc = " encoders. This will throw an error if the user tries to set"]
3050 #[doc = " inverted while the SparkMax is Brushless and using the hall"]
3051 #[doc = " effect sensor."]
3052 #[doc = ""]
3053 #[doc = " @param inverted The phase of the encoder"]
3054 #[doc = ""]
3055 #[doc = " @return REVLibError::kOk if successful"]
3056 #[link_name = "\u{1}_ZN3rev23SparkMaxRelativeEncoder11SetInvertedEb"]
3057 pub fn SparkMaxRelativeEncoder_SetInverted(
3058 this: *mut ::std::os::raw::c_void,
3059 inverted: bool,
3060 ) -> root::rev::REVLibError;
3061 }
3062 extern "C" {
3063 #[doc = " Get the phase of the MotorFeedbackSensor. This will just return false"]
3064 #[doc = " if the user tries to get inverted while the SparkMax is"]
3065 #[doc = " Brushless and using the hall effect sensor."]
3066 #[doc = ""]
3067 #[doc = " @return The phase of the encoder"]
3068 #[link_name = "\u{1}_ZNK3rev23SparkMaxRelativeEncoder11GetInvertedEv"]
3069 pub fn SparkMaxRelativeEncoder_GetInverted(this: *mut ::std::os::raw::c_void) -> bool;
3070 }
3071 #[repr(C)]
3072 #[derive(Debug)]
3073 pub struct CANSparkMax {
3074 pub _base: root::rev::CANSparkMaxLowLevel,
3075 pub m_setpoint: f64,
3076 pub m_relativeEncoderCreated: root::std::atomic<bool>,
3077 pub m_alternateEncoderCreated: root::std::atomic<bool>,
3078 pub m_analogSensorCreated: root::std::atomic<bool>,
3079 pub m_pidControllerCreated: root::std::atomic<bool>,
3080 pub m_forwardLimitSwitchCreated: root::std::atomic<bool>,
3081 pub m_reverseLimitSwitchCreated: root::std::atomic<bool>,
3082 }
3083 pub const CANSparkMax_IdleMode_kCoast: root::rev::CANSparkMax_IdleMode = 0;
3084 pub const CANSparkMax_IdleMode_kBrake: root::rev::CANSparkMax_IdleMode = 1;
3085 pub type CANSparkMax_IdleMode = ::std::os::raw::c_int;
3086 pub const CANSparkMax_InputMode_kPWM: root::rev::CANSparkMax_InputMode = 0;
3087 pub const CANSparkMax_InputMode_kCAN: root::rev::CANSparkMax_InputMode = 1;
3088 #[doc = " @deprecated You don't need this"]
3089 pub type CANSparkMax_InputMode = ::std::os::raw::c_int;
3090 pub const CANSparkMax_SoftLimitDirection_kForward:
3091 root::rev::CANSparkMax_SoftLimitDirection = 0;
3092 pub const CANSparkMax_SoftLimitDirection_kReverse:
3093 root::rev::CANSparkMax_SoftLimitDirection = 1;
3094 pub type CANSparkMax_SoftLimitDirection = ::std::os::raw::c_int;
3095 pub const CANSparkMax_FaultID_kBrownout: root::rev::CANSparkMax_FaultID = 0;
3096 pub const CANSparkMax_FaultID_kOvercurrent: root::rev::CANSparkMax_FaultID = 1;
3097 pub const CANSparkMax_FaultID_kIWDTReset: root::rev::CANSparkMax_FaultID = 2;
3098 pub const CANSparkMax_FaultID_kMotorFault: root::rev::CANSparkMax_FaultID = 3;
3099 pub const CANSparkMax_FaultID_kSensorFault: root::rev::CANSparkMax_FaultID = 4;
3100 pub const CANSparkMax_FaultID_kStall: root::rev::CANSparkMax_FaultID = 5;
3101 pub const CANSparkMax_FaultID_kEEPROMCRC: root::rev::CANSparkMax_FaultID = 6;
3102 pub const CANSparkMax_FaultID_kCANTX: root::rev::CANSparkMax_FaultID = 7;
3103 pub const CANSparkMax_FaultID_kCANRX: root::rev::CANSparkMax_FaultID = 8;
3104 pub const CANSparkMax_FaultID_kHasReset: root::rev::CANSparkMax_FaultID = 9;
3105 pub const CANSparkMax_FaultID_kDRVFault: root::rev::CANSparkMax_FaultID = 10;
3106 pub const CANSparkMax_FaultID_kOtherFault: root::rev::CANSparkMax_FaultID = 11;
3107 pub const CANSparkMax_FaultID_kSoftLimitFwd: root::rev::CANSparkMax_FaultID = 12;
3108 pub const CANSparkMax_FaultID_kSoftLimitRev: root::rev::CANSparkMax_FaultID = 13;
3109 pub const CANSparkMax_FaultID_kHardLimitFwd: root::rev::CANSparkMax_FaultID = 14;
3110 pub const CANSparkMax_FaultID_kHardLimitRev: root::rev::CANSparkMax_FaultID = 15;
3111 pub type CANSparkMax_FaultID = ::std::os::raw::c_int;
3112 #[repr(C)]
3113 #[derive(Debug, Copy, Clone)]
3114 pub struct CANSparkMax_ExternalFollower {
3115 pub arbId: ::std::os::raw::c_int,
3116 pub configId: ::std::os::raw::c_int,
3117 }
3118 #[test]
3119 fn bindgen_test_layout_CANSparkMax_ExternalFollower() {
3120 assert_eq!(
3121 ::std::mem::size_of::<CANSparkMax_ExternalFollower>(),
3122 8usize,
3123 concat!("Size of: ", stringify!(CANSparkMax_ExternalFollower))
3124 );
3125 assert_eq!(
3126 ::std::mem::align_of::<CANSparkMax_ExternalFollower>(),
3127 4usize,
3128 concat!("Alignment of ", stringify!(CANSparkMax_ExternalFollower))
3129 );
3130 fn test_field_arbId() {
3131 assert_eq!(
3132 unsafe {
3133 let uninit =
3134 ::std::mem::MaybeUninit::<CANSparkMax_ExternalFollower>::uninit();
3135 let ptr = uninit.as_ptr();
3136 ::std::ptr::addr_of!((*ptr).arbId) as usize - ptr as usize
3137 },
3138 0usize,
3139 concat!(
3140 "Offset of field: ",
3141 stringify!(CANSparkMax_ExternalFollower),
3142 "::",
3143 stringify!(arbId)
3144 )
3145 );
3146 }
3147 test_field_arbId();
3148 fn test_field_configId() {
3149 assert_eq!(
3150 unsafe {
3151 let uninit =
3152 ::std::mem::MaybeUninit::<CANSparkMax_ExternalFollower>::uninit();
3153 let ptr = uninit.as_ptr();
3154 ::std::ptr::addr_of!((*ptr).configId) as usize - ptr as usize
3155 },
3156 4usize,
3157 concat!(
3158 "Offset of field: ",
3159 stringify!(CANSparkMax_ExternalFollower),
3160 "::",
3161 stringify!(configId)
3162 )
3163 );
3164 }
3165 test_field_configId();
3166 }
3167 extern "C" {
3168 #[link_name = "\u{1}_ZN3rev11CANSparkMax17kFollowerDisabledE"]
3169 pub static CANSparkMax_kFollowerDisabled: root::rev::CANSparkMax_ExternalFollower;
3170 }
3171 extern "C" {
3172 #[link_name = "\u{1}_ZN3rev11CANSparkMax17kFollowerSparkMaxE"]
3173 pub static CANSparkMax_kFollowerSparkMax: root::rev::CANSparkMax_ExternalFollower;
3174 }
3175 extern "C" {
3176 #[link_name = "\u{1}_ZN3rev11CANSparkMax16kFollowerPhoenixE"]
3177 pub static CANSparkMax_kFollowerPhoenix: root::rev::CANSparkMax_ExternalFollower;
3178 }
3179 #[test]
3180 fn bindgen_test_layout_CANSparkMax() {
3181 assert_eq!(
3182 ::std::mem::size_of::<CANSparkMax>(),
3183 48usize,
3184 concat!("Size of: ", stringify!(CANSparkMax))
3185 );
3186 assert_eq!(
3187 ::std::mem::align_of::<CANSparkMax>(),
3188 8usize,
3189 concat!("Alignment of ", stringify!(CANSparkMax))
3190 );
3191 fn test_field_m_setpoint() {
3192 assert_eq!(
3193 unsafe {
3194 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3195 let ptr = uninit.as_ptr();
3196 ::std::ptr::addr_of!((*ptr).m_setpoint) as usize - ptr as usize
3197 },
3198 32usize,
3199 concat!(
3200 "Offset of field: ",
3201 stringify!(CANSparkMax),
3202 "::",
3203 stringify!(m_setpoint)
3204 )
3205 );
3206 }
3207 test_field_m_setpoint();
3208 fn test_field_m_relativeEncoderCreated() {
3209 assert_eq!(
3210 unsafe {
3211 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3212 let ptr = uninit.as_ptr();
3213 ::std::ptr::addr_of!((*ptr).m_relativeEncoderCreated) as usize
3214 - ptr as usize
3215 },
3216 40usize,
3217 concat!(
3218 "Offset of field: ",
3219 stringify!(CANSparkMax),
3220 "::",
3221 stringify!(m_relativeEncoderCreated)
3222 )
3223 );
3224 }
3225 test_field_m_relativeEncoderCreated();
3226 fn test_field_m_alternateEncoderCreated() {
3227 assert_eq!(
3228 unsafe {
3229 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3230 let ptr = uninit.as_ptr();
3231 ::std::ptr::addr_of!((*ptr).m_alternateEncoderCreated) as usize
3232 - ptr as usize
3233 },
3234 41usize,
3235 concat!(
3236 "Offset of field: ",
3237 stringify!(CANSparkMax),
3238 "::",
3239 stringify!(m_alternateEncoderCreated)
3240 )
3241 );
3242 }
3243 test_field_m_alternateEncoderCreated();
3244 fn test_field_m_analogSensorCreated() {
3245 assert_eq!(
3246 unsafe {
3247 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3248 let ptr = uninit.as_ptr();
3249 ::std::ptr::addr_of!((*ptr).m_analogSensorCreated) as usize - ptr as usize
3250 },
3251 42usize,
3252 concat!(
3253 "Offset of field: ",
3254 stringify!(CANSparkMax),
3255 "::",
3256 stringify!(m_analogSensorCreated)
3257 )
3258 );
3259 }
3260 test_field_m_analogSensorCreated();
3261 fn test_field_m_pidControllerCreated() {
3262 assert_eq!(
3263 unsafe {
3264 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3265 let ptr = uninit.as_ptr();
3266 ::std::ptr::addr_of!((*ptr).m_pidControllerCreated) as usize - ptr as usize
3267 },
3268 43usize,
3269 concat!(
3270 "Offset of field: ",
3271 stringify!(CANSparkMax),
3272 "::",
3273 stringify!(m_pidControllerCreated)
3274 )
3275 );
3276 }
3277 test_field_m_pidControllerCreated();
3278 fn test_field_m_forwardLimitSwitchCreated() {
3279 assert_eq!(
3280 unsafe {
3281 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3282 let ptr = uninit.as_ptr();
3283 ::std::ptr::addr_of!((*ptr).m_forwardLimitSwitchCreated) as usize
3284 - ptr as usize
3285 },
3286 44usize,
3287 concat!(
3288 "Offset of field: ",
3289 stringify!(CANSparkMax),
3290 "::",
3291 stringify!(m_forwardLimitSwitchCreated)
3292 )
3293 );
3294 }
3295 test_field_m_forwardLimitSwitchCreated();
3296 fn test_field_m_reverseLimitSwitchCreated() {
3297 assert_eq!(
3298 unsafe {
3299 let uninit = ::std::mem::MaybeUninit::<CANSparkMax>::uninit();
3300 let ptr = uninit.as_ptr();
3301 ::std::ptr::addr_of!((*ptr).m_reverseLimitSwitchCreated) as usize
3302 - ptr as usize
3303 },
3304 45usize,
3305 concat!(
3306 "Offset of field: ",
3307 stringify!(CANSparkMax),
3308 "::",
3309 stringify!(m_reverseLimitSwitchCreated)
3310 )
3311 );
3312 }
3313 test_field_m_reverseLimitSwitchCreated();
3314 }
3315 extern "C" {
3316 #[doc = " Returns an object for interfacing with the encoder connected to the"]
3317 #[doc = " encoder pins or front port of the SPARK MAX."]
3318 #[doc = ""]
3319 #[doc = " The default encoder type is assumed to be the hall effect for brushless."]
3320 #[doc = " This can be modified for brushed DC to use an quadrature encoder."]
3321 #[link_name = "\u{1}_ZN3rev11CANSparkMax10GetEncoderENS_23SparkMaxRelativeEncoder4TypeEi"]
3322 pub fn CANSparkMax_GetEncoder(
3323 this: *mut root::rev::CANSparkMax,
3324 encoderType: root::rev::SparkMaxRelativeEncoder_Type,
3325 countsPerRev: ::std::os::raw::c_int,
3326 ) -> root::rev::SparkMaxRelativeEncoder;
3327 }
3328 extern "C" {
3329 #[doc = " Returns an object for interfacing with the encoder connected to the"]
3330 #[doc = " encoder pins or front port of the SPARK MAX."]
3331 #[doc = ""]
3332 #[doc = " The default encoder type is assumed to be the hall effect for brushless."]
3333 #[doc = " This can be modified for brushed DC to use an quadrature encoder."]
3334 #[doc = ""]
3335 #[doc = " @deprecated Use CANSparkMax::GetEncoder(SparkMaxRelativeEncoder::Type,"]
3336 #[doc = " int) instead"]
3337 #[link_name = "\u{1}_ZN3rev11CANSparkMax10GetEncoderENS_10CANEncoder11EncoderTypeEi"]
3338 pub fn CANSparkMax_GetEncoder1(
3339 this: *mut root::rev::CANSparkMax,
3340 encoderType: root::rev::CANEncoder_EncoderType,
3341 countsPerRev: ::std::os::raw::c_int,
3342 ) -> root::rev::SparkMaxRelativeEncoder;
3343 }
3344 extern "C" {
3345 #[doc = " Returns an object for interfacing with a quadrature encoder connected to"]
3346 #[doc = " the alternate encoder mode data port pins. These are defined as:"]
3347 #[doc = ""]
3348 #[doc = " Pin 4 (Forward Limit Switch): Index"]
3349 #[doc = " Pin 6 (Multi-function): Encoder A"]
3350 #[doc = " Pin 8 (Reverse Limit Switch): Encoder B"]
3351 #[doc = ""]
3352 #[doc = " This call will disable support for the limit switch inputs."]
3353 #[link_name = "\u{1}_ZN3rev11CANSparkMax19GetAlternateEncoderEi"]
3354 pub fn CANSparkMax_GetAlternateEncoder(
3355 this: *mut root::rev::CANSparkMax,
3356 countsPerRev: ::std::os::raw::c_int,
3357 ) -> root::rev::SparkMaxAlternateEncoder;
3358 }
3359 extern "C" {
3360 #[doc = " Returns an object for interfacing with a quadrature encoder connected to"]
3361 #[doc = " the alternate encoder mode data port pins. These are defined as:"]
3362 #[doc = ""]
3363 #[doc = " Pin 4 (Forward Limit Switch): Index"]
3364 #[doc = " Pin 6 (Multi-function): Encoder A"]
3365 #[doc = " Pin 8 (Reverse Limit Switch): Encoder B"]
3366 #[doc = ""]
3367 #[doc = " This call will disable support for the limit switch inputs."]
3368 #[link_name = "\u{1}_ZN3rev11CANSparkMax19GetAlternateEncoderENS_24SparkMaxAlternateEncoder4TypeEi"]
3369 pub fn CANSparkMax_GetAlternateEncoder1(
3370 this: *mut root::rev::CANSparkMax,
3371 encoderType: root::rev::SparkMaxAlternateEncoder_Type,
3372 countsPerRev: ::std::os::raw::c_int,
3373 ) -> root::rev::SparkMaxAlternateEncoder;
3374 }
3375 extern "C" {
3376 #[doc = " Returns an object for interfacing with a quadrature encoder connected to"]
3377 #[doc = " the alternate encoder mode data port pins. These are defined as:"]
3378 #[doc = ""]
3379 #[doc = " Pin 4 (Forward Limit Switch): Index"]
3380 #[doc = " Pin 6 (Multi-function): Encoder A"]
3381 #[doc = " Pin 8 (Reverse Limit Switch): Encoder B"]
3382 #[doc = ""]
3383 #[doc = " This call will disable support for the limit switch inputs."]
3384 #[doc = ""]
3385 #[doc = " @deprecated Use"]
3386 #[doc = " CANSparkMax::GetAlternateEncoder(SparkMaxAlternateEncoder::Type, int)"]
3387 #[doc = " instead"]
3388 #[link_name = "\u{1}_ZN3rev11CANSparkMax19GetAlternateEncoderENS_10CANEncoder20AlternateEncoderTypeEi"]
3389 pub fn CANSparkMax_GetAlternateEncoder2(
3390 this: *mut root::rev::CANSparkMax,
3391 encoderType: root::rev::CANEncoder_AlternateEncoderType,
3392 countsPerRev: ::std::os::raw::c_int,
3393 ) -> root::rev::SparkMaxAlternateEncoder;
3394 }
3395 extern "C" {
3396 #[doc = " Returns an object for interfacing with a connected analog sensor."]
3397 #[doc = " By default, the mode is set to kAbsolute, thus treating the"]
3398 #[doc = " sensor as an absolute sensor."]
3399 #[link_name = "\u{1}_ZN3rev11CANSparkMax9GetAnalogENS_20SparkMaxAnalogSensor4ModeE"]
3400 pub fn CANSparkMax_GetAnalog(
3401 this: *mut root::rev::CANSparkMax,
3402 mode: root::rev::SparkMaxAnalogSensor_Mode,
3403 ) -> root::rev::SparkMaxAnalogSensor;
3404 }
3405 extern "C" {
3406 #[doc = " Returns an object for interfacing with a connected analog sensor."]
3407 #[doc = ""]
3408 #[doc = " @deprecated Use GetAnalog(SparkMaxAnalogSensor::Mode) instead"]
3409 #[link_name = "\u{1}_ZN3rev11CANSparkMax9GetAnalogENS_9CANAnalog10AnalogModeE"]
3410 pub fn CANSparkMax_GetAnalog1(
3411 this: *mut root::rev::CANSparkMax,
3412 mode: root::rev::CANAnalog_AnalogMode,
3413 ) -> root::rev::SparkMaxAnalogSensor;
3414 }
3415 extern "C" {
3416 #[doc = " Returns an object for interfacing with the integrated PID controller."]
3417 #[link_name = "\u{1}_ZN3rev11CANSparkMax16GetPIDControllerEv"]
3418 pub fn CANSparkMax_GetPIDController(
3419 this: *mut root::rev::CANSparkMax,
3420 ) -> root::rev::SparkMaxPIDController;
3421 }
3422 extern "C" {
3423 #[doc = " Returns an object for interfacing with the forward limit switch connected"]
3424 #[doc = " to the appropriate pins on the data port."]
3425 #[doc = ""]
3426 #[doc = " This call will disable support for the alternate encoder."]
3427 #[doc = ""]
3428 #[doc = " @param switchType Whether the limit switch is normally open or normally"]
3429 #[doc = " closed."]
3430 #[link_name = "\u{1}_ZN3rev11CANSparkMax21GetForwardLimitSwitchENS_19SparkMaxLimitSwitch4TypeE"]
3431 pub fn CANSparkMax_GetForwardLimitSwitch(
3432 this: *mut root::rev::CANSparkMax,
3433 switchType: root::rev::SparkMaxLimitSwitch_Type,
3434 ) -> root::rev::SparkMaxLimitSwitch;
3435 }
3436 extern "C" {
3437 #[doc = " Returns an object for interfacing with the forward limit switch connected"]
3438 #[doc = " to the appropriate pins on the data port."]
3439 #[doc = ""]
3440 #[doc = " This call will disable support for the alternate encoder."]
3441 #[doc = ""]
3442 #[doc = " @param polarity Whether the limit switch is normally open or normally"]
3443 #[doc = " closed."]
3444 #[doc = ""]
3445 #[doc = " @deprecated Use"]
3446 #[doc = " GetForwardLimitSwitch(SparkMaxLimitSwitch::Type)"]
3447 #[doc = " instead"]
3448 #[link_name = "\u{1}_ZN3rev11CANSparkMax21GetForwardLimitSwitchENS_15CANDigitalInput19LimitSwitchPolarityE"]
3449 pub fn CANSparkMax_GetForwardLimitSwitch1(
3450 this: *mut root::rev::CANSparkMax,
3451 polarity: root::rev::CANDigitalInput_LimitSwitchPolarity,
3452 ) -> root::rev::SparkMaxLimitSwitch;
3453 }
3454 extern "C" {
3455 #[doc = " Returns an object for interfacing with the reverse limit switch connected"]
3456 #[doc = " to the appropriate pins on the data port."]
3457 #[doc = ""]
3458 #[doc = " This call will disable support for the alternate encoder."]
3459 #[doc = ""]
3460 #[doc = " @param switchType Whether the limit switch is normally open or normally"]
3461 #[doc = " closed."]
3462 #[link_name = "\u{1}_ZN3rev11CANSparkMax21GetReverseLimitSwitchENS_19SparkMaxLimitSwitch4TypeE"]
3463 pub fn CANSparkMax_GetReverseLimitSwitch(
3464 this: *mut root::rev::CANSparkMax,
3465 switchType: root::rev::SparkMaxLimitSwitch_Type,
3466 ) -> root::rev::SparkMaxLimitSwitch;
3467 }
3468 extern "C" {
3469 #[doc = " Returns an object for interfacing with the reverse limit switch connected"]
3470 #[doc = " to the appropriate pins on the data port."]
3471 #[doc = ""]
3472 #[doc = " This call will disable support for the alternate encoder."]
3473 #[doc = ""]
3474 #[doc = " @param polarity Whether the limit switch is normally open or normally"]
3475 #[doc = " closed."]
3476 #[doc = ""]
3477 #[doc = " @deprecated Use"]
3478 #[doc = " GetReverseLimitSwitch(SparkMaxLimitSwitch::Type)"]
3479 #[doc = " instead"]
3480 #[link_name = "\u{1}_ZN3rev11CANSparkMax21GetReverseLimitSwitchENS_15CANDigitalInput19LimitSwitchPolarityE"]
3481 pub fn CANSparkMax_GetReverseLimitSwitch1(
3482 this: *mut root::rev::CANSparkMax,
3483 polarity: root::rev::CANDigitalInput_LimitSwitchPolarity,
3484 ) -> root::rev::SparkMaxLimitSwitch;
3485 }
3486 extern "C" {
3487 #[doc = " Sets the current limit in Amps."]
3488 #[doc = ""]
3489 #[doc = " The motor controller will reduce the controller voltage output to avoid"]
3490 #[doc = " surpassing this limit. This limit is enabled by default and used for"]
3491 #[doc = " brushless only. This limit is highly recommended when using the NEO"]
3492 #[doc = " brushless motor."]
3493 #[doc = ""]
3494 #[doc = " The NEO Brushless Motor has a low internal resistance, which"]
3495 #[doc = " can mean large current spikes that could be enough to cause damage to"]
3496 #[doc = " the motor and controller. This current limit provides a smarter"]
3497 #[doc = " strategy to deal with high current draws and keep the motor and"]
3498 #[doc = " controller operating in a safe region."]
3499 #[doc = ""]
3500 #[doc = ""]
3501 #[doc = " @param limit The current limit in Amps."]
3502 #[link_name = "\u{1}_ZN3rev11CANSparkMax20SetSmartCurrentLimitEj"]
3503 pub fn CANSparkMax_SetSmartCurrentLimit(
3504 this: *mut root::rev::CANSparkMax,
3505 limit: ::std::os::raw::c_uint,
3506 ) -> root::rev::REVLibError;
3507 }
3508 extern "C" {
3509 #[doc = " Sets the current limit in Amps."]
3510 #[doc = ""]
3511 #[doc = " The motor controller will reduce the controller voltage output to avoid"]
3512 #[doc = " surpassing this limit. This limit is enabled by default and used for"]
3513 #[doc = " brushless only. This limit is highly recommended when using the NEO"]
3514 #[doc = " brushless motor."]
3515 #[doc = ""]
3516 #[doc = " The NEO Brushless Motor has a low internal resistance, which"]
3517 #[doc = " can mean large current spikes that could be enough to cause damage to"]
3518 #[doc = " the motor and controller. This current limit provides a smarter"]
3519 #[doc = " strategy to deal with high current draws and keep the motor and"]
3520 #[doc = " controller operating in a safe region."]
3521 #[doc = ""]
3522 #[doc = " The controller can also limit the current based on the RPM of the motor"]
3523 #[doc = " in a linear fashion to help with controllability in closed loop control."]
3524 #[doc = " For a response that is linear the entire RPM range leave limit RPM at 0."]
3525 #[doc = ""]
3526 #[doc = ""]
3527 #[doc = " @param stallLimit The current limit in Amps at 0 RPM."]
3528 #[doc = " @param freeLimit The current limit at free speed (5700RPM for NEO)."]
3529 #[doc = " @param limitRPM RPM less than this value will be set to the stallLimit,"]
3530 #[doc = " RPM values greater than limitRPM will scale linearly to freeLimit"]
3531 #[link_name = "\u{1}_ZN3rev11CANSparkMax20SetSmartCurrentLimitEjjj"]
3532 pub fn CANSparkMax_SetSmartCurrentLimit1(
3533 this: *mut root::rev::CANSparkMax,
3534 stallLimit: ::std::os::raw::c_uint,
3535 freeLimit: ::std::os::raw::c_uint,
3536 limitRPM: ::std::os::raw::c_uint,
3537 ) -> root::rev::REVLibError;
3538 }
3539 extern "C" {
3540 #[doc = " Sets the secondary current limit in Amps."]
3541 #[doc = ""]
3542 #[doc = " The motor controller will disable the output of the controller briefly"]
3543 #[doc = " if the current limit is exceeded to reduce the current. This limit is"]
3544 #[doc = " a simplified 'on/off' controller. This limit is enabled by default"]
3545 #[doc = " but is set higher than the default Smart Current Limit."]
3546 #[doc = ""]
3547 #[doc = " The time the controller is off after the current limit is reached"]
3548 #[doc = " is determined by the parameter limitCycles, which is the number of"]
3549 #[doc = " PWM cycles (20kHz). The recommended value is the default of 0 which"]
3550 #[doc = " is the minimum time and is part of a PWM cycle from when the over"]
3551 #[doc = " current is detected. This allows the controller to regulate the current"]
3552 #[doc = " close to the limit value."]
3553 #[doc = ""]
3554 #[doc = " The total time is set by the equation"]
3555 #[doc = ""]
3556 #[doc = " @code t = (50us - t0) + 50us * limitCycles"]
3557 #[doc = " t = total off time after over current"]
3558 #[doc = " t0 = time from the start of the PWM cycle until over current is detected"]
3559 #[doc = " @endcode"]
3560 #[doc = ""]
3561 #[doc = ""]
3562 #[doc = " @param limit The current limit in Amps."]
3563 #[doc = " @param limitCycles The number of additional PWM cycles to turn"]
3564 #[doc = " the driver off after overcurrent is detected."]
3565 #[link_name = "\u{1}_ZN3rev11CANSparkMax24SetSecondaryCurrentLimitEdi"]
3566 pub fn CANSparkMax_SetSecondaryCurrentLimit(
3567 this: *mut root::rev::CANSparkMax,
3568 limit: f64,
3569 limitCycles: ::std::os::raw::c_int,
3570 ) -> root::rev::REVLibError;
3571 }
3572 extern "C" {
3573 #[doc = " Sets the idle mode setting for the SPARK MAX."]
3574 #[doc = ""]
3575 #[doc = " @param mode Idle mode (coast or brake)."]
3576 #[link_name = "\u{1}_ZN3rev11CANSparkMax11SetIdleModeENS0_8IdleModeE"]
3577 pub fn CANSparkMax_SetIdleMode(
3578 this: *mut root::rev::CANSparkMax,
3579 mode: root::rev::CANSparkMax_IdleMode,
3580 ) -> root::rev::REVLibError;
3581 }
3582 extern "C" {
3583 #[doc = " Gets the idle mode setting for the SPARK MAX."]
3584 #[doc = ""]
3585 #[doc = " This uses the Get Parameter API and should be used infrequently. This"]
3586 #[doc = " function uses a non-blocking call and will return a cached value if the"]
3587 #[doc = " parameter is not returned by the timeout. The timeout can be changed by"]
3588 #[doc = " calling SetCANTimeout(int milliseconds)"]
3589 #[doc = ""]
3590 #[doc = " @return IdleMode Idle mode setting"]
3591 #[link_name = "\u{1}_ZN3rev11CANSparkMax11GetIdleModeEv"]
3592 pub fn CANSparkMax_GetIdleMode(
3593 this: *mut root::rev::CANSparkMax,
3594 ) -> root::rev::CANSparkMax_IdleMode;
3595 }
3596 extern "C" {
3597 #[doc = " Sets the voltage compensation setting for all modes on the SPARK MAX and"]
3598 #[doc = " enables voltage compensation."]
3599 #[doc = ""]
3600 #[doc = " @param nominalVoltage Nominal voltage to compensate output to"]
3601 #[doc = ""]
3602 #[doc = " @return REVLibError::kOk if successful"]
3603 #[link_name = "\u{1}_ZN3rev11CANSparkMax25EnableVoltageCompensationEd"]
3604 pub fn CANSparkMax_EnableVoltageCompensation(
3605 this: *mut root::rev::CANSparkMax,
3606 nominalVoltage: f64,
3607 ) -> root::rev::REVLibError;
3608 }
3609 extern "C" {
3610 #[doc = " Disables the voltage compensation setting for all modes on the SPARK MAX."]
3611 #[doc = ""]
3612 #[doc = " @return REVLibError::kOk if successful"]
3613 #[link_name = "\u{1}_ZN3rev11CANSparkMax26DisableVoltageCompensationEv"]
3614 pub fn CANSparkMax_DisableVoltageCompensation(
3615 this: *mut root::rev::CANSparkMax,
3616 ) -> root::rev::REVLibError;
3617 }
3618 extern "C" {
3619 #[doc = " Get the configured voltage compensation nominal voltage value"]
3620 #[doc = ""]
3621 #[doc = " @return The nominal voltage for voltage compensation mode."]
3622 #[link_name = "\u{1}_ZN3rev11CANSparkMax36GetVoltageCompensationNominalVoltageEv"]
3623 pub fn CANSparkMax_GetVoltageCompensationNominalVoltage(
3624 this: *mut root::rev::CANSparkMax,
3625 ) -> f64;
3626 }
3627 extern "C" {
3628 #[doc = " Sets the ramp rate for open loop control modes."]
3629 #[doc = ""]
3630 #[doc = " This is the maximum rate at which the motor controller's output"]
3631 #[doc = " is allowed to change."]
3632 #[doc = ""]
3633 #[doc = " @param rate Time in seconds to go from 0 to full throttle."]
3634 #[link_name = "\u{1}_ZN3rev11CANSparkMax19SetOpenLoopRampRateEd"]
3635 pub fn CANSparkMax_SetOpenLoopRampRate(
3636 this: *mut root::rev::CANSparkMax,
3637 rate: f64,
3638 ) -> root::rev::REVLibError;
3639 }
3640 extern "C" {
3641 #[doc = " Sets the ramp rate for closed loop control modes."]
3642 #[doc = ""]
3643 #[doc = " This is the maximum rate at which the motor controller's output"]
3644 #[doc = " is allowed to change."]
3645 #[doc = ""]
3646 #[doc = " @param rate Time in seconds to go from 0 to full throttle."]
3647 #[link_name = "\u{1}_ZN3rev11CANSparkMax21SetClosedLoopRampRateEd"]
3648 pub fn CANSparkMax_SetClosedLoopRampRate(
3649 this: *mut root::rev::CANSparkMax,
3650 rate: f64,
3651 ) -> root::rev::REVLibError;
3652 }
3653 extern "C" {
3654 #[doc = " Get the configured open loop ramp rate"]
3655 #[doc = ""]
3656 #[doc = " This is the maximum rate at which the motor controller's output"]
3657 #[doc = " is allowed to change."]
3658 #[doc = ""]
3659 #[doc = " @return rampte rate time in seconds to go from 0 to full throttle."]
3660 #[link_name = "\u{1}_ZN3rev11CANSparkMax19GetOpenLoopRampRateEv"]
3661 pub fn CANSparkMax_GetOpenLoopRampRate(this: *mut root::rev::CANSparkMax) -> f64;
3662 }
3663 extern "C" {
3664 #[doc = " Get the configured closed loop ramp rate"]
3665 #[doc = ""]
3666 #[doc = " This is the maximum rate at which the motor controller's output"]
3667 #[doc = " is allowed to change."]
3668 #[doc = ""]
3669 #[doc = " @return rampte rate time in seconds to go from 0 to full throttle."]
3670 #[link_name = "\u{1}_ZN3rev11CANSparkMax21GetClosedLoopRampRateEv"]
3671 pub fn CANSparkMax_GetClosedLoopRampRate(this: *mut root::rev::CANSparkMax) -> f64;
3672 }
3673 extern "C" {
3674 #[doc = " Causes this controller's output to mirror the provided leader."]
3675 #[doc = ""]
3676 #[doc = " Only voltage output is mirrored. Settings changed on the leader do not"]
3677 #[doc = " affect the follower."]
3678 #[doc = ""]
3679 #[doc = " Following anything other than a CAN SPARK MAX is not officially"]
3680 #[doc = " supported."]
3681 #[doc = ""]
3682 #[doc = " @param leader The motor controller to follow."]
3683 #[doc = ""]
3684 #[doc = " @param invert Set the follower to output opposite of the leader"]
3685 #[link_name = "\u{1}_ZN3rev11CANSparkMax6FollowERKS0_b"]
3686 pub fn CANSparkMax_Follow(
3687 this: *mut root::rev::CANSparkMax,
3688 leader: *const root::rev::CANSparkMax,
3689 invert: bool,
3690 ) -> root::rev::REVLibError;
3691 }
3692 extern "C" {
3693 #[doc = " Causes this controller's output to mirror the provided leader."]
3694 #[doc = ""]
3695 #[doc = " Only voltage output is mirrored. Settings changed on the leader do not"]
3696 #[doc = " affect the follower."]
3697 #[doc = ""]
3698 #[doc = " Following anything other than a CAN SPARK MAX is not officially"]
3699 #[doc = " supported."]
3700 #[doc = ""]
3701 #[doc = " @param leader The type of motor controller to follow (Talon SRX, Spark"]
3702 #[doc = " Max, etc.)."]
3703 #[doc = " @param deviceID The CAN ID of the device to follow."]
3704 #[doc = ""]
3705 #[doc = " @param invert Set the follower to output opposite of the leader"]
3706 #[link_name = "\u{1}_ZN3rev11CANSparkMax6FollowENS0_16ExternalFollowerEib"]
3707 pub fn CANSparkMax_Follow1(
3708 this: *mut root::rev::CANSparkMax,
3709 leader: root::rev::CANSparkMax_ExternalFollower,
3710 deviceID: ::std::os::raw::c_int,
3711 invert: bool,
3712 ) -> root::rev::REVLibError;
3713 }
3714 extern "C" {
3715 #[doc = " Returns whether the controller is following another controller"]
3716 #[doc = ""]
3717 #[doc = " @return True if this device is following another controller"]
3718 #[doc = " false otherwise"]
3719 #[link_name = "\u{1}_ZN3rev11CANSparkMax10IsFollowerEv"]
3720 pub fn CANSparkMax_IsFollower(this: *mut root::rev::CANSparkMax) -> bool;
3721 }
3722 extern "C" {
3723 #[doc = " Returns fault bits."]
3724 #[link_name = "\u{1}_ZN3rev11CANSparkMax9GetFaultsEv"]
3725 pub fn CANSparkMax_GetFaults(this: *mut root::rev::CANSparkMax) -> u16;
3726 }
3727 extern "C" {
3728 #[doc = " Returns sticky fault bits."]
3729 #[link_name = "\u{1}_ZN3rev11CANSparkMax15GetStickyFaultsEv"]
3730 pub fn CANSparkMax_GetStickyFaults(this: *mut root::rev::CANSparkMax) -> u16;
3731 }
3732 extern "C" {
3733 #[doc = " Returns whether the fault with the given ID occurred."]
3734 #[link_name = "\u{1}_ZNK3rev11CANSparkMax8GetFaultENS0_7FaultIDE"]
3735 pub fn CANSparkMax_GetFault(
3736 this: *const root::rev::CANSparkMax,
3737 faultID: root::rev::CANSparkMax_FaultID,
3738 ) -> bool;
3739 }
3740 extern "C" {
3741 #[doc = " Returns whether the sticky fault with the given ID occurred."]
3742 #[link_name = "\u{1}_ZNK3rev11CANSparkMax14GetStickyFaultENS0_7FaultIDE"]
3743 pub fn CANSparkMax_GetStickyFault(
3744 this: *const root::rev::CANSparkMax,
3745 faultID: root::rev::CANSparkMax_FaultID,
3746 ) -> bool;
3747 }
3748 extern "C" {
3749 #[doc = " Returns the voltage fed into the motor controller."]
3750 #[link_name = "\u{1}_ZN3rev11CANSparkMax13GetBusVoltageEv"]
3751 pub fn CANSparkMax_GetBusVoltage(this: *mut root::rev::CANSparkMax) -> f64;
3752 }
3753 extern "C" {
3754 #[doc = " Returns motor controller's output duty cycle."]
3755 #[link_name = "\u{1}_ZN3rev11CANSparkMax16GetAppliedOutputEv"]
3756 pub fn CANSparkMax_GetAppliedOutput(this: *mut root::rev::CANSparkMax) -> f64;
3757 }
3758 extern "C" {
3759 #[doc = " Returns motor controller's output current in Amps."]
3760 #[link_name = "\u{1}_ZN3rev11CANSparkMax16GetOutputCurrentEv"]
3761 pub fn CANSparkMax_GetOutputCurrent(this: *mut root::rev::CANSparkMax) -> f64;
3762 }
3763 extern "C" {
3764 #[doc = " Returns the motor temperature in Celsius."]
3765 #[link_name = "\u{1}_ZN3rev11CANSparkMax19GetMotorTemperatureEv"]
3766 pub fn CANSparkMax_GetMotorTemperature(this: *mut root::rev::CANSparkMax) -> f64;
3767 }
3768 extern "C" {
3769 #[doc = " Clears all non-sticky faults."]
3770 #[doc = ""]
3771 #[doc = " Sticky faults must be cleared by resetting the motor controller."]
3772 #[link_name = "\u{1}_ZN3rev11CANSparkMax11ClearFaultsEv"]
3773 pub fn CANSparkMax_ClearFaults(
3774 this: *mut root::rev::CANSparkMax,
3775 ) -> root::rev::REVLibError;
3776 }
3777 extern "C" {
3778 #[doc = " Writes all settings to flash."]
3779 #[link_name = "\u{1}_ZN3rev11CANSparkMax9BurnFlashEv"]
3780 pub fn CANSparkMax_BurnFlash(
3781 this: *mut root::rev::CANSparkMax,
3782 ) -> root::rev::REVLibError;
3783 }
3784 extern "C" {
3785 #[doc = " Sets timeout for sending CAN messages. A timeout of 0 also means that"]
3786 #[doc = " error handling will be done automatically by registering calls and"]
3787 #[doc = " waiting for responses, rather than needing to call GetLastError()."]
3788 #[doc = ""]
3789 #[doc = " @param milliseconds The timeout in milliseconds."]
3790 #[link_name = "\u{1}_ZN3rev11CANSparkMax13SetCANTimeoutEi"]
3791 pub fn CANSparkMax_SetCANTimeout(
3792 this: *mut root::rev::CANSparkMax,
3793 milliseconds: ::std::os::raw::c_int,
3794 ) -> root::rev::REVLibError;
3795 }
3796 extern "C" {
3797 #[doc = " Enable soft limits"]
3798 #[doc = ""]
3799 #[doc = " @param direction the direction of motion to restrict"]
3800 #[doc = ""]
3801 #[doc = " @param enable set true to enable soft limits"]
3802 #[link_name = "\u{1}_ZN3rev11CANSparkMax15EnableSoftLimitENS0_18SoftLimitDirectionEb"]
3803 pub fn CANSparkMax_EnableSoftLimit(
3804 this: *mut root::rev::CANSparkMax,
3805 direction: root::rev::CANSparkMax_SoftLimitDirection,
3806 enable: bool,
3807 ) -> root::rev::REVLibError;
3808 }
3809 extern "C" {
3810 #[doc = " Returns true if the soft limit is enabled."]
3811 #[link_name = "\u{1}_ZN3rev11CANSparkMax18IsSoftLimitEnabledENS0_18SoftLimitDirectionE"]
3812 pub fn CANSparkMax_IsSoftLimitEnabled(
3813 this: *mut root::rev::CANSparkMax,
3814 direction: root::rev::CANSparkMax_SoftLimitDirection,
3815 ) -> bool;
3816 }
3817 extern "C" {
3818 #[doc = " Set the soft limit based on position. The default unit is"]
3819 #[doc = " rotations, but will match the unit scaling set by the user."]
3820 #[doc = ""]
3821 #[doc = " Note that this value is not scaled internally so care must"]
3822 #[doc = " be taken to make sure these units match the desired conversion"]
3823 #[doc = ""]
3824 #[doc = " @param direction the direction of motion to restrict"]
3825 #[doc = ""]
3826 #[doc = " @param limit position soft limit of the controller"]
3827 #[link_name = "\u{1}_ZN3rev11CANSparkMax12SetSoftLimitENS0_18SoftLimitDirectionEd"]
3828 pub fn CANSparkMax_SetSoftLimit(
3829 this: *mut root::rev::CANSparkMax,
3830 direction: root::rev::CANSparkMax_SoftLimitDirection,
3831 limit: f64,
3832 ) -> root::rev::REVLibError;
3833 }
3834 extern "C" {
3835 #[doc = " Get the soft limit setting in the controller"]
3836 #[doc = ""]
3837 #[doc = " @param direction the direction of motion to restrict"]
3838 #[doc = ""]
3839 #[doc = " @return position soft limit setting of the controller"]
3840 #[link_name = "\u{1}_ZN3rev11CANSparkMax12GetSoftLimitENS0_18SoftLimitDirectionE"]
3841 pub fn CANSparkMax_GetSoftLimit(
3842 this: *mut root::rev::CANSparkMax,
3843 direction: root::rev::CANSparkMax_SoftLimitDirection,
3844 ) -> f64;
3845 }
3846 extern "C" {
3847 #[doc = " All device errors are tracked on a per thread basis for all"]
3848 #[doc = " devices in that thread. This is meant to be called"]
3849 #[doc = " immediately following another call that has the possibility"]
3850 #[doc = " of throwing an error to validate if an error has occurred."]
3851 #[doc = ""]
3852 #[doc = " @return the last error that was generated."]
3853 #[link_name = "\u{1}_ZN3rev11CANSparkMax12GetLastErrorEv"]
3854 pub fn CANSparkMax_GetLastError(
3855 this: *mut root::rev::CANSparkMax,
3856 ) -> root::rev::REVLibError;
3857 }
3858 extern "C" {
3859 #[doc = " Create a new object to control a SPARK MAX motor Controller"]
3860 #[doc = ""]
3861 #[doc = " @param deviceID The device ID."]
3862 #[doc = " @param type The motor type connected to the controller. Brushless"]
3863 #[doc = " motor wires must be connected to their matching colors,"]
3864 #[doc = " and the hall sensor must be plugged in. Brushed motors must be connected"]
3865 #[doc = " to the Red and Black terminals only."]
3866 #[link_name = "\u{1}_ZN3rev11CANSparkMaxC1EiNS_19CANSparkMaxLowLevel9MotorTypeE"]
3867 pub fn CANSparkMax_CANSparkMax(
3868 this: *mut root::rev::CANSparkMax,
3869 deviceID: ::std::os::raw::c_int,
3870 type_: root::rev::CANSparkMaxLowLevel_MotorType,
3871 );
3872 }
3873 impl CANSparkMax {
3874 #[inline]
3875 pub unsafe fn GetEncoder(
3876 &mut self,
3877 encoderType: root::rev::SparkMaxRelativeEncoder_Type,
3878 countsPerRev: ::std::os::raw::c_int,
3879 ) -> root::rev::SparkMaxRelativeEncoder {
3880 CANSparkMax_GetEncoder(self, encoderType, countsPerRev)
3881 }
3882 #[inline]
3883 pub unsafe fn GetEncoder1(
3884 &mut self,
3885 encoderType: root::rev::CANEncoder_EncoderType,
3886 countsPerRev: ::std::os::raw::c_int,
3887 ) -> root::rev::SparkMaxRelativeEncoder {
3888 CANSparkMax_GetEncoder1(self, encoderType, countsPerRev)
3889 }
3890 #[inline]
3891 pub unsafe fn GetAlternateEncoder(
3892 &mut self,
3893 countsPerRev: ::std::os::raw::c_int,
3894 ) -> root::rev::SparkMaxAlternateEncoder {
3895 CANSparkMax_GetAlternateEncoder(self, countsPerRev)
3896 }
3897 #[inline]
3898 pub unsafe fn GetAlternateEncoder1(
3899 &mut self,
3900 encoderType: root::rev::SparkMaxAlternateEncoder_Type,
3901 countsPerRev: ::std::os::raw::c_int,
3902 ) -> root::rev::SparkMaxAlternateEncoder {
3903 CANSparkMax_GetAlternateEncoder1(self, encoderType, countsPerRev)
3904 }
3905 #[inline]
3906 pub unsafe fn GetAlternateEncoder2(
3907 &mut self,
3908 encoderType: root::rev::CANEncoder_AlternateEncoderType,
3909 countsPerRev: ::std::os::raw::c_int,
3910 ) -> root::rev::SparkMaxAlternateEncoder {
3911 CANSparkMax_GetAlternateEncoder2(self, encoderType, countsPerRev)
3912 }
3913 #[inline]
3914 pub unsafe fn GetAnalog(
3915 &mut self,
3916 mode: root::rev::SparkMaxAnalogSensor_Mode,
3917 ) -> root::rev::SparkMaxAnalogSensor {
3918 CANSparkMax_GetAnalog(self, mode)
3919 }
3920 #[inline]
3921 pub unsafe fn GetAnalog1(
3922 &mut self,
3923 mode: root::rev::CANAnalog_AnalogMode,
3924 ) -> root::rev::SparkMaxAnalogSensor {
3925 CANSparkMax_GetAnalog1(self, mode)
3926 }
3927 #[inline]
3928 pub unsafe fn GetPIDController(&mut self) -> root::rev::SparkMaxPIDController {
3929 CANSparkMax_GetPIDController(self)
3930 }
3931 #[inline]
3932 pub unsafe fn GetForwardLimitSwitch(
3933 &mut self,
3934 switchType: root::rev::SparkMaxLimitSwitch_Type,
3935 ) -> root::rev::SparkMaxLimitSwitch {
3936 CANSparkMax_GetForwardLimitSwitch(self, switchType)
3937 }
3938 #[inline]
3939 pub unsafe fn GetForwardLimitSwitch1(
3940 &mut self,
3941 polarity: root::rev::CANDigitalInput_LimitSwitchPolarity,
3942 ) -> root::rev::SparkMaxLimitSwitch {
3943 CANSparkMax_GetForwardLimitSwitch1(self, polarity)
3944 }
3945 #[inline]
3946 pub unsafe fn GetReverseLimitSwitch(
3947 &mut self,
3948 switchType: root::rev::SparkMaxLimitSwitch_Type,
3949 ) -> root::rev::SparkMaxLimitSwitch {
3950 CANSparkMax_GetReverseLimitSwitch(self, switchType)
3951 }
3952 #[inline]
3953 pub unsafe fn GetReverseLimitSwitch1(
3954 &mut self,
3955 polarity: root::rev::CANDigitalInput_LimitSwitchPolarity,
3956 ) -> root::rev::SparkMaxLimitSwitch {
3957 CANSparkMax_GetReverseLimitSwitch1(self, polarity)
3958 }
3959 #[inline]
3960 pub unsafe fn SetSmartCurrentLimit(
3961 &mut self,
3962 limit: ::std::os::raw::c_uint,
3963 ) -> root::rev::REVLibError {
3964 CANSparkMax_SetSmartCurrentLimit(self, limit)
3965 }
3966 #[inline]
3967 pub unsafe fn SetSmartCurrentLimit1(
3968 &mut self,
3969 stallLimit: ::std::os::raw::c_uint,
3970 freeLimit: ::std::os::raw::c_uint,
3971 limitRPM: ::std::os::raw::c_uint,
3972 ) -> root::rev::REVLibError {
3973 CANSparkMax_SetSmartCurrentLimit1(self, stallLimit, freeLimit, limitRPM)
3974 }
3975 #[inline]
3976 pub unsafe fn SetSecondaryCurrentLimit(
3977 &mut self,
3978 limit: f64,
3979 limitCycles: ::std::os::raw::c_int,
3980 ) -> root::rev::REVLibError {
3981 CANSparkMax_SetSecondaryCurrentLimit(self, limit, limitCycles)
3982 }
3983 #[inline]
3984 pub unsafe fn SetIdleMode(
3985 &mut self,
3986 mode: root::rev::CANSparkMax_IdleMode,
3987 ) -> root::rev::REVLibError {
3988 CANSparkMax_SetIdleMode(self, mode)
3989 }
3990 #[inline]
3991 pub unsafe fn GetIdleMode(&mut self) -> root::rev::CANSparkMax_IdleMode {
3992 CANSparkMax_GetIdleMode(self)
3993 }
3994 #[inline]
3995 pub unsafe fn EnableVoltageCompensation(
3996 &mut self,
3997 nominalVoltage: f64,
3998 ) -> root::rev::REVLibError {
3999 CANSparkMax_EnableVoltageCompensation(self, nominalVoltage)
4000 }
4001 #[inline]
4002 pub unsafe fn DisableVoltageCompensation(&mut self) -> root::rev::REVLibError {
4003 CANSparkMax_DisableVoltageCompensation(self)
4004 }
4005 #[inline]
4006 pub unsafe fn GetVoltageCompensationNominalVoltage(&mut self) -> f64 {
4007 CANSparkMax_GetVoltageCompensationNominalVoltage(self)
4008 }
4009 #[inline]
4010 pub unsafe fn SetOpenLoopRampRate(&mut self, rate: f64) -> root::rev::REVLibError {
4011 CANSparkMax_SetOpenLoopRampRate(self, rate)
4012 }
4013 #[inline]
4014 pub unsafe fn SetClosedLoopRampRate(&mut self, rate: f64) -> root::rev::REVLibError {
4015 CANSparkMax_SetClosedLoopRampRate(self, rate)
4016 }
4017 #[inline]
4018 pub unsafe fn GetOpenLoopRampRate(&mut self) -> f64 {
4019 CANSparkMax_GetOpenLoopRampRate(self)
4020 }
4021 #[inline]
4022 pub unsafe fn GetClosedLoopRampRate(&mut self) -> f64 {
4023 CANSparkMax_GetClosedLoopRampRate(self)
4024 }
4025 #[inline]
4026 pub unsafe fn Follow(
4027 &mut self,
4028 leader: *const root::rev::CANSparkMax,
4029 invert: bool,
4030 ) -> root::rev::REVLibError {
4031 CANSparkMax_Follow(self, leader, invert)
4032 }
4033 #[inline]
4034 pub unsafe fn Follow1(
4035 &mut self,
4036 leader: root::rev::CANSparkMax_ExternalFollower,
4037 deviceID: ::std::os::raw::c_int,
4038 invert: bool,
4039 ) -> root::rev::REVLibError {
4040 CANSparkMax_Follow1(self, leader, deviceID, invert)
4041 }
4042 #[inline]
4043 pub unsafe fn IsFollower(&mut self) -> bool {
4044 CANSparkMax_IsFollower(self)
4045 }
4046 #[inline]
4047 pub unsafe fn GetFaults(&mut self) -> u16 {
4048 CANSparkMax_GetFaults(self)
4049 }
4050 #[inline]
4051 pub unsafe fn GetStickyFaults(&mut self) -> u16 {
4052 CANSparkMax_GetStickyFaults(self)
4053 }
4054 #[inline]
4055 pub unsafe fn GetFault(&self, faultID: root::rev::CANSparkMax_FaultID) -> bool {
4056 CANSparkMax_GetFault(self, faultID)
4057 }
4058 #[inline]
4059 pub unsafe fn GetStickyFault(&self, faultID: root::rev::CANSparkMax_FaultID) -> bool {
4060 CANSparkMax_GetStickyFault(self, faultID)
4061 }
4062 #[inline]
4063 pub unsafe fn GetBusVoltage(&mut self) -> f64 {
4064 CANSparkMax_GetBusVoltage(self)
4065 }
4066 #[inline]
4067 pub unsafe fn GetAppliedOutput(&mut self) -> f64 {
4068 CANSparkMax_GetAppliedOutput(self)
4069 }
4070 #[inline]
4071 pub unsafe fn GetOutputCurrent(&mut self) -> f64 {
4072 CANSparkMax_GetOutputCurrent(self)
4073 }
4074 #[inline]
4075 pub unsafe fn GetMotorTemperature(&mut self) -> f64 {
4076 CANSparkMax_GetMotorTemperature(self)
4077 }
4078 #[inline]
4079 pub unsafe fn ClearFaults(&mut self) -> root::rev::REVLibError {
4080 CANSparkMax_ClearFaults(self)
4081 }
4082 #[inline]
4083 pub unsafe fn BurnFlash(&mut self) -> root::rev::REVLibError {
4084 CANSparkMax_BurnFlash(self)
4085 }
4086 #[inline]
4087 pub unsafe fn SetCANTimeout(
4088 &mut self,
4089 milliseconds: ::std::os::raw::c_int,
4090 ) -> root::rev::REVLibError {
4091 CANSparkMax_SetCANTimeout(self, milliseconds)
4092 }
4093 #[inline]
4094 pub unsafe fn EnableSoftLimit(
4095 &mut self,
4096 direction: root::rev::CANSparkMax_SoftLimitDirection,
4097 enable: bool,
4098 ) -> root::rev::REVLibError {
4099 CANSparkMax_EnableSoftLimit(self, direction, enable)
4100 }
4101 #[inline]
4102 pub unsafe fn IsSoftLimitEnabled(
4103 &mut self,
4104 direction: root::rev::CANSparkMax_SoftLimitDirection,
4105 ) -> bool {
4106 CANSparkMax_IsSoftLimitEnabled(self, direction)
4107 }
4108 #[inline]
4109 pub unsafe fn SetSoftLimit(
4110 &mut self,
4111 direction: root::rev::CANSparkMax_SoftLimitDirection,
4112 limit: f64,
4113 ) -> root::rev::REVLibError {
4114 CANSparkMax_SetSoftLimit(self, direction, limit)
4115 }
4116 #[inline]
4117 pub unsafe fn GetSoftLimit(
4118 &mut self,
4119 direction: root::rev::CANSparkMax_SoftLimitDirection,
4120 ) -> f64 {
4121 CANSparkMax_GetSoftLimit(self, direction)
4122 }
4123 #[inline]
4124 pub unsafe fn GetLastError(&mut self) -> root::rev::REVLibError {
4125 CANSparkMax_GetLastError(self)
4126 }
4127 #[inline]
4128 pub unsafe fn new(
4129 deviceID: ::std::os::raw::c_int,
4130 type_: root::rev::CANSparkMaxLowLevel_MotorType,
4131 ) -> Self {
4132 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
4133 CANSparkMax_CANSparkMax(__bindgen_tmp.as_mut_ptr(), deviceID, type_);
4134 __bindgen_tmp.assume_init()
4135 }
4136 }
4137 extern "C" {
4138 #[doc = " Speed Controller Interface ****/"]
4139 #[doc = " Common interface for setting the speed of a speed controller."]
4140 #[doc = ""]
4141 #[doc = " @param speed The speed to set. Value should be between -1.0 and 1.0."]
4142 #[link_name = "\u{1}_ZN3rev11CANSparkMax3SetEd"]
4143 pub fn CANSparkMax_Set(this: *mut ::std::os::raw::c_void, speed: f64);
4144 }
4145 extern "C" {
4146 #[doc = " Sets the voltage output of the SpeedController. This is equivalent to"]
4147 #[doc = " a call to SetReference(output, CANSparkMax::ControlType::kVoltage). The"]
4148 #[doc = " behavior of this call differs slightly from the WPILib documentation for"]
4149 #[doc = " this call since the device internally sets the desired voltage (not a"]
4150 #[doc = " compensation value). That means that this *can* be a 'set-and-forget'"]
4151 #[doc = " call."]
4152 #[doc = ""]
4153 #[doc = " @param output The voltage to output."]
4154 #[link_name = "\u{1}_ZN3rev11CANSparkMax10SetVoltageEN5units6unit_tINS1_4unitISt5ratioILl1ELl1EENS1_9base_unitIS4_ILl2ELl1EES5_S4_ILln3ELl1EES4_ILl0ELl1EES4_ILln1ELl1EES9_S9_S9_S9_EES9_S9_EEdNS1_12linear_scaleEEE"]
4155 pub fn CANSparkMax_SetVoltage(
4156 this: *mut ::std::os::raw::c_void,
4157 output: root::units::voltage::volt_t,
4158 );
4159 }
4160 extern "C" {
4161 #[doc = " Common interface for getting the current set speed of a speed controller."]
4162 #[doc = ""]
4163 #[doc = " @return The current set speed. Value is between -1.0 and 1.0."]
4164 #[link_name = "\u{1}_ZNK3rev11CANSparkMax3GetEv"]
4165 pub fn CANSparkMax_Get(this: *mut ::std::os::raw::c_void) -> f64;
4166 }
4167 extern "C" {
4168 #[doc = " Common interface for inverting direction of a speed controller."]
4169 #[doc = ""]
4170 #[doc = " This call has no effect if the controller is a follower. To invert"]
4171 #[doc = " a follower, see the follow() method."]
4172 #[doc = ""]
4173 #[doc = " @param isInverted The state of inversion, true is inverted."]
4174 #[link_name = "\u{1}_ZN3rev11CANSparkMax11SetInvertedEb"]
4175 pub fn CANSparkMax_SetInverted(this: *mut ::std::os::raw::c_void, isInverted: bool);
4176 }
4177 extern "C" {
4178 #[doc = " Common interface for returning the inversion state of a speed controller."]
4179 #[doc = ""]
4180 #[doc = " This call has no effect if the controller is a follower."]
4181 #[doc = ""]
4182 #[doc = " @return isInverted The state of inversion, true is inverted."]
4183 #[link_name = "\u{1}_ZNK3rev11CANSparkMax11GetInvertedEv"]
4184 pub fn CANSparkMax_GetInverted(this: *mut ::std::os::raw::c_void) -> bool;
4185 }
4186 extern "C" {
4187 #[doc = " Common interface for disabling a motor."]
4188 #[link_name = "\u{1}_ZN3rev11CANSparkMax7DisableEv"]
4189 pub fn CANSparkMax_Disable(this: *mut ::std::os::raw::c_void);
4190 }
4191 extern "C" {
4192 #[doc = " Common interface to stop the motor until Set is called again."]
4193 #[link_name = "\u{1}_ZN3rev11CANSparkMax9StopMotorEv"]
4194 pub fn CANSparkMax_StopMotor(this: *mut ::std::os::raw::c_void);
4195 }
4196 #[repr(C)]
4197 #[derive(Debug, Copy, Clone)]
4198 pub struct CIEColor {
4199 pub X: f64,
4200 pub Y: f64,
4201 pub Z: f64,
4202 pub mag: f64,
4203 }
4204 extern "C" {
4205 #[link_name = "\u{1}_ZN3rev8CIEColor13IlluminantD65E"]
4206 pub static CIEColor_IlluminantD65: [f64; 3usize];
4207 }
4208 extern "C" {
4209 #[link_name = "\u{1}_ZN3rev8CIEColor8XYZtoRGBE"]
4210 pub static CIEColor_XYZtoRGB: [f64; 9usize];
4211 }
4212 #[test]
4213 fn bindgen_test_layout_CIEColor() {
4214 assert_eq!(
4215 ::std::mem::size_of::<CIEColor>(),
4216 32usize,
4217 concat!("Size of: ", stringify!(CIEColor))
4218 );
4219 assert_eq!(
4220 ::std::mem::align_of::<CIEColor>(),
4221 8usize,
4222 concat!("Alignment of ", stringify!(CIEColor))
4223 );
4224 fn test_field_X() {
4225 assert_eq!(
4226 unsafe {
4227 let uninit = ::std::mem::MaybeUninit::<CIEColor>::uninit();
4228 let ptr = uninit.as_ptr();
4229 ::std::ptr::addr_of!((*ptr).X) as usize - ptr as usize
4230 },
4231 0usize,
4232 concat!(
4233 "Offset of field: ",
4234 stringify!(CIEColor),
4235 "::",
4236 stringify!(X)
4237 )
4238 );
4239 }
4240 test_field_X();
4241 fn test_field_Y() {
4242 assert_eq!(
4243 unsafe {
4244 let uninit = ::std::mem::MaybeUninit::<CIEColor>::uninit();
4245 let ptr = uninit.as_ptr();
4246 ::std::ptr::addr_of!((*ptr).Y) as usize - ptr as usize
4247 },
4248 8usize,
4249 concat!(
4250 "Offset of field: ",
4251 stringify!(CIEColor),
4252 "::",
4253 stringify!(Y)
4254 )
4255 );
4256 }
4257 test_field_Y();
4258 fn test_field_Z() {
4259 assert_eq!(
4260 unsafe {
4261 let uninit = ::std::mem::MaybeUninit::<CIEColor>::uninit();
4262 let ptr = uninit.as_ptr();
4263 ::std::ptr::addr_of!((*ptr).Z) as usize - ptr as usize
4264 },
4265 16usize,
4266 concat!(
4267 "Offset of field: ",
4268 stringify!(CIEColor),
4269 "::",
4270 stringify!(Z)
4271 )
4272 );
4273 }
4274 test_field_Z();
4275 fn test_field_mag() {
4276 assert_eq!(
4277 unsafe {
4278 let uninit = ::std::mem::MaybeUninit::<CIEColor>::uninit();
4279 let ptr = uninit.as_ptr();
4280 ::std::ptr::addr_of!((*ptr).mag) as usize - ptr as usize
4281 },
4282 24usize,
4283 concat!(
4284 "Offset of field: ",
4285 stringify!(CIEColor),
4286 "::",
4287 stringify!(mag)
4288 )
4289 );
4290 }
4291 test_field_mag();
4292 }
4293 #[doc = " REV Robotics Color Sensor V3."]
4294 #[doc = ""]
4295 #[doc = " This class allows access to a REV Robotics color sensor V3 on an I2C bus."]
4296 #[repr(C)]
4297 #[derive(Debug)]
4298 pub struct ColorMatch {
4299 pub m_colorsToMatch: root::std::vector,
4300 pub m_confidenceLevel: f64,
4301 }
4302 #[test]
4303 fn bindgen_test_layout_ColorMatch() {
4304 assert_eq!(
4305 ::std::mem::size_of::<ColorMatch>(),
4306 32usize,
4307 concat!("Size of: ", stringify!(ColorMatch))
4308 );
4309 assert_eq!(
4310 ::std::mem::align_of::<ColorMatch>(),
4311 8usize,
4312 concat!("Alignment of ", stringify!(ColorMatch))
4313 );
4314 fn test_field_m_colorsToMatch() {
4315 assert_eq!(
4316 unsafe {
4317 let uninit = ::std::mem::MaybeUninit::<ColorMatch>::uninit();
4318 let ptr = uninit.as_ptr();
4319 ::std::ptr::addr_of!((*ptr).m_colorsToMatch) as usize - ptr as usize
4320 },
4321 0usize,
4322 concat!(
4323 "Offset of field: ",
4324 stringify!(ColorMatch),
4325 "::",
4326 stringify!(m_colorsToMatch)
4327 )
4328 );
4329 }
4330 test_field_m_colorsToMatch();
4331 fn test_field_m_confidenceLevel() {
4332 assert_eq!(
4333 unsafe {
4334 let uninit = ::std::mem::MaybeUninit::<ColorMatch>::uninit();
4335 let ptr = uninit.as_ptr();
4336 ::std::ptr::addr_of!((*ptr).m_confidenceLevel) as usize - ptr as usize
4337 },
4338 24usize,
4339 concat!(
4340 "Offset of field: ",
4341 stringify!(ColorMatch),
4342 "::",
4343 stringify!(m_confidenceLevel)
4344 )
4345 );
4346 }
4347 test_field_m_confidenceLevel();
4348 }
4349 extern "C" {
4350 #[doc = " Add color to match object"]
4351 #[doc = ""]
4352 #[doc = " @param color color to add to matching"]
4353 #[doc = ""]
4354 #[link_name = "\u{1}_ZN3rev10ColorMatch13AddColorMatchERKN3frc5ColorE"]
4355 pub fn ColorMatch_AddColorMatch(
4356 this: *mut root::rev::ColorMatch,
4357 color: *const root::frc::Color,
4358 );
4359 }
4360 extern "C" {
4361 #[doc = " Set the confidence interval for determining color. Defaults to 0.95"]
4362 #[doc = ""]
4363 #[doc = " @param confidence A value between 0 and 1"]
4364 #[link_name = "\u{1}_ZN3rev10ColorMatch22SetConfidenceThresholdEd"]
4365 pub fn ColorMatch_SetConfidenceThreshold(
4366 this: *mut root::rev::ColorMatch,
4367 confidence: f64,
4368 );
4369 }
4370 extern "C" {
4371 #[doc = " MatchColor uses euclidean distance to compare a given normalized RGB"]
4372 #[doc = " vector against stored values"]
4373 #[doc = ""]
4374 #[doc = " @param colorToMatch color to compare against stored colors"]
4375 #[doc = ""]
4376 #[doc = " @return Matched color if detected"]
4377 #[link_name = "\u{1}_ZN3rev10ColorMatch10MatchColorERKN3frc5ColorE"]
4378 pub fn ColorMatch_MatchColor(
4379 this: *mut root::rev::ColorMatch,
4380 colorToMatch: *const root::frc::Color,
4381 ) -> root::std::optional;
4382 }
4383 extern "C" {
4384 #[doc = " MatchColor uses euclidean distance to compare a given normalized RGB"]
4385 #[doc = " vector against stored values"]
4386 #[doc = ""]
4387 #[doc = " @param colorToMatch color to compare against stored colors"]
4388 #[doc = ""]
4389 #[doc = " @param confidence The confidence value for this match, this is"]
4390 #[doc = " simply 1 - euclidean distance of the two color vectors"]
4391 #[doc = ""]
4392 #[doc = " @return Matched color if detected"]
4393 #[link_name = "\u{1}_ZN3rev10ColorMatch10MatchColorERKN3frc5ColorERd"]
4394 pub fn ColorMatch_MatchColor1(
4395 this: *mut root::rev::ColorMatch,
4396 colorToMatch: *const root::frc::Color,
4397 confidence: *mut f64,
4398 ) -> root::std::optional;
4399 }
4400 extern "C" {
4401 #[doc = " MatchColor uses euclidean distance to compare a given normalized RGB"]
4402 #[doc = " vector against stored values"]
4403 #[doc = ""]
4404 #[doc = " @param colorToMatch color to compare against stored colors"]
4405 #[doc = ""]
4406 #[doc = " @param confidence The confidence value for this match, this is"]
4407 #[doc = " simply 1 - euclidean distance of the two color vectors"]
4408 #[doc = ""]
4409 #[doc = " @return Closest matching color"]
4410 #[link_name = "\u{1}_ZN3rev10ColorMatch17MatchClosestColorERKN3frc5ColorERd"]
4411 pub fn ColorMatch_MatchClosestColor(
4412 this: *mut root::rev::ColorMatch,
4413 colorToMatch: *const root::frc::Color,
4414 confidence: *mut f64,
4415 ) -> root::frc::Color;
4416 }
4417 extern "C" {
4418 #[link_name = "\u{1}_ZN3rev10ColorMatchC1Ev"]
4419 pub fn ColorMatch_ColorMatch(this: *mut root::rev::ColorMatch);
4420 }
4421 impl ColorMatch {
4422 #[inline]
4423 pub unsafe fn AddColorMatch(&mut self, color: *const root::frc::Color) {
4424 ColorMatch_AddColorMatch(self, color)
4425 }
4426 #[inline]
4427 pub unsafe fn SetConfidenceThreshold(&mut self, confidence: f64) {
4428 ColorMatch_SetConfidenceThreshold(self, confidence)
4429 }
4430 #[inline]
4431 pub unsafe fn MatchColor(
4432 &mut self,
4433 colorToMatch: *const root::frc::Color,
4434 ) -> root::std::optional {
4435 ColorMatch_MatchColor(self, colorToMatch)
4436 }
4437 #[inline]
4438 pub unsafe fn MatchColor1(
4439 &mut self,
4440 colorToMatch: *const root::frc::Color,
4441 confidence: *mut f64,
4442 ) -> root::std::optional {
4443 ColorMatch_MatchColor1(self, colorToMatch, confidence)
4444 }
4445 #[inline]
4446 pub unsafe fn MatchClosestColor(
4447 &mut self,
4448 colorToMatch: *const root::frc::Color,
4449 confidence: *mut f64,
4450 ) -> root::frc::Color {
4451 ColorMatch_MatchClosestColor(self, colorToMatch, confidence)
4452 }
4453 #[inline]
4454 pub unsafe fn new() -> Self {
4455 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
4456 ColorMatch_ColorMatch(__bindgen_tmp.as_mut_ptr());
4457 __bindgen_tmp.assume_init()
4458 }
4459 }
4460 #[doc = " REV Robotics Color Sensor V3."]
4461 #[doc = ""]
4462 #[doc = " This class allows access to a REV Robotics color sensor V3 on an I2C bus."]
4463 #[repr(C)]
4464 #[derive(Debug)]
4465 pub struct ColorSensorV3 {
4466 pub m_i2c: root::frc::I2C,
4467 pub m_simDevice: root::hal::SimDevice,
4468 pub m_simR: root::hal::SimDouble,
4469 pub m_simG: root::hal::SimDouble,
4470 pub m_simB: root::hal::SimDouble,
4471 pub m_simIR: root::hal::SimDouble,
4472 pub m_simProx: root::hal::SimDouble,
4473 }
4474 pub const ColorSensorV3_GainFactor_k1x: root::rev::ColorSensorV3_GainFactor = 0;
4475 pub const ColorSensorV3_GainFactor_k3x: root::rev::ColorSensorV3_GainFactor = 1;
4476 pub const ColorSensorV3_GainFactor_k6x: root::rev::ColorSensorV3_GainFactor = 2;
4477 pub const ColorSensorV3_GainFactor_k9x: root::rev::ColorSensorV3_GainFactor = 3;
4478 pub const ColorSensorV3_GainFactor_k18x: root::rev::ColorSensorV3_GainFactor = 4;
4479 pub type ColorSensorV3_GainFactor = ::std::os::raw::c_int;
4480 pub const ColorSensorV3_LEDPulseFrequency_k60kHz:
4481 root::rev::ColorSensorV3_LEDPulseFrequency = 24;
4482 pub const ColorSensorV3_LEDPulseFrequency_k70kHz:
4483 root::rev::ColorSensorV3_LEDPulseFrequency = 64;
4484 pub const ColorSensorV3_LEDPulseFrequency_k80kHz:
4485 root::rev::ColorSensorV3_LEDPulseFrequency = 40;
4486 pub const ColorSensorV3_LEDPulseFrequency_k90kHz:
4487 root::rev::ColorSensorV3_LEDPulseFrequency = 48;
4488 pub const ColorSensorV3_LEDPulseFrequency_k100kHz:
4489 root::rev::ColorSensorV3_LEDPulseFrequency = 56;
4490 pub type ColorSensorV3_LEDPulseFrequency = ::std::os::raw::c_int;
4491 pub const ColorSensorV3_LEDCurrent_kPulse2mA: root::rev::ColorSensorV3_LEDCurrent = 0;
4492 pub const ColorSensorV3_LEDCurrent_kPulse5mA: root::rev::ColorSensorV3_LEDCurrent = 1;
4493 pub const ColorSensorV3_LEDCurrent_kPulse10mA: root::rev::ColorSensorV3_LEDCurrent = 2;
4494 pub const ColorSensorV3_LEDCurrent_kPulse25mA: root::rev::ColorSensorV3_LEDCurrent = 3;
4495 pub const ColorSensorV3_LEDCurrent_kPulse50mA: root::rev::ColorSensorV3_LEDCurrent = 4;
4496 pub const ColorSensorV3_LEDCurrent_kPulse75mA: root::rev::ColorSensorV3_LEDCurrent = 5;
4497 pub const ColorSensorV3_LEDCurrent_kPulse100mA: root::rev::ColorSensorV3_LEDCurrent = 6;
4498 pub const ColorSensorV3_LEDCurrent_kPulse125mA: root::rev::ColorSensorV3_LEDCurrent = 7;
4499 pub type ColorSensorV3_LEDCurrent = ::std::os::raw::c_int;
4500 pub const ColorSensorV3_ProximityResolution_k8bit:
4501 root::rev::ColorSensorV3_ProximityResolution = 0;
4502 pub const ColorSensorV3_ProximityResolution_k9bit:
4503 root::rev::ColorSensorV3_ProximityResolution = 8;
4504 pub const ColorSensorV3_ProximityResolution_k10bit:
4505 root::rev::ColorSensorV3_ProximityResolution = 16;
4506 pub const ColorSensorV3_ProximityResolution_k11bit:
4507 root::rev::ColorSensorV3_ProximityResolution = 24;
4508 pub type ColorSensorV3_ProximityResolution = ::std::os::raw::c_int;
4509 pub const ColorSensorV3_ProximityMeasurementRate_k6ms:
4510 root::rev::ColorSensorV3_ProximityMeasurementRate = 1;
4511 pub const ColorSensorV3_ProximityMeasurementRate_k12ms:
4512 root::rev::ColorSensorV3_ProximityMeasurementRate = 2;
4513 pub const ColorSensorV3_ProximityMeasurementRate_k25ms:
4514 root::rev::ColorSensorV3_ProximityMeasurementRate = 3;
4515 pub const ColorSensorV3_ProximityMeasurementRate_k50ms:
4516 root::rev::ColorSensorV3_ProximityMeasurementRate = 4;
4517 pub const ColorSensorV3_ProximityMeasurementRate_k100ms:
4518 root::rev::ColorSensorV3_ProximityMeasurementRate = 5;
4519 pub const ColorSensorV3_ProximityMeasurementRate_k200ms:
4520 root::rev::ColorSensorV3_ProximityMeasurementRate = 6;
4521 pub const ColorSensorV3_ProximityMeasurementRate_k400ms:
4522 root::rev::ColorSensorV3_ProximityMeasurementRate = 7;
4523 pub type ColorSensorV3_ProximityMeasurementRate = ::std::os::raw::c_int;
4524 pub const ColorSensorV3_ColorResolution_k20bit: root::rev::ColorSensorV3_ColorResolution =
4525 0;
4526 pub const ColorSensorV3_ColorResolution_k19bit: root::rev::ColorSensorV3_ColorResolution =
4527 16;
4528 pub const ColorSensorV3_ColorResolution_k18bit: root::rev::ColorSensorV3_ColorResolution =
4529 32;
4530 pub const ColorSensorV3_ColorResolution_k17bit: root::rev::ColorSensorV3_ColorResolution =
4531 48;
4532 pub const ColorSensorV3_ColorResolution_k16bit: root::rev::ColorSensorV3_ColorResolution =
4533 64;
4534 pub const ColorSensorV3_ColorResolution_k13bit: root::rev::ColorSensorV3_ColorResolution =
4535 80;
4536 pub type ColorSensorV3_ColorResolution = ::std::os::raw::c_int;
4537 pub const ColorSensorV3_ColorMeasurementRate_k25ms:
4538 root::rev::ColorSensorV3_ColorMeasurementRate = 0;
4539 pub const ColorSensorV3_ColorMeasurementRate_k50ms:
4540 root::rev::ColorSensorV3_ColorMeasurementRate = 1;
4541 pub const ColorSensorV3_ColorMeasurementRate_k100ms:
4542 root::rev::ColorSensorV3_ColorMeasurementRate = 2;
4543 pub const ColorSensorV3_ColorMeasurementRate_k200ms:
4544 root::rev::ColorSensorV3_ColorMeasurementRate = 3;
4545 pub const ColorSensorV3_ColorMeasurementRate_k500ms:
4546 root::rev::ColorSensorV3_ColorMeasurementRate = 4;
4547 pub const ColorSensorV3_ColorMeasurementRate_k1000ms:
4548 root::rev::ColorSensorV3_ColorMeasurementRate = 5;
4549 pub const ColorSensorV3_ColorMeasurementRate_k2000ms:
4550 root::rev::ColorSensorV3_ColorMeasurementRate = 7;
4551 pub type ColorSensorV3_ColorMeasurementRate = ::std::os::raw::c_int;
4552 #[repr(C)]
4553 #[derive(Debug, Copy, Clone)]
4554 pub struct ColorSensorV3_RawColor {
4555 pub red: u32,
4556 pub green: u32,
4557 pub blue: u32,
4558 pub ir: u32,
4559 }
4560 #[test]
4561 fn bindgen_test_layout_ColorSensorV3_RawColor() {
4562 assert_eq!(
4563 ::std::mem::size_of::<ColorSensorV3_RawColor>(),
4564 16usize,
4565 concat!("Size of: ", stringify!(ColorSensorV3_RawColor))
4566 );
4567 assert_eq!(
4568 ::std::mem::align_of::<ColorSensorV3_RawColor>(),
4569 4usize,
4570 concat!("Alignment of ", stringify!(ColorSensorV3_RawColor))
4571 );
4572 fn test_field_red() {
4573 assert_eq!(
4574 unsafe {
4575 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3_RawColor>::uninit();
4576 let ptr = uninit.as_ptr();
4577 ::std::ptr::addr_of!((*ptr).red) as usize - ptr as usize
4578 },
4579 0usize,
4580 concat!(
4581 "Offset of field: ",
4582 stringify!(ColorSensorV3_RawColor),
4583 "::",
4584 stringify!(red)
4585 )
4586 );
4587 }
4588 test_field_red();
4589 fn test_field_green() {
4590 assert_eq!(
4591 unsafe {
4592 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3_RawColor>::uninit();
4593 let ptr = uninit.as_ptr();
4594 ::std::ptr::addr_of!((*ptr).green) as usize - ptr as usize
4595 },
4596 4usize,
4597 concat!(
4598 "Offset of field: ",
4599 stringify!(ColorSensorV3_RawColor),
4600 "::",
4601 stringify!(green)
4602 )
4603 );
4604 }
4605 test_field_green();
4606 fn test_field_blue() {
4607 assert_eq!(
4608 unsafe {
4609 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3_RawColor>::uninit();
4610 let ptr = uninit.as_ptr();
4611 ::std::ptr::addr_of!((*ptr).blue) as usize - ptr as usize
4612 },
4613 8usize,
4614 concat!(
4615 "Offset of field: ",
4616 stringify!(ColorSensorV3_RawColor),
4617 "::",
4618 stringify!(blue)
4619 )
4620 );
4621 }
4622 test_field_blue();
4623 fn test_field_ir() {
4624 assert_eq!(
4625 unsafe {
4626 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3_RawColor>::uninit();
4627 let ptr = uninit.as_ptr();
4628 ::std::ptr::addr_of!((*ptr).ir) as usize - ptr as usize
4629 },
4630 12usize,
4631 concat!(
4632 "Offset of field: ",
4633 stringify!(ColorSensorV3_RawColor),
4634 "::",
4635 stringify!(ir)
4636 )
4637 );
4638 }
4639 test_field_ir();
4640 }
4641 pub const ColorSensorV3_Register_kMainCtrl: root::rev::ColorSensorV3_Register = 0;
4642 pub const ColorSensorV3_Register_kProximitySensorLED: root::rev::ColorSensorV3_Register = 1;
4643 pub const ColorSensorV3_Register_kProximitySensorPulses: root::rev::ColorSensorV3_Register =
4644 2;
4645 pub const ColorSensorV3_Register_kProximitySensorRate: root::rev::ColorSensorV3_Register =
4646 3;
4647 pub const ColorSensorV3_Register_kLightSensorMeasurementRate:
4648 root::rev::ColorSensorV3_Register = 4;
4649 pub const ColorSensorV3_Register_kLightSensorGain: root::rev::ColorSensorV3_Register = 5;
4650 pub const ColorSensorV3_Register_kPartID: root::rev::ColorSensorV3_Register = 6;
4651 pub const ColorSensorV3_Register_kMainStatus: root::rev::ColorSensorV3_Register = 7;
4652 pub const ColorSensorV3_Register_kProximityData: root::rev::ColorSensorV3_Register = 8;
4653 pub const ColorSensorV3_Register_kDataInfrared: root::rev::ColorSensorV3_Register = 10;
4654 pub const ColorSensorV3_Register_kDataGreen: root::rev::ColorSensorV3_Register = 13;
4655 pub const ColorSensorV3_Register_kDataBlue: root::rev::ColorSensorV3_Register = 16;
4656 pub const ColorSensorV3_Register_kDataRed: root::rev::ColorSensorV3_Register = 19;
4657 pub type ColorSensorV3_Register = ::std::os::raw::c_int;
4658 pub const ColorSensorV3_MainCtrlFields_kProximitySensorEnable:
4659 root::rev::ColorSensorV3_MainCtrlFields = 1;
4660 pub const ColorSensorV3_MainCtrlFields_kLightSensorEnable:
4661 root::rev::ColorSensorV3_MainCtrlFields = 2;
4662 pub const ColorSensorV3_MainCtrlFields_kRGBMode: root::rev::ColorSensorV3_MainCtrlFields =
4663 4;
4664 pub type ColorSensorV3_MainCtrlFields = ::std::os::raw::c_int;
4665 #[repr(C, packed)]
4666 #[derive(Debug, Copy, Clone)]
4667 pub struct ColorSensorV3_MainStatus {
4668 pub _bitfield_align_1: [u8; 0],
4669 pub _bitfield_1: root::__BindgenBitfieldUnit<[u8; 1usize]>,
4670 }
4671 #[test]
4672 fn bindgen_test_layout_ColorSensorV3_MainStatus() {
4673 assert_eq!(
4674 ::std::mem::size_of::<ColorSensorV3_MainStatus>(),
4675 1usize,
4676 concat!("Size of: ", stringify!(ColorSensorV3_MainStatus))
4677 );
4678 assert_eq!(
4679 ::std::mem::align_of::<ColorSensorV3_MainStatus>(),
4680 1usize,
4681 concat!("Alignment of ", stringify!(ColorSensorV3_MainStatus))
4682 );
4683 }
4684 impl ColorSensorV3_MainStatus {
4685 #[inline]
4686 pub fn PSDataStatus(&self) -> u8 {
4687 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
4688 }
4689 #[inline]
4690 pub fn set_PSDataStatus(&mut self, val: u8) {
4691 unsafe {
4692 let val: u8 = ::std::mem::transmute(val);
4693 self._bitfield_1.set(0usize, 1u8, val as u64)
4694 }
4695 }
4696 #[inline]
4697 pub fn PSInterruptStatus(&self) -> u8 {
4698 unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
4699 }
4700 #[inline]
4701 pub fn set_PSInterruptStatus(&mut self, val: u8) {
4702 unsafe {
4703 let val: u8 = ::std::mem::transmute(val);
4704 self._bitfield_1.set(1usize, 1u8, val as u64)
4705 }
4706 }
4707 #[inline]
4708 pub fn PSLogicStatus(&self) -> u8 {
4709 unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u8) }
4710 }
4711 #[inline]
4712 pub fn set_PSLogicStatus(&mut self, val: u8) {
4713 unsafe {
4714 let val: u8 = ::std::mem::transmute(val);
4715 self._bitfield_1.set(2usize, 1u8, val as u64)
4716 }
4717 }
4718 #[inline]
4719 pub fn LSDataStatus(&self) -> u8 {
4720 unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) }
4721 }
4722 #[inline]
4723 pub fn set_LSDataStatus(&mut self, val: u8) {
4724 unsafe {
4725 let val: u8 = ::std::mem::transmute(val);
4726 self._bitfield_1.set(3usize, 1u8, val as u64)
4727 }
4728 }
4729 #[inline]
4730 pub fn LSInterruptStatus(&self) -> u8 {
4731 unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u8) }
4732 }
4733 #[inline]
4734 pub fn set_LSInterruptStatus(&mut self, val: u8) {
4735 unsafe {
4736 let val: u8 = ::std::mem::transmute(val);
4737 self._bitfield_1.set(4usize, 1u8, val as u64)
4738 }
4739 }
4740 #[inline]
4741 pub fn PowerOnStatus(&self) -> u8 {
4742 unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u8) }
4743 }
4744 #[inline]
4745 pub fn set_PowerOnStatus(&mut self, val: u8) {
4746 unsafe {
4747 let val: u8 = ::std::mem::transmute(val);
4748 self._bitfield_1.set(5usize, 1u8, val as u64)
4749 }
4750 }
4751 #[inline]
4752 pub fn new_bitfield_1(
4753 PSDataStatus: u8,
4754 PSInterruptStatus: u8,
4755 PSLogicStatus: u8,
4756 LSDataStatus: u8,
4757 LSInterruptStatus: u8,
4758 PowerOnStatus: u8,
4759 ) -> root::__BindgenBitfieldUnit<[u8; 1usize]> {
4760 let mut __bindgen_bitfield_unit: root::__BindgenBitfieldUnit<[u8; 1usize]> =
4761 Default::default();
4762 __bindgen_bitfield_unit.set(0usize, 1u8, {
4763 let PSDataStatus: u8 = unsafe { ::std::mem::transmute(PSDataStatus) };
4764 PSDataStatus as u64
4765 });
4766 __bindgen_bitfield_unit.set(1usize, 1u8, {
4767 let PSInterruptStatus: u8 = unsafe { ::std::mem::transmute(PSInterruptStatus) };
4768 PSInterruptStatus as u64
4769 });
4770 __bindgen_bitfield_unit.set(2usize, 1u8, {
4771 let PSLogicStatus: u8 = unsafe { ::std::mem::transmute(PSLogicStatus) };
4772 PSLogicStatus as u64
4773 });
4774 __bindgen_bitfield_unit.set(3usize, 1u8, {
4775 let LSDataStatus: u8 = unsafe { ::std::mem::transmute(LSDataStatus) };
4776 LSDataStatus as u64
4777 });
4778 __bindgen_bitfield_unit.set(4usize, 1u8, {
4779 let LSInterruptStatus: u8 = unsafe { ::std::mem::transmute(LSInterruptStatus) };
4780 LSInterruptStatus as u64
4781 });
4782 __bindgen_bitfield_unit.set(5usize, 1u8, {
4783 let PowerOnStatus: u8 = unsafe { ::std::mem::transmute(PowerOnStatus) };
4784 PowerOnStatus as u64
4785 });
4786 __bindgen_bitfield_unit
4787 }
4788 }
4789 extern "C" {
4790 #[link_name = "\u{1}_ZN3rev13ColorSensorV37CmatrixE"]
4791 pub static ColorSensorV3_Cmatrix: [f64; 9usize];
4792 }
4793 #[test]
4794 fn bindgen_test_layout_ColorSensorV3() {
4795 assert_eq!(
4796 ::std::mem::size_of::<ColorSensorV3>(),
4797 32usize,
4798 concat!("Size of: ", stringify!(ColorSensorV3))
4799 );
4800 assert_eq!(
4801 ::std::mem::align_of::<ColorSensorV3>(),
4802 4usize,
4803 concat!("Alignment of ", stringify!(ColorSensorV3))
4804 );
4805 fn test_field_m_i2c() {
4806 assert_eq!(
4807 unsafe {
4808 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4809 let ptr = uninit.as_ptr();
4810 ::std::ptr::addr_of!((*ptr).m_i2c) as usize - ptr as usize
4811 },
4812 0usize,
4813 concat!(
4814 "Offset of field: ",
4815 stringify!(ColorSensorV3),
4816 "::",
4817 stringify!(m_i2c)
4818 )
4819 );
4820 }
4821 test_field_m_i2c();
4822 fn test_field_m_simDevice() {
4823 assert_eq!(
4824 unsafe {
4825 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4826 let ptr = uninit.as_ptr();
4827 ::std::ptr::addr_of!((*ptr).m_simDevice) as usize - ptr as usize
4828 },
4829 8usize,
4830 concat!(
4831 "Offset of field: ",
4832 stringify!(ColorSensorV3),
4833 "::",
4834 stringify!(m_simDevice)
4835 )
4836 );
4837 }
4838 test_field_m_simDevice();
4839 fn test_field_m_simR() {
4840 assert_eq!(
4841 unsafe {
4842 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4843 let ptr = uninit.as_ptr();
4844 ::std::ptr::addr_of!((*ptr).m_simR) as usize - ptr as usize
4845 },
4846 12usize,
4847 concat!(
4848 "Offset of field: ",
4849 stringify!(ColorSensorV3),
4850 "::",
4851 stringify!(m_simR)
4852 )
4853 );
4854 }
4855 test_field_m_simR();
4856 fn test_field_m_simG() {
4857 assert_eq!(
4858 unsafe {
4859 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4860 let ptr = uninit.as_ptr();
4861 ::std::ptr::addr_of!((*ptr).m_simG) as usize - ptr as usize
4862 },
4863 16usize,
4864 concat!(
4865 "Offset of field: ",
4866 stringify!(ColorSensorV3),
4867 "::",
4868 stringify!(m_simG)
4869 )
4870 );
4871 }
4872 test_field_m_simG();
4873 fn test_field_m_simB() {
4874 assert_eq!(
4875 unsafe {
4876 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4877 let ptr = uninit.as_ptr();
4878 ::std::ptr::addr_of!((*ptr).m_simB) as usize - ptr as usize
4879 },
4880 20usize,
4881 concat!(
4882 "Offset of field: ",
4883 stringify!(ColorSensorV3),
4884 "::",
4885 stringify!(m_simB)
4886 )
4887 );
4888 }
4889 test_field_m_simB();
4890 fn test_field_m_simIR() {
4891 assert_eq!(
4892 unsafe {
4893 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4894 let ptr = uninit.as_ptr();
4895 ::std::ptr::addr_of!((*ptr).m_simIR) as usize - ptr as usize
4896 },
4897 24usize,
4898 concat!(
4899 "Offset of field: ",
4900 stringify!(ColorSensorV3),
4901 "::",
4902 stringify!(m_simIR)
4903 )
4904 );
4905 }
4906 test_field_m_simIR();
4907 fn test_field_m_simProx() {
4908 assert_eq!(
4909 unsafe {
4910 let uninit = ::std::mem::MaybeUninit::<ColorSensorV3>::uninit();
4911 let ptr = uninit.as_ptr();
4912 ::std::ptr::addr_of!((*ptr).m_simProx) as usize - ptr as usize
4913 },
4914 28usize,
4915 concat!(
4916 "Offset of field: ",
4917 stringify!(ColorSensorV3),
4918 "::",
4919 stringify!(m_simProx)
4920 )
4921 );
4922 }
4923 test_field_m_simProx();
4924 }
4925 extern "C" {
4926 #[doc = " Get the normalized RGB color from the sensor (normalized based on"]
4927 #[doc = " total R + G + B)"]
4928 #[doc = ""]
4929 #[doc = " @return frc::Color class with normalized sRGB values"]
4930 #[link_name = "\u{1}_ZN3rev13ColorSensorV38GetColorEv"]
4931 pub fn ColorSensorV3_GetColor(this: *mut root::rev::ColorSensorV3) -> root::frc::Color;
4932 }
4933 extern "C" {
4934 #[doc = " Get the raw color value from the sensor."]
4935 #[doc = ""]
4936 #[doc = " @return Raw color values from sensopr"]
4937 #[link_name = "\u{1}_ZN3rev13ColorSensorV311GetRawColorEv"]
4938 pub fn ColorSensorV3_GetRawColor(
4939 this: *mut root::rev::ColorSensorV3,
4940 ) -> root::rev::ColorSensorV3_RawColor;
4941 }
4942 extern "C" {
4943 #[doc = " Get the color converted to CIE XYZ color space using factory"]
4944 #[doc = " calibrated constants."]
4945 #[doc = ""]
4946 #[doc = " https://en.wikipedia.org/wiki/CIE_1931_color_space"]
4947 #[doc = ""]
4948 #[doc = " @return CIEColor value from sensor"]
4949 #[link_name = "\u{1}_ZN3rev13ColorSensorV311GetCIEColorEv"]
4950 pub fn ColorSensorV3_GetCIEColor(
4951 this: *mut root::rev::ColorSensorV3,
4952 ) -> root::rev::CIEColor;
4953 }
4954 extern "C" {
4955 #[doc = " Get the normalzied IR value from the sensor. Works best when within 2"]
4956 #[doc = " inches and perpendicular to surface of interest."]
4957 #[doc = ""]
4958 #[doc = " @return Color class with normalized values"]
4959 #[link_name = "\u{1}_ZN3rev13ColorSensorV35GetIREv"]
4960 pub fn ColorSensorV3_GetIR(this: *mut root::rev::ColorSensorV3) -> f64;
4961 }
4962 extern "C" {
4963 #[doc = " Get the raw proximity value from the sensor ADC. This value is largest"]
4964 #[doc = " when an object is close to the sensor and smallest when"]
4965 #[doc = " far away."]
4966 #[doc = ""]
4967 #[doc = " @return Proximity measurement value, ranging from 0 to 2047 in"]
4968 #[doc = " default configuration"]
4969 #[link_name = "\u{1}_ZN3rev13ColorSensorV312GetProximityEv"]
4970 pub fn ColorSensorV3_GetProximity(this: *mut root::rev::ColorSensorV3) -> u32;
4971 }
4972 extern "C" {
4973 #[doc = " Set the gain factor applied to color ADC measurements."]
4974 #[doc = ""]
4975 #[doc = " By default, the gain is set to 3x."]
4976 #[doc = ""]
4977 #[doc = " @param gain Gain factor applied to color ADC measurements"]
4978 #[doc = " measurements"]
4979 #[link_name = "\u{1}_ZN3rev13ColorSensorV37SetGainENS0_10GainFactorE"]
4980 pub fn ColorSensorV3_SetGain(
4981 this: *mut root::rev::ColorSensorV3,
4982 gain: root::rev::ColorSensorV3_GainFactor,
4983 );
4984 }
4985 extern "C" {
4986 #[doc = " Configure the the IR LED used by the proximity sensor."]
4987 #[doc = ""]
4988 #[doc = " These settings are only needed for advanced users, the defaults"]
4989 #[doc = " will work fine for most teams. Consult the APDS-9151 for more"]
4990 #[doc = " information on these configuration settings and how they will affect"]
4991 #[doc = " proximity sensor measurements."]
4992 #[doc = ""]
4993 #[doc = " @param freq The pulse modulation frequency for the proximity"]
4994 #[doc = " sensor LED"]
4995 #[doc = " @param curr The pulse current for the proximity sensor LED"]
4996 #[doc = " @param pulses The number of pulses per measurement of the"]
4997 #[doc = " proximity sensor LED"]
4998 #[link_name = "\u{1}_ZN3rev13ColorSensorV327ConfigureProximitySensorLEDENS0_17LEDPulseFrequencyENS0_10LEDCurrentEh"]
4999 pub fn ColorSensorV3_ConfigureProximitySensorLED(
5000 this: *mut root::rev::ColorSensorV3,
5001 freq: root::rev::ColorSensorV3_LEDPulseFrequency,
5002 current: root::rev::ColorSensorV3_LEDCurrent,
5003 pulses: u8,
5004 );
5005 }
5006 extern "C" {
5007 #[doc = " Configure the proximity sensor."]
5008 #[doc = ""]
5009 #[doc = " These settings are only needed for advanced users, the defaults"]
5010 #[doc = " will work fine for most teams. Consult the APDS-9151 for more"]
5011 #[doc = " information on these configuration settings and how they will affect"]
5012 #[doc = " proximity sensor measurements."]
5013 #[doc = ""]
5014 #[doc = " @param res Bit resolution output by the proximity sensor ADC."]
5015 #[doc = " @param rate Measurement rate of the proximity sensor"]
5016 #[link_name = "\u{1}_ZN3rev13ColorSensorV324ConfigureProximitySensorENS0_19ProximityResolutionENS0_24ProximityMeasurementRateE"]
5017 pub fn ColorSensorV3_ConfigureProximitySensor(
5018 this: *mut root::rev::ColorSensorV3,
5019 res: root::rev::ColorSensorV3_ProximityResolution,
5020 rate: root::rev::ColorSensorV3_ProximityMeasurementRate,
5021 );
5022 }
5023 extern "C" {
5024 #[doc = " Configure the color sensor."]
5025 #[doc = ""]
5026 #[doc = " These settings are only needed for advanced users, the defaults"]
5027 #[doc = " will work fine for most teams. Consult the APDS-9151 for more"]
5028 #[doc = " information on these configuration settings and how they will affect"]
5029 #[doc = " color sensor measurements."]
5030 #[doc = ""]
5031 #[doc = " @param res Bit resolution output by the respective light sensor ADCs"]
5032 #[doc = " @param rate Measurement rate of the light sensor"]
5033 #[link_name = "\u{1}_ZN3rev13ColorSensorV320ConfigureColorSensorENS0_15ColorResolutionENS0_20ColorMeasurementRateE"]
5034 pub fn ColorSensorV3_ConfigureColorSensor(
5035 this: *mut root::rev::ColorSensorV3,
5036 res: root::rev::ColorSensorV3_ColorResolution,
5037 rate: root::rev::ColorSensorV3_ColorMeasurementRate,
5038 );
5039 }
5040 extern "C" {
5041 #[doc = " Indicates if the device reset. Based on the power on status flag in the"]
5042 #[doc = " status register. Per the datasheet:"]
5043 #[doc = ""]
5044 #[doc = " Part went through a power-up event, either because the part was turned"]
5045 #[doc = " on or because there was power supply voltage disturbance (default at"]
5046 #[doc = " first register read)."]
5047 #[doc = ""]
5048 #[doc = " This flag is self clearing"]
5049 #[doc = ""]
5050 #[doc = " @return true if the device was reset"]
5051 #[link_name = "\u{1}_ZN3rev13ColorSensorV38HasResetEv"]
5052 pub fn ColorSensorV3_HasReset(this: *mut root::rev::ColorSensorV3) -> bool;
5053 }
5054 extern "C" {
5055 #[doc = " Indicates if the device can currently be communicated with."]
5056 #[doc = ""]
5057 #[doc = " @return true if the device is currently connected and responsive"]
5058 #[link_name = "\u{1}_ZN3rev13ColorSensorV311IsConnectedEv"]
5059 pub fn ColorSensorV3_IsConnected(this: *mut root::rev::ColorSensorV3) -> bool;
5060 }
5061 extern "C" {
5062 #[doc = " Constructs a ColorSensorV3."]
5063 #[doc = ""]
5064 #[doc = " Note that the REV Color Sensor is really two devices in one package:"]
5065 #[doc = " a color sensor providing red, green, blue and IR values, and a proximity"]
5066 #[doc = " sensor."]
5067 #[doc = ""]
5068 #[doc = " @param port The I2C port the color sensor is attached to"]
5069 #[link_name = "\u{1}_ZN3rev13ColorSensorV3C1EN3frc3I2C4PortE"]
5070 pub fn ColorSensorV3_ColorSensorV3(
5071 this: *mut root::rev::ColorSensorV3,
5072 port: root::frc::I2C_Port,
5073 );
5074 }
5075 impl ColorSensorV3 {
5076 #[inline]
5077 pub unsafe fn GetColor(&mut self) -> root::frc::Color {
5078 ColorSensorV3_GetColor(self)
5079 }
5080 #[inline]
5081 pub unsafe fn GetRawColor(&mut self) -> root::rev::ColorSensorV3_RawColor {
5082 ColorSensorV3_GetRawColor(self)
5083 }
5084 #[inline]
5085 pub unsafe fn GetCIEColor(&mut self) -> root::rev::CIEColor {
5086 ColorSensorV3_GetCIEColor(self)
5087 }
5088 #[inline]
5089 pub unsafe fn GetIR(&mut self) -> f64 {
5090 ColorSensorV3_GetIR(self)
5091 }
5092 #[inline]
5093 pub unsafe fn GetProximity(&mut self) -> u32 {
5094 ColorSensorV3_GetProximity(self)
5095 }
5096 #[inline]
5097 pub unsafe fn SetGain(&mut self, gain: root::rev::ColorSensorV3_GainFactor) {
5098 ColorSensorV3_SetGain(self, gain)
5099 }
5100 #[inline]
5101 pub unsafe fn ConfigureProximitySensorLED(
5102 &mut self,
5103 freq: root::rev::ColorSensorV3_LEDPulseFrequency,
5104 current: root::rev::ColorSensorV3_LEDCurrent,
5105 pulses: u8,
5106 ) {
5107 ColorSensorV3_ConfigureProximitySensorLED(self, freq, current, pulses)
5108 }
5109 #[inline]
5110 pub unsafe fn ConfigureProximitySensor(
5111 &mut self,
5112 res: root::rev::ColorSensorV3_ProximityResolution,
5113 rate: root::rev::ColorSensorV3_ProximityMeasurementRate,
5114 ) {
5115 ColorSensorV3_ConfigureProximitySensor(self, res, rate)
5116 }
5117 #[inline]
5118 pub unsafe fn ConfigureColorSensor(
5119 &mut self,
5120 res: root::rev::ColorSensorV3_ColorResolution,
5121 rate: root::rev::ColorSensorV3_ColorMeasurementRate,
5122 ) {
5123 ColorSensorV3_ConfigureColorSensor(self, res, rate)
5124 }
5125 #[inline]
5126 pub unsafe fn HasReset(&mut self) -> bool {
5127 ColorSensorV3_HasReset(self)
5128 }
5129 #[inline]
5130 pub unsafe fn IsConnected(&mut self) -> bool {
5131 ColorSensorV3_IsConnected(self)
5132 }
5133 #[inline]
5134 pub unsafe fn new(port: root::frc::I2C_Port) -> Self {
5135 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
5136 ColorSensorV3_ColorSensorV3(__bindgen_tmp.as_mut_ptr(), port);
5137 __bindgen_tmp.assume_init()
5138 }
5139 }
5140 }
5141 pub mod std {
5142 #[allow(unused_imports)]
5143 use self::super::super::root;
5144 pub type size_t = ::std::os::raw::c_ulong;
5145 #[repr(C)]
5146 pub struct basic_string<_CharT> {
5147 pub _M_dataplus: root::std::basic_string__Alloc_hider,
5148 pub _M_string_length: root::std::basic_string_size_type,
5149 pub __bindgen_anon_1: root::std::basic_string__bindgen_ty_2<_CharT>,
5150 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
5151 }
5152 pub type basic_string__Char_alloc_type = root::__gnu_cxx::__alloc_traits;
5153 pub type basic_string__Alloc_traits = root::__gnu_cxx::__alloc_traits;
5154 pub type basic_string_traits_type<_Traits> = _Traits;
5155 pub type basic_string_value_type = [u8; 0usize];
5156 pub type basic_string_allocator_type = root::std::basic_string__Char_alloc_type;
5157 pub type basic_string_size_type = root::std::basic_string__Alloc_traits;
5158 pub type basic_string_difference_type = root::std::basic_string__Alloc_traits;
5159 pub type basic_string_reference = root::std::basic_string__Alloc_traits;
5160 pub type basic_string_const_reference = root::std::basic_string__Alloc_traits;
5161 pub type basic_string_pointer = root::std::basic_string__Alloc_traits;
5162 pub type basic_string_const_pointer = root::std::basic_string__Alloc_traits;
5163 pub type basic_string_iterator =
5164 root::__gnu_cxx::__normal_iterator<root::std::basic_string_pointer>;
5165 pub type basic_string_const_iterator =
5166 root::__gnu_cxx::__normal_iterator<root::std::basic_string_const_pointer>;
5167 pub type basic_string_const_reverse_iterator =
5168 root::std::reverse_iterator<root::std::basic_string_const_iterator>;
5169 pub type basic_string_reverse_iterator =
5170 root::std::reverse_iterator<root::std::basic_string_iterator>;
5171 pub type basic_string___const_iterator = root::std::basic_string_const_iterator;
5172 pub type basic_string___sv_type<_CharT> = root::std::basic_string_view<_CharT>;
5173 pub type basic_string__If_sv = root::std::enable_if_t;
5174 #[repr(C)]
5175 #[derive(Debug, Copy, Clone)]
5176 pub struct basic_string___sv_wrapper<_CharT> {
5177 pub _M_sv: root::std::basic_string___sv_type<_CharT>,
5178 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
5179 }
5180 #[repr(C)]
5181 #[derive(Debug, Copy, Clone)]
5182 pub struct basic_string__Alloc_hider {
5183 pub _M_p: root::std::basic_string_pointer,
5184 }
5185 pub const basic_string__S_local_capacity: root::std::basic_string__bindgen_ty_1 = 0;
5186 pub type basic_string__bindgen_ty_1 = i32;
5187 #[repr(C)]
5188 pub union basic_string__bindgen_ty_2<_CharT> {
5189 pub _M_local_buf: *mut _CharT,
5190 pub _M_allocated_capacity: root::std::basic_string_size_type,
5191 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
5192 }
5193 pub type integral_constant_value_type<_Tp> = _Tp;
5194 pub type integral_constant_type = u8;
5195 pub type true_type = u8;
5196 pub type false_type = u8;
5197 pub type __bool_constant = u8;
5198 #[repr(C)]
5199 #[derive(Debug, Copy, Clone)]
5200 pub struct __and_ {
5201 pub _address: u8,
5202 }
5203 #[repr(C)]
5204 #[derive(Debug, Copy, Clone)]
5205 pub struct __not_ {
5206 pub _address: u8,
5207 }
5208 #[repr(C)]
5209 #[derive(Debug, Copy, Clone)]
5210 pub struct is_empty {
5211 pub _address: u8,
5212 }
5213 #[repr(C)]
5214 #[derive(Debug, Copy, Clone)]
5215 pub struct is_same {
5216 pub _address: u8,
5217 }
5218 #[repr(C)]
5219 #[derive(Debug, Copy, Clone)]
5220 pub struct remove_cv {
5221 pub _address: u8,
5222 }
5223 pub type remove_cv_type<_Tp> = _Tp;
5224 #[repr(C)]
5225 #[derive(Debug, Copy, Clone)]
5226 pub struct make_unsigned {
5227 pub _address: u8,
5228 }
5229 pub type make_unsigned_type = u8;
5230 #[repr(C)]
5231 #[derive(Copy, Clone)]
5232 pub union aligned_storage_type {
5233 pub __data: *mut ::std::os::raw::c_uchar,
5234 pub __align: root::std::aligned_storage_type__bindgen_ty_1,
5235 }
5236 #[repr(C)]
5237 #[derive(Debug, Copy, Clone)]
5238 pub struct aligned_storage_type__bindgen_ty_1 {
5239 pub _address: u8,
5240 }
5241 #[test]
5242 fn bindgen_test_layout_aligned_storage_type() {
5243 assert_eq!(
5244 ::std::mem::size_of::<aligned_storage_type>(),
5245 8usize,
5246 concat!("Size of: ", stringify!(aligned_storage_type))
5247 );
5248 assert_eq!(
5249 ::std::mem::align_of::<aligned_storage_type>(),
5250 8usize,
5251 concat!("Alignment of ", stringify!(aligned_storage_type))
5252 );
5253 }
5254 pub type __remove_cvref_t = root::std::remove_cv;
5255 pub type enable_if_t = u8;
5256 #[repr(C)]
5257 #[derive(Debug, Copy, Clone)]
5258 pub struct __detector {
5259 pub _address: u8,
5260 }
5261 pub type __detector_value_t = root::std::false_type;
5262 pub type __detector_type<_Default> = _Default;
5263 pub type __detected_or = root::std::__detector;
5264 pub type __detected_or_t = root::std::__detected_or;
5265 #[repr(C)]
5266 #[derive(Debug, Copy, Clone)]
5267 pub struct iterator {
5268 pub _address: u8,
5269 }
5270 pub type iterator_iterator_category<_Category> = _Category;
5271 pub type iterator_value_type<_Tp> = _Tp;
5272 pub type iterator_difference_type<_Distance> = _Distance;
5273 pub type iterator_pointer<_Pointer> = _Pointer;
5274 pub type iterator_reference<_Reference> = _Reference;
5275 #[repr(C)]
5276 #[derive(Debug, Copy, Clone)]
5277 pub struct __iterator_traits {
5278 pub _address: u8,
5279 }
5280 #[repr(C)]
5281 #[derive(Debug, Copy, Clone)]
5282 pub struct iterator_traits {
5283 pub _address: u8,
5284 }
5285 #[repr(C)]
5286 #[derive(Debug, Copy, Clone)]
5287 pub struct __replace_first_arg {
5288 pub _address: u8,
5289 }
5290 #[repr(C)]
5291 #[derive(Debug, Copy, Clone)]
5292 pub struct __ptr_traits_elem_1 {
5293 pub _address: u8,
5294 }
5295 #[repr(C)]
5296 #[derive(Debug, Copy, Clone)]
5297 pub struct __ptr_traits_elem {
5298 pub _address: u8,
5299 }
5300 #[repr(C)]
5301 #[derive(Debug, Copy, Clone)]
5302 pub struct pointer_traits {
5303 pub _address: u8,
5304 }
5305 pub type pointer_traits___difference_type = [u8; 0usize];
5306 #[repr(C)]
5307 #[derive(Debug, Copy, Clone)]
5308 pub struct pointer_traits___rebind {
5309 pub _address: u8,
5310 }
5311 pub type pointer_traits_pointer<_Ptr> = _Ptr;
5312 pub type pointer_traits_difference_type = root::std::__detected_or_t;
5313 pub type pointer_traits_rebind = root::std::pointer_traits___rebind;
5314 #[repr(C)]
5315 #[derive(Debug, Copy, Clone)]
5316 pub struct reverse_iterator<_Iterator> {
5317 pub current: _Iterator,
5318 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>,
5319 }
5320 pub type reverse_iterator___traits_type = root::std::iterator_traits;
5321 pub type reverse_iterator_iterator_type<_Iterator> = _Iterator;
5322 pub type reverse_iterator_pointer = root::std::reverse_iterator___traits_type;
5323 pub type reverse_iterator_difference_type = root::std::reverse_iterator___traits_type;
5324 pub type reverse_iterator_reference = root::std::reverse_iterator___traits_type;
5325 pub mod __detail {
5326 #[allow(unused_imports)]
5327 use self::super::super::super::root;
5328 }
5329 #[repr(C)]
5330 #[derive(Debug)]
5331 pub struct atomic<_Tp> {
5332 pub _M_i: _Tp,
5333 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Tp>>,
5334 }
5335 pub type atomic_value_type<_Tp> = _Tp;
5336 pub type __allocator_base = root::__gnu_cxx::new_allocator;
5337 #[repr(C)]
5338 #[derive(Debug)]
5339 pub struct allocator {
5340 pub _address: u8,
5341 }
5342 pub type allocator_value_type<_Tp> = _Tp;
5343 pub type allocator_size_type = root::std::size_t;
5344 pub type allocator_difference_type = isize;
5345 pub type allocator_pointer<_Tp> = *mut _Tp;
5346 pub type allocator_const_pointer<_Tp> = *const _Tp;
5347 pub type allocator_reference<_Tp> = *mut _Tp;
5348 pub type allocator_const_reference<_Tp> = *const _Tp;
5349 #[repr(C)]
5350 #[derive(Debug, Copy, Clone)]
5351 pub struct allocator_rebind {
5352 pub _address: u8,
5353 }
5354 pub type allocator_rebind_other = root::std::allocator;
5355 pub type allocator_propagate_on_container_move_assignment = root::std::true_type;
5356 pub type allocator_is_always_equal = root::std::true_type;
5357 #[repr(C)]
5358 #[derive(Debug, Copy, Clone)]
5359 pub struct __allocator_traits_base {
5360 pub _address: u8,
5361 }
5362 #[repr(C)]
5363 #[derive(Debug, Copy, Clone)]
5364 pub struct __allocator_traits_base___rebind {
5365 pub _address: u8,
5366 }
5367 pub type __allocator_traits_base___pointer = [u8; 0usize];
5368 pub type __allocator_traits_base___c_pointer = [u8; 0usize];
5369 pub type __allocator_traits_base___v_pointer = [u8; 0usize];
5370 pub type __allocator_traits_base___cv_pointer = [u8; 0usize];
5371 pub type __allocator_traits_base___pocca = [u8; 0usize];
5372 pub type __allocator_traits_base___pocma = [u8; 0usize];
5373 pub type __allocator_traits_base___pocs = [u8; 0usize];
5374 pub type __allocator_traits_base___equal = [u8; 0usize];
5375 #[test]
5376 fn bindgen_test_layout___allocator_traits_base() {
5377 assert_eq!(
5378 ::std::mem::size_of::<__allocator_traits_base>(),
5379 1usize,
5380 concat!("Size of: ", stringify!(__allocator_traits_base))
5381 );
5382 assert_eq!(
5383 ::std::mem::align_of::<__allocator_traits_base>(),
5384 1usize,
5385 concat!("Alignment of ", stringify!(__allocator_traits_base))
5386 );
5387 }
5388 pub type __alloc_rebind = root::std::__allocator_traits_base;
5389 #[repr(C)]
5390 #[derive(Debug, Copy, Clone)]
5391 pub struct allocator_traits {
5392 pub _address: u8,
5393 }
5394 pub type allocator_traits_allocator_type<_Alloc> = _Alloc;
5395 pub type allocator_traits_value_type = [u8; 0usize];
5396 pub type allocator_traits_pointer = root::std::__detected_or_t;
5397 #[repr(C)]
5398 #[derive(Debug, Copy, Clone)]
5399 pub struct allocator_traits__Ptr {
5400 pub _address: u8,
5401 }
5402 pub type allocator_traits__Ptr_type = [u8; 0usize];
5403 #[repr(C)]
5404 #[derive(Debug, Copy, Clone)]
5405 pub struct allocator_traits__Diff {
5406 pub _address: u8,
5407 }
5408 pub type allocator_traits__Diff_type = root::std::pointer_traits;
5409 #[repr(C)]
5410 #[derive(Debug, Copy, Clone)]
5411 pub struct allocator_traits__Size {
5412 pub _address: u8,
5413 }
5414 pub type allocator_traits_const_pointer = [u8; 0usize];
5415 pub type allocator_traits_void_pointer = root::std::allocator_traits__Ptr;
5416 pub type allocator_traits_const_void_pointer = root::std::allocator_traits__Ptr;
5417 pub type allocator_traits_difference_type = [u8; 0usize];
5418 pub type allocator_traits_size_type = [u8; 0usize];
5419 pub type allocator_traits_propagate_on_container_copy_assignment =
5420 root::std::__detected_or_t;
5421 pub type allocator_traits_propagate_on_container_move_assignment =
5422 root::std::__detected_or_t;
5423 pub type allocator_traits_propagate_on_container_swap = root::std::__detected_or_t;
5424 pub type allocator_traits_is_always_equal = root::std::__detected_or_t;
5425 pub type allocator_traits_rebind_alloc = root::std::__alloc_rebind;
5426 pub type allocator_traits_rebind_traits = root::std::allocator_traits;
5427 #[repr(C)]
5428 #[derive(Debug, Copy, Clone)]
5429 pub struct allocator_traits___construct_helper {
5430 pub _address: u8,
5431 }
5432 pub type allocator_traits___construct_helper_type<_Alloc> = _Alloc;
5433 pub type allocator_traits___has_construct = root::std::allocator_traits___construct_helper;
5434 #[repr(C)]
5435 #[derive(Debug, Copy, Clone)]
5436 pub struct in_place_t {
5437 pub _address: u8,
5438 }
5439 #[test]
5440 fn bindgen_test_layout_in_place_t() {
5441 assert_eq!(
5442 ::std::mem::size_of::<in_place_t>(),
5443 1usize,
5444 concat!("Size of: ", stringify!(in_place_t))
5445 );
5446 assert_eq!(
5447 ::std::mem::align_of::<in_place_t>(),
5448 1usize,
5449 concat!("Alignment of ", stringify!(in_place_t))
5450 );
5451 }
5452 pub type string = root::std::basic_string<::std::os::raw::c_char>;
5453 pub type streamoff = ::std::os::raw::c_long;
5454 #[repr(C)]
5455 #[derive(Debug)]
5456 pub struct fpos<_StateT> {
5457 pub _M_off: root::std::streamoff,
5458 pub _M_state: _StateT,
5459 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_StateT>>,
5460 }
5461 pub type streampos = root::std::fpos<root::mbstate_t>;
5462 #[repr(C)]
5463 #[derive(Debug, Copy, Clone)]
5464 pub struct char_traits {
5465 pub _address: u8,
5466 }
5467 #[repr(C)]
5468 #[derive(Debug, Copy, Clone)]
5469 pub struct basic_string_view<_CharT> {
5470 pub _M_len: root::std::size_t,
5471 pub _M_str: *const _CharT,
5472 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_CharT>>,
5473 }
5474 pub type basic_string_view_traits_type<_Traits> = _Traits;
5475 pub type basic_string_view_value_type<_CharT> = _CharT;
5476 pub type basic_string_view_pointer<_CharT> =
5477 *mut root::std::basic_string_view_value_type<_CharT>;
5478 pub type basic_string_view_const_pointer<_CharT> =
5479 *const root::std::basic_string_view_value_type<_CharT>;
5480 pub type basic_string_view_reference<_CharT> =
5481 *mut root::std::basic_string_view_value_type<_CharT>;
5482 pub type basic_string_view_const_reference<_CharT> =
5483 *const root::std::basic_string_view_value_type<_CharT>;
5484 pub type basic_string_view_const_iterator<_CharT> =
5485 *const root::std::basic_string_view_value_type<_CharT>;
5486 pub type basic_string_view_iterator<_CharT> =
5487 root::std::basic_string_view_const_iterator<_CharT>;
5488 pub type basic_string_view_const_reverse_iterator<_CharT> =
5489 root::std::reverse_iterator<root::std::basic_string_view_const_iterator<_CharT>>;
5490 pub type basic_string_view_reverse_iterator<_CharT> =
5491 root::std::basic_string_view_const_reverse_iterator<_CharT>;
5492 pub type basic_string_view_size_type = root::std::size_t;
5493 pub type basic_string_view_difference_type = isize;
5494 #[repr(C)]
5495 #[derive(Debug)]
5496 pub struct _Vector_base {
5497 pub _M_impl: root::std::_Vector_base__Vector_impl,
5498 }
5499 pub type _Vector_base__Tp_alloc_type = root::__gnu_cxx::__alloc_traits;
5500 pub type _Vector_base_pointer = root::__gnu_cxx::__alloc_traits;
5501 #[repr(C)]
5502 #[derive(Debug, Copy, Clone)]
5503 pub struct _Vector_base__Vector_impl_data {
5504 pub _M_start: root::std::_Vector_base_pointer,
5505 pub _M_finish: root::std::_Vector_base_pointer,
5506 pub _M_end_of_storage: root::std::_Vector_base_pointer,
5507 }
5508 #[repr(C)]
5509 #[derive(Debug, Copy, Clone)]
5510 pub struct _Vector_base__Vector_impl {
5511 pub _base_1: root::std::_Vector_base__Vector_impl_data,
5512 }
5513 pub type _Vector_base_allocator_type<_Alloc> = _Alloc;
5514 #[repr(C)]
5515 #[derive(Debug)]
5516 pub struct vector {
5517 pub _base: root::std::_Vector_base,
5518 }
5519 pub type vector__Base = root::std::_Vector_base;
5520 pub type vector__Tp_alloc_type = root::std::vector__Base;
5521 pub type vector__Alloc_traits = root::__gnu_cxx::__alloc_traits;
5522 pub type vector_value_type<_Tp> = _Tp;
5523 pub type vector_pointer = root::std::vector__Base;
5524 pub type vector_const_pointer = root::std::vector__Alloc_traits;
5525 pub type vector_reference = root::std::vector__Alloc_traits;
5526 pub type vector_const_reference = root::std::vector__Alloc_traits;
5527 pub type vector_iterator = root::__gnu_cxx::__normal_iterator<root::std::vector_pointer>;
5528 pub type vector_const_iterator =
5529 root::__gnu_cxx::__normal_iterator<root::std::vector_const_pointer>;
5530 pub type vector_const_reverse_iterator =
5531 root::std::reverse_iterator<root::std::vector_const_iterator>;
5532 pub type vector_reverse_iterator = root::std::reverse_iterator<root::std::vector_iterator>;
5533 pub type vector_size_type = root::std::size_t;
5534 pub type vector_difference_type = isize;
5535 pub type vector_allocator_type<_Alloc> = _Alloc;
5536 #[repr(C)]
5537 #[derive(Debug)]
5538 pub struct vector__Temporary_value {
5539 pub _M_this: *mut root::std::vector,
5540 pub __buf: u8,
5541 }
5542 extern "C" {
5543 #[link_name = "\u{1}num"]
5544 pub static ratio_num: root::intmax_t;
5545 }
5546 extern "C" {
5547 #[link_name = "\u{1}den"]
5548 pub static ratio_den: root::intmax_t;
5549 }
5550 pub mod chrono {
5551 #[allow(unused_imports)]
5552 use self::super::super::super::root;
5553 }
5554 #[repr(C)]
5555 #[derive(Debug, Copy, Clone)]
5556 pub struct optional {
5557 pub _address: u8,
5558 }
5559 pub type optional__Base = u8;
5560 pub type optional___not_self = root::std::__not_;
5561 pub type optional___not_tag = root::std::__not_;
5562 pub type optional__Requires = root::std::enable_if_t;
5563 pub type optional_value_type<_Tp> = _Tp;
5564 }
5565 pub mod __gnu_cxx {
5566 #[allow(unused_imports)]
5567 use self::super::super::root;
5568 #[repr(C)]
5569 #[derive(Debug, Copy, Clone)]
5570 pub struct __normal_iterator<_Iterator> {
5571 pub _M_current: _Iterator,
5572 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<_Iterator>>,
5573 }
5574 pub type __normal_iterator___traits_type = root::std::iterator_traits;
5575 pub type __normal_iterator_iterator_type<_Iterator> = _Iterator;
5576 pub type __normal_iterator_iterator_category =
5577 root::__gnu_cxx::__normal_iterator___traits_type;
5578 pub type __normal_iterator_value_type = root::__gnu_cxx::__normal_iterator___traits_type;
5579 pub type __normal_iterator_difference_type =
5580 root::__gnu_cxx::__normal_iterator___traits_type;
5581 pub type __normal_iterator_reference = root::__gnu_cxx::__normal_iterator___traits_type;
5582 pub type __normal_iterator_pointer = root::__gnu_cxx::__normal_iterator___traits_type;
5583 #[repr(C)]
5584 #[derive(Debug)]
5585 pub struct new_allocator {
5586 pub _address: u8,
5587 }
5588 pub type new_allocator_value_type<_Tp> = _Tp;
5589 pub type new_allocator_size_type = root::std::size_t;
5590 pub type new_allocator_difference_type = isize;
5591 pub type new_allocator_pointer<_Tp> = *mut _Tp;
5592 pub type new_allocator_const_pointer<_Tp> = *const _Tp;
5593 pub type new_allocator_reference<_Tp> = *mut _Tp;
5594 pub type new_allocator_const_reference<_Tp> = *const _Tp;
5595 #[repr(C)]
5596 #[derive(Debug, Copy, Clone)]
5597 pub struct new_allocator_rebind {
5598 pub _address: u8,
5599 }
5600 pub type new_allocator_propagate_on_container_move_assignment = root::std::true_type;
5601 #[repr(C)]
5602 #[derive(Debug, Copy, Clone)]
5603 pub struct __alloc_traits {
5604 pub _address: u8,
5605 }
5606 pub type __alloc_traits_allocator_type<_Alloc> = _Alloc;
5607 pub type __alloc_traits__Base_type = root::std::allocator_traits;
5608 pub type __alloc_traits_value_type = root::__gnu_cxx::__alloc_traits__Base_type;
5609 pub type __alloc_traits_pointer = root::__gnu_cxx::__alloc_traits__Base_type;
5610 pub type __alloc_traits_const_pointer = root::__gnu_cxx::__alloc_traits__Base_type;
5611 pub type __alloc_traits_size_type = root::__gnu_cxx::__alloc_traits__Base_type;
5612 pub type __alloc_traits_difference_type = root::__gnu_cxx::__alloc_traits__Base_type;
5613 pub type __alloc_traits_reference = *mut root::__gnu_cxx::__alloc_traits_value_type;
5614 pub type __alloc_traits_const_reference = *const root::__gnu_cxx::__alloc_traits_value_type;
5615 pub type __alloc_traits___is_custom_pointer = root::std::__and_;
5616 #[repr(C)]
5617 #[derive(Debug, Copy, Clone)]
5618 pub struct __alloc_traits_rebind {
5619 pub _address: u8,
5620 }
5621 pub type __alloc_traits_rebind_other = root::__gnu_cxx::__alloc_traits__Base_type;
5622 #[repr(C)]
5623 #[derive(Debug, Copy, Clone)]
5624 pub struct _Char_types {
5625 pub _address: u8,
5626 }
5627 pub type _Char_types_int_type = ::std::os::raw::c_ulong;
5628 pub type _Char_types_pos_type = root::std::streampos;
5629 pub type _Char_types_off_type = root::std::streamoff;
5630 pub type _Char_types_state_type = root::mbstate_t;
5631 #[repr(C)]
5632 #[derive(Debug, Copy, Clone)]
5633 pub struct char_traits {
5634 pub _address: u8,
5635 }
5636 pub type char_traits_char_type<_CharT> = _CharT;
5637 pub type char_traits_int_type = root::__gnu_cxx::_Char_types;
5638 pub type char_traits_pos_type = root::__gnu_cxx::_Char_types;
5639 pub type char_traits_off_type = root::__gnu_cxx::_Char_types;
5640 pub type char_traits_state_type = root::__gnu_cxx::_Char_types;
5641 }
5642 #[repr(C)]
5643 #[derive(Copy, Clone)]
5644 pub struct __mbstate_t {
5645 pub __count: ::std::os::raw::c_int,
5646 pub __value: root::__mbstate_t__bindgen_ty_1,
5647 }
5648 #[repr(C)]
5649 #[derive(Copy, Clone)]
5650 pub union __mbstate_t__bindgen_ty_1 {
5651 pub __wch: ::std::os::raw::c_uint,
5652 pub __wchb: [::std::os::raw::c_char; 4usize],
5653 }
5654 #[test]
5655 fn bindgen_test_layout___mbstate_t__bindgen_ty_1() {
5656 assert_eq!(
5657 ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(),
5658 4usize,
5659 concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1))
5660 );
5661 assert_eq!(
5662 ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(),
5663 4usize,
5664 concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1))
5665 );
5666 fn test_field___wch() {
5667 assert_eq!(
5668 unsafe {
5669 let uninit = ::std::mem::MaybeUninit::<__mbstate_t__bindgen_ty_1>::uninit();
5670 let ptr = uninit.as_ptr();
5671 ::std::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize
5672 },
5673 0usize,
5674 concat!(
5675 "Offset of field: ",
5676 stringify!(__mbstate_t__bindgen_ty_1),
5677 "::",
5678 stringify!(__wch)
5679 )
5680 );
5681 }
5682 test_field___wch();
5683 fn test_field___wchb() {
5684 assert_eq!(
5685 unsafe {
5686 let uninit = ::std::mem::MaybeUninit::<__mbstate_t__bindgen_ty_1>::uninit();
5687 let ptr = uninit.as_ptr();
5688 ::std::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize
5689 },
5690 0usize,
5691 concat!(
5692 "Offset of field: ",
5693 stringify!(__mbstate_t__bindgen_ty_1),
5694 "::",
5695 stringify!(__wchb)
5696 )
5697 );
5698 }
5699 test_field___wchb();
5700 }
5701 #[test]
5702 fn bindgen_test_layout___mbstate_t() {
5703 assert_eq!(
5704 ::std::mem::size_of::<__mbstate_t>(),
5705 8usize,
5706 concat!("Size of: ", stringify!(__mbstate_t))
5707 );
5708 assert_eq!(
5709 ::std::mem::align_of::<__mbstate_t>(),
5710 4usize,
5711 concat!("Alignment of ", stringify!(__mbstate_t))
5712 );
5713 fn test_field___count() {
5714 assert_eq!(
5715 unsafe {
5716 let uninit = ::std::mem::MaybeUninit::<__mbstate_t>::uninit();
5717 let ptr = uninit.as_ptr();
5718 ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize
5719 },
5720 0usize,
5721 concat!(
5722 "Offset of field: ",
5723 stringify!(__mbstate_t),
5724 "::",
5725 stringify!(__count)
5726 )
5727 );
5728 }
5729 test_field___count();
5730 fn test_field___value() {
5731 assert_eq!(
5732 unsafe {
5733 let uninit = ::std::mem::MaybeUninit::<__mbstate_t>::uninit();
5734 let ptr = uninit.as_ptr();
5735 ::std::ptr::addr_of!((*ptr).__value) as usize - ptr as usize
5736 },
5737 4usize,
5738 concat!(
5739 "Offset of field: ",
5740 stringify!(__mbstate_t),
5741 "::",
5742 stringify!(__value)
5743 )
5744 );
5745 }
5746 test_field___value();
5747 }
5748 pub type mbstate_t = root::__mbstate_t;
5749 pub mod __pstl {
5750 #[allow(unused_imports)]
5751 use self::super::super::root;
5752 pub mod execution {
5753 #[allow(unused_imports)]
5754 use self::super::super::super::root;
5755 }
5756 }
5757 pub mod fmt {
5758 #[allow(unused_imports)]
5759 use self::super::super::root;
5760 pub mod detail {
5761 #[allow(unused_imports)]
5762 use self::super::super::super::root;
5763 }
5764 }
5765 pub mod units {
5766 #[allow(unused_imports)]
5767 use self::super::super::root;
5768 pub mod detail {
5769 #[allow(unused_imports)]
5770 use self::super::super::super::root;
5771 #[doc = " @brief\t\thelper type to identify base units."]
5772 #[doc = " @details\t\tA non-templated base class for `base_unit` which enables RTTI testing."]
5773 #[repr(C)]
5774 #[derive(Debug, Copy, Clone)]
5775 pub struct _base_unit_t {
5776 pub _address: u8,
5777 }
5778 #[test]
5779 fn bindgen_test_layout__base_unit_t() {
5780 assert_eq!(
5781 ::std::mem::size_of::<_base_unit_t>(),
5782 1usize,
5783 concat!("Size of: ", stringify!(_base_unit_t))
5784 );
5785 assert_eq!(
5786 ::std::mem::align_of::<_base_unit_t>(),
5787 1usize,
5788 concat!("Alignment of ", stringify!(_base_unit_t))
5789 );
5790 }
5791 #[doc = " @brief\t\thelper type to identify units."]
5792 #[doc = " @details\t\tA non-templated base class for `unit` which enables RTTI testing."]
5793 #[repr(C)]
5794 #[derive(Debug, Copy, Clone)]
5795 pub struct _unit_t {
5796 pub _address: u8,
5797 }
5798 #[test]
5799 fn bindgen_test_layout__unit_t() {
5800 assert_eq!(
5801 ::std::mem::size_of::<_unit_t>(),
5802 1usize,
5803 concat!("Size of: ", stringify!(_unit_t))
5804 );
5805 assert_eq!(
5806 ::std::mem::align_of::<_unit_t>(),
5807 1usize,
5808 concat!("Alignment of ", stringify!(_unit_t))
5809 );
5810 }
5811 }
5812 pub mod constants {
5813 #[allow(unused_imports)]
5814 use self::super::super::super::root;
5815 }
5816 pub mod traits {
5817 #[allow(unused_imports)]
5818 use self::super::super::super::root;
5819 }
5820 #[doc = " @ingroup\t\tUnitTypes"]
5821 #[doc = " @brief\t\tClass representing SI base unit types."]
5822 #[doc = " @details\t\tBase units are represented by a combination of `std::ratio` template parameters, each"]
5823 #[doc = "\t\t\t\tdescribing the exponent of the type of unit they represent. Example: meters per second"]
5824 #[doc = "\t\t\t\twould be described by a +1 exponent for meters, and a -1 exponent for seconds, thus:"]
5825 #[doc = "\t\t\t\t`base_unit<std::ratio<1>, std::ratio<0>, std::ratio<-1>>`"]
5826 #[doc = " @tparam\t\tMeter\t\t`std::ratio` representing the exponent value for meters."]
5827 #[doc = " @tparam\t\tKilogram\t`std::ratio` representing the exponent value for kilograms."]
5828 #[doc = " @tparam\t\tSecond\t\t`std::ratio` representing the exponent value for seconds."]
5829 #[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."]
5830 #[doc = " @tparam\t\tAmpere\t\t`std::ratio` representing the exponent value for amperes."]
5831 #[doc = " @tparam\t\tKelvin\t\t`std::ratio` representing the exponent value for Kelvin."]
5832 #[doc = " @tparam\t\tMole\t\t`std::ratio` representing the exponent value for moles."]
5833 #[doc = " @tparam\t\tCandela\t\t`std::ratio` representing the exponent value for candelas."]
5834 #[doc = " @tparam\t\tByte\t\t`std::ratio` representing the exponent value for bytes."]
5835 #[doc = " @sa\t\t\tcategory\t for type aliases for SI base_unit types."]
5836 #[repr(C)]
5837 #[derive(Debug, Copy, Clone)]
5838 pub struct base_unit {
5839 pub _address: u8,
5840 }
5841 pub type base_unit_meter_ratio<Meter> = Meter;
5842 pub type base_unit_kilogram_ratio<Kilogram> = Kilogram;
5843 pub type base_unit_second_ratio<Second> = Second;
5844 pub type base_unit_radian_ratio<Radian> = Radian;
5845 pub type base_unit_ampere_ratio<Ampere> = Ampere;
5846 pub type base_unit_kelvin_ratio<Kelvin> = Kelvin;
5847 pub type base_unit_mole_ratio<Mole> = Mole;
5848 pub type base_unit_candela_ratio<Candela> = Candela;
5849 pub type base_unit_byte_ratio<Byte> = Byte;
5850 pub mod category {
5851 #[allow(unused_imports)]
5852 use self::super::super::super::root;
5853 pub type voltage_unit = root::units::base_unit;
5854 }
5855 #[doc = " @ingroup\t\tUnitContainers"]
5856 #[doc = " @brief\t\tContainer for values which represent quantities of a given unit."]
5857 #[doc = " @details\t\tStores a value which represents a quantity in the given units. Unit containers"]
5858 #[doc = "\t\t\t\t(except scalar values) are *not* convertible to built-in c++ types, in order to"]
5859 #[doc = "\t\t\t\tprovide type safety in dimensional analysis. Unit containers *are* implicitly"]
5860 #[doc = "\t\t\t\tconvertible to other compatible unit container types. Unit containers support"]
5861 #[doc = "\t\t\t\tvarious types of arithmetic operations, depending on their scale type."]
5862 #[doc = ""]
5863 #[doc = "\t\t\t\tThe value of a `unit_t` can only be changed on construction, or by assignment"]
5864 #[doc = "\t\t\t\tfrom another `unit_t` type. If necessary, the underlying value can be accessed"]
5865 #[doc = "\t\t\t\tusing `operator()`: @code"]
5866 #[doc = "\t\t\t\tmeter_t m(5.0);"]
5867 #[doc = "\t\t\t\tdouble val = m(); // val == 5.0\t@endcode."]
5868 #[doc = " @tparam\t\tUnits unit tag for which type of units the `unit_t` represents (e.g. meters)"]
5869 #[doc = " @tparam\t\tT underlying type of the storage. Defaults to double."]
5870 #[doc = " @tparam\t\tNonLinearScale optional scale class for the units. Defaults to linear (i.e. does"]
5871 #[doc = "\t\t\t\tnot scale the unit value). Examples of non-linear scales could be logarithmic,"]
5872 #[doc = "\t\t\t\tdecibel, or richter scales. Non-linear scales must adhere to the non-linear-scale"]
5873 #[doc = "\t\t\t\tconcept, i.e. `is_nonlinear_scale<...>::value` must be `true`."]
5874 #[doc = " @sa"]
5875 #[doc = "\t\t\t\t- \\ref lengthContainers \"length unit containers\""]
5876 #[doc = "\t\t\t\t- \\ref massContainers \"mass unit containers\""]
5877 #[doc = "\t\t\t\t- \\ref timeContainers \"time unit containers\""]
5878 #[doc = "\t\t\t\t- \\ref angleContainers \"angle unit containers\""]
5879 #[doc = "\t\t\t\t- \\ref currentContainers \"current unit containers\""]
5880 #[doc = "\t\t\t\t- \\ref temperatureContainers \"temperature unit containers\""]
5881 #[doc = "\t\t\t\t- \\ref substanceContainers \"substance unit containers\""]
5882 #[doc = "\t\t\t\t- \\ref luminousIntensityContainers \"luminous intensity unit containers\""]
5883 #[doc = "\t\t\t\t- \\ref solidAngleContainers \"solid angle unit containers\""]
5884 #[doc = "\t\t\t\t- \\ref frequencyContainers \"frequency unit containers\""]
5885 #[doc = "\t\t\t\t- \\ref velocityContainers \"velocity unit containers\""]
5886 #[doc = "\t\t\t\t- \\ref angularVelocityContainers \"angular velocity unit containers\""]
5887 #[doc = "\t\t\t\t- \\ref accelerationContainers \"acceleration unit containers\""]
5888 #[doc = "\t\t\t\t- \\ref forceContainers \"force unit containers\""]
5889 #[doc = "\t\t\t\t- \\ref pressureContainers \"pressure unit containers\""]
5890 #[doc = "\t\t\t\t- \\ref chargeContainers \"charge unit containers\""]
5891 #[doc = "\t\t\t\t- \\ref energyContainers \"energy unit containers\""]
5892 #[doc = "\t\t\t\t- \\ref powerContainers \"power unit containers\""]
5893 #[doc = "\t\t\t\t- \\ref voltageContainers \"voltage unit containers\""]
5894 #[doc = "\t\t\t\t- \\ref capacitanceContainers \"capacitance unit containers\""]
5895 #[doc = "\t\t\t\t- \\ref impedanceContainers \"impedance unit containers\""]
5896 #[doc = "\t\t\t\t- \\ref magneticFluxContainers \"magnetic flux unit containers\""]
5897 #[doc = "\t\t\t\t- \\ref magneticFieldStrengthContainers \"magnetic field strength unit containers\""]
5898 #[doc = "\t\t\t\t- \\ref inductanceContainers \"inductance unit containers\""]
5899 #[doc = "\t\t\t\t- \\ref luminousFluxContainers \"luminous flux unit containers\""]
5900 #[doc = "\t\t\t\t- \\ref illuminanceContainers \"illuminance unit containers\""]
5901 #[doc = "\t\t\t\t- \\ref radiationContainers \"radiation unit containers\""]
5902 #[doc = "\t\t\t\t- \\ref torqueContainers \"torque unit containers\""]
5903 #[doc = "\t\t\t\t- \\ref areaContainers \"area unit containers\""]
5904 #[doc = "\t\t\t\t- \\ref volumeContainers \"volume unit containers\""]
5905 #[doc = "\t\t\t\t- \\ref densityContainers \"density unit containers\""]
5906 #[doc = "\t\t\t\t- \\ref concentrationContainers \"concentration unit containers\""]
5907 #[doc = "\t\t\t\t- \\ref constantContainers \"constant unit containers\""]
5908 #[repr(C)]
5909 pub struct unit_t {
5910 pub _base: root::units::linear_scale<[u8; 0usize]>,
5911 }
5912 pub type unit_t_nls = root::units::linear_scale<[u8; 0usize]>;
5913 pub type unit_t_non_linear_scale_type = root::units::linear_scale<[u8; 0usize]>;
5914 pub type unit_t_underlying_type<T> = T;
5915 pub type unit_t_value_type<T> = T;
5916 pub type unit_t_unit_type<Units> = Units;
5917 #[doc = " @cond"]
5918 #[repr(C)]
5919 #[derive(Debug)]
5920 pub struct linear_scale<T> {
5921 #[doc = "< linearized value."]
5922 pub m_value: T,
5923 pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
5924 }
5925 pub mod voltage {
5926 #[allow(unused_imports)]
5927 use self::super::super::super::root;
5928 pub type volts = u8;
5929 pub type volt = root::units::voltage::volts;
5930 #[doc = " @ingroup\t\tUnitContainers"]
5931 #[doc = " @brief\t\tContainer for values which represent quantities of a given unit."]
5932 #[doc = " @details\t\tStores a value which represents a quantity in the given units. Unit containers"]
5933 #[doc = "\t\t\t\t(except scalar values) are *not* convertible to built-in c++ types, in order to"]
5934 #[doc = "\t\t\t\tprovide type safety in dimensional analysis. Unit containers *are* implicitly"]
5935 #[doc = "\t\t\t\tconvertible to other compatible unit container types. Unit containers support"]
5936 #[doc = "\t\t\t\tvarious types of arithmetic operations, depending on their scale type."]
5937 #[doc = ""]
5938 #[doc = "\t\t\t\tThe value of a `unit_t` can only be changed on construction, or by assignment"]
5939 #[doc = "\t\t\t\tfrom another `unit_t` type. If necessary, the underlying value can be accessed"]
5940 #[doc = "\t\t\t\tusing `operator()`: @code"]
5941 #[doc = "\t\t\t\tmeter_t m(5.0);"]
5942 #[doc = "\t\t\t\tdouble val = m(); // val == 5.0\t@endcode."]
5943 #[doc = " @tparam\t\tUnits unit tag for which type of units the `unit_t` represents (e.g. meters)"]
5944 #[doc = " @tparam\t\tT underlying type of the storage. Defaults to double."]
5945 #[doc = " @tparam\t\tNonLinearScale optional scale class for the units. Defaults to linear (i.e. does"]
5946 #[doc = "\t\t\t\tnot scale the unit value). Examples of non-linear scales could be logarithmic,"]
5947 #[doc = "\t\t\t\tdecibel, or richter scales. Non-linear scales must adhere to the non-linear-scale"]
5948 #[doc = "\t\t\t\tconcept, i.e. `is_nonlinear_scale<...>::value` must be `true`."]
5949 #[doc = " @sa"]
5950 #[doc = "\t\t\t\t- \\ref lengthContainers \"length unit containers\""]
5951 #[doc = "\t\t\t\t- \\ref massContainers \"mass unit containers\""]
5952 #[doc = "\t\t\t\t- \\ref timeContainers \"time unit containers\""]
5953 #[doc = "\t\t\t\t- \\ref angleContainers \"angle unit containers\""]
5954 #[doc = "\t\t\t\t- \\ref currentContainers \"current unit containers\""]
5955 #[doc = "\t\t\t\t- \\ref temperatureContainers \"temperature unit containers\""]
5956 #[doc = "\t\t\t\t- \\ref substanceContainers \"substance unit containers\""]
5957 #[doc = "\t\t\t\t- \\ref luminousIntensityContainers \"luminous intensity unit containers\""]
5958 #[doc = "\t\t\t\t- \\ref solidAngleContainers \"solid angle unit containers\""]
5959 #[doc = "\t\t\t\t- \\ref frequencyContainers \"frequency unit containers\""]
5960 #[doc = "\t\t\t\t- \\ref velocityContainers \"velocity unit containers\""]
5961 #[doc = "\t\t\t\t- \\ref angularVelocityContainers \"angular velocity unit containers\""]
5962 #[doc = "\t\t\t\t- \\ref accelerationContainers \"acceleration unit containers\""]
5963 #[doc = "\t\t\t\t- \\ref forceContainers \"force unit containers\""]
5964 #[doc = "\t\t\t\t- \\ref pressureContainers \"pressure unit containers\""]
5965 #[doc = "\t\t\t\t- \\ref chargeContainers \"charge unit containers\""]
5966 #[doc = "\t\t\t\t- \\ref energyContainers \"energy unit containers\""]
5967 #[doc = "\t\t\t\t- \\ref powerContainers \"power unit containers\""]
5968 #[doc = "\t\t\t\t- \\ref voltageContainers \"voltage unit containers\""]
5969 #[doc = "\t\t\t\t- \\ref capacitanceContainers \"capacitance unit containers\""]
5970 #[doc = "\t\t\t\t- \\ref impedanceContainers \"impedance unit containers\""]
5971 #[doc = "\t\t\t\t- \\ref magneticFluxContainers \"magnetic flux unit containers\""]
5972 #[doc = "\t\t\t\t- \\ref magneticFieldStrengthContainers \"magnetic field strength unit containers\""]
5973 #[doc = "\t\t\t\t- \\ref inductanceContainers \"inductance unit containers\""]
5974 #[doc = "\t\t\t\t- \\ref luminousFluxContainers \"luminous flux unit containers\""]
5975 #[doc = "\t\t\t\t- \\ref illuminanceContainers \"illuminance unit containers\""]
5976 #[doc = "\t\t\t\t- \\ref radiationContainers \"radiation unit containers\""]
5977 #[doc = "\t\t\t\t- \\ref torqueContainers \"torque unit containers\""]
5978 #[doc = "\t\t\t\t- \\ref areaContainers \"area unit containers\""]
5979 #[doc = "\t\t\t\t- \\ref volumeContainers \"volume unit containers\""]
5980 #[doc = "\t\t\t\t- \\ref densityContainers \"density unit containers\""]
5981 #[doc = "\t\t\t\t- \\ref concentrationContainers \"concentration unit containers\""]
5982 #[doc = "\t\t\t\t- \\ref constantContainers \"constant unit containers\""]
5983 pub type volt_t = root::units::unit_t;
5984 }
5985 }
5986 pub mod frc {
5987 #[allow(unused_imports)]
5988 use self::super::super::root;
5989 #[repr(C)]
5990 pub struct SpeedController__bindgen_vtable(::std::os::raw::c_void);
5991 #[doc = " Interface for speed controlling devices."]
5992 #[doc = ""]
5993 #[doc = " @deprecated Use MotorController."]
5994 #[repr(C)]
5995 #[derive(Debug)]
5996 pub struct SpeedController {
5997 pub vtable_: *const SpeedController__bindgen_vtable,
5998 }
5999 #[test]
6000 fn bindgen_test_layout_SpeedController() {
6001 assert_eq!(
6002 ::std::mem::size_of::<SpeedController>(),
6003 8usize,
6004 concat!("Size of: ", stringify!(SpeedController))
6005 );
6006 assert_eq!(
6007 ::std::mem::align_of::<SpeedController>(),
6008 8usize,
6009 concat!("Alignment of ", stringify!(SpeedController))
6010 );
6011 }
6012 extern "C" {
6013 #[doc = " Sets the voltage output of the SpeedController. Compensates for"]
6014 #[doc = " the current bus voltage to ensure that the desired voltage is output even"]
6015 #[doc = " if the battery voltage is below 12V - highly useful when the voltage"]
6016 #[doc = " outputs are \"meaningful\" (e.g. they come from a feedforward calculation)."]
6017 #[doc = ""]
6018 #[doc = " <p>NOTE: This function *must* be called regularly in order for voltage"]
6019 #[doc = " compensation to work properly - unlike the ordinary set function, it is not"]
6020 #[doc = " \"set it and forget it.\""]
6021 #[doc = ""]
6022 #[doc = " @param output The voltage to output."]
6023 #[link_name = "\u{1}_ZN3frc15SpeedController10SetVoltageEN5units6unit_tINS1_4unitISt5ratioILl1ELl1EENS1_9base_unitIS4_ILl2ELl1EES5_S4_ILln3ELl1EES4_ILl0ELl1EES4_ILln1ELl1EES9_S9_S9_S9_EES9_S9_EEdNS1_12linear_scaleEEE"]
6024 pub fn SpeedController_SetVoltage(
6025 this: *mut ::std::os::raw::c_void,
6026 output: root::units::voltage::volt_t,
6027 );
6028 }
6029 #[doc = " Interface for motor controlling devices."]
6030 #[repr(C)]
6031 #[derive(Debug)]
6032 pub struct MotorController {
6033 pub _base: root::frc::SpeedController,
6034 }
6035 #[test]
6036 fn bindgen_test_layout_MotorController() {
6037 assert_eq!(
6038 ::std::mem::size_of::<MotorController>(),
6039 8usize,
6040 concat!("Size of: ", stringify!(MotorController))
6041 );
6042 assert_eq!(
6043 ::std::mem::align_of::<MotorController>(),
6044 8usize,
6045 concat!("Alignment of ", stringify!(MotorController))
6046 );
6047 }
6048 #[doc = " Represents colors that can be used with Addressable LEDs."]
6049 #[doc = ""]
6050 #[doc = " Limited to 12 bits of precision."]
6051 #[repr(C)]
6052 #[derive(Debug, Copy, Clone)]
6053 pub struct Color {
6054 pub red: f64,
6055 pub green: f64,
6056 pub blue: f64,
6057 }
6058 extern "C" {
6059 #[doc = " 0x1560BD."]
6060 #[link_name = "\u{1}_ZN3frc5Color6kDenimE"]
6061 pub static Color_kDenim: root::frc::Color;
6062 }
6063 extern "C" {
6064 #[doc = " 0x0066B3."]
6065 #[link_name = "\u{1}_ZN3frc5Color10kFirstBlueE"]
6066 pub static Color_kFirstBlue: root::frc::Color;
6067 }
6068 extern "C" {
6069 #[doc = " 0xED1C24."]
6070 #[link_name = "\u{1}_ZN3frc5Color9kFirstRedE"]
6071 pub static Color_kFirstRed: root::frc::Color;
6072 }
6073 extern "C" {
6074 #[doc = " 0xF0F8FF."]
6075 #[link_name = "\u{1}_ZN3frc5Color10kAliceBlueE"]
6076 pub static Color_kAliceBlue: root::frc::Color;
6077 }
6078 extern "C" {
6079 #[doc = " 0xFAEBD7."]
6080 #[link_name = "\u{1}_ZN3frc5Color13kAntiqueWhiteE"]
6081 pub static Color_kAntiqueWhite: root::frc::Color;
6082 }
6083 extern "C" {
6084 #[doc = " 0x00FFFF."]
6085 #[link_name = "\u{1}_ZN3frc5Color5kAquaE"]
6086 pub static Color_kAqua: root::frc::Color;
6087 }
6088 extern "C" {
6089 #[doc = " 0x7FFFD4."]
6090 #[link_name = "\u{1}_ZN3frc5Color11kAquamarineE"]
6091 pub static Color_kAquamarine: root::frc::Color;
6092 }
6093 extern "C" {
6094 #[doc = " 0xF0FFFF."]
6095 #[link_name = "\u{1}_ZN3frc5Color6kAzureE"]
6096 pub static Color_kAzure: root::frc::Color;
6097 }
6098 extern "C" {
6099 #[doc = " 0xF5F5DC."]
6100 #[link_name = "\u{1}_ZN3frc5Color6kBeigeE"]
6101 pub static Color_kBeige: root::frc::Color;
6102 }
6103 extern "C" {
6104 #[doc = " 0xFFE4C4."]
6105 #[link_name = "\u{1}_ZN3frc5Color7kBisqueE"]
6106 pub static Color_kBisque: root::frc::Color;
6107 }
6108 extern "C" {
6109 #[doc = " 0x000000."]
6110 #[link_name = "\u{1}_ZN3frc5Color6kBlackE"]
6111 pub static Color_kBlack: root::frc::Color;
6112 }
6113 extern "C" {
6114 #[doc = " 0xFFEBCD."]
6115 #[link_name = "\u{1}_ZN3frc5Color15kBlanchedAlmondE"]
6116 pub static Color_kBlanchedAlmond: root::frc::Color;
6117 }
6118 extern "C" {
6119 #[doc = " 0x0000FF."]
6120 #[link_name = "\u{1}_ZN3frc5Color5kBlueE"]
6121 pub static Color_kBlue: root::frc::Color;
6122 }
6123 extern "C" {
6124 #[doc = " 0x8A2BE2."]
6125 #[link_name = "\u{1}_ZN3frc5Color11kBlueVioletE"]
6126 pub static Color_kBlueViolet: root::frc::Color;
6127 }
6128 extern "C" {
6129 #[doc = " 0xA52A2A."]
6130 #[link_name = "\u{1}_ZN3frc5Color6kBrownE"]
6131 pub static Color_kBrown: root::frc::Color;
6132 }
6133 extern "C" {
6134 #[doc = " 0xDEB887."]
6135 #[link_name = "\u{1}_ZN3frc5Color10kBurlywoodE"]
6136 pub static Color_kBurlywood: root::frc::Color;
6137 }
6138 extern "C" {
6139 #[doc = " 0x5F9EA0."]
6140 #[link_name = "\u{1}_ZN3frc5Color10kCadetBlueE"]
6141 pub static Color_kCadetBlue: root::frc::Color;
6142 }
6143 extern "C" {
6144 #[doc = " 0x7FFF00."]
6145 #[link_name = "\u{1}_ZN3frc5Color11kChartreuseE"]
6146 pub static Color_kChartreuse: root::frc::Color;
6147 }
6148 extern "C" {
6149 #[doc = " 0xD2691E."]
6150 #[link_name = "\u{1}_ZN3frc5Color10kChocolateE"]
6151 pub static Color_kChocolate: root::frc::Color;
6152 }
6153 extern "C" {
6154 #[doc = " 0xFF7F50."]
6155 #[link_name = "\u{1}_ZN3frc5Color6kCoralE"]
6156 pub static Color_kCoral: root::frc::Color;
6157 }
6158 extern "C" {
6159 #[doc = " 0x6495ED."]
6160 #[link_name = "\u{1}_ZN3frc5Color15kCornflowerBlueE"]
6161 pub static Color_kCornflowerBlue: root::frc::Color;
6162 }
6163 extern "C" {
6164 #[doc = " 0xFFF8DC."]
6165 #[link_name = "\u{1}_ZN3frc5Color9kCornsilkE"]
6166 pub static Color_kCornsilk: root::frc::Color;
6167 }
6168 extern "C" {
6169 #[doc = " 0xDC143C."]
6170 #[link_name = "\u{1}_ZN3frc5Color8kCrimsonE"]
6171 pub static Color_kCrimson: root::frc::Color;
6172 }
6173 extern "C" {
6174 #[doc = " 0x00FFFF."]
6175 #[link_name = "\u{1}_ZN3frc5Color5kCyanE"]
6176 pub static Color_kCyan: root::frc::Color;
6177 }
6178 extern "C" {
6179 #[doc = " 0x00008B."]
6180 #[link_name = "\u{1}_ZN3frc5Color9kDarkBlueE"]
6181 pub static Color_kDarkBlue: root::frc::Color;
6182 }
6183 extern "C" {
6184 #[doc = " 0x008B8B."]
6185 #[link_name = "\u{1}_ZN3frc5Color9kDarkCyanE"]
6186 pub static Color_kDarkCyan: root::frc::Color;
6187 }
6188 extern "C" {
6189 #[doc = " 0xB8860B."]
6190 #[link_name = "\u{1}_ZN3frc5Color14kDarkGoldenrodE"]
6191 pub static Color_kDarkGoldenrod: root::frc::Color;
6192 }
6193 extern "C" {
6194 #[doc = " 0xA9A9A9."]
6195 #[link_name = "\u{1}_ZN3frc5Color9kDarkGrayE"]
6196 pub static Color_kDarkGray: root::frc::Color;
6197 }
6198 extern "C" {
6199 #[doc = " 0x006400."]
6200 #[link_name = "\u{1}_ZN3frc5Color10kDarkGreenE"]
6201 pub static Color_kDarkGreen: root::frc::Color;
6202 }
6203 extern "C" {
6204 #[doc = " 0xBDB76B."]
6205 #[link_name = "\u{1}_ZN3frc5Color10kDarkKhakiE"]
6206 pub static Color_kDarkKhaki: root::frc::Color;
6207 }
6208 extern "C" {
6209 #[doc = " 0x8B008B."]
6210 #[link_name = "\u{1}_ZN3frc5Color12kDarkMagentaE"]
6211 pub static Color_kDarkMagenta: root::frc::Color;
6212 }
6213 extern "C" {
6214 #[doc = " 0x556B2F."]
6215 #[link_name = "\u{1}_ZN3frc5Color15kDarkOliveGreenE"]
6216 pub static Color_kDarkOliveGreen: root::frc::Color;
6217 }
6218 extern "C" {
6219 #[doc = " 0xFF8C00."]
6220 #[link_name = "\u{1}_ZN3frc5Color11kDarkOrangeE"]
6221 pub static Color_kDarkOrange: root::frc::Color;
6222 }
6223 extern "C" {
6224 #[doc = " 0x9932CC."]
6225 #[link_name = "\u{1}_ZN3frc5Color11kDarkOrchidE"]
6226 pub static Color_kDarkOrchid: root::frc::Color;
6227 }
6228 extern "C" {
6229 #[doc = " 0x8B0000."]
6230 #[link_name = "\u{1}_ZN3frc5Color8kDarkRedE"]
6231 pub static Color_kDarkRed: root::frc::Color;
6232 }
6233 extern "C" {
6234 #[doc = " 0xE9967A."]
6235 #[link_name = "\u{1}_ZN3frc5Color11kDarkSalmonE"]
6236 pub static Color_kDarkSalmon: root::frc::Color;
6237 }
6238 extern "C" {
6239 #[doc = " 0x8FBC8F."]
6240 #[link_name = "\u{1}_ZN3frc5Color13kDarkSeaGreenE"]
6241 pub static Color_kDarkSeaGreen: root::frc::Color;
6242 }
6243 extern "C" {
6244 #[doc = " 0x483D8B."]
6245 #[link_name = "\u{1}_ZN3frc5Color14kDarkSlateBlueE"]
6246 pub static Color_kDarkSlateBlue: root::frc::Color;
6247 }
6248 extern "C" {
6249 #[doc = " 0x2F4F4F."]
6250 #[link_name = "\u{1}_ZN3frc5Color14kDarkSlateGrayE"]
6251 pub static Color_kDarkSlateGray: root::frc::Color;
6252 }
6253 extern "C" {
6254 #[doc = " 0x00CED1."]
6255 #[link_name = "\u{1}_ZN3frc5Color14kDarkTurquoiseE"]
6256 pub static Color_kDarkTurquoise: root::frc::Color;
6257 }
6258 extern "C" {
6259 #[doc = " 0x9400D3."]
6260 #[link_name = "\u{1}_ZN3frc5Color11kDarkVioletE"]
6261 pub static Color_kDarkViolet: root::frc::Color;
6262 }
6263 extern "C" {
6264 #[doc = " 0xFF1493."]
6265 #[link_name = "\u{1}_ZN3frc5Color9kDeepPinkE"]
6266 pub static Color_kDeepPink: root::frc::Color;
6267 }
6268 extern "C" {
6269 #[doc = " 0x00BFFF."]
6270 #[link_name = "\u{1}_ZN3frc5Color12kDeepSkyBlueE"]
6271 pub static Color_kDeepSkyBlue: root::frc::Color;
6272 }
6273 extern "C" {
6274 #[doc = " 0x696969."]
6275 #[link_name = "\u{1}_ZN3frc5Color8kDimGrayE"]
6276 pub static Color_kDimGray: root::frc::Color;
6277 }
6278 extern "C" {
6279 #[doc = " 0x1E90FF."]
6280 #[link_name = "\u{1}_ZN3frc5Color11kDodgerBlueE"]
6281 pub static Color_kDodgerBlue: root::frc::Color;
6282 }
6283 extern "C" {
6284 #[doc = " 0xB22222."]
6285 #[link_name = "\u{1}_ZN3frc5Color10kFirebrickE"]
6286 pub static Color_kFirebrick: root::frc::Color;
6287 }
6288 extern "C" {
6289 #[doc = " 0xFFFAF0."]
6290 #[link_name = "\u{1}_ZN3frc5Color12kFloralWhiteE"]
6291 pub static Color_kFloralWhite: root::frc::Color;
6292 }
6293 extern "C" {
6294 #[doc = " 0x228B22."]
6295 #[link_name = "\u{1}_ZN3frc5Color12kForestGreenE"]
6296 pub static Color_kForestGreen: root::frc::Color;
6297 }
6298 extern "C" {
6299 #[doc = " 0xFF00FF."]
6300 #[link_name = "\u{1}_ZN3frc5Color8kFuchsiaE"]
6301 pub static Color_kFuchsia: root::frc::Color;
6302 }
6303 extern "C" {
6304 #[doc = " 0xDCDCDC."]
6305 #[link_name = "\u{1}_ZN3frc5Color10kGainsboroE"]
6306 pub static Color_kGainsboro: root::frc::Color;
6307 }
6308 extern "C" {
6309 #[doc = " 0xF8F8FF."]
6310 #[link_name = "\u{1}_ZN3frc5Color11kGhostWhiteE"]
6311 pub static Color_kGhostWhite: root::frc::Color;
6312 }
6313 extern "C" {
6314 #[doc = " 0xFFD700."]
6315 #[link_name = "\u{1}_ZN3frc5Color5kGoldE"]
6316 pub static Color_kGold: root::frc::Color;
6317 }
6318 extern "C" {
6319 #[doc = " 0xDAA520."]
6320 #[link_name = "\u{1}_ZN3frc5Color10kGoldenrodE"]
6321 pub static Color_kGoldenrod: root::frc::Color;
6322 }
6323 extern "C" {
6324 #[doc = " 0x808080."]
6325 #[link_name = "\u{1}_ZN3frc5Color5kGrayE"]
6326 pub static Color_kGray: root::frc::Color;
6327 }
6328 extern "C" {
6329 #[doc = " 0x008000."]
6330 #[link_name = "\u{1}_ZN3frc5Color6kGreenE"]
6331 pub static Color_kGreen: root::frc::Color;
6332 }
6333 extern "C" {
6334 #[doc = " 0xADFF2F."]
6335 #[link_name = "\u{1}_ZN3frc5Color12kGreenYellowE"]
6336 pub static Color_kGreenYellow: root::frc::Color;
6337 }
6338 extern "C" {
6339 #[doc = " 0xF0FFF0."]
6340 #[link_name = "\u{1}_ZN3frc5Color9kHoneydewE"]
6341 pub static Color_kHoneydew: root::frc::Color;
6342 }
6343 extern "C" {
6344 #[doc = " 0xFF69B4."]
6345 #[link_name = "\u{1}_ZN3frc5Color8kHotPinkE"]
6346 pub static Color_kHotPink: root::frc::Color;
6347 }
6348 extern "C" {
6349 #[doc = " 0xCD5C5C."]
6350 #[link_name = "\u{1}_ZN3frc5Color10kIndianRedE"]
6351 pub static Color_kIndianRed: root::frc::Color;
6352 }
6353 extern "C" {
6354 #[doc = " 0x4B0082."]
6355 #[link_name = "\u{1}_ZN3frc5Color7kIndigoE"]
6356 pub static Color_kIndigo: root::frc::Color;
6357 }
6358 extern "C" {
6359 #[doc = " 0xFFFFF0."]
6360 #[link_name = "\u{1}_ZN3frc5Color6kIvoryE"]
6361 pub static Color_kIvory: root::frc::Color;
6362 }
6363 extern "C" {
6364 #[doc = " 0xF0E68C."]
6365 #[link_name = "\u{1}_ZN3frc5Color6kKhakiE"]
6366 pub static Color_kKhaki: root::frc::Color;
6367 }
6368 extern "C" {
6369 #[doc = " 0xE6E6FA."]
6370 #[link_name = "\u{1}_ZN3frc5Color9kLavenderE"]
6371 pub static Color_kLavender: root::frc::Color;
6372 }
6373 extern "C" {
6374 #[doc = " 0xFFF0F5."]
6375 #[link_name = "\u{1}_ZN3frc5Color14kLavenderBlushE"]
6376 pub static Color_kLavenderBlush: root::frc::Color;
6377 }
6378 extern "C" {
6379 #[doc = " 0x7CFC00."]
6380 #[link_name = "\u{1}_ZN3frc5Color10kLawnGreenE"]
6381 pub static Color_kLawnGreen: root::frc::Color;
6382 }
6383 extern "C" {
6384 #[doc = " 0xFFFACD."]
6385 #[link_name = "\u{1}_ZN3frc5Color13kLemonChiffonE"]
6386 pub static Color_kLemonChiffon: root::frc::Color;
6387 }
6388 extern "C" {
6389 #[doc = " 0xADD8E6."]
6390 #[link_name = "\u{1}_ZN3frc5Color10kLightBlueE"]
6391 pub static Color_kLightBlue: root::frc::Color;
6392 }
6393 extern "C" {
6394 #[doc = " 0xF08080."]
6395 #[link_name = "\u{1}_ZN3frc5Color11kLightCoralE"]
6396 pub static Color_kLightCoral: root::frc::Color;
6397 }
6398 extern "C" {
6399 #[doc = " 0xE0FFFF."]
6400 #[link_name = "\u{1}_ZN3frc5Color10kLightCyanE"]
6401 pub static Color_kLightCyan: root::frc::Color;
6402 }
6403 extern "C" {
6404 #[doc = " 0xFAFAD2."]
6405 #[link_name = "\u{1}_ZN3frc5Color21kLightGoldenrodYellowE"]
6406 pub static Color_kLightGoldenrodYellow: root::frc::Color;
6407 }
6408 extern "C" {
6409 #[doc = " 0xD3D3D3."]
6410 #[link_name = "\u{1}_ZN3frc5Color10kLightGrayE"]
6411 pub static Color_kLightGray: root::frc::Color;
6412 }
6413 extern "C" {
6414 #[doc = " 0x90EE90."]
6415 #[link_name = "\u{1}_ZN3frc5Color11kLightGreenE"]
6416 pub static Color_kLightGreen: root::frc::Color;
6417 }
6418 extern "C" {
6419 #[doc = " 0xFFB6C1."]
6420 #[link_name = "\u{1}_ZN3frc5Color10kLightPinkE"]
6421 pub static Color_kLightPink: root::frc::Color;
6422 }
6423 extern "C" {
6424 #[doc = " 0xFFA07A."]
6425 #[link_name = "\u{1}_ZN3frc5Color12kLightSalmonE"]
6426 pub static Color_kLightSalmon: root::frc::Color;
6427 }
6428 extern "C" {
6429 #[doc = " 0x20B2AA."]
6430 #[link_name = "\u{1}_ZN3frc5Color14kLightSeaGreenE"]
6431 pub static Color_kLightSeaGreen: root::frc::Color;
6432 }
6433 extern "C" {
6434 #[doc = " 0x87CEFA."]
6435 #[link_name = "\u{1}_ZN3frc5Color13kLightSkyBlueE"]
6436 pub static Color_kLightSkyBlue: root::frc::Color;
6437 }
6438 extern "C" {
6439 #[doc = " 0x778899."]
6440 #[link_name = "\u{1}_ZN3frc5Color15kLightSlateGrayE"]
6441 pub static Color_kLightSlateGray: root::frc::Color;
6442 }
6443 extern "C" {
6444 #[doc = " 0xB0C4DE."]
6445 #[link_name = "\u{1}_ZN3frc5Color15kLightSteelBlueE"]
6446 pub static Color_kLightSteelBlue: root::frc::Color;
6447 }
6448 extern "C" {
6449 #[doc = " 0xFFFFE0."]
6450 #[link_name = "\u{1}_ZN3frc5Color12kLightYellowE"]
6451 pub static Color_kLightYellow: root::frc::Color;
6452 }
6453 extern "C" {
6454 #[doc = " 0x00FF00."]
6455 #[link_name = "\u{1}_ZN3frc5Color5kLimeE"]
6456 pub static Color_kLime: root::frc::Color;
6457 }
6458 extern "C" {
6459 #[doc = " 0x32CD32."]
6460 #[link_name = "\u{1}_ZN3frc5Color10kLimeGreenE"]
6461 pub static Color_kLimeGreen: root::frc::Color;
6462 }
6463 extern "C" {
6464 #[doc = " 0xFAF0E6."]
6465 #[link_name = "\u{1}_ZN3frc5Color6kLinenE"]
6466 pub static Color_kLinen: root::frc::Color;
6467 }
6468 extern "C" {
6469 #[doc = " 0xFF00FF."]
6470 #[link_name = "\u{1}_ZN3frc5Color8kMagentaE"]
6471 pub static Color_kMagenta: root::frc::Color;
6472 }
6473 extern "C" {
6474 #[doc = " 0x800000."]
6475 #[link_name = "\u{1}_ZN3frc5Color7kMaroonE"]
6476 pub static Color_kMaroon: root::frc::Color;
6477 }
6478 extern "C" {
6479 #[doc = " 0x66CDAA."]
6480 #[link_name = "\u{1}_ZN3frc5Color17kMediumAquamarineE"]
6481 pub static Color_kMediumAquamarine: root::frc::Color;
6482 }
6483 extern "C" {
6484 #[doc = " 0x0000CD."]
6485 #[link_name = "\u{1}_ZN3frc5Color11kMediumBlueE"]
6486 pub static Color_kMediumBlue: root::frc::Color;
6487 }
6488 extern "C" {
6489 #[doc = " 0xBA55D3."]
6490 #[link_name = "\u{1}_ZN3frc5Color13kMediumOrchidE"]
6491 pub static Color_kMediumOrchid: root::frc::Color;
6492 }
6493 extern "C" {
6494 #[doc = " 0x9370DB."]
6495 #[link_name = "\u{1}_ZN3frc5Color13kMediumPurpleE"]
6496 pub static Color_kMediumPurple: root::frc::Color;
6497 }
6498 extern "C" {
6499 #[doc = " 0x3CB371."]
6500 #[link_name = "\u{1}_ZN3frc5Color15kMediumSeaGreenE"]
6501 pub static Color_kMediumSeaGreen: root::frc::Color;
6502 }
6503 extern "C" {
6504 #[doc = " 0x7B68EE."]
6505 #[link_name = "\u{1}_ZN3frc5Color16kMediumSlateBlueE"]
6506 pub static Color_kMediumSlateBlue: root::frc::Color;
6507 }
6508 extern "C" {
6509 #[doc = " 0x00FA9A."]
6510 #[link_name = "\u{1}_ZN3frc5Color18kMediumSpringGreenE"]
6511 pub static Color_kMediumSpringGreen: root::frc::Color;
6512 }
6513 extern "C" {
6514 #[doc = " 0x48D1CC."]
6515 #[link_name = "\u{1}_ZN3frc5Color16kMediumTurquoiseE"]
6516 pub static Color_kMediumTurquoise: root::frc::Color;
6517 }
6518 extern "C" {
6519 #[doc = " 0xC71585."]
6520 #[link_name = "\u{1}_ZN3frc5Color16kMediumVioletRedE"]
6521 pub static Color_kMediumVioletRed: root::frc::Color;
6522 }
6523 extern "C" {
6524 #[doc = " 0x191970."]
6525 #[link_name = "\u{1}_ZN3frc5Color13kMidnightBlueE"]
6526 pub static Color_kMidnightBlue: root::frc::Color;
6527 }
6528 extern "C" {
6529 #[doc = " 0xF5FFFA."]
6530 #[link_name = "\u{1}_ZN3frc5Color10kMintcreamE"]
6531 pub static Color_kMintcream: root::frc::Color;
6532 }
6533 extern "C" {
6534 #[doc = " 0xFFE4E1."]
6535 #[link_name = "\u{1}_ZN3frc5Color10kMistyRoseE"]
6536 pub static Color_kMistyRose: root::frc::Color;
6537 }
6538 extern "C" {
6539 #[doc = " 0xFFE4B5."]
6540 #[link_name = "\u{1}_ZN3frc5Color9kMoccasinE"]
6541 pub static Color_kMoccasin: root::frc::Color;
6542 }
6543 extern "C" {
6544 #[doc = " 0xFFDEAD."]
6545 #[link_name = "\u{1}_ZN3frc5Color12kNavajoWhiteE"]
6546 pub static Color_kNavajoWhite: root::frc::Color;
6547 }
6548 extern "C" {
6549 #[doc = " 0x000080."]
6550 #[link_name = "\u{1}_ZN3frc5Color5kNavyE"]
6551 pub static Color_kNavy: root::frc::Color;
6552 }
6553 extern "C" {
6554 #[doc = " 0xFDF5E6."]
6555 #[link_name = "\u{1}_ZN3frc5Color8kOldLaceE"]
6556 pub static Color_kOldLace: root::frc::Color;
6557 }
6558 extern "C" {
6559 #[doc = " 0x808000."]
6560 #[link_name = "\u{1}_ZN3frc5Color6kOliveE"]
6561 pub static Color_kOlive: root::frc::Color;
6562 }
6563 extern "C" {
6564 #[doc = " 0x6B8E23."]
6565 #[link_name = "\u{1}_ZN3frc5Color10kOliveDrabE"]
6566 pub static Color_kOliveDrab: root::frc::Color;
6567 }
6568 extern "C" {
6569 #[doc = " 0xFFA500."]
6570 #[link_name = "\u{1}_ZN3frc5Color7kOrangeE"]
6571 pub static Color_kOrange: root::frc::Color;
6572 }
6573 extern "C" {
6574 #[doc = " 0xFF4500."]
6575 #[link_name = "\u{1}_ZN3frc5Color10kOrangeRedE"]
6576 pub static Color_kOrangeRed: root::frc::Color;
6577 }
6578 extern "C" {
6579 #[doc = " 0xDA70D6."]
6580 #[link_name = "\u{1}_ZN3frc5Color7kOrchidE"]
6581 pub static Color_kOrchid: root::frc::Color;
6582 }
6583 extern "C" {
6584 #[doc = " 0xEEE8AA."]
6585 #[link_name = "\u{1}_ZN3frc5Color14kPaleGoldenrodE"]
6586 pub static Color_kPaleGoldenrod: root::frc::Color;
6587 }
6588 extern "C" {
6589 #[doc = " 0x98FB98."]
6590 #[link_name = "\u{1}_ZN3frc5Color10kPaleGreenE"]
6591 pub static Color_kPaleGreen: root::frc::Color;
6592 }
6593 extern "C" {
6594 #[doc = " 0xAFEEEE."]
6595 #[link_name = "\u{1}_ZN3frc5Color14kPaleTurquoiseE"]
6596 pub static Color_kPaleTurquoise: root::frc::Color;
6597 }
6598 extern "C" {
6599 #[doc = " 0xDB7093."]
6600 #[link_name = "\u{1}_ZN3frc5Color14kPaleVioletRedE"]
6601 pub static Color_kPaleVioletRed: root::frc::Color;
6602 }
6603 extern "C" {
6604 #[doc = " 0xFFEFD5."]
6605 #[link_name = "\u{1}_ZN3frc5Color11kPapayaWhipE"]
6606 pub static Color_kPapayaWhip: root::frc::Color;
6607 }
6608 extern "C" {
6609 #[doc = " 0xFFDAB9."]
6610 #[link_name = "\u{1}_ZN3frc5Color10kPeachPuffE"]
6611 pub static Color_kPeachPuff: root::frc::Color;
6612 }
6613 extern "C" {
6614 #[doc = " 0xCD853F."]
6615 #[link_name = "\u{1}_ZN3frc5Color5kPeruE"]
6616 pub static Color_kPeru: root::frc::Color;
6617 }
6618 extern "C" {
6619 #[doc = " 0xFFC0CB."]
6620 #[link_name = "\u{1}_ZN3frc5Color5kPinkE"]
6621 pub static Color_kPink: root::frc::Color;
6622 }
6623 extern "C" {
6624 #[doc = " 0xDDA0DD."]
6625 #[link_name = "\u{1}_ZN3frc5Color5kPlumE"]
6626 pub static Color_kPlum: root::frc::Color;
6627 }
6628 extern "C" {
6629 #[doc = " 0xB0E0E6."]
6630 #[link_name = "\u{1}_ZN3frc5Color11kPowderBlueE"]
6631 pub static Color_kPowderBlue: root::frc::Color;
6632 }
6633 extern "C" {
6634 #[doc = " 0x800080."]
6635 #[link_name = "\u{1}_ZN3frc5Color7kPurpleE"]
6636 pub static Color_kPurple: root::frc::Color;
6637 }
6638 extern "C" {
6639 #[doc = " 0xFF0000."]
6640 #[link_name = "\u{1}_ZN3frc5Color4kRedE"]
6641 pub static Color_kRed: root::frc::Color;
6642 }
6643 extern "C" {
6644 #[doc = " 0xBC8F8F."]
6645 #[link_name = "\u{1}_ZN3frc5Color10kRosyBrownE"]
6646 pub static Color_kRosyBrown: root::frc::Color;
6647 }
6648 extern "C" {
6649 #[doc = " 0x4169E1."]
6650 #[link_name = "\u{1}_ZN3frc5Color10kRoyalBlueE"]
6651 pub static Color_kRoyalBlue: root::frc::Color;
6652 }
6653 extern "C" {
6654 #[doc = " 0x8B4513."]
6655 #[link_name = "\u{1}_ZN3frc5Color12kSaddleBrownE"]
6656 pub static Color_kSaddleBrown: root::frc::Color;
6657 }
6658 extern "C" {
6659 #[doc = " 0xFA8072."]
6660 #[link_name = "\u{1}_ZN3frc5Color7kSalmonE"]
6661 pub static Color_kSalmon: root::frc::Color;
6662 }
6663 extern "C" {
6664 #[doc = " 0xF4A460."]
6665 #[link_name = "\u{1}_ZN3frc5Color11kSandyBrownE"]
6666 pub static Color_kSandyBrown: root::frc::Color;
6667 }
6668 extern "C" {
6669 #[doc = " 0x2E8B57."]
6670 #[link_name = "\u{1}_ZN3frc5Color9kSeaGreenE"]
6671 pub static Color_kSeaGreen: root::frc::Color;
6672 }
6673 extern "C" {
6674 #[doc = " 0xFFF5EE."]
6675 #[link_name = "\u{1}_ZN3frc5Color9kSeashellE"]
6676 pub static Color_kSeashell: root::frc::Color;
6677 }
6678 extern "C" {
6679 #[doc = " 0xA0522D."]
6680 #[link_name = "\u{1}_ZN3frc5Color7kSiennaE"]
6681 pub static Color_kSienna: root::frc::Color;
6682 }
6683 extern "C" {
6684 #[doc = " 0xC0C0C0."]
6685 #[link_name = "\u{1}_ZN3frc5Color7kSilverE"]
6686 pub static Color_kSilver: root::frc::Color;
6687 }
6688 extern "C" {
6689 #[doc = " 0x87CEEB."]
6690 #[link_name = "\u{1}_ZN3frc5Color8kSkyBlueE"]
6691 pub static Color_kSkyBlue: root::frc::Color;
6692 }
6693 extern "C" {
6694 #[doc = " 0x6A5ACD."]
6695 #[link_name = "\u{1}_ZN3frc5Color10kSlateBlueE"]
6696 pub static Color_kSlateBlue: root::frc::Color;
6697 }
6698 extern "C" {
6699 #[doc = " 0x708090."]
6700 #[link_name = "\u{1}_ZN3frc5Color10kSlateGrayE"]
6701 pub static Color_kSlateGray: root::frc::Color;
6702 }
6703 extern "C" {
6704 #[doc = " 0xFFFAFA."]
6705 #[link_name = "\u{1}_ZN3frc5Color5kSnowE"]
6706 pub static Color_kSnow: root::frc::Color;
6707 }
6708 extern "C" {
6709 #[doc = " 0x00FF7F."]
6710 #[link_name = "\u{1}_ZN3frc5Color12kSpringGreenE"]
6711 pub static Color_kSpringGreen: root::frc::Color;
6712 }
6713 extern "C" {
6714 #[doc = " 0x4682B4."]
6715 #[link_name = "\u{1}_ZN3frc5Color10kSteelBlueE"]
6716 pub static Color_kSteelBlue: root::frc::Color;
6717 }
6718 extern "C" {
6719 #[doc = " 0xD2B48C."]
6720 #[link_name = "\u{1}_ZN3frc5Color4kTanE"]
6721 pub static Color_kTan: root::frc::Color;
6722 }
6723 extern "C" {
6724 #[doc = " 0x008080."]
6725 #[link_name = "\u{1}_ZN3frc5Color5kTealE"]
6726 pub static Color_kTeal: root::frc::Color;
6727 }
6728 extern "C" {
6729 #[doc = " 0xD8BFD8."]
6730 #[link_name = "\u{1}_ZN3frc5Color8kThistleE"]
6731 pub static Color_kThistle: root::frc::Color;
6732 }
6733 extern "C" {
6734 #[doc = " 0xFF6347."]
6735 #[link_name = "\u{1}_ZN3frc5Color7kTomatoE"]
6736 pub static Color_kTomato: root::frc::Color;
6737 }
6738 extern "C" {
6739 #[doc = " 0x40E0D0."]
6740 #[link_name = "\u{1}_ZN3frc5Color10kTurquoiseE"]
6741 pub static Color_kTurquoise: root::frc::Color;
6742 }
6743 extern "C" {
6744 #[doc = " 0xEE82EE."]
6745 #[link_name = "\u{1}_ZN3frc5Color7kVioletE"]
6746 pub static Color_kViolet: root::frc::Color;
6747 }
6748 extern "C" {
6749 #[doc = " 0xF5DEB3."]
6750 #[link_name = "\u{1}_ZN3frc5Color6kWheatE"]
6751 pub static Color_kWheat: root::frc::Color;
6752 }
6753 extern "C" {
6754 #[doc = " 0xFFFFFF."]
6755 #[link_name = "\u{1}_ZN3frc5Color6kWhiteE"]
6756 pub static Color_kWhite: root::frc::Color;
6757 }
6758 extern "C" {
6759 #[doc = " 0xF5F5F5."]
6760 #[link_name = "\u{1}_ZN3frc5Color11kWhiteSmokeE"]
6761 pub static Color_kWhiteSmoke: root::frc::Color;
6762 }
6763 extern "C" {
6764 #[doc = " 0xFFFF00."]
6765 #[link_name = "\u{1}_ZN3frc5Color7kYellowE"]
6766 pub static Color_kYellow: root::frc::Color;
6767 }
6768 extern "C" {
6769 #[doc = " 0x9ACD32."]
6770 #[link_name = "\u{1}_ZN3frc5Color12kYellowGreenE"]
6771 pub static Color_kYellowGreen: root::frc::Color;
6772 }
6773 pub const Color_kPrecision: f64 = 0.000244140625;
6774 #[test]
6775 fn bindgen_test_layout_Color() {
6776 assert_eq!(
6777 ::std::mem::size_of::<Color>(),
6778 24usize,
6779 concat!("Size of: ", stringify!(Color))
6780 );
6781 assert_eq!(
6782 ::std::mem::align_of::<Color>(),
6783 8usize,
6784 concat!("Alignment of ", stringify!(Color))
6785 );
6786 fn test_field_red() {
6787 assert_eq!(
6788 unsafe {
6789 let uninit = ::std::mem::MaybeUninit::<Color>::uninit();
6790 let ptr = uninit.as_ptr();
6791 ::std::ptr::addr_of!((*ptr).red) as usize - ptr as usize
6792 },
6793 0usize,
6794 concat!(
6795 "Offset of field: ",
6796 stringify!(Color),
6797 "::",
6798 stringify!(red)
6799 )
6800 );
6801 }
6802 test_field_red();
6803 fn test_field_green() {
6804 assert_eq!(
6805 unsafe {
6806 let uninit = ::std::mem::MaybeUninit::<Color>::uninit();
6807 let ptr = uninit.as_ptr();
6808 ::std::ptr::addr_of!((*ptr).green) as usize - ptr as usize
6809 },
6810 8usize,
6811 concat!(
6812 "Offset of field: ",
6813 stringify!(Color),
6814 "::",
6815 stringify!(green)
6816 )
6817 );
6818 }
6819 test_field_green();
6820 fn test_field_blue() {
6821 assert_eq!(
6822 unsafe {
6823 let uninit = ::std::mem::MaybeUninit::<Color>::uninit();
6824 let ptr = uninit.as_ptr();
6825 ::std::ptr::addr_of!((*ptr).blue) as usize - ptr as usize
6826 },
6827 16usize,
6828 concat!(
6829 "Offset of field: ",
6830 stringify!(Color),
6831 "::",
6832 stringify!(blue)
6833 )
6834 );
6835 }
6836 test_field_blue();
6837 }
6838 #[doc = " I2C bus interface class."]
6839 #[doc = ""]
6840 #[doc = " This class is intended to be used by sensor (and other I2C device) drivers."]
6841 #[doc = " It probably should not be used directly."]
6842 #[repr(C)]
6843 #[derive(Debug)]
6844 pub struct I2C {
6845 pub m_port: root::hal::I2CPort,
6846 pub m_deviceAddress: ::std::os::raw::c_int,
6847 }
6848 pub const I2C_Port_kOnboard: root::frc::I2C_Port = 0;
6849 pub const I2C_Port_kMXP: root::frc::I2C_Port = 1;
6850 pub type I2C_Port = ::std::os::raw::c_uint;
6851 #[test]
6852 fn bindgen_test_layout_I2C() {
6853 assert_eq!(
6854 ::std::mem::size_of::<I2C>(),
6855 8usize,
6856 concat!("Size of: ", stringify!(I2C))
6857 );
6858 assert_eq!(
6859 ::std::mem::align_of::<I2C>(),
6860 4usize,
6861 concat!("Alignment of ", stringify!(I2C))
6862 );
6863 fn test_field_m_port() {
6864 assert_eq!(
6865 unsafe {
6866 let uninit = ::std::mem::MaybeUninit::<I2C>::uninit();
6867 let ptr = uninit.as_ptr();
6868 ::std::ptr::addr_of!((*ptr).m_port) as usize - ptr as usize
6869 },
6870 0usize,
6871 concat!(
6872 "Offset of field: ",
6873 stringify!(I2C),
6874 "::",
6875 stringify!(m_port)
6876 )
6877 );
6878 }
6879 test_field_m_port();
6880 fn test_field_m_deviceAddress() {
6881 assert_eq!(
6882 unsafe {
6883 let uninit = ::std::mem::MaybeUninit::<I2C>::uninit();
6884 let ptr = uninit.as_ptr();
6885 ::std::ptr::addr_of!((*ptr).m_deviceAddress) as usize - ptr as usize
6886 },
6887 4usize,
6888 concat!(
6889 "Offset of field: ",
6890 stringify!(I2C),
6891 "::",
6892 stringify!(m_deviceAddress)
6893 )
6894 );
6895 }
6896 test_field_m_deviceAddress();
6897 }
6898 extern "C" {
6899 #[link_name = "\u{1}_ZNK3frc3I2C7GetPortEv"]
6900 pub fn I2C_GetPort(this: *const root::frc::I2C) -> root::frc::I2C_Port;
6901 }
6902 extern "C" {
6903 #[link_name = "\u{1}_ZNK3frc3I2C16GetDeviceAddressEv"]
6904 pub fn I2C_GetDeviceAddress(this: *const root::frc::I2C) -> ::std::os::raw::c_int;
6905 }
6906 extern "C" {
6907 #[doc = " Generic transaction."]
6908 #[doc = ""]
6909 #[doc = " This is a lower-level interface to the I2C hardware giving you more control"]
6910 #[doc = " over each transaction. If you intend to write multiple bytes in the same"]
6911 #[doc = " transaction and do not plan to receive anything back, use writeBulk()"]
6912 #[doc = " instead. Calling this with a receiveSize of 0 will result in an error."]
6913 #[doc = ""]
6914 #[doc = " @param dataToSend Buffer of data to send as part of the transaction."]
6915 #[doc = " @param sendSize Number of bytes to send as part of the transaction."]
6916 #[doc = " @param dataReceived Buffer to read data into."]
6917 #[doc = " @param receiveSize Number of bytes to read from the device."]
6918 #[doc = " @return Transfer Aborted... false for success, true for aborted."]
6919 #[link_name = "\u{1}_ZN3frc3I2C11TransactionEPhiS1_i"]
6920 pub fn I2C_Transaction(
6921 this: *mut root::frc::I2C,
6922 dataToSend: *mut u8,
6923 sendSize: ::std::os::raw::c_int,
6924 dataReceived: *mut u8,
6925 receiveSize: ::std::os::raw::c_int,
6926 ) -> bool;
6927 }
6928 extern "C" {
6929 #[doc = " Attempt to address a device on the I2C bus."]
6930 #[doc = ""]
6931 #[doc = " This allows you to figure out if there is a device on the I2C bus that"]
6932 #[doc = " responds to the address specified in the constructor."]
6933 #[doc = ""]
6934 #[doc = " @return Transfer Aborted... false for success, true for aborted."]
6935 #[link_name = "\u{1}_ZN3frc3I2C11AddressOnlyEv"]
6936 pub fn I2C_AddressOnly(this: *mut root::frc::I2C) -> bool;
6937 }
6938 extern "C" {
6939 #[doc = " Execute a write transaction with the device."]
6940 #[doc = ""]
6941 #[doc = " Write a single byte to a register on a device and wait until the"]
6942 #[doc = " transaction is complete."]
6943 #[doc = ""]
6944 #[doc = " @param registerAddress The address of the register on the device to be"]
6945 #[doc = " written."]
6946 #[doc = " @param data The byte to write to the register on the device."]
6947 #[doc = " @return Transfer Aborted... false for success, true for aborted."]
6948 #[link_name = "\u{1}_ZN3frc3I2C5WriteEih"]
6949 pub fn I2C_Write(
6950 this: *mut root::frc::I2C,
6951 registerAddress: ::std::os::raw::c_int,
6952 data: u8,
6953 ) -> bool;
6954 }
6955 extern "C" {
6956 #[doc = " Execute a bulk write transaction with the device."]
6957 #[doc = ""]
6958 #[doc = " Write multiple bytes to a device and wait until the"]
6959 #[doc = " transaction is complete."]
6960 #[doc = ""]
6961 #[doc = " @param data The data to write to the register on the device."]
6962 #[doc = " @param count The number of bytes to be written."]
6963 #[doc = " @return Transfer Aborted... false for success, true for aborted."]
6964 #[link_name = "\u{1}_ZN3frc3I2C9WriteBulkEPhi"]
6965 pub fn I2C_WriteBulk(
6966 this: *mut root::frc::I2C,
6967 data: *mut u8,
6968 count: ::std::os::raw::c_int,
6969 ) -> bool;
6970 }
6971 extern "C" {
6972 #[doc = " Execute a read transaction with the device."]
6973 #[doc = ""]
6974 #[doc = " Read bytes from a device."]
6975 #[doc = " Most I2C devices will auto-increment the register pointer internally"]
6976 #[doc = " allowing you to read consecutive registers on a device in a single"]
6977 #[doc = " transaction."]
6978 #[doc = ""]
6979 #[doc = " @param registerAddress The register to read first in the transaction."]
6980 #[doc = " @param count The number of bytes to read in the transaction."]
6981 #[doc = " @param data A pointer to the array of bytes to store the data"]
6982 #[doc = " read from the device."]
6983 #[doc = " @return Transfer Aborted... false for success, true for aborted."]
6984 #[link_name = "\u{1}_ZN3frc3I2C4ReadEiiPh"]
6985 pub fn I2C_Read(
6986 this: *mut root::frc::I2C,
6987 registerAddress: ::std::os::raw::c_int,
6988 count: ::std::os::raw::c_int,
6989 data: *mut u8,
6990 ) -> bool;
6991 }
6992 extern "C" {
6993 #[doc = " Execute a read only transaction with the device."]
6994 #[doc = ""]
6995 #[doc = " Read bytes from a device. This method does not write any data to prompt the"]
6996 #[doc = " device."]
6997 #[doc = ""]
6998 #[doc = " @param buffer A pointer to the array of bytes to store the data read from"]
6999 #[doc = " the device."]
7000 #[doc = " @param count The number of bytes to read in the transaction."]
7001 #[doc = " @return Transfer Aborted... false for success, true for aborted."]
7002 #[link_name = "\u{1}_ZN3frc3I2C8ReadOnlyEiPh"]
7003 pub fn I2C_ReadOnly(
7004 this: *mut root::frc::I2C,
7005 count: ::std::os::raw::c_int,
7006 buffer: *mut u8,
7007 ) -> bool;
7008 }
7009 extern "C" {
7010 #[doc = " Verify that a device's registers contain expected values."]
7011 #[doc = ""]
7012 #[doc = " Most devices will have a set of registers that contain a known value that"]
7013 #[doc = " can be used to identify them. This allows an I2C device driver to easily"]
7014 #[doc = " verify that the device contains the expected value."]
7015 #[doc = ""]
7016 #[doc = " @pre The device must support and be configured to use register"]
7017 #[doc = " auto-increment."]
7018 #[doc = ""]
7019 #[doc = " @param registerAddress The base register to start reading from the device."]
7020 #[doc = " @param count The size of the field to be verified."]
7021 #[doc = " @param expected A buffer containing the values expected from the"]
7022 #[doc = " device."]
7023 #[link_name = "\u{1}_ZN3frc3I2C12VerifySensorEiiPKh"]
7024 pub fn I2C_VerifySensor(
7025 this: *mut root::frc::I2C,
7026 registerAddress: ::std::os::raw::c_int,
7027 count: ::std::os::raw::c_int,
7028 expected: *const u8,
7029 ) -> bool;
7030 }
7031 extern "C" {
7032 #[doc = " Constructor."]
7033 #[doc = ""]
7034 #[doc = " @param port The I2C port to which the device is connected."]
7035 #[doc = " @param deviceAddress The address of the device on the I2C bus."]
7036 #[link_name = "\u{1}_ZN3frc3I2CC1ENS0_4PortEi"]
7037 pub fn I2C_I2C(
7038 this: *mut root::frc::I2C,
7039 port: root::frc::I2C_Port,
7040 deviceAddress: ::std::os::raw::c_int,
7041 );
7042 }
7043 extern "C" {
7044 #[link_name = "\u{1}_ZN3frc3I2CD1Ev"]
7045 pub fn I2C_I2C_destructor(this: *mut root::frc::I2C);
7046 }
7047 impl I2C {
7048 #[inline]
7049 pub unsafe fn GetPort(&self) -> root::frc::I2C_Port {
7050 I2C_GetPort(self)
7051 }
7052 #[inline]
7053 pub unsafe fn GetDeviceAddress(&self) -> ::std::os::raw::c_int {
7054 I2C_GetDeviceAddress(self)
7055 }
7056 #[inline]
7057 pub unsafe fn Transaction(
7058 &mut self,
7059 dataToSend: *mut u8,
7060 sendSize: ::std::os::raw::c_int,
7061 dataReceived: *mut u8,
7062 receiveSize: ::std::os::raw::c_int,
7063 ) -> bool {
7064 I2C_Transaction(self, dataToSend, sendSize, dataReceived, receiveSize)
7065 }
7066 #[inline]
7067 pub unsafe fn AddressOnly(&mut self) -> bool {
7068 I2C_AddressOnly(self)
7069 }
7070 #[inline]
7071 pub unsafe fn Write(
7072 &mut self,
7073 registerAddress: ::std::os::raw::c_int,
7074 data: u8,
7075 ) -> bool {
7076 I2C_Write(self, registerAddress, data)
7077 }
7078 #[inline]
7079 pub unsafe fn WriteBulk(
7080 &mut self,
7081 data: *mut u8,
7082 count: ::std::os::raw::c_int,
7083 ) -> bool {
7084 I2C_WriteBulk(self, data, count)
7085 }
7086 #[inline]
7087 pub unsafe fn Read(
7088 &mut self,
7089 registerAddress: ::std::os::raw::c_int,
7090 count: ::std::os::raw::c_int,
7091 data: *mut u8,
7092 ) -> bool {
7093 I2C_Read(self, registerAddress, count, data)
7094 }
7095 #[inline]
7096 pub unsafe fn ReadOnly(
7097 &mut self,
7098 count: ::std::os::raw::c_int,
7099 buffer: *mut u8,
7100 ) -> bool {
7101 I2C_ReadOnly(self, count, buffer)
7102 }
7103 #[inline]
7104 pub unsafe fn VerifySensor(
7105 &mut self,
7106 registerAddress: ::std::os::raw::c_int,
7107 count: ::std::os::raw::c_int,
7108 expected: *const u8,
7109 ) -> bool {
7110 I2C_VerifySensor(self, registerAddress, count, expected)
7111 }
7112 #[inline]
7113 pub unsafe fn new(
7114 port: root::frc::I2C_Port,
7115 deviceAddress: ::std::os::raw::c_int,
7116 ) -> Self {
7117 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
7118 I2C_I2C(__bindgen_tmp.as_mut_ptr(), port, deviceAddress);
7119 __bindgen_tmp.assume_init()
7120 }
7121 #[inline]
7122 pub unsafe fn destruct(&mut self) {
7123 I2C_I2C_destructor(self)
7124 }
7125 }
7126 }
7127 pub type HAL_Handle = i32;
7128 pub type HAL_SimDeviceHandle = root::HAL_Handle;
7129 pub type HAL_SimValueHandle = root::HAL_Handle;
7130 pub mod hal {
7131 #[allow(unused_imports)]
7132 use self::super::super::root;
7133 #[doc = " A move-only C++ wrapper around a HAL handle."]
7134 #[doc = " Does not ensure destruction."]
7135 pub type I2CPort = u32;
7136 #[doc = " C++ wrapper around a HAL simulator value handle."]
7137 #[repr(C)]
7138 #[derive(Debug, Copy, Clone)]
7139 pub struct SimValue {
7140 pub m_handle: root::HAL_SimValueHandle,
7141 }
7142 #[test]
7143 fn bindgen_test_layout_SimValue() {
7144 assert_eq!(
7145 ::std::mem::size_of::<SimValue>(),
7146 4usize,
7147 concat!("Size of: ", stringify!(SimValue))
7148 );
7149 assert_eq!(
7150 ::std::mem::align_of::<SimValue>(),
7151 4usize,
7152 concat!("Alignment of ", stringify!(SimValue))
7153 );
7154 fn test_field_m_handle() {
7155 assert_eq!(
7156 unsafe {
7157 let uninit = ::std::mem::MaybeUninit::<SimValue>::uninit();
7158 let ptr = uninit.as_ptr();
7159 ::std::ptr::addr_of!((*ptr).m_handle) as usize - ptr as usize
7160 },
7161 0usize,
7162 concat!(
7163 "Offset of field: ",
7164 stringify!(SimValue),
7165 "::",
7166 stringify!(m_handle)
7167 )
7168 );
7169 }
7170 test_field_m_handle();
7171 }
7172 #[doc = " C++ wrapper around a HAL simulator double value handle."]
7173 #[repr(C)]
7174 #[derive(Debug, Copy, Clone)]
7175 pub struct SimDouble {
7176 pub _base: root::hal::SimValue,
7177 }
7178 #[test]
7179 fn bindgen_test_layout_SimDouble() {
7180 assert_eq!(
7181 ::std::mem::size_of::<SimDouble>(),
7182 4usize,
7183 concat!("Size of: ", stringify!(SimDouble))
7184 );
7185 assert_eq!(
7186 ::std::mem::align_of::<SimDouble>(),
7187 4usize,
7188 concat!("Alignment of ", stringify!(SimDouble))
7189 );
7190 }
7191 #[doc = " A move-only C++ wrapper around a HAL simulator device handle."]
7192 #[repr(C)]
7193 #[derive(Debug)]
7194 pub struct SimDevice {
7195 pub m_handle: root::HAL_SimDeviceHandle,
7196 }
7197 pub const SimDevice_Direction_kInput: root::hal::SimDevice_Direction = 0;
7198 pub const SimDevice_Direction_kOutput: root::hal::SimDevice_Direction = 1;
7199 pub const SimDevice_Direction_kBidir: root::hal::SimDevice_Direction = 2;
7200 #[doc = " Direction of a simulated value (from the perspective of user code)."]
7201 pub type SimDevice_Direction = ::std::os::raw::c_uint;
7202 #[test]
7203 fn bindgen_test_layout_SimDevice() {
7204 assert_eq!(
7205 ::std::mem::size_of::<SimDevice>(),
7206 4usize,
7207 concat!("Size of: ", stringify!(SimDevice))
7208 );
7209 assert_eq!(
7210 ::std::mem::align_of::<SimDevice>(),
7211 4usize,
7212 concat!("Alignment of ", stringify!(SimDevice))
7213 );
7214 fn test_field_m_handle() {
7215 assert_eq!(
7216 unsafe {
7217 let uninit = ::std::mem::MaybeUninit::<SimDevice>::uninit();
7218 let ptr = uninit.as_ptr();
7219 ::std::ptr::addr_of!((*ptr).m_handle) as usize - ptr as usize
7220 },
7221 0usize,
7222 concat!(
7223 "Offset of field: ",
7224 stringify!(SimDevice),
7225 "::",
7226 stringify!(m_handle)
7227 )
7228 );
7229 }
7230 test_field_m_handle();
7231 }
7232 extern "C" {
7233 #[doc = " Creates a simulated device."]
7234 #[doc = ""]
7235 #[doc = " The device name must be unique. Returns null if the device name"]
7236 #[doc = " already exists. This is a convenience method that appends index in"]
7237 #[doc = " brackets to the device name, e.g. passing index=1 results in \"device[1]\""]
7238 #[doc = " for the device name."]
7239 #[doc = ""]
7240 #[doc = " If not in simulation, results in an \"empty\" object that evaluates to false"]
7241 #[doc = " in a boolean context."]
7242 #[doc = ""]
7243 #[doc = " @param name device name"]
7244 #[doc = " @param index device index number to append to name"]
7245 #[link_name = "\u{1}_ZN3hal9SimDeviceC1EPKci"]
7246 pub fn SimDevice_SimDevice(
7247 this: *mut root::hal::SimDevice,
7248 name: *const ::std::os::raw::c_char,
7249 index: ::std::os::raw::c_int,
7250 );
7251 }
7252 extern "C" {
7253 #[doc = " Creates a simulated device."]
7254 #[doc = ""]
7255 #[doc = " The device name must be unique. Returns null if the device name"]
7256 #[doc = " already exists. This is a convenience method that appends index and"]
7257 #[doc = " channel in brackets to the device name, e.g. passing index=1 and channel=2"]
7258 #[doc = " results in \"device[1,2]\" for the device name."]
7259 #[doc = ""]
7260 #[doc = " If not in simulation, results in an \"empty\" object that evaluates to false"]
7261 #[doc = " in a boolean context."]
7262 #[doc = ""]
7263 #[doc = " @param name device name"]
7264 #[doc = " @param index device index number to append to name"]
7265 #[doc = " @param channel device channel number to append to name"]
7266 #[link_name = "\u{1}_ZN3hal9SimDeviceC1EPKcii"]
7267 pub fn SimDevice_SimDevice1(
7268 this: *mut root::hal::SimDevice,
7269 name: *const ::std::os::raw::c_char,
7270 index: ::std::os::raw::c_int,
7271 channel: ::std::os::raw::c_int,
7272 );
7273 }
7274 impl SimDevice {
7275 #[inline]
7276 pub unsafe fn new(
7277 name: *const ::std::os::raw::c_char,
7278 index: ::std::os::raw::c_int,
7279 ) -> Self {
7280 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
7281 SimDevice_SimDevice(__bindgen_tmp.as_mut_ptr(), name, index);
7282 __bindgen_tmp.assume_init()
7283 }
7284 #[inline]
7285 pub unsafe fn new1(
7286 name: *const ::std::os::raw::c_char,
7287 index: ::std::os::raw::c_int,
7288 channel: ::std::os::raw::c_int,
7289 ) -> Self {
7290 let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
7291 SimDevice_SimDevice1(__bindgen_tmp.as_mut_ptr(), name, index, channel);
7292 __bindgen_tmp.assume_init()
7293 }
7294 }
7295 }
7296 pub const HAL_I2CPort_HAL_I2C_kInvalid: root::HAL_I2CPort = -1;
7297 pub const HAL_I2CPort_HAL_I2C_kOnboard: root::HAL_I2CPort = 0;
7298 pub const HAL_I2CPort_HAL_I2C_kMXP: root::HAL_I2CPort = 1;
7299 #[doc = " @defgroup hal_i2c I2C Functions"]
7300 #[doc = " @ingroup hal_capi"]
7301 #[doc = " @{"]
7302 pub type HAL_I2CPort = i32;
7303 pub mod wpi {
7304 #[allow(unused_imports)]
7305 use self::super::super::root;
7306 }
7307 #[test]
7308 fn __bindgen_test_layout_basic_string_open0_char_char_traits_open1_char_close1_allocator_open1_char_close1_close0_instantiation(
7309 ) {
7310 assert_eq!(
7311 ::std::mem::size_of::<root::std::basic_string<::std::os::raw::c_char>>(),
7312 32usize,
7313 concat!(
7314 "Size of template specialization: ",
7315 stringify!(root::std::basic_string<::std::os::raw::c_char>)
7316 )
7317 );
7318 assert_eq!(
7319 ::std::mem::align_of::<root::std::basic_string<::std::os::raw::c_char>>(),
7320 8usize,
7321 concat!(
7322 "Alignment of template specialization: ",
7323 stringify!(root::std::basic_string<::std::os::raw::c_char>)
7324 )
7325 );
7326 }
7327 #[test]
7328 fn __bindgen_test_layout_char_traits_open0_char_close0_instantiation() {
7329 assert_eq!(
7330 ::std::mem::size_of::<root::std::char_traits>(),
7331 1usize,
7332 concat!(
7333 "Size of template specialization: ",
7334 stringify!(root::std::char_traits)
7335 )
7336 );
7337 assert_eq!(
7338 ::std::mem::align_of::<root::std::char_traits>(),
7339 1usize,
7340 concat!(
7341 "Alignment of template specialization: ",
7342 stringify!(root::std::char_traits)
7343 )
7344 );
7345 }
7346 #[test]
7347 fn __bindgen_test_layout_allocator_open0_char_close0_instantiation() {
7348 assert_eq!(
7349 ::std::mem::size_of::<root::std::allocator>(),
7350 1usize,
7351 concat!(
7352 "Size of template specialization: ",
7353 stringify!(root::std::allocator)
7354 )
7355 );
7356 assert_eq!(
7357 ::std::mem::align_of::<root::std::allocator>(),
7358 1usize,
7359 concat!(
7360 "Alignment of template specialization: ",
7361 stringify!(root::std::allocator)
7362 )
7363 );
7364 }
7365 #[test]
7366 fn __bindgen_test_layout_unit_t_open0_volt_double_close0_instantiation() {
7367 assert_eq!(
7368 ::std::mem::size_of::<root::units::unit_t>(),
7369 8usize,
7370 concat!(
7371 "Size of template specialization: ",
7372 stringify!(root::units::unit_t)
7373 )
7374 );
7375 assert_eq!(
7376 ::std::mem::align_of::<root::units::unit_t>(),
7377 8usize,
7378 concat!(
7379 "Alignment of template specialization: ",
7380 stringify!(root::units::unit_t)
7381 )
7382 );
7383 }
7384 #[test]
7385 fn __bindgen_test_layout_atomic_open0_bool__close0_instantiation() {
7386 assert_eq!(
7387 ::std::mem::size_of::<root::std::atomic<bool>>(),
7388 1usize,
7389 concat!(
7390 "Size of template specialization: ",
7391 stringify!(root::std::atomic<bool>)
7392 )
7393 );
7394 assert_eq!(
7395 ::std::mem::align_of::<root::std::atomic<bool>>(),
7396 1usize,
7397 concat!(
7398 "Alignment of template specialization: ",
7399 stringify!(root::std::atomic<bool>)
7400 )
7401 );
7402 }
7403 #[test]
7404 fn __bindgen_test_layout_atomic_open0_bool__close0_instantiation_1() {
7405 assert_eq!(
7406 ::std::mem::size_of::<root::std::atomic<bool>>(),
7407 1usize,
7408 concat!(
7409 "Size of template specialization: ",
7410 stringify!(root::std::atomic<bool>)
7411 )
7412 );
7413 assert_eq!(
7414 ::std::mem::align_of::<root::std::atomic<bool>>(),
7415 1usize,
7416 concat!(
7417 "Alignment of template specialization: ",
7418 stringify!(root::std::atomic<bool>)
7419 )
7420 );
7421 }
7422 #[test]
7423 fn __bindgen_test_layout_atomic_open0_bool__close0_instantiation_2() {
7424 assert_eq!(
7425 ::std::mem::size_of::<root::std::atomic<bool>>(),
7426 1usize,
7427 concat!(
7428 "Size of template specialization: ",
7429 stringify!(root::std::atomic<bool>)
7430 )
7431 );
7432 assert_eq!(
7433 ::std::mem::align_of::<root::std::atomic<bool>>(),
7434 1usize,
7435 concat!(
7436 "Alignment of template specialization: ",
7437 stringify!(root::std::atomic<bool>)
7438 )
7439 );
7440 }
7441 #[test]
7442 fn __bindgen_test_layout_atomic_open0_bool__close0_instantiation_3() {
7443 assert_eq!(
7444 ::std::mem::size_of::<root::std::atomic<bool>>(),
7445 1usize,
7446 concat!(
7447 "Size of template specialization: ",
7448 stringify!(root::std::atomic<bool>)
7449 )
7450 );
7451 assert_eq!(
7452 ::std::mem::align_of::<root::std::atomic<bool>>(),
7453 1usize,
7454 concat!(
7455 "Alignment of template specialization: ",
7456 stringify!(root::std::atomic<bool>)
7457 )
7458 );
7459 }
7460 #[test]
7461 fn __bindgen_test_layout_atomic_open0_bool__close0_instantiation_4() {
7462 assert_eq!(
7463 ::std::mem::size_of::<root::std::atomic<bool>>(),
7464 1usize,
7465 concat!(
7466 "Size of template specialization: ",
7467 stringify!(root::std::atomic<bool>)
7468 )
7469 );
7470 assert_eq!(
7471 ::std::mem::align_of::<root::std::atomic<bool>>(),
7472 1usize,
7473 concat!(
7474 "Alignment of template specialization: ",
7475 stringify!(root::std::atomic<bool>)
7476 )
7477 );
7478 }
7479 #[test]
7480 fn __bindgen_test_layout_atomic_open0_bool__close0_instantiation_5() {
7481 assert_eq!(
7482 ::std::mem::size_of::<root::std::atomic<bool>>(),
7483 1usize,
7484 concat!(
7485 "Size of template specialization: ",
7486 stringify!(root::std::atomic<bool>)
7487 )
7488 );
7489 assert_eq!(
7490 ::std::mem::align_of::<root::std::atomic<bool>>(),
7491 1usize,
7492 concat!(
7493 "Alignment of template specialization: ",
7494 stringify!(root::std::atomic<bool>)
7495 )
7496 );
7497 }
7498 #[test]
7499 fn __bindgen_test_layout_vector_open0_Color_allocator_open1_Color_close1_close0_instantiation()
7500 {
7501 assert_eq!(
7502 ::std::mem::size_of::<root::std::vector>(),
7503 24usize,
7504 concat!(
7505 "Size of template specialization: ",
7506 stringify!(root::std::vector)
7507 )
7508 );
7509 assert_eq!(
7510 ::std::mem::align_of::<root::std::vector>(),
7511 8usize,
7512 concat!(
7513 "Alignment of template specialization: ",
7514 stringify!(root::std::vector)
7515 )
7516 );
7517 }
7518 #[test]
7519 fn __bindgen_test_layout_allocator_open0_Color_close0_instantiation() {
7520 assert_eq!(
7521 ::std::mem::size_of::<root::std::allocator>(),
7522 1usize,
7523 concat!(
7524 "Size of template specialization: ",
7525 stringify!(root::std::allocator)
7526 )
7527 );
7528 assert_eq!(
7529 ::std::mem::align_of::<root::std::allocator>(),
7530 1usize,
7531 concat!(
7532 "Alignment of template specialization: ",
7533 stringify!(root::std::allocator)
7534 )
7535 );
7536 }
7537}