WPILibC++ 2024.3.2
|
Functions to control Power Distribution devices. More...
Classes | |
struct | HAL_PowerDistributionVersion |
Power distribution version. More... | |
struct | HAL_PowerDistributionFaults |
struct | HAL_PowerDistributionStickyFaults |
Storage for REV PDH Sticky Faults. More... | |
struct | HAL_PowerDistributionChannelData |
Macros | |
#define | HAL_DEFAULT_POWER_DISTRIBUTION_MODULE -1 |
Typedefs | |
typedef struct HAL_PowerDistributionChannelData | HAL_PowerDistributionChannelData |
Enumerations | |
enum | HAL_PowerDistributionType : int32_t { HAL_PowerDistributionType_kAutomatic = 0 , HAL_PowerDistributionType_kCTRE = 1 , HAL_PowerDistributionType_kRev = 2 } |
The types of power distribution devices. More... | |
Functions | |
HAL_PowerDistributionHandle | HAL_InitializePowerDistribution (int32_t moduleNumber, HAL_PowerDistributionType type, const char *allocationLocation, int32_t *status) |
Initializes a Power Distribution Panel. More... | |
int32_t | HAL_GetPowerDistributionModuleNumber (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the module number for a specific handle. More... | |
void | HAL_CleanPowerDistribution (HAL_PowerDistributionHandle handle) |
Cleans a PowerDistribution module. More... | |
HAL_Bool | HAL_CheckPowerDistributionChannel (HAL_PowerDistributionHandle handle, int32_t channel) |
Checks if a PowerDistribution channel is valid. More... | |
HAL_Bool | HAL_CheckPowerDistributionModule (int32_t module, HAL_PowerDistributionType type) |
Checks if a PowerDistribution module is valid. More... | |
HAL_PowerDistributionType | HAL_GetPowerDistributionType (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the type of PowerDistribution module. More... | |
int32_t | HAL_GetPowerDistributionNumChannels (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the number of channels for this handle. More... | |
double | HAL_GetPowerDistributionTemperature (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the temperature of the Power Distribution Panel. More... | |
double | HAL_GetPowerDistributionVoltage (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the PowerDistribution input voltage. More... | |
double | HAL_GetPowerDistributionChannelCurrent (HAL_PowerDistributionHandle handle, int32_t channel, int32_t *status) |
Gets the current of a specific PowerDistribution channel. More... | |
void | HAL_GetPowerDistributionAllChannelCurrents (HAL_PowerDistributionHandle handle, double *currents, int32_t currentsLength, int32_t *status) |
Gets the current of all channels on the PowerDistribution. More... | |
double | HAL_GetPowerDistributionTotalCurrent (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the total current of the PowerDistribution. More... | |
double | HAL_GetPowerDistributionTotalPower (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the total power of the Power Distribution Panel. More... | |
double | HAL_GetPowerDistributionTotalEnergy (HAL_PowerDistributionHandle handle, int32_t *status) |
Gets the total energy of the Power Distribution Panel. More... | |
void | HAL_ResetPowerDistributionTotalEnergy (HAL_PowerDistributionHandle handle, int32_t *status) |
Resets the PowerDistribution accumulated energy. More... | |
void | HAL_ClearPowerDistributionStickyFaults (HAL_PowerDistributionHandle handle, int32_t *status) |
Clears any PowerDistribution sticky faults. More... | |
void | HAL_SetPowerDistributionSwitchableChannel (HAL_PowerDistributionHandle handle, HAL_Bool enabled, int32_t *status) |
Power on/off switchable channel. More... | |
HAL_Bool | HAL_GetPowerDistributionSwitchableChannel (HAL_PowerDistributionHandle handle, int32_t *status) |
Returns true if switchable channel is powered on. More... | |
void | HAL_GetPowerDistributionVersion (HAL_PowerDistributionHandle handle, HAL_PowerDistributionVersion *version, int32_t *status) |
Get the version of the PowerDistribution. More... | |
void | HAL_GetPowerDistributionFaults (HAL_PowerDistributionHandle handle, HAL_PowerDistributionFaults *faults, int32_t *status) |
Get the current faults of the PowerDistribution. More... | |
void | HAL_GetPowerDistributionStickyFaults (HAL_PowerDistributionHandle handle, HAL_PowerDistributionStickyFaults *stickyFaults, int32_t *status) |
Gets the sticky faults of the PowerDistribution. More... | |
void | HAL_StartPowerDistributionStream (HAL_PowerDistributionHandle handle, int32_t *status) |
HAL_PowerDistributionChannelData * | HAL_GetPowerDistributionStreamData (HAL_PowerDistributionHandle handle, int32_t *count, int32_t *status) |
void | HAL_FreePowerDistributionStreamData (HAL_PowerDistributionChannelData *data, int32_t count) |
void | HAL_StopPowerDistributionStream (HAL_PowerDistributionHandle handle, int32_t *status) |
Functions to control Power Distribution devices.
#define HAL_DEFAULT_POWER_DISTRIBUTION_MODULE -1 |
typedef struct HAL_PowerDistributionChannelData HAL_PowerDistributionChannelData |
enum HAL_PowerDistributionType : int32_t |
HAL_Bool HAL_CheckPowerDistributionChannel | ( | HAL_PowerDistributionHandle | handle, |
int32_t | channel | ||
) |
Checks if a PowerDistribution channel is valid.
handle | the module handle |
channel | the channel to check |
HAL_Bool HAL_CheckPowerDistributionModule | ( | int32_t | module, |
HAL_PowerDistributionType | type | ||
) |
Checks if a PowerDistribution module is valid.
module | the module to check |
type | the type of module |
void HAL_CleanPowerDistribution | ( | HAL_PowerDistributionHandle | handle | ) |
Cleans a PowerDistribution module.
handle | the module handle |
void HAL_ClearPowerDistributionStickyFaults | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Clears any PowerDistribution sticky faults.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
void HAL_FreePowerDistributionStreamData | ( | HAL_PowerDistributionChannelData * | data, |
int32_t | count | ||
) |
void HAL_GetPowerDistributionAllChannelCurrents | ( | HAL_PowerDistributionHandle | handle, |
double * | currents, | ||
int32_t | currentsLength, | ||
int32_t * | status | ||
) |
Gets the current of all channels on the PowerDistribution.
The array must be large enough to hold all channels.
[in] | handle | the module handle |
[out] | currents | the currents |
[in] | currentsLength | the length of the currents array |
[out] | status | Error status variable. 0 on success. |
double HAL_GetPowerDistributionChannelCurrent | ( | HAL_PowerDistributionHandle | handle, |
int32_t | channel, | ||
int32_t * | status | ||
) |
Gets the current of a specific PowerDistribution channel.
[in] | handle | the module handle |
[in] | channel | the channel |
[out] | status | Error status variable. 0 on success. |
void HAL_GetPowerDistributionFaults | ( | HAL_PowerDistributionHandle | handle, |
HAL_PowerDistributionFaults * | faults, | ||
int32_t * | status | ||
) |
Get the current faults of the PowerDistribution.
[in] | handle | the module handle |
[out] | faults | the HAL_PowerDistributionFaults to populate |
[out] | status | Error status variable. 0 on success. |
int32_t HAL_GetPowerDistributionModuleNumber | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the module number for a specific handle.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
int32_t HAL_GetPowerDistributionNumChannels | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the number of channels for this handle.
[in] | handle | the handle |
[out] | status | Error status variable. 0 on success. |
void HAL_GetPowerDistributionStickyFaults | ( | HAL_PowerDistributionHandle | handle, |
HAL_PowerDistributionStickyFaults * | stickyFaults, | ||
int32_t * | status | ||
) |
Gets the sticky faults of the PowerDistribution.
[in] | handle | the module handle |
[out] | stickyFaults | the HAL_PowerDistributionStickyFaults to populate |
[out] | status | Error status variable. 0 on success. |
HAL_PowerDistributionChannelData * HAL_GetPowerDistributionStreamData | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | count, | ||
int32_t * | status | ||
) |
HAL_Bool HAL_GetPowerDistributionSwitchableChannel | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Returns true if switchable channel is powered on.
This is a REV PDH-specific function. This function will no-op on CTRE PDP.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
double HAL_GetPowerDistributionTemperature | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the temperature of the Power Distribution Panel.
Not supported on the Rev PDH and returns 0.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
double HAL_GetPowerDistributionTotalCurrent | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the total current of the PowerDistribution.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
double HAL_GetPowerDistributionTotalEnergy | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the total energy of the Power Distribution Panel.
Not supported on the Rev PDH and returns 0.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
double HAL_GetPowerDistributionTotalPower | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the total power of the Power Distribution Panel.
Not supported on the Rev PDH and returns 0.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
HAL_PowerDistributionType HAL_GetPowerDistributionType | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the type of PowerDistribution module.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
void HAL_GetPowerDistributionVersion | ( | HAL_PowerDistributionHandle | handle, |
HAL_PowerDistributionVersion * | version, | ||
int32_t * | status | ||
) |
Get the version of the PowerDistribution.
[in] | handle | the module handle |
[out] | version | the HAL_PowerDistributionVersion to populate |
[out] | status | Error status variable. 0 on success. |
double HAL_GetPowerDistributionVoltage | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Gets the PowerDistribution input voltage.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
HAL_PowerDistributionHandle HAL_InitializePowerDistribution | ( | int32_t | moduleNumber, |
HAL_PowerDistributionType | type, | ||
const char * | allocationLocation, | ||
int32_t * | status | ||
) |
Initializes a Power Distribution Panel.
[in] | moduleNumber | the module number to initialize |
[in] | type | the type of module to initialize |
[in] | allocationLocation | the location where the allocation is occurring |
[out] | status | Error status variable. 0 on success. |
void HAL_ResetPowerDistributionTotalEnergy | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
Resets the PowerDistribution accumulated energy.
Not supported on the Rev PDH and does nothing.
[in] | handle | the module handle |
[out] | status | Error status variable. 0 on success. |
void HAL_SetPowerDistributionSwitchableChannel | ( | HAL_PowerDistributionHandle | handle, |
HAL_Bool | enabled, | ||
int32_t * | status | ||
) |
Power on/off switchable channel.
This is a REV PDH-specific function. This function will no-op on CTRE PDP.
[in] | handle | the module handle |
[in] | enabled | true to turn on switchable channel |
[out] | status | Error status variable. 0 on success. |
void HAL_StartPowerDistributionStream | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |
void HAL_StopPowerDistributionStream | ( | HAL_PowerDistributionHandle | handle, |
int32_t * | status | ||
) |