CTRE Phoenix C++ 5.33.1
ctre::phoenix::RCRadio3Ch Class Reference

Class to convert RC PWM signals into CAN signals using CANifier. More...

#include <ctre/phoenix/RCRadio3Ch.h>

Inheritance diagram for ctre::phoenix::RCRadio3Ch:
ctre::phoenix::tasking::IProcessable

Public Types

enum  Channel { Channel1 , Channel2 , Channel3 }
 CANifier PWM Channel. More...
 
enum  Status { LossOfCAN , LossOfPwm , Okay }
 Status of CANiifer. More...
 

Public Member Functions

 RCRadio3Ch (ctre::phoenix::CANifier *canifier)
 Constructor for RCRadio3Ch. More...
 
double GetDutyCycleUs (Channel channel)
 Gets the microsecond duty cycle of specified channel. More...
 
double GetDutyCyclePerc (Channel channel)
 Gets the percent duty cycle of specified channel. More...
 
bool GetSwitchValue (Channel channel)
 Gets whether a switch is on or off for a channel. More...
 
double GetPeriodUs (Channel channel)
 Gets the period of the pwm signal of a channel. More...
 
void Process ()
 Call this once every loop, it processes the incoming CANifier signals. More...
 
- Public Member Functions inherited from ctre::phoenix::tasking::IProcessable
virtual ~IProcessable ()
 
virtual void Process ()=0
 This function is called when a process occurs. More...
 

Public Attributes

Status CurrentStatus = Status::Okay
 Current status of CANifier. More...
 

Detailed Description

Class to convert RC PWM signals into CAN signals using CANifier.

Member Enumeration Documentation

◆ Channel

CANifier PWM Channel.

Enumerator
Channel1 

PWM Channel 1.

Channel2 

PWM Channel 2.

Channel3 

PWM Channel 3.

◆ Status

Status of CANiifer.

Enumerator
LossOfCAN 

CANifier is not communicating over CAN.

LossOfPwm 

CANifier does not detect PWM input.

Okay 

CANifier is OK.

Constructor & Destructor Documentation

◆ RCRadio3Ch()

ctre::phoenix::RCRadio3Ch::RCRadio3Ch ( ctre::phoenix::CANifier canifier)

Constructor for RCRadio3Ch.

Parameters
canifierreference to CANifier to use

Member Function Documentation

◆ GetDutyCyclePerc()

double ctre::phoenix::RCRadio3Ch::GetDutyCyclePerc ( Channel  channel)

Gets the percent duty cycle of specified channel.

Parameters
channelchannel to read
Returns
duty cycle in percent [0,1]

◆ GetDutyCycleUs()

double ctre::phoenix::RCRadio3Ch::GetDutyCycleUs ( Channel  channel)

Gets the microsecond duty cycle of specified channel.

Parameters
channelchannel to read
Returns
duty cycle in micro seconds

◆ GetPeriodUs()

double ctre::phoenix::RCRadio3Ch::GetPeriodUs ( Channel  channel)

Gets the period of the pwm signal of a channel.

Parameters
channelchannel to read
Returns
period of pwm signal in microseconds

◆ GetSwitchValue()

bool ctre::phoenix::RCRadio3Ch::GetSwitchValue ( Channel  channel)

Gets whether a switch is on or off for a channel.

Parameters
channelchannel to read
Returns
true if switch is on

◆ Process()

void ctre::phoenix::RCRadio3Ch::Process ( )
virtual

Call this once every loop, it processes the incoming CANifier signals.

Implements ctre::phoenix::tasking::IProcessable.

Member Data Documentation

◆ CurrentStatus

Status ctre::phoenix::RCRadio3Ch::CurrentStatus = Status::Okay

Current status of CANifier.


The documentation for this class was generated from the following file: