CTRE_Phoenix 5.20.2
ctre::phoenix::RCRadio3Ch Class Reference

#include <RCRadio3Ch.h>

Inherits ctre::phoenix::tasking::IProcessable.

Public Types

enum  Channel { Channel1 , Channel2 , Channel3 }
 
enum  Status { LossOfCAN , LossOfPwm , Okay }
 

Public Member Functions

 RCRadio3Ch (ctre::phoenix::CANifier *canifier)
 
double GetDutyCycleUs (Channel channel)
 
double GetDutyCyclePerc (Channel channel)
 
bool GetSwitchValue (Channel channel)
 
double GetPeriodUs (Channel channel)
 
void Process ()
 
virtual void Process ()=0
 

Public Attributes

Status CurrentStatus = Status::Okay
 

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: