CTRE Phoenix 6 C++ 26.0.0-beta-1
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, 0 is OK
43 */
45
46 /**
47 * \brief Control device with generic control request object. User must make
48 * sure the specified object is castable to a valid control request,
49 * otherwise this function will fail at run-time and return the NotSupported
50 * StatusCode
51 *
52 * \param request Control object to request of the device
53 * \returns Status Code of the request, 0 is OK
54 */
56
57};
58
59}
60}
61}
62}
63
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
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(const controls::ControlRequest &request)=0
Control device with generic control request object.
virtual ctre::phoenix::StatusCode SetControl(const controls::MusicTone &request)=0
Plays a single tone at the user specified frequency.
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14