vex_sdk/
pneumatic.rs

1//! CTE Workcell Pneumatics Control
2
3use crate::V5_DeviceT;
4
5#[repr(C)]
6#[derive(Default, Copy, Clone, Eq, PartialEq, Debug)]
7pub struct V5_DevicePneumaticCtrl {
8    pub flags: u16,
9    pub m1_pwm: u8,
10    pub m2_pwm: u8,
11    pub m3_pwm: u8,
12    pub m4_pwm: u8,
13    pub m1_time: u8,
14    pub m2_time: u8,
15    pub m3_time: u8,
16    pub m4_time: u8,
17    pub comp_pwm: u8,
18}
19
20unsafe extern "system" {
21    pub fn vexDevicePneumaticActuationStatusGet(
22        device: V5_DeviceT,
23        ac1: *mut u16,
24        ac2: *mut u16,
25        ac3: *mut u16,
26        ac4: *mut u16,
27    ) -> u32;
28    pub fn vexDevicePneumaticCompressorSet(device: V5_DeviceT, bState: bool);
29    pub fn vexDevicePneumaticCtrlSet(device: V5_DeviceT, pCtrl: *mut V5_DevicePneumaticCtrl);
30    pub fn vexDevicePneumaticCylinderPwmSet(device: V5_DeviceT, id: u32, bState: bool, pwm: u8);
31    pub fn vexDevicePneumaticCylinderSet(device: V5_DeviceT, id: u32, bState: bool);
32    pub fn vexDevicePneumaticPwmGet(device: V5_DeviceT) -> u32;
33    pub fn vexDevicePneumaticPwmSet(device: V5_DeviceT, pwm: u8);
34    pub fn vexDevicePneumaticStatusGet(device: V5_DeviceT) -> u32;
35}