#include <MiniDSP.h>
|
| MiniDSP (USB *p) |
|
bool | connected () |
|
void | attachOnInit (void(*funcOnInit)(void)) |
|
void | attachOnVolumeChange (void(*funcOnVolumeChange)(uint8_t)) |
|
void | attachOnMutedChange (void(*funcOnMutedChange)(bool)) |
|
int | getVolume () const |
|
float | getVolumeDB () const |
|
bool | isMuted () const |
|
| HIDUniversal (USB *p) |
|
uint8_t | Poll () override |
|
void | EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) override |
|
| HIDComposite (USB *p) |
|
bool | SetReportParser (uint8_t id, HIDReportParser *prs) |
|
uint8_t | Init (uint8_t parent, uint8_t port, bool lowspeed) |
|
uint8_t | Release () |
|
virtual uint8_t | GetAddress () |
|
virtual bool | isReady () |
|
uint8_t | SndRpt (uint16_t nbytes, uint8_t *dataptr) |
|
| USBHID (USB *pusb) |
|
const USB * | GetUsb () |
|
uint8_t | SetProtocol (uint8_t iface, uint8_t protocol) |
|
uint8_t | GetProtocol (uint8_t iface, uint8_t *dataptr) |
|
uint8_t | GetIdle (uint8_t iface, uint8_t reportID, uint8_t *dataptr) |
|
uint8_t | SetIdle (uint8_t iface, uint8_t reportID, uint8_t duration) |
|
uint8_t | GetReportDescr (uint16_t wIndex, USBReadParser *parser=NULL) |
|
uint8_t | GetHidDescr (uint8_t ep, uint16_t nbytes, uint8_t *dataptr) |
|
uint8_t | GetReport (uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr) |
|
uint8_t | SetReport (uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr) |
|
virtual uint8_t | ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) |
|
virtual void | ResetHubPort (uint8_t port) |
|
virtual bool | DEVCLASSOK (uint8_t klass) |
|
virtual bool | DEVSUBCLASSOK (uint8_t subklass) |
|
Arduino MiniDSP 2x4HD USB Host Driver by Dennis Frett.
This class implements support for the MiniDSP 2x4HD via USB. Based on NodeJS implementation by Mathieu Rene: https://github.com/mrene/node-minidsp and the Python implementation by Mark Kubiak: https://github.com/markubiak/python3-minidsp.
It uses the HIDUniversal class for all the USB communication.
Definition at line 39 of file MiniDSP.h.
◆ MiniDSP()
MiniDSP::MiniDSP |
( |
USB * |
p | ) |
|
|
inline |
Constructor for the MiniDSP class.
- Parameters
-
p | Pointer to the USB class instance. |
Definition at line 46 of file MiniDSP.h.
◆ connected()
bool MiniDSP::connected |
( |
| ) |
|
|
inline |
Used to check if a MiniDSP 2x4HD is connected.
- Returns
- Returns true if it is connected.
Definition at line 53 of file MiniDSP.h.
◆ attachOnInit()
void MiniDSP::attachOnInit |
( |
void(*)(void) |
funcOnInit | ) |
|
|
inline |
Used to call your own function when the device is successfully initialized.
- Parameters
-
funcOnInit | Function to call. |
Definition at line 62 of file MiniDSP.h.
◆ attachOnVolumeChange()
void MiniDSP::attachOnVolumeChange |
( |
void(*)(uint8_t) |
funcOnVolumeChange | ) |
|
|
inline |
Used to call your own function when the volume has changed. The volume is passed as an unsigned integer that represents twice the -dB value. Example: 19 represents -9.5dB.
- Parameters
-
funcOnVolumeChange | Function to call. |
Definition at line 72 of file MiniDSP.h.
◆ attachOnMutedChange()
void MiniDSP::attachOnMutedChange |
( |
void(*)(bool) |
funcOnMutedChange | ) |
|
|
inline |
Used to call your own function when the muted status has changed. The muted status is passed as a boolean. True means muted, false means unmuted.
- Parameters
-
funcOnMutedChange | Function to call. |
Definition at line 82 of file MiniDSP.h.
◆ getVolume()
int MiniDSP::getVolume |
( |
| ) |
const |
|
inline |
Retrieve the current volume of the MiniDSP. The volume is passed as an unsigned integer that represents twice the -dB value. Example: 19 represents -9.5dB.
- Returns
- Current volume.
Definition at line 92 of file MiniDSP.h.
◆ getVolumeDB()
float MiniDSP::getVolumeDB |
( |
| ) |
const |
|
inline |
Retrieve the current volume of the MiniDSP in -dB.
- Returns
- Current volume.
Definition at line 100 of file MiniDSP.h.
◆ isMuted()
bool MiniDSP::isMuted |
( |
| ) |
const |
|
inline |
Retrieve the current muted status of the MiniDSP
- Returns
true
if the device is muted, false
otherwise.
Definition at line 108 of file MiniDSP.h.
◆ ParseHIDData()
void MiniDSP::ParseHIDData |
( |
USBHID * |
hid, |
|
|
bool |
is_rpt_id, |
|
|
uint8_t |
len, |
|
|
uint8_t * |
buf |
|
) |
| |
|
protectedvirtual |
Used to parse USB HID data.
- Parameters
-
hid | Pointer to the HID class. |
is_rpt_id | Only used for Hubs. |
len | The length of the incoming data. |
buf | Pointer to the data buffer. |
Reimplemented from HIDUniversal.
Definition at line 24 of file MiniDSP.cpp.
◆ OnInitSuccessful()
uint8_t MiniDSP::OnInitSuccessful |
( |
| ) |
|
|
protectedvirtual |
Called when a device is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.
Reimplemented from HIDComposite.
Definition at line 57 of file MiniDSP.cpp.
◆ VIDPIDOK()
virtual bool MiniDSP::VIDPIDOK |
( |
uint16_t |
vid, |
|
|
uint16_t |
pid |
|
) |
| |
|
inlineprotectedvirtual |
Used by the USB core to check what this driver support.
- Parameters
-
vid | The device's VID. |
pid | The device's PID. |
- Returns
- Returns true if the device's VID and PID matches this driver.
Reimplemented from USBDeviceConfig.
Definition at line 141 of file MiniDSP.h.
The documentation for this class was generated from the following files: