CTRE Phoenix 6 C++ 24.3.0
ctre::phoenix::platform Namespace Reference

Namespaces

namespace  can
 

Enumerations

enum  DeviceType { kDeviceTypeListInitializer }
 Enumeration of all supported device types. More...
 
enum  FrcUsageType {
  TalonSRX , PigeonIMU , CANifier , VictorSPX ,
  CANcoder , TalonFX , CANdle , CANivore ,
  Pigeon2
}
 

Functions

CTREXPORT void EnableConsoleUTF8Output ()
 Enables UTF-8 console output. More...
 
CTREXPORT void ReportError (int isError, int32_t errorCode, int isLVCode, const char *details, const char *location, const char *callStack)
 
static void SleepUs (int timeUs)
 
template<typename DURATION = std::chrono::microseconds>
static auto CurrentTime ()
 Returns the monotonic time of the system, converted to the given duration. More...
 
CTREXPORT std::string GetStackTrace (int offset)
 Get a stack trace, ignoring the first "offset" symbols. More...
 
CTREXPORT int32_t SimCreate (DeviceType type, int id)
 
CTREXPORT int32_t SimDestroy (DeviceType type, int id)
 
CTREXPORT int32_t SimDestroyAll ()
 
CTREXPORT int32_t SimSetPhysicsInput (DeviceType type, int id, std::string_view physicsType, double value)
 
CTREXPORT int32_t SimGetPhysicsValue (DeviceType type, int id, std::string_view physicsType, double &value)
 
CTREXPORT int32_t SimGetLastError (DeviceType type, int id)
 
CTREXPORT int FRC_Report (int resource, int instanceNumber, std::string const &canbus="", int callerIdx=0, int context=0, const char *feature=nullptr)
 
CTREXPORT int FRC_Report (std::string const &model, int instanceNumber, std::string const &canbus="", int callerIdx=0, int context=0, const char *feature=nullptr)
 

Enumeration Type Documentation

◆ DeviceType

Enumeration of all supported device types.

Enumerator
kDeviceTypeListInitializer 

◆ FrcUsageType

Enumerator
TalonSRX 
PigeonIMU 
CANifier 
VictorSPX 
CANcoder 
TalonFX 
CANdle 
CANivore 
Pigeon2 

Function Documentation

◆ CurrentTime()

template<typename DURATION = std::chrono::microseconds>
static auto ctre::phoenix::platform::CurrentTime ( )
inlinestatic

Returns the monotonic time of the system, converted to the given duration.

The default duration is in microseconds.

◆ EnableConsoleUTF8Output()

CTREXPORT void ctre::phoenix::platform::EnableConsoleUTF8Output ( )

Enables UTF-8 console output.

◆ FRC_Report() [1/2]

CTREXPORT int ctre::phoenix::platform::FRC_Report ( int  resource,
int  instanceNumber,
std::string const &  canbus = "",
int  callerIdx = 0,
int  context = 0,
const char *  feature = nullptr 
)

◆ FRC_Report() [2/2]

CTREXPORT int ctre::phoenix::platform::FRC_Report ( std::string const &  model,
int  instanceNumber,
std::string const &  canbus = "",
int  callerIdx = 0,
int  context = 0,
const char *  feature = nullptr 
)

◆ GetStackTrace()

CTREXPORT std::string ctre::phoenix::platform::GetStackTrace ( int  offset)

Get a stack trace, ignoring the first "offset" symbols.

Parameters
offsetThe number of symbols at the top of the stack to ignore

◆ ReportError()

CTREXPORT void ctre::phoenix::platform::ReportError ( int  isError,
int32_t  errorCode,
int  isLVCode,
const char *  details,
const char *  location,
const char *  callStack 
)

◆ SimCreate()

CTREXPORT int32_t ctre::phoenix::platform::SimCreate ( DeviceType  type,
int  id 
)

◆ SimDestroy()

CTREXPORT int32_t ctre::phoenix::platform::SimDestroy ( DeviceType  type,
int  id 
)

◆ SimDestroyAll()

CTREXPORT int32_t ctre::phoenix::platform::SimDestroyAll ( )

◆ SimGetLastError()

CTREXPORT int32_t ctre::phoenix::platform::SimGetLastError ( DeviceType  type,
int  id 
)

◆ SimGetPhysicsValue()

CTREXPORT int32_t ctre::phoenix::platform::SimGetPhysicsValue ( DeviceType  type,
int  id,
std::string_view  physicsType,
double &  value 
)

◆ SimSetPhysicsInput()

CTREXPORT int32_t ctre::phoenix::platform::SimSetPhysicsInput ( DeviceType  type,
int  id,
std::string_view  physicsType,
double  value 
)

◆ SleepUs()

static void ctre::phoenix::platform::SleepUs ( int  timeUs)
inlinestatic
Parameters
timeUsHow long to yield current thread in microseconds (us). If platform cannot honor us resolution, round up to nearest value that platform can honor.