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

#include <daisy_field.h>

Public Types

enum  { SW_1 , SW_2 , SW_LAST }
 
enum  {
  KNOB_1 , KNOB_2 , KNOB_3 , KNOB_4 ,
  KNOB_5 , KNOB_6 , KNOB_7 , KNOB_8 ,
  KNOB_LAST
}
 
enum  {
  CV_1 , CV_2 , CV_3 , CV_4 ,
  CV_LAST
}
 
enum  {
  LED_KEY_B1 , LED_KEY_B2 , LED_KEY_B3 , LED_KEY_B4 ,
  LED_KEY_B5 , LED_KEY_B6 , LED_KEY_B7 , LED_KEY_B8 ,
  LED_KEY_A8 , LED_KEY_A7 , LED_KEY_A6 , LED_KEY_A5 ,
  LED_KEY_A4 , LED_KEY_A3 , LED_KEY_A2 , LED_KEY_A1 ,
  LED_KNOB_1 , LED_KNOB_2 , LED_KNOB_3 , LED_KNOB_4 ,
  LED_KNOB_5 , LED_KNOB_6 , LED_KNOB_7 , LED_KNOB_8 ,
  LED_SW_1 , LED_SW_2 , LED_LAST
}
 

Public Member Functions

 DaisyField ()
 
 ~DaisyField ()
 
void Init (bool boost=false)
 
void DelayMs (size_t del)
 
void StartAudio (AudioHandle::InterleavingAudioCallback cb)
 
void StartAudio (AudioHandle::AudioCallback cb)
 
void StopAudio ()
 
void ChangeAudioCallback (AudioHandle::InterleavingAudioCallback cb)
 
void ChangeAudioCallback (AudioHandle::AudioCallback cb)
 
void SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate)
 
float AudioSampleRate ()
 
void SetAudioBlockSize (size_t blocksize)
 
size_t AudioBlockSize ()
 
float AudioCallbackRate ()
 
void StartAdc ()
 
void StopAdc ()
 
void StartDac ()
 
void ProcessAnalogControls ()
 
void ProcessDigitalControls ()
 
void ProcessAllControls ()
 
void SetCvOut1 (uint16_t val)
 
void SetCvOut2 (uint16_t val)
 
bool KeyboardState (size_t idx) const
 
bool KeyboardRisingEdge (size_t idx) const
 
bool KeyboardFallingEdge (size_t idx) const
 
float GetKnobValue (size_t idx) const
 
float GetCvValue (size_t idx) const
 
SwitchGetSwitch (size_t idx)
 
AnalogControlGetKnob (size_t idx)
 
AnalogControlGetCv (size_t idx)
 
void VegasMode ()
 

Public Attributes

DaisySeed seed
 
OledDisplay< SSD130x4WireSpi128x64Driverdisplay
 
GPIO gate_out
 
GateIn gate_in
 
LedDriverPca9685< 2, trueled_driver
 
Switch sw [SW_LAST]
 
AnalogControl knob [KNOB_LAST]
 
AnalogControl cv [CV_LAST]
 
MidiUartHandler midi
 

Member Enumeration Documentation

◆ anonymous enum

enums for controls, etc.

Enumerator
SW_1 

tactile switch

SW_2 

tactile switch

SW_LAST 

&

◆ anonymous enum

All knobs connect to Daisy Seed's ADC1 pin via CD4051 mux Knobs are in order that they are laid out on hardware.

Enumerator
KNOB_1 

&

KNOB_2 

&

KNOB_3 

&

KNOB_4 

&

KNOB_5 

&

KNOB_6 

&

KNOB_7 

&

KNOB_8 

&

KNOB_LAST 

&

◆ anonymous enum

Enumerator
CV_1 
CV_2 

Connected to ADC1_INP17

CV_3 

Connected to ADC1_INP15

CV_4 

Connected to ADC1_INP4

CV_LAST 

Connected to ADC1_INP11 &

◆ anonymous enum

Enumerator
LED_KEY_B1 

&

LED_KEY_B2 

&

LED_KEY_B3 

&

LED_KEY_B4 

&

LED_KEY_B5 

&

LED_KEY_B6 

&

LED_KEY_B7 

&

LED_KEY_B8 

&

LED_KEY_A8 

&

LED_KEY_A7 

&

LED_KEY_A6 

&

LED_KEY_A5 

&

LED_KEY_A4 

&

LED_KEY_A3 

&

LED_KEY_A2 

&

LED_KEY_A1 

&

LED_KNOB_1 

&

LED_KNOB_2 

&

LED_KNOB_3 

&

LED_KNOB_4 

&

LED_KNOB_5 

&

LED_KNOB_6 

&

LED_KNOB_7 

&

LED_KNOB_8 

&

LED_SW_1 

&

LED_SW_2 

&

LED_LAST 

