vex_sdk/
magnet.rs

1//! V5 Workcell Electromagnet
2
3use core::ffi::c_double;
4
5use crate::V5_DeviceT;
6
7#[repr(transparent)]
8#[derive(Default, Debug, Copy, Clone, Eq, PartialEq)]
9pub struct V5_DeviceMagnetDuration(pub core::ffi::c_uchar);
10
11impl V5_DeviceMagnetDuration {
12    pub const kMagnetDurationShort: Self = Self(0);
13    pub const kMagnetDurationMedium: Self = Self(1);
14    pub const kMagnetDurationLong: Self = Self(2);
15    pub const kMagnetDurationExtraLong: Self = Self(3);
16}
17
18unsafe extern "system" {
19    pub fn vexDeviceMagnetPowerSet(device: V5_DeviceT, value: i32, time: i32);
20    pub fn vexDeviceMagnetPowerGet(device: V5_DeviceT) -> i32;
21    pub fn vexDeviceMagnetPickup(device: V5_DeviceT, duration: V5_DeviceMagnetDuration);
22    pub fn vexDeviceMagnetDrop(device: V5_DeviceT, duration: V5_DeviceMagnetDuration);
23    pub fn vexDeviceMagnetTemperatureGet(device: V5_DeviceT) -> c_double;
24    pub fn vexDeviceMagnetCurrentGet(device: V5_DeviceT) -> c_double;
25    pub fn vexDeviceMagnetStatusGet(device: V5_DeviceT) -> u32;
26}