A class to communicate a USB dac (send:only 48kHz,16bit,2ch , receive:only 48kHz,16bit,1ch). Need "USBHost_AddIso" library.

Dependents:   USBHostDac_Audio_in_out

Fork of USBHostDac by GR-PEACH_producer_meeting

Embed: (wiki syntax)

« Back to documentation index

USBHostDac Class Reference

USBHostDac Class Reference

A class to communicate a USB dac (send:only 48kHz,16bit,2ch , receive:only 48kHz,16bit,1ch) More...

#include <USBHostDac.h>

Public Member Functions

 USBHostDac ()
 Constructor.
virtual ~USBHostDac ()
 Destructor.
bool connect ()
 Try to connect a audio device.
bool connected ()
 Check if a audio is connected.
uint32_t send (uint8_t *buf, uint32_t len, bool flush=true)
 Data send : only 48kHz,16bit,2ch.
uint32_t receive (uint8_t *buf, uint32_t len)
 Data receive : only 48kHz,16bit,1ch.

Detailed Description

A class to communicate a USB dac (send:only 48kHz,16bit,2ch , receive:only 48kHz,16bit,1ch)

Definition at line 38 of file USBHostDac.h.


Constructor & Destructor Documentation

USBHostDac (  )

Constructor.

Definition at line 32 of file USBHostDac.cpp.

~USBHostDac (  ) [virtual]

Destructor.

Definition at line 43 of file USBHostDac.cpp.


Member Function Documentation

bool connect (  )

Try to connect a audio device.

Returns:
true if connection was successful

Definition at line 74 of file USBHostDac.cpp.

bool connected (  )

Check if a audio is connected.

Returns:
true if a audio is connected

Definition at line 70 of file USBHostDac.cpp.

uint32_t receive ( uint8_t *  buf,
uint32_t  len 
)

Data receive : only 48kHz,16bit,1ch.

Parameters:
bufpointer on a buffer which will be read
lenlength of the transfer
Returns:
the number of bytes read is returned

Definition at line 170 of file USBHostDac.cpp.

uint32_t send ( uint8_t *  buf,
uint32_t  len,
bool  flush = true 
)

Data send : only 48kHz,16bit,2ch.

It's sent by the 1536byte unit.

Parameters:
bufpointer on a buffer which will be written
lenlength of the transfer
flushif true, less than 1536 bytes of data is sent
Returns:
the number of bytes written is returned

Definition at line 116 of file USBHostDac.cpp.