CTRE Phoenix 6 C++ 25.1.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
13
14
15namespace ctre {
16namespace phoenix6 {
17namespace hardware {
18namespace traits {
19
20/**
21 * Contains all control functions available for motors that support playing
22 * music.
23 */
25{
26public:
27 virtual ~SupportsMusic() = default;
28
29
30 /**
31 * \brief Plays a single tone at the user specified frequency.
32 *
33 * - MusicTone Parameters:
34 * - AudioFrequency: Sound frequency to play. A value of zero will silence the
35 * device. The effective frequency range is 10-20000 Hz. Any
36 * nonzero frequency less than 10 Hz will be capped to 10 Hz.
37 * Any frequency above 20 kHz will be capped to 20 kHz.
38 *
39 * \param request Control object to request of the device
40 * \returns Status Code of the request, 0 is OK
41 */
43
44 /**
45 * \brief Control device with generic control request object. User must make
46 * sure the specified object is castable to a valid control request,
47 * otherwise this function will fail at run-time and return the NotSupported
48 * StatusCode
49 *
50 * \param request Control object to request of the device
51 * \returns Status Code of the request, 0 is OK
52 */
54
55};
56
57}
58}
59}
60}
61
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:30
Plays a single tone at the user specified frequency.
Definition MusicTone.hpp:25
Contains all control functions available for motors that support playing music.
Definition SupportsMusic.hpp:25
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:27
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18