&

Constructor & Destructor Documentation

◆ DaisyField()

daisy::DaisyField::DaisyField ( )
inline

◆ ~DaisyField()

daisy::DaisyField::~DaisyField ( )
inline

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisyField::AudioBlockSize ( )

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

◆ AudioCallbackRate()

float daisy::DaisyField::AudioCallbackRate ( )

Returns the rate in Hz that the Audio callback is called

◆ AudioSampleRate()

float daisy::DaisyField::AudioSampleRate ( )

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

◆ ChangeAudioCallback() [1/2]

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

Switch callback functions

Parameters
cbNew multichannel callback function.

◆ ChangeAudioCallback() [2/2]

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

Switch callback functions

Parameters
cbNew interleaved callback function.

◆ DelayMs()

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

Wait some ms before going on.

Parameters
delDelay time in ms.

◆ GetCv()

AnalogControl * daisy::DaisyField::GetCv ( size_t  idx)

Getter for CV objects.

Parameters
idxThe CV input of interest.

◆ GetCvValue()

float daisy::DaisyField::GetCvValue ( size_t  idx) const

Returns the CV input's value

Parameters
idxThe CV input of interest.

◆ GetKnob()

AnalogControl * daisy::DaisyField::GetKnob ( size_t  idx)

Getter for knob objects

Parameters
idxThe knob input of interest.

◆ GetKnobValue()

float daisy::DaisyField::GetKnobValue ( size_t  idx) const

Returns the knob's value

Parameters
idxThe knob of interest.

◆ GetSwitch()

Switch * daisy::DaisyField::GetSwitch ( size_t  idx)

Getter for switch objects

Parameters
idxThe switch of interest.

◆ Init()

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

Initializes the Daisy Field, and all of its hardware.

◆ KeyboardFallingEdge()

bool daisy::DaisyField::KeyboardFallingEdge ( size_t  idx) const

Returns true if the key has just been released

Parameters
idxthe key of interest

◆ KeyboardRisingEdge()

bool daisy::DaisyField::KeyboardRisingEdge ( size_t  idx) const

Returns true if the key has just been pressed

Parameters
idxthe key of interest

◆ KeyboardState()

bool daisy::DaisyField::KeyboardState ( size_t  idx) const

Returns true if the key has not been pressed recently

Parameters
idxthe key of interest

◆ ProcessAllControls()

void daisy::DaisyField::ProcessAllControls ( )
inline

Process Analog and Digital Controls

◆ ProcessAnalogControls()

void daisy::DaisyField::ProcessAnalogControls ( )

Processes the ADC inputs, updating their values

◆ ProcessDigitalControls()

void daisy::DaisyField::ProcessDigitalControls ( )

Process tactile switches and keyboard states

◆ SetAudioBlockSize()

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

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

◆ SetAudioSampleRate()

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

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

◆ SetCvOut1()

void daisy::DaisyField::SetCvOut1 ( uint16_t  val)

Sets the output of CV out 1 to a value between 0-4095 that corresponds to 0-5V

◆ SetCvOut2()

void daisy::DaisyField::SetCvOut2 ( uint16_t  val)

Sets the output of CV out 2 to a value between 0-4095 that corresponds to 0-5V

◆ StartAdc()

void daisy::DaisyField::StartAdc ( )

Starts Transfering data from the ADC

◆ StartAudio() [1/2]

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

Starts the callback

Parameters
cbmultichannel callback function

◆ StartAudio() [2/2]

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

Starts the callback

Parameters
cbInterleaved callback function

◆ StartDac()

void daisy::DaisyField::StartDac ( )

Turns on the built-in 12-bit DAC on the Daisy Seed This is now deprecated and does nothing. The polling use of the DACs now handles starting the tranmission.

◆ StopAdc()

void daisy::DaisyField::StopAdc ( )

Stops Transfering data from the ADC

◆ StopAudio()

void daisy::DaisyField::StopAudio ( )

Stops the audio if it is running.

◆ VegasMode()

void daisy::DaisyField::VegasMode ( )

Light show, cycling through all LEDs, and OLED

Member Data Documentation

◆ cv

AnalogControl daisy::DaisyField::cv[CV_LAST]

◆ display

OledDisplay<SSD130x4WireSpi128x64Driver> daisy::DaisyField::display

◆ gate_in

GateIn daisy::DaisyField::gate_in

◆ gate_out

GPIO daisy::DaisyField::gate_out

◆ knob

AnalogControl daisy::DaisyField::knob[KNOB_LAST]

◆ led_driver

LedDriverPca9685<2, true> daisy::DaisyField::led_driver

◆ midi

MidiUartHandler daisy::DaisyField::midi

◆ seed

DaisySeed daisy::DaisyField::seed

◆ sw

Switch daisy::DaisyField::sw[SW_LAST]

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