CTRE_Phoenix 5.20.2
|
Classes | |
enum | GeneralPin |
enum | LEDChannel |
class | PinValues |
enum | PWMChannel |
Public Attributes | |
final int | PWMChannelCount = 4 |
CTRE CANifier
Device for interfacing common devices to the CAN bus.
|
inline |
Constructor.
deviceId | The CAN Device ID of the CANifier. |
|
inline |
Clears the Sticky Faults
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Configures all persistent settings (overloaded so timeoutMs is 50 ms).
allConfigs | Object with all of the persistant settings |
|
inline |
Configures all persistent settings.
allConfigs | Object with all of the persistant settings |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Enables clearing the position of the feedback sensor when the forward limit switch is triggered
clearPositionOnLimitF | Whether clearing is enabled, defaults false |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Enables clearing the position of the feedback sensor when the reverse limit switch is triggered
clearPositionOnLimitR | Whether clearing is enabled, defaults false |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Enables clearing the position of the feedback sensor when the quadrature index signal is detected
clearPositionOnQuadIdx | Whether clearing is enabled, defaults false |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Configures all persistent settings to defaults (overloaded so timeoutMs is 50 ms).
|
inline |
Configures all persistent settings to defaults.
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Gets the value of a custom parameter. This is for arbitrary use.
Sometimes it is necessary to save calibration/duty cycle/output information in the device. Particularly if the device is part of a subsystem that can be replaced.
paramIndex | Index of custom parameter. [0-1] |
|
inline |
Gets the value of a custom parameter. This is for arbitrary use.
Sometimes it is necessary to save calibration/duty cycle/output information in the device. Particularly if the device is part of a subsystem that can be replaced.
paramIndex | Index of custom parameter. [0-1] |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Gets a parameter. Generally this is not used. This can be utilized in
param | Parameter enumeration. |
ordinal | Ordinal of parameter. |
|
inline |
Gets a parameter. Generally this is not used. This can be utilized in
param | Parameter enumeration. |
ordinal | Ordinal of parameter. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Sets the value of a custom parameter. This is for arbitrary use.
Sometimes it is necessary to save calibration/duty cycle/output information in the device. Particularly if the device is part of a subsystem that can be replaced.
newValue | Value for custom parameter. |
paramIndex | Index of custom parameter. [0-1] |
|
inline |
Sets the value of a custom parameter. This is for arbitrary use.
Sometimes it is necessary to save calibration/duty cycle/output information in the device. Particularly if the device is part of a subsystem that can be replaced.
newValue | Value for custom parameter. |
paramIndex | Index of custom parameter. [0-1] |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Sets a parameter. Generally this is not used. This can be utilized in
param | Parameter enumeration. |
value | Value of parameter. |
subValue | Subvalue for parameter. Maximum value of 255. |
ordinal | Ordinal of parameter. |
|
inline |
Sets a parameter. Generally this is not used. This can be utilized in
param | Parameter enumeration. |
value | Value of parameter. |
subValue | Subvalue for parameter. Maximum value of 255. |
ordinal | Ordinal of parameter. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Sets a parameter. Generally this is not used. This can be utilized in
param | Parameter enumeration. |
value | Value of parameter. |
subValue | Subvalue for parameter. Maximum value of 255. |
ordinal | Ordinal of parameter. |
|
inline |
Sets a parameter. Generally this is not used. This can be utilized in
param | Parameter enumeration. |
value | Value of parameter. |
subValue | Subvalue for parameter. Maximum value of 255. |
ordinal | Ordinal of parameter. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Configures the period of each velocity sample. Every 1ms a position value is sampled, and the delta between that sample and the position sampled kPeriod ms ago is inserted into a filter. kPeriod is configured with this function.
period | Desired period for the velocity measurement. |
|
inline |
Configures the period of each velocity sample. Every 1ms a position value is sampled, and the delta between that sample and the position sampled kPeriod ms ago is inserted into a filter. kPeriod is configured with this function.
period | Desired period for the velocity measurement. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Configures the period of each velocity sample. Every 1ms a position value is sampled, and the delta between that sample and the position sampled kPeriod ms ago is inserted into a filter. kPeriod is configured with this function.
period | Desired period for the velocity measurement. |
|
inline |
Configures the period of each velocity sample. Every 1ms a position value is sampled, and the delta between that sample and the position sampled kPeriod ms ago is inserted into a filter. kPeriod is configured with this function.
period | Desired period for the velocity measurement. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Sets the number of velocity samples used in the rolling average velocity measurement.
windowSize | Number of samples in the rolling average of velocity measurement. Valid values are 1,2,4,8,16,32. If another value is specified, it will truncate to nearest support value. |
|
inline |
Sets the number of velocity samples used in the rolling average velocity measurement.
windowSize | Number of samples in the rolling average of velocity measurement. Valid values are 1,2,4,8,16,32. If another value is specified, it will truncate to nearest support value. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Destructor
|
inline |
Enables PWM Outputs Currently supports PWM 0, PWM 1, and PWM 2
pwmChannel | Index of the PWM channel to enable. |
bEnable | "True" enables output on the pwm channel. |
|
inline |
Gets all persistant settings (overloaded so timeoutMs is 50 ms).
allConfigs | Object with all of the persistant settings |
|
inline |
Gets all persistant settings.
allConfigs | Object with all of the persistant settings |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Gets the bus voltage seen by the device.
|
inline |
|
inline |
Gets the CANifier fault status
toFill | Container for fault statuses. |
|
inline |
Gets the firmware version of the device.
|
inline |
Gets the state of the specified pin
inputPin | The index of the pin. |
|
inline |
Gets the state of all General Pins
allPins | A structure to fill with the current state of all pins. |
|
inline |
Call GetLastError() generated by this object. Not all functions return an error code but can potentially report errors.
This function can be used to retrieve those error codes.
|
inline |
Gets the PWM Input
pwmChannel | PWM channel to get. |
pulseWidthAndPeriod | Double array to hold Duty Cycle [0] and Period [1]. |
|
inline |
Gets the quadrature encoder's position
|
inline |
Gets the quadrature encoder's velocity
|
inline |
Gets the period of the given status frame.
frame | Frame to get the period of. |
|
inline |
Gets the period of the given status frame.
frame | Frame to get the period of. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Gets the CANifier sticky fault status
toFill | Container for sticky fault statuses. |
|
inline |
Returns true if the device has reset since last call.
|
inline |
Sets the period of the given control frame.
frame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
|
inline |
Sets the period of the given control frame.
frame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
|
inline |
Sets the output of a General Pin
outputPin | The pin to use as output. |
outputValue | The desired output state. |
outputEnable | Whether this pin is an output. "True" enables output. |
|
inline |
Sets the output of all General Pins
outputBits | A bit mask of all the output states. LSB->MSB is in the order of the com.ctre.phoenix.CANifier.GeneralPin enum. |
isOutputBits | A boolean bit mask that sets the pins to be outputs or inputs. A bit of 1 enables output. |
|
inline |
Sets the LED Output
percentOutput | Output duty cycle expressed as percentage. |
ledChannel | Channel to set the output of. |
|
inline |
Sets the PWM Output Currently supports PWM 0, PWM 1, and PWM 2
pwmChannel | Index of the PWM channel to output. |
dutyCycle | Duty Cycle (0 to 1) to output. Default period of the signal is 4.2 ms. |
|
inline |
Sets the quadrature encoder's position
newPosition | Position to set |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Sets the period of the given status frame.
statusFrame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
|
inline |
Sets the period of the given status frame.
statusFrame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
|
inline |
Sets the period of the given status frame.
statusFrame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
|
inline |
Sets the period of the given status frame.
statusFrame | Frame whose period is to be changed. |
periodMs | Period in ms for the given frame. |
timeoutMs | Timeout value in ms. If nonzero, function will wait for config success and report an error if it times out. If zero, no blocking or checking is performed. |
final int com.ctre.phoenix.CANifier.PWMChannelCount = 4 |
Number of PWM channels available to CANifier