Skip to content

Class daisy::DaisyPetal

ClassList > daisy > DaisyPetal

Helpers and hardware definitions for daisy petal.

  • #include <daisy_petal.h>

Public Types

Type Name
enum FootswitchLed
enum Knob
enum RingLed
enum Sw

Public Attributes

Type Name
Encoder encoder
AnalogControl expression
Led footswitch_led
AnalogControl knob
RgbLed ring_led
DaisySeed seed
Switch switches

Public Functions

Type Name
size_t AudioBlockSize ()
float AudioCallbackRate ()
float AudioSampleRate ()
void ChangeAudioCallback (AudioHandle::InterleavingAudioCallback cb)
void ChangeAudioCallback (AudioHandle::AudioCallback cb)
void ClearLeds ()
DaisyPetal ()
void DelayMs (size_t del)
float GetExpression ()
float GetKnobValue (Knob k)
void Init (bool boost=false)
void ProcessAllControls ()
void ProcessAnalogControls ()
void ProcessDigitalControls ()
void SetAudioBlockSize (size_t size)
void SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate)
void SetFootswitchLed (FootswitchLed idx, float bright)
void SetRingLed (RingLed idx, float r, float g, float b)
void StartAdc ()
void StartAudio (AudioHandle::InterleavingAudioCallback cb)
void StartAudio (AudioHandle::AudioCallback cb)
void StopAdc ()
void StopAudio ()
void UpdateLeds ()
~DaisyPetal ()

Public Types Documentation

enum FootswitchLed

enum daisy::DaisyPetal::FootswitchLed {
    FOOTSWITCH_LED_1,
    FOOTSWITCH_LED_2,
    FOOTSWITCH_LED_3,
    FOOTSWITCH_LED_4,
    FOOTSWITCH_LED_LAST
};

footswitch leds


enum Knob

enum daisy::DaisyPetal::Knob {
    KNOB_1,
    KNOB_2,
    KNOB_3,
    KNOB_4,
    KNOB_5,
    KNOB_6,
    KNOB_LAST
};

Knobs


enum RingLed

enum daisy::DaisyPetal::RingLed {
    RING_LED_1,
    RING_LED_2,
    RING_LED_3,
    RING_LED_4,
    RING_LED_5,
    RING_LED_6,
    RING_LED_7,
    RING_LED_8,
    RING_LED_LAST
};

Leds in ringled


enum Sw

enum daisy::DaisyPetal::Sw {
    SW_1,
    SW_2,
    SW_3,
    SW_4,
    SW_5,
    SW_6,
    SW_7,
    SW_LAST
};

Switches


Public Attributes Documentation

variable encoder

Encoder daisy::DaisyPetal::encoder;

&


variable expression

AnalogControl daisy::DaisyPetal::expression;

&


variable footswitch_led

Led daisy::DaisyPetal::footswitch_led[4];

&


variable knob

AnalogControl daisy::DaisyPetal::knob[KNOB_LAST];

&


variable ring_led

RgbLed daisy::DaisyPetal::ring_led[8];

&


variable seed

DaisySeed daisy::DaisyPetal::seed;

&


variable switches

Switch daisy::DaisyPetal::switches[SW_LAST];

< &


Public Functions Documentation

function AudioBlockSize

size_t daisy::DaisyPetal::AudioBlockSize () 

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


function AudioCallbackRate

float daisy::DaisyPetal::AudioCallbackRate () 

Returns the rate in Hz that the Audio callback is called


function AudioSampleRate

float daisy::DaisyPetal::AudioSampleRate () 

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


function ChangeAudioCallback [½]

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

Switch callback functions

Parameters:

  • cb New interleaved callback function.

function ChangeAudioCallback [2/2]

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

Switch callback functions

Parameters:

  • cb New multichannel callback function.

function ClearLeds

void daisy::DaisyPetal::ClearLeds () 

Turn all leds off


function DaisyPetal

inline daisy::DaisyPetal::DaisyPetal () 

Constructor


function DelayMs

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

Wait before moving on.

Parameters:

  • del Delay time in ms.

function GetExpression

float daisy::DaisyPetal::GetExpression () 

&


function GetKnobValue

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

Get value per knob.

Parameters:

  • k Which knob to get

Returns:

Floating point knob position.


function Init

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

Initialize daisy petal


function ProcessAllControls

inline void daisy::DaisyPetal::ProcessAllControls () 

Process Analog and Digital Controls


function ProcessAnalogControls

void daisy::DaisyPetal::ProcessAnalogControls () 

Call at the same frequency as controls are read for stable readings.


function ProcessDigitalControls

void daisy::DaisyPetal::ProcessDigitalControls () 

Process digital controls


function SetAudioBlockSize

void daisy::DaisyPetal::SetAudioBlockSize (
    size_t size
) 

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

Parameters:

  • size Audio block size

function SetAudioSampleRate

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

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


function SetFootswitchLed

void daisy::DaisyPetal::SetFootswitchLed (
    FootswitchLed idx,
    float bright
) 

Set footswitch LED

Parameters:

  • idx Led Index
  • bright Brightness

function SetRingLed

void daisy::DaisyPetal::SetRingLed (
    RingLed idx,
    float r,
    float g,
    float b
) 

Set ring LED colors

Parameters:

  • idx Index to set
  • r Red value
  • g Green value
  • b Blue value

function StartAdc

void daisy::DaisyPetal::StartAdc () 

Start analog to digital conversion.


function StartAudio [½]

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

Starts the callback

Parameters:

  • cb Interleaved callback function

function StartAudio [2/2]

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

Starts the callback

Parameters:

  • cb multichannel callback function

function StopAdc

void daisy::DaisyPetal::StopAdc () 

Stops Transfering data from the ADC


function StopAudio

void daisy::DaisyPetal::StopAudio () 

Stops the audio if it is running.


function UpdateLeds

void daisy::DaisyPetal::UpdateLeds () 

Update Leds to values you had set.


function ~DaisyPetal

inline daisy::DaisyPetal::~DaisyPetal () 

Destructor



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