libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::DaisyPatch 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_patch.h>

Public Types

enum  Ctrl {
  CTRL_1 , CTRL_2 , CTRL_3 , CTRL_4 ,
  CTRL_LAST
}
 
enum  GateInput { GATE_IN_1 , GATE_IN_2 , GATE_IN_LAST }
 

Public Member Functions

 DaisyPatch ()
 
 ~DaisyPatch ()
 
void Init (bool boost=false)
 
void DelayMs (size_t del)
 
void StartAudio (AudioHandle::AudioCallback 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 (Ctrl k)
 
void ProcessDigitalControls ()
 
void DisplayControls (bool invert=true)
 

Public Attributes

DaisySeed seed
 
Encoder encoder
 
AnalogControl controls [CTRL_LAST]
 
GateIn gate_input [GATE_IN_LAST]
 
MidiUartHandler midi
 
OledDisplay< SSD130x4WireSpi128x64Driverdisplay
 
dsy_gpio gate_output
 

Member Enumeration Documentation

◆ Ctrl

Enum of Ctrls to represent the four CV/Knob combos on the Patch

Enumerator
CTRL_1 
CTRL_2 
CTRL_3 
CTRL_4 
CTRL_LAST 

◆ GateInput

Daisy patch gate inputs

Enumerator
GATE_IN_1 
GATE_IN_2 
GATE_IN_LAST 

<

Constructor & Destructor Documentation

◆ DaisyPatch()

daisy::DaisyPatch::DaisyPatch ( )
inline

Constructor

◆ ~DaisyPatch()

daisy::DaisyPatch::~DaisyPatch ( )
inline

Destructor

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisyPatch::AudioBlockSize ( )

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

◆ AudioCallbackRate()

float daisy::DaisyPatch::AudioCallbackRate ( )

Returns the rate in Hz that the Audio callback is called

◆ AudioSampleRate()

float daisy::DaisyPatch::AudioSampleRate ( )

Get sample rate

◆ ChangeAudioCallback()

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

Switch callback functions

Parameters
cbNew multichannel callback function.

◆ DelayMs()

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

Wait some ms before going on.

Parameters
delDelay time in ms.

◆ DisplayControls()

void daisy::DaisyPatch::DisplayControls ( bool  invert = true)

Control the display

◆ GetKnobValue()

float daisy::DaisyPatch::GetKnobValue ( Ctrl  k)

Get value for a particular control

Parameters
kWhich control to get

◆ Init()

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

Initializes the daisy seed, and patch hardware.

◆ ProcessAllControls()

void daisy::DaisyPatch::ProcessAllControls ( )
inline

Process Analog and Digital Controls

◆ ProcessAnalogControls()

void daisy::DaisyPatch::ProcessAnalogControls ( )

Call at same rate as reading controls for good reads.

◆ ProcessDigitalControls()

void daisy::DaisyPatch::ProcessDigitalControls ( )

Process the digital controls

◆ SetAudioBlockSize()

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

Audio Block size defaults to 48. Change it using this function before StartingAudio

Parameters
sizeAudio block size.

◆ SetAudioSampleRate()

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

Set the sample rate for the audio

◆ StartAdc()

void daisy::DaisyPatch::StartAdc ( )

Start analog to digital conversion.

◆ StartAudio()

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

Starts the callback

Parameters
cbmultichannel callback function

◆ StopAdc()

void daisy::DaisyPatch::StopAdc ( )

Stops Transfering data from the ADC

◆ StopAudio()

void daisy::DaisyPatch::StopAudio ( )

Stops the audio

Member Data Documentation

◆ controls

AnalogControl daisy::DaisyPatch::controls[CTRL_LAST]

Array of controls

◆ display

OledDisplay<SSD130x4WireSpi128x64Driver> daisy::DaisyPatch::display

&

◆ encoder

Encoder daisy::DaisyPatch::encoder

Encoder object

◆ gate_input

GateIn daisy::DaisyPatch::gate_input[GATE_IN_LAST]

Gate inputs

◆ gate_output

dsy_gpio daisy::DaisyPatch::gate_output

&

◆ midi

MidiUartHandler daisy::DaisyPatch::midi

Handles midi

◆ seed

DaisySeed daisy::DaisyPatch::seed

Seed object


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