Package edu.wpi.first.hal
Class PowerDistributionJNI
java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.PowerDistributionJNI
Power Distribution JNI Functions.
- See Also:
-
- "hal/PowerDistribution.h"
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.hal.JNIWrapper
JNIWrapper.Helper -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAutomatically determines the module type.static final intCTRE (Cross The Road Electronics) Power Distribution Panel (PDP).static final intUse the default module number for the selected module type.static final intREV Power Distribution Hub (PDH). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckChannel(int handle, int channel) Checks if a PowerDistribution channel is valid.static booleancheckModule(int module, int type) Checks if a PowerDistribution module is valid.static voidclearStickyFaults(int handle) Clears any PowerDistribution sticky faults.static voidfree(int handle) Cleans a PowerDistribution module.static voidgetAllCurrents(int handle, double[] currents) Gets the current of all channels on the PowerDistribution.static doublegetChannelCurrent(int handle, int channel) Gets the current of a specific PowerDistribution channel.static doublegetChannelCurrentNoError(int handle, int channel) Gets the current of a specific PowerDistribution channel without throwing any errors.static PowerDistributionFaultsgetFaults(int handle) Get the current faults of the PowerDistribution.static intgetFaultsNative(int handle) Get the current faults of the PowerDistribution.static intgetModuleNumber(int handle) Gets the module number for a specific handle.static intgetNumChannels(int handle) Gets the number of channels for this handle.getStickyFaults(int handle) Gets the sticky faults of the PowerDistribution.static intgetStickyFaultsNative(int handle) Gets the sticky faults of the PowerDistribution.static booleangetSwitchableChannel(int handle) Returns true if switchable channel is powered on.static booleangetSwitchableChannelNoError(int handle) Returns true if switchable channel is powered on without throwing any errors.static doublegetTemperature(int handle) Gets the temperature of the PowerDistribution.static doublegetTotalCurrent(int handle) Gets the total current of the PowerDistribution.static doublegetTotalCurrentNoError(int handle) Gets the total current of the PowerDistribution without throwing any errors.static doublegetTotalEnergy(int handle) Gets the total energy of the Power Distribution Panel.static doublegetTotalPower(int handle) Gets the total power of the Power Distribution Panel.static intgetType(int handle) Gets the type of PowerDistribution module.static PowerDistributionVersiongetVersion(int handle) Get the version of the PowerDistribution.static doublegetVoltage(int handle) Gets the PowerDistribution input voltage.static doublegetVoltageNoError(int handle) Gets the PowerDistribution input voltage without throwing any errors.static intinitialize(int module, int type) Initializes a Power Distribution Panel.static voidresetTotalEnergy(int handle) Resets the Power Distribution Panel accumulated energy.static voidsetSwitchableChannel(int handle, boolean enabled) Power on/off switchable channel.static voidsetSwitchableChannelNoError(int handle, boolean enabled) Power on/off switchable channel without throwing any errors.Methods inherited from class edu.wpi.first.hal.JNIWrapper
forceLoad, suppressUnused
-
Field Details
-
AUTOMATIC_TYPE
Automatically determines the module type.- See Also:
-
CTRE_TYPE
CTRE (Cross The Road Electronics) Power Distribution Panel (PDP).- See Also:
-
REV_TYPE
REV Power Distribution Hub (PDH).- See Also:
-
DEFAULT_MODULE
Use the default module number for the selected module type.- See Also:
-
-
Method Details
-
initialize
Initializes a Power Distribution Panel.- Parameters:
module- the module number to initializetype- the type of module to initialize- Returns:
- the created PowerDistribution handle
- See Also:
-
- "HAL_InitializePowerDistribution"
-
free
Cleans a PowerDistribution module.- Parameters:
handle- the module handle- See Also:
-
- "HAL_CleanPowerDistribution"
-
getModuleNumber
Gets the module number for a specific handle.- Parameters:
handle- the module handle- Returns:
- the module number
- See Also:
-
- "HAL_GetPowerDistributionModuleNumber"
-
checkModule
Checks if a PowerDistribution module is valid.- Parameters:
module- the module to checktype- the type of module- Returns:
- true if the module is valid, otherwise false
- See Also:
-
- "HAL_CheckPowerDistributionModule"
-
checkChannel
Checks if a PowerDistribution channel is valid.- Parameters:
handle- the module handlechannel- the channel to check- Returns:
- true if the channel is valid, otherwise false
- See Also:
-
- "HAL_CheckPowerDistributionChannel"
-
getType
Gets the type of PowerDistribution module.- Parameters:
handle- the module handle- Returns:
- the type of module
- See Also:
-
- "HAL_GetPowerDistributionType"
-
getNumChannels
Gets the number of channels for this handle.- Parameters:
handle- the handle- Returns:
- number of channels
- See Also:
-
- "HAL_GetPowerDistributionNumChannels"
-
getTemperature
Gets the temperature of the PowerDistribution.Not supported on the Rev PDH and returns 0.
- Parameters:
handle- the module handle- Returns:
- the module temperature (celsius)
- See Also:
-
- "HAL_GetPowerDistributionTemperature"
-
getVoltage
Gets the PowerDistribution input voltage.- Parameters:
handle- the module handle- Returns:
- the input voltage (volts)
- See Also:
-
- "HAL_GetPowerDistributionVoltage"
-
getChannelCurrent
Gets the current of a specific PowerDistribution channel.- Parameters:
handle- the module handlechannel- the channel- Returns:
- the channel current (amps)
- See Also:
-
- "HAL_GetPowerDistributionChannelCurrent"
-
getAllCurrents
Gets the current of all channels on the PowerDistribution.The array must be large enough to hold all channels.
- Parameters:
handle- the module handlecurrents- the currents- See Also:
-
- "HAL_GetPowerDistributionAllChannelCurrents"
-
getTotalCurrent
Gets the total current of the PowerDistribution.- Parameters:
handle- the module handle- Returns:
- the total current (amps)
- See Also:
-
- "HAL_GetPowerDistributionTotalCurrent"
-
getTotalPower
Gets the total power of the Power Distribution Panel.Not supported on the Rev PDH and returns 0.
- Parameters:
handle- the module handle- Returns:
- the total power (watts)
- See Also:
-
- "HAL_GetPowerDistributionTotalPower"
-
getTotalEnergy
Gets the total energy of the Power Distribution Panel.Not supported on the Rev PDH and does nothing.
- Parameters:
handle- the module handle- Returns:
- the total energy (joules)
- See Also:
-
- "HAL_GetPowerDistributionTotalEnergy"
-
resetTotalEnergy
Resets the Power Distribution Panel accumulated energy.Not supported on the Rev PDH and returns 0.
- Parameters:
handle- the module handle- See Also:
-
- "HAL_ClearPowerDistributionStickyFaults"
-
clearStickyFaults
Clears any PowerDistribution sticky faults.- Parameters:
handle- the module handle- See Also:
-
- "HAL_ClearPowerDistributionStickyFaults"
-
getSwitchableChannel
Returns true if switchable channel is powered on.This is a REV PDH-specific function. This function will no-op on CTRE PDP.
- Parameters:
handle- the module handle- Returns:
- the state of the switchable channel
- See Also:
-
- "HAL_GetPowerDistributionSwitchableChannel"
-
setSwitchableChannel
Power on/off switchable channel.This is a REV PDH-specific function. This function will no-op on CTRE PDP.
- Parameters:
handle- the module handleenabled- true to turn on switchable channel- See Also:
-
- "HAL_SetPowerDistributionSwitchableChannel"
-
getVoltageNoError
Gets the PowerDistribution input voltage without throwing any errors.- Parameters:
handle- the module handle- Returns:
- the input voltage (volts)
- See Also:
-
- "HAL_GetPowerDistributionVoltage"
-
getChannelCurrentNoError
Gets the current of a specific PowerDistribution channel without throwing any errors.- Parameters:
handle- the module handlechannel- the channel- Returns:
- the channel current (amps)
- See Also:
-
- "HAL_GetPowerDistributionChannelCurrent"
-
getTotalCurrentNoError
Gets the total current of the PowerDistribution without throwing any errors.- Parameters:
handle- the module handle- Returns:
- the total current (amps)
- See Also:
-
- "HAL_GetPowerDistributionTotalCurrent"
-
getSwitchableChannelNoError
Returns true if switchable channel is powered on without throwing any errors.This is a REV PDH-specific function. This function will no-op on CTRE PDP.
- Parameters:
handle- the module handle- Returns:
- the state of the switchable channel
- See Also:
-
- "HAL_GetPowerDistributionSwitchableChannel"
-
setSwitchableChannelNoError
Power on/off switchable channel without throwing any errors.This is a REV PDH-specific function. This function will no-op on CTRE PDP.
- Parameters:
handle- the module handleenabled- true to turn on switchable channel- See Also:
-
- "HAL_SetPowerDistributionSwitchableChannel"
-
getFaultsNative
Get the current faults of the PowerDistribution.- Parameters:
handle- the module handle- Returns:
- the current faults
- See Also:
-
- "HAL_GetPowerDistributionFaults"
-
getFaults
Get the current faults of the PowerDistribution.- Parameters:
handle- the module handle- Returns:
- the current faults
- See Also:
-
- "HAL_GetPowerDistributionFaults"
-
getStickyFaultsNative
Gets the sticky faults of the PowerDistribution.- Parameters:
handle- the module handle- Returns:
- the sticky faults
- See Also:
-
- "HAL_GetPowerDistributionStickyFaults"
-
getStickyFaults
Gets the sticky faults of the PowerDistribution.- Parameters:
handle- the module handle- Returns:
- the sticky faults
- See Also:
-
- "HAL_GetPowerDistributionStickyFaults"
-
getVersion
Get the version of the PowerDistribution.- Parameters:
handle- the module handle- Returns:
- version
- See Also:
-
- "HAL_GetPowerDistributionVersion"
-