CTRE Phoenix 6 C++ 26.70.0-alpha-2
Loading...
Searching...
No Matches
AutoFeedEnable.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
9#include <wpi/system/Notifier.hpp>
10#include <mutex>
11#include <stdint.h>
12
13namespace ctre {
14namespace phoenix6 {
15namespace wpiutils {
16
17/**
18 * \brief Automatically feeds the non-FRC enable signal to devices
19 * in simulation and hardware-attached simulation.
20 */
21class AutoFeedEnable final {
22private:
23 std::mutex _lck;
24 uint32_t _startCount = 0;
25 wpi::Notifier _enableNotifier;
26
27 AutoFeedEnable();
28
29public:
30 /**
31 * \brief Gets the AutoFeedEnable instance.
32 *
33 * \returns AutoFeedEnable instance
34 */
35 static AutoFeedEnable &GetInstance();
36
37 /**
38 * \brief Starts feeding the enable signal to CTRE actuators.
39 */
40 void Start();
41 /**
42 * \brief Stops feeding the enable signal to CTRE actuators.
43 * The enable signal will only be stopped when all actuators
44 * have requested to stop the enable signal.
45 */
46 void Stop();
47};
48
49}
50}
51}
void Start()
Starts feeding the enable signal to CTRE actuators.
static AutoFeedEnable & GetInstance()
Gets the AutoFeedEnable instance.
void Stop()
Stops feeding the enable signal to CTRE actuators.
Definition CallbackHelper.hpp:13
Definition ExternalFeedbackConfigs.hpp:16
Definition motor_constants.h:14