Struct PowerDistributionPanel

Source
pub struct PowerDistributionPanel { /* private fields */ }
Expand description

An interface to the PDP for getting information about robot power.

Implementations§

Source§

impl PowerDistributionPanel

Source

pub fn new() -> HalResult<PowerDistributionPanel>

Initalizes a PDP using the default module, which is 0, according to WPILibC.

Source

pub fn new_with_module(module: i32) -> HalResult<PowerDistributionPanel>

Create a new PDP interface on the specified module.

Source

pub fn voltage(&self) -> HalMaybe<f64>

Get the voltage going into the PDP.

Source

pub fn temperature(&self) -> HalMaybe<f64>

Get the PDP’s temperature, in degrees Celsius.

§Errors

The HalMaybe returned will have an error most commonly in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Source

pub fn current(&self, channel: i32) -> HalMaybe<f64>

Get the current on a specific channel on the PDP, in amps.

§Errrors

If channel is invalid, the return value will contain NAN and `HalError(0).

The HalMaybe returned will have an error most commonly in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Source

pub fn total_current(&self) -> HalMaybe<f64>

Get the total current drawn from the PDP, in amps.

§Errors

The HalMaybe returned will have an error most commonly in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Source

pub fn total_power(&self) -> HalMaybe<f64>

Get the total power drawn from the PDP, in watts.

§Errors

The HalMaybe returned will have an error most commonly in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Source

pub fn total_energy(&self) -> HalMaybe<f64>

Get the total energy expended by the PDP, in joules.

§Errors

The HalMaybe returned will have an error most commonly in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Source

pub fn reset_total_energy(&self) -> HalResult<()>

Reset the total energy count so far to zero.

§Errors

Errors in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Source

pub fn clear_sticky_faults(&self) -> HalResult<()>

Clear sticky faults in the PDP.

§Errors

Errors in the case of a CAN timeout. (In Fact, this is the only error WPILib will ever report!).

Trait Implementations§

Source§

impl Debug for PowerDistributionPanel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.