CTRE Phoenix 6 C++ 26.2.0
Loading...
Searching...
No Matches
SupportsMusic.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
14
15
16namespace ctre {
17namespace phoenix6 {
18namespace hardware {
19namespace traits {
20
21/**
22 * Contains all control functions available for motors that support playing
23 * music.
24 */
25class SupportsMusic : public virtual CommonDevice
26{
27public:
28 virtual ~SupportsMusic() = default;
29
30
31 /**
32 * \brief Plays a single tone at the user specified frequency.
33 *
34 * - MusicTone Parameters:
35 * - AudioFrequency: Sound frequency to play. A value of zero will silence
36 * the device. The effective frequency range is 10-20000 Hz.
37 * Any nonzero frequency less than 10 Hz will be capped to
38 * 10 Hz. Any frequency above 20 kHz will be capped to 20
39 * kHz.
40 *
41 * \param request Control object to request of the device
42 * \returns Status code of the request
43 */
45
46 /**
47 * \brief Apply a generic empty control used to do nothing.
48 *
49 * \param request Control object to request of the device
50 * \returns Status code of the request
51 */
53
54 /**
55 * \brief Control device with generic control request object. User must make
56 * sure the specified object is castable to a valid control request,
57 * otherwise this function will fail at run-time and return the NotSupported
58 * StatusCode
59 *
60 * \param request Control object to request of the device
61 * \returns Status code of the request
62 */
64
65};
66
67}
68}
69}
70}
71
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Generic Empty Control class used to do nothing.
Definition ControlRequest.hpp:65
Plays a single tone at the user specified frequency.
Definition MusicTone.hpp:20
Contains everything common between Phoenix 6 devices.
Definition CommonDevice.hpp:23
Contains all control functions available for motors that support playing music.
Definition SupportsMusic.hpp:26
virtual ctre::phoenix::StatusCode SetControl(controls::ControlRequest const &request)=0
Control device with generic control request object.
virtual ctre::phoenix::StatusCode SetControl(controls::MusicTone const &request)=0
Plays a single tone at the user specified frequency.
virtual ctre::phoenix::StatusCode SetControl(controls::EmptyControl const &request)=0
Apply a generic empty control used to do nothing.
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14