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

Helpers and hardware definitions for daisy petal. More...

Detailed Description

Helpers and hardware definitions for daisy petal.

#include <daisy_petal.h>

Public Types

enum  Sw {
  SW_1 , SW_2 , SW_3 , SW_4 ,
  SW_5 , SW_6 , SW_7 , SW_LAST
}
 
enum  Knob {
  KNOB_1 , KNOB_2 , KNOB_3 , KNOB_4 ,
  KNOB_5 , KNOB_6 , KNOB_LAST
}
 
enum  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
}
 
enum  FootswitchLed {
  FOOTSWITCH_LED_1 , FOOTSWITCH_LED_2 , FOOTSWITCH_LED_3 , FOOTSWITCH_LED_4 ,
  FOOTSWITCH_LED_LAST
}
 

Public Member Functions

 DaisyPetal ()
 
 ~DaisyPetal ()
 
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 size)
 
size_t AudioBlockSize ()
 
float AudioCallbackRate ()
 
void StartAdc ()
 
void StopAdc ()
 
void ProcessAnalogControls ()
 
void ProcessAllControls ()
 
float GetKnobValue (Knob k)
 
float GetExpression ()
 
void ProcessDigitalControls ()
 
void ClearLeds ()
 
void UpdateLeds ()
 
void SetRingLed (RingLed idx, float r, float g, float b)
 
void SetFootswitchLed (FootswitchLed idx, float bright)
 

Public Attributes

DaisySeed seed
 
Encoder encoder
 
AnalogControl knob [KNOB_LAST]
 
AnalogControl expression
 
Switch switches [SW_LAST]
 
RgbLed ring_led [8]
 
Led footswitch_led [4]
 

Member Enumeration Documentation

◆ FootswitchLed

footswitch leds

Enumerator
FOOTSWITCH_LED_1 

&

FOOTSWITCH_LED_2 

&

FOOTSWITCH_LED_3 

&

FOOTSWITCH_LED_4 

&

FOOTSWITCH_LED_LAST 

&

◆ Knob

Knobs

Enumerator
KNOB_1 

&

KNOB_2 

&

KNOB_3 

&

KNOB_4 

&

KNOB_5 

&

KNOB_6 

&

KNOB_LAST 

&

◆ RingLed

Leds in ringled

Enumerator
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 

&

◆ Sw

Switches

Enumerator
SW_1 

Footswitch

SW_2 

Footswitch

SW_3 

Footswitch

SW_4 

Footswitch

SW_5 

Toggle

SW_6 

Toggle

SW_7 

Toggle

SW_LAST 

Last enum item

Constructor & Destructor Documentation

◆ DaisyPetal()

daisy::DaisyPetal::DaisyPetal ( )
inline

Constructor

◆ ~DaisyPetal()

daisy::DaisyPetal::~DaisyPetal ( )
inline

Destructor

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisyPetal::AudioBlockSize ( )

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

◆ AudioCallbackRate()

float daisy::DaisyPetal::AudioCallbackRate ( )

Returns the rate in Hz that the Audio callback is called

◆ AudioSampleRate()

float daisy::DaisyPetal::AudioSampleRate ( )

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

◆ ChangeAudioCallback() [1/2]

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

Switch callback functions

Parameters
cbNew multichannel callback function.

◆ ChangeAudioCallback() [2/2]

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

Switch callback functions

Parameters
cbNew interleaved callback function.

◆ ClearLeds()

void daisy::DaisyPetal::ClearLeds ( )

Turn all leds off

◆ DelayMs()

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

Wait before moving on.

Parameters
delDelay time in ms.

◆ GetExpression()

float daisy::DaisyPetal::GetExpression ( )

&

◆ GetKnobValue()

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

Get value per knob.

Parameters
kWhich knob to get
Returns
Floating point knob position.

◆ Init()

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

Initialize daisy petal

◆ ProcessAllControls()

void daisy::DaisyPetal::ProcessAllControls ( )
inline

Process Analog and Digital Controls

◆ ProcessAnalogControls()

void daisy::DaisyPetal::ProcessAnalogControls ( )

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

◆ ProcessDigitalControls()

void daisy::DaisyPetal::ProcessDigitalControls ( )

Process digital controls

◆ SetAudioBlockSize()

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

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

Parameters
sizeAudio block size

◆ SetAudioSampleRate()

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

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

◆ SetFootswitchLed()

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

Set footswitch LED

Parameters
idxLed Index
brightBrightness

◆ SetRingLed()

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

Set ring LED colors

Parameters
idxIndex to set
rRed value
gGreen value
bBlue value

◆ StartAdc()

void daisy::DaisyPetal::StartAdc ( )

Start analog to digital conversion.

◆ StartAudio() [1/2]

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

Starts the callback

Parameters
cbmultichannel callback function

◆ StartAudio() [2/2]

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

Starts the callback

Parameters
cbInterleaved callback function

◆ StopAdc()

void daisy::DaisyPetal::StopAdc ( )

Stops Transfering data from the ADC

◆ StopAudio()

void daisy::DaisyPetal::StopAudio ( )

Stops the audio if it is running.

◆ UpdateLeds()

void daisy::DaisyPetal::UpdateLeds ( )

Update Leds to values you had set.

Member Data Documentation

◆ encoder

Encoder daisy::DaisyPetal::encoder

&

◆ expression

AnalogControl daisy::DaisyPetal::expression

&

◆ footswitch_led

Led daisy::DaisyPetal::footswitch_led[4]

&

◆ knob

AnalogControl daisy::DaisyPetal::knob[KNOB_LAST]

&

◆ ring_led

RgbLed daisy::DaisyPetal::ring_led[8]

&

◆ seed

DaisySeed daisy::DaisyPetal::seed

&

◆ switches

Switch daisy::DaisyPetal::switches[SW_LAST]

< &


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