libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::DaisyPod Class Reference

Class that handles initializing all of the hardware specific to the Daisy Patch Board.
Helper funtions are also in place to provide easy access to built-in controls and peripherals. More...

Detailed Description

Class that handles initializing all of the hardware specific to the Daisy Patch Board.
Helper funtions are also in place to provide easy access to built-in controls and peripherals.

Author
Stephen Hensley
Date
November 2019

#include <daisy_pod.h>

Public Types

enum  Sw { BUTTON_1 , BUTTON_2 , BUTTON_LAST }
 
enum  Knob { KNOB_1 , KNOB_2 , KNOB_LAST }
 

Public Member Functions

 DaisyPod ()
 
 ~DaisyPod ()
 
void Init (bool boost=false)
 
void DelayMs (size_t del)
 
void StartAudio (AudioHandle::InterleavingAudioCallback cb)
 
void StartAudio (AudioHandle::AudioCallback cb)
 
void ChangeAudioCallback (AudioHandle::InterleavingAudioCallback cb)
 
void ChangeAudioCallback (AudioHandle::AudioCallback cb)
 
void StopAudio ()
 
void SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate)
 
float AudioSampleRate ()
 
void SetAudioBlockSize (size_t blocksize)
 
size_t AudioBlockSize ()
 
float AudioCallbackRate ()
 
void StartAdc ()
 
void StopAdc ()
 
void ProcessAnalogControls ()
 
void ProcessAllControls ()
 
float GetKnobValue (Knob k)
 
void ProcessDigitalControls ()
 
void ClearLeds ()
 
void UpdateLeds ()
 

Public Attributes

DaisySeed seed
 
Encoder encoder
 
AnalogControl knob1
 
AnalogControl knob2
 
AnalogControlknobs [KNOB_LAST]
 
Switch button1
 
Switch button2
 
Switchbuttons [BUTTON_LAST]
 
RgbLed led1
 
RgbLed led2
 
MidiUartHandler midi
 

Member Enumeration Documentation

◆ Knob

Knobs

Enumerator
KNOB_1 
KNOB_2 

&

KNOB_LAST 

&

◆ Sw

Switches

Enumerator
BUTTON_1 
BUTTON_2 

&

BUTTON_LAST 

&

Constructor & Destructor Documentation

◆ DaisyPod()

daisy::DaisyPod::DaisyPod ( )
inline

◆ ~DaisyPod()

daisy::DaisyPod::~DaisyPod ( )
inline

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisyPod::AudioBlockSize ( )

Returns the number of samples per channel in a block of audio.

◆ AudioCallbackRate()

float daisy::DaisyPod::AudioCallbackRate ( )

Returns the rate in Hz that the Audio callback is called

◆ AudioSampleRate()

float daisy::DaisyPod::AudioSampleRate ( )

Returns the audio sample rate in Hz as a floating point number.

◆ ChangeAudioCallback() [1/2]

void daisy::DaisyPod::ChangeAudioCallback ( AudioHandle::AudioCallback  cb)

Switch callback functions

Parameters
cbNew multichannel callback function.

◆ ChangeAudioCallback() [2/2]

void daisy::DaisyPod::ChangeAudioCallback ( AudioHandle::InterleavingAudioCallback  cb)

Switch callback functions

Parameters
cbNew interleaved callback function.

◆ ClearLeds()

void daisy::DaisyPod::ClearLeds ( )

Reset Leds

◆ DelayMs()

void daisy::DaisyPod::DelayMs ( size_t  del)

Wait for a bit

Parameters
delTime to wait in ms.

◆ GetKnobValue()

float daisy::DaisyPod::GetKnobValue ( Knob  k)

&

◆ Init()

void daisy::DaisyPod::Init ( bool  boost = false)

Init related stuff.

◆ ProcessAllControls()

void daisy::DaisyPod::ProcessAllControls ( )
inline

Process Analog and Digital Controls

◆ ProcessAnalogControls()

void daisy::DaisyPod::ProcessAnalogControls ( )

Call at same rate as analog reads for smooth reading.

◆ ProcessDigitalControls()

void daisy::DaisyPod::ProcessDigitalControls ( )

Process digital controls

◆ SetAudioBlockSize()

void daisy::DaisyPod::SetAudioBlockSize ( size_t  blocksize)

Sets the number of samples processed per channel by the audio callback.

◆ SetAudioSampleRate()

void daisy::DaisyPod::SetAudioSampleRate ( SaiHandle::Config::SampleRate  samplerate)

Updates the Audio Sample Rate, and reinitializes. Audio must be stopped for this to work.

◆ StartAdc()

void daisy::DaisyPod::StartAdc ( )

Start analog to digital conversion.

◆ StartAudio() [1/2]

void daisy::DaisyPod::StartAudio ( AudioHandle::AudioCallback  cb)

Starts the callback

Parameters
cbmultichannel callback function

◆ StartAudio() [2/2]

void daisy::DaisyPod::StartAudio ( AudioHandle::InterleavingAudioCallback  cb)

Starts the callback

Parameters
cbInterleaved callback function

◆ StopAdc()

void daisy::DaisyPod::StopAdc ( )

Stops Transfering data from the ADC

◆ StopAudio()

void daisy::DaisyPod::StopAudio ( )

Stops the audio if it is running.

◆ UpdateLeds()

void daisy::DaisyPod::UpdateLeds ( )

Update Leds to set colors

Member Data Documentation

◆ button1

Switch daisy::DaisyPod::button1

&

◆ button2

Switch daisy::DaisyPod::button2

&

◆ buttons

Switch * daisy::DaisyPod::buttons[BUTTON_LAST]

&

◆ encoder

Encoder daisy::DaisyPod::encoder

&

◆ knob1

AnalogControl daisy::DaisyPod::knob1

&

◆ knob2

AnalogControl daisy::DaisyPod::knob2

&

◆ knobs

AnalogControl * daisy::DaisyPod::knobs[KNOB_LAST]

&

◆ led1

RgbLed daisy::DaisyPod::led1

&

◆ led2

RgbLed daisy::DaisyPod::led2

&

◆ midi

MidiUartHandler daisy::DaisyPod::midi

◆ seed

DaisySeed daisy::DaisyPod::seed

Public Members

autotoc_md0


The documentation for this class was generated from the following file: