CTRE Phoenix 6 C++ 25.2.1
Loading...
Searching...
No Matches
CANdiSimState.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
12#include <units/angle.h>
13#include <units/angular_velocity.h>
14#include <units/voltage.h>
15
16namespace ctre {
17namespace phoenix6 {
18
19namespace hardware {
20namespace core {
21 /* forward proto */
22 class CoreCANdi;
23}
24}
25
26namespace sim {
27
28 /**
29 * \brief Class to control the state of a simulated hardware#CANdi.
30 */
32 {
33 private:
34 int _id;
35
36 public:
37 /**
38 * \brief Creates an object to control the state of the given hardware#CANdi.
39 *
40 * \details Note the recommended method of accessing simulation features is to
41 * use hardware#CANdi#GetSimState.
42 *
43 * \param device Device to which this simulation state is attached
44 */
46 /* disallow copy, allow move */
47 CANdiSimState(CANdiSimState const &) = delete;
51
52 /**
53 * \brief Sets the simulated supply voltage of the CANdi.
54 *
55 * \details The minimum allowed supply voltage is 4 V - values below this
56 * will be promoted to 4 V.
57 *
58 * \param volts The supply voltage in Volts
59 * \returns Status code
60 */
61 ctre::phoenix::StatusCode SetSupplyVoltage(units::voltage::volt_t volts);
62 };
63}
64
65}
66}
Class for CANdi, a CAN digital input device that detects when a digital signal is asserted or deasser...
Definition CoreCANdi.hpp:911
Class to control the state of a simulated hardware::CANdi.
Definition CANdiSimState.hpp:32
ctre::phoenix::StatusCode SetSupplyVoltage(units::voltage::volt_t volts)
Sets the simulated supply voltage of the CANdi.
CANdiSimState & operator=(CANdiSimState const &)=delete
CANdiSimState & operator=(CANdiSimState &&)=default
CANdiSimState(hardware::core::CoreCANdi const &device)
Creates an object to control the state of the given hardware::CANdi.
CANdiSimState(CANdiSimState const &)=delete
CANdiSimState(CANdiSimState &&)=default
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18