Skip to content

Class daisy::DaisySeed

ClassList > daisy > DaisySeed

This is the higher-level interface for the Daisy board. All basic peripheral configuration/initialization is setup here. .

  • #include <daisy_seed.h>

Public Types

Type Name
enum BoardVersion

Public Attributes

Type Name
AdcHandle adc
AudioHandle audio_handle
Ak4556 codec
DacHandle dac
GPIO led
QSPIHandle qspi
QSPIHandle::Config qspi_config
SdramHandle sdram_handle
System system
GPIO testpoint
UsbHandle usb_handle

Public Functions

Type Name
size_t AudioBlockSize ()
float AudioCallbackRate () const
const SaiHandle & AudioSaiHandle () const
float AudioSampleRate ()
void ChangeAudioCallback (AudioHandle::InterleavingAudioCallback cb)
void ChangeAudioCallback (AudioHandle::AudioCallback cb)
BoardVersion CheckBoardVersion ()
void Configure ()
DaisySeed ()
void DeInit ()
void DelayMs (size_t del)
void Init (bool boost=false)
void SetAudioBlockSize (size_t blocksize)
void SetAudioSampleRate (SaiHandle::Config::SampleRate samplerate)
void SetLed (bool state)
void SetTestPoint (bool state)
void StartAudio (AudioHandle::InterleavingAudioCallback cb)
void StartAudio (AudioHandle::AudioCallback cb)
void StopAudio ()
~DaisySeed ()

Public Static Functions

Type Name
Pin GetPin (uint8_t pin_idx)
void Print (const char * format, VA... va)
void PrintLine (const char * format, VA... va)
void StartLog (bool wait_for_pc=false)

Public Types Documentation

enum BoardVersion

enum daisy::DaisySeed::BoardVersion {
    DAISY_SEED,
    DAISY_SEED_1_1,
    DAISY_SEED_2_DFM
};

Internal indices for DaisySeed-equivalent devices This shouldn't have any effect on user-facing code, and only needs to be checked to properly initialize the onboard-circuits.


Public Attributes Documentation

variable adc

AdcHandle daisy::DaisySeed::adc;

&


variable audio_handle

AudioHandle daisy::DaisySeed::audio_handle;

&


variable codec

Ak4556 daisy::DaisySeed::codec;

variable dac

DacHandle daisy::DaisySeed::dac;

variable led

GPIO daisy::DaisySeed::led;

variable qspi

QSPIHandle daisy::DaisySeed::qspi;

variable qspi_config

QSPIHandle::Config daisy::DaisySeed::qspi_config;

variable sdram_handle

SdramHandle daisy::DaisySeed::sdram_handle;

&


variable system

System daisy::DaisySeed::system;

variable testpoint

GPIO daisy::DaisySeed::testpoint;

variable usb_handle

UsbHandle daisy::DaisySeed::usb_handle;

&


Public Functions Documentation

function AudioBlockSize

size_t daisy::DaisySeed::AudioBlockSize () 

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


function AudioCallbackRate

float daisy::DaisySeed::AudioCallbackRate () const

Returns the rate in Hz that the Audio callback is called


function AudioSaiHandle

const  SaiHandle & daisy::DaisySeed::AudioSaiHandle () const

Returns the SAI Handle for the Daisy Seed This can be useful when adding a secondary codec, the result of this function can be passed to the audio reinit with an SAI2 configuration


function AudioSampleRate

float daisy::DaisySeed::AudioSampleRate () 

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


function ChangeAudioCallback [½]

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

Changes to a new interleaved callback


function ChangeAudioCallback [2/2]

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

Changes to a new multichannel callback


function CheckBoardVersion

BoardVersion daisy::DaisySeed::CheckBoardVersion () 

Returns the BoardVersion detected during intiialization


function Configure

void daisy::DaisySeed::Configure () 

This function used to provide a pre-initialization configuraiton it has since been deprecated, and does nothing.


function DaisySeed

inline daisy::DaisySeed::DaisySeed () 

function DeInit

void daisy::DaisySeed::DeInit () 

Deinitializes all peripherals automatically handled by Init.


function DelayMs

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

Wait some ms before going on.

Parameters:

  • del Delay time in ms.

function Init

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

Initializes the Daisy Seed and the following peripherals: SDRAM, QSPI, 24-bit 48kHz Audio via AK4556, Internal USB, as well as the built-in LED and Testpoint.

ADCs, DACs, and other special peripherals (such as I2C, SPI, etc.) can be initialized using their specific initializers within libdaisy for a specific application.


function SetAudioBlockSize

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

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


function SetAudioSampleRate

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

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


function SetLed

void daisy::DaisySeed::SetLed (
    bool state
) 

Sets the state of the built in LED


function SetTestPoint

void daisy::DaisySeed::SetTestPoint (
    bool state
) 

Sets the state of the test point near pin 10


function StartAudio [½]

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

Begins the audio for the seeds builtin audio. the specified callback will get called whenever new data is ready to be prepared.


function StartAudio [2/2]

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

Begins the audio for the seeds builtin audio. the specified callback will get called whenever new data is ready to be prepared. This will use the newer non-interleaved callback.


function StopAudio

void daisy::DaisySeed::StopAudio () 

Stops the audio if it is running.


function ~DaisySeed

inline daisy::DaisySeed::~DaisySeed () 

Public Static Functions Documentation

function GetPin

static Pin daisy::DaisySeed::GetPin (
    uint8_t pin_idx
) 

Returns the gpio_pin corresponding to the index 0-31. For the given GPIO on the Daisy Seed (labeled 1-32 in docs).


function Print

template<typename... VA>
static inline void daisy::DaisySeed::Print (
    const  char * format,
    VA... va
) 

Print formatted debug log message


function PrintLine

template<typename... VA>
static inline void daisy::DaisySeed::PrintLine (
    const  char * format,
    VA... va
) 

Print formatted debug log message with automatic line termination


function StartLog

static inline void daisy::DaisySeed::StartLog (
    bool wait_for_pc=false
) 

Start the logging session. Optionally wait for terminal connection before proceeding.



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