Skip to content

Class daisy::DaisyPod

ClassList > daisy > DaisyPod

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...

  • #include <daisy_pod.h>

Public Types

Type Name
enum Knob
enum Sw

Public Attributes

Type Name
Switch button1
Switch button2
Switch * buttons
Encoder encoder
AnalogControl knob1
AnalogControl knob2
AnalogControl * knobs
RgbLed led1
RgbLed led2
MidiUartHandler midi
DaisySeed seed

Public Functions

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

Detailed Description

Author:

Stephen Hensley

Date:

November 2019

Public Types Documentation

enum Knob

enum daisy::DaisyPod::Knob {
    KNOB_1,
    KNOB_2,
    KNOB_LAST
};

Knobs


enum Sw

enum daisy::DaisyPod::Sw {
    BUTTON_1,
    BUTTON_2,
    BUTTON_LAST
};

Switches


Public Attributes Documentation

variable button1

Switch daisy::DaisyPod::button1;

&


variable button2

Switch daisy::DaisyPod::button2;

&


variable buttons

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

&


variable encoder

Encoder daisy::DaisyPod::encoder;

&


variable knob1

AnalogControl daisy::DaisyPod::knob1;

&


variable knob2

AnalogControl daisy::DaisyPod::knob2;

&


variable knobs

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

&


variable led1

RgbLed daisy::DaisyPod::led1;

&


variable led2

RgbLed daisy::DaisyPod::led2;

&


variable midi

MidiUartHandler daisy::DaisyPod::midi;

variable seed

DaisySeed daisy::DaisyPod::seed;

Public Members

autotoc_md0


Public Functions Documentation

function AudioBlockSize

size_t daisy::DaisyPod::AudioBlockSize () 

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


function AudioCallbackRate

float daisy::DaisyPod::AudioCallbackRate () 

Returns the rate in Hz that the Audio callback is called


function AudioSampleRate

float daisy::DaisyPod::AudioSampleRate () 

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


function ChangeAudioCallback [½]

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

Switch callback functions

Parameters:

  • cb New interleaved callback function.

function ChangeAudioCallback [2/2]

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

Switch callback functions

Parameters:

  • cb New multichannel callback function.

function ClearLeds

void daisy::DaisyPod::ClearLeds () 

Reset Leds


function DaisyPod

inline daisy::DaisyPod::DaisyPod () 

function DelayMs

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

Wait for a bit

Parameters:

  • del Time to wait in ms.

function GetKnobValue

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

&


function Init

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

Init related stuff.


function ProcessAllControls

inline void daisy::DaisyPod::ProcessAllControls () 

Process Analog and Digital Controls


function ProcessAnalogControls

void daisy::DaisyPod::ProcessAnalogControls () 

Call at same rate as analog reads for smooth reading.


function ProcessDigitalControls

void daisy::DaisyPod::ProcessDigitalControls () 

Process digital controls


function SetAudioBlockSize

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

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


function SetAudioSampleRate

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

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


function StartAdc

void daisy::DaisyPod::StartAdc () 

Start analog to digital conversion.


function StartAudio [½]

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

Starts the callback

Parameters:

  • cb Interleaved callback function

function StartAudio [2/2]

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

Starts the callback

Parameters:

  • cb multichannel callback function

function StopAdc

void daisy::DaisyPod::StopAdc () 

Stops Transfering data from the ADC


function StopAudio

void daisy::DaisyPod::StopAudio () 

Stops the audio if it is running.


function UpdateLeds

void daisy::DaisyPod::UpdateLeds () 

Update Leds to set colors


function ~DaisyPod

inline daisy::DaisyPod::~DaisyPod () 


The documentation for this class was generated from the following file external-docs/libDaisy/src/daisy_pod.h