Skip to content

daisy::DaisyField

Module: LIBDAISY / BOARDS

#include <daisy_field.h>

Public Types

Name
enum @0
enum @1
enum @2
enum @3

Public Functions

Name
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
Switch * GetSwitch(size_t idx)
AnalogControl * GetKnob(size_t idx)
AnalogControl * GetCv(size_t idx)
void VegasMode()

Public Attributes

Name
DaisySeed seed
OledDisplay< SSD130x4WireSpi128x64Driver > display
dsy_gpio gate_out
GateIn gate_in
LedDriverPca9685< 2, true > led_driver
Switch[SW_LAST] sw
AnalogControl[KNOB_LAST] knob
AnalogControl[CV_LAST] cv
MidiUartHandler midi

Public Types Documentation

enum @0

Enumerator Value Description
SW_1 tactile switch
SW_2 tactile switch
SW_LAST &

enums for controls, etc.

enum @1

Enumerator Value Description
KNOB_1 &
KNOB_2 &
KNOB_3 &
KNOB_4 &
KNOB_5 &
KNOB_6 &
KNOB_7 &
KNOB_8 &
KNOB_LAST &

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

enum @2

Enumerator Value Description
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 &

enum @3

Enumerator Value Description
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 Functions Documentation

function DaisyField

inline DaisyField()

function ~DaisyField

inline ~DaisyField()

function Init

void Init(
    bool boost =false
)

Initializes the Daisy Field, and all of its hardware.


function DelayMs

void DelayMs(
    size_t del
)

Parameters:

  • del Delay time in ms.

Wait some ms before going on.


function StartAudio

void StartAudio(
    AudioHandle::InterleavingAudioCallback cb
)

Parameters:

  • cb Interleaved callback function

Starts the callback


function StartAudio

void StartAudio(
    AudioHandle::AudioCallback cb
)

Parameters:

  • cb multichannel callback function

Starts the callback


function StopAudio

void StopAudio()

Stops the audio if it is running.


function ChangeAudioCallback

void ChangeAudioCallback(
    AudioHandle::InterleavingAudioCallback cb
)

Parameters:

  • cb New interleaved callback function.

Switch callback functions


function ChangeAudioCallback

void ChangeAudioCallback(
    AudioHandle::AudioCallback cb
)

Parameters:

  • cb New multichannel callback function.

Switch callback functions


function SetAudioSampleRate

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

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


function AudioSampleRate

float AudioSampleRate()

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


function SetAudioBlockSize

void SetAudioBlockSize(
    size_t blocksize
)

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


function AudioBlockSize

size_t AudioBlockSize()

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


function AudioCallbackRate

float AudioCallbackRate()

Returns the rate in Hz that the Audio callback is called


function StartAdc

void StartAdc()

Starts Transfering data from the ADC


function StopAdc

void StopAdc()

Stops Transfering data from the ADC


function StartDac

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


function ProcessAnalogControls

void ProcessAnalogControls()

Processes the ADC inputs, updating their values


function ProcessDigitalControls

void ProcessDigitalControls()

Process tactile switches and keyboard states


function ProcessAllControls

inline void ProcessAllControls()

Process Analog and Digital Controls


function SetCvOut1

void SetCvOut1(
    uint16_t val
)

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


function SetCvOut2

void SetCvOut2(
    uint16_t val
)

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


function KeyboardState

bool KeyboardState(
    size_t idx
) const

Parameters:

  • idx the key of interest

Returns true if the key has not been pressed recently


function KeyboardRisingEdge

bool KeyboardRisingEdge(
    size_t idx
) const

Parameters:

  • idx the key of interest

Returns true if the key has just been pressed


function KeyboardFallingEdge

bool KeyboardFallingEdge(
    size_t idx
) const

Parameters:

  • idx the key of interest

Returns true if the key has just been released


function GetKnobValue

float GetKnobValue(
    size_t idx
) const

Parameters:

  • idx The knob of interest.

Returns the knob's value


function GetCvValue

float GetCvValue(
    size_t idx
) const

Parameters:

  • idx The CV input of interest.

Returns the CV input's value


function GetSwitch

Switch * GetSwitch(
    size_t idx
)

Parameters:

  • idx The switch of interest.

Getter for switch objects


function GetKnob

AnalogControl * GetKnob(
    size_t idx
)

Parameters:

  • idx The knob input of interest.

Getter for knob objects


function GetCv

AnalogControl * GetCv(
    size_t idx
)

Parameters:

  • idx The CV input of interest.

Getter for CV objects.


function VegasMode

void VegasMode()

Light show, cycling through all LEDs, and OLED


Public Attributes Documentation

variable seed

DaisySeed seed;

variable display

OledDisplay< SSD130x4WireSpi128x64Driver > display;

variable gate_out

dsy_gpio gate_out;

variable gate_in

GateIn gate_in;

variable led_driver

LedDriverPca9685< 2, true > led_driver;

variable sw

Switch[SW_LAST] sw;

variable knob

AnalogControl[KNOB_LAST] knob;

variable cv

AnalogControl[CV_LAST] cv;

variable midi

MidiUartHandler midi;

Updated on 2024-01-03 at 19:41:01 +0000