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

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

Detailed Description

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

#include <daisy_seed.h>

Public Types

enum class  BoardVersion { DAISY_SEED , DAISY_SEED_1_1 , DAISY_SEED_2_DFM }
 

Public Member Functions

 DaisySeed ()
 
 ~DaisySeed ()
 
void Configure ()
 
void Init (bool boost=false)
 
void DeInit ()
 
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 blocksize)
 
size_t AudioBlockSize ()
 
float AudioCallbackRate () const
 
const SaiHandleAudioSaiHandle () const
 
void SetLed (bool state)
 
void SetTestPoint (bool state)
 
BoardVersion CheckBoardVersion ()
 

Static Public Member Functions

static Pin GetPin (uint8_t pin_idx)
 
template<typename... VA>
static void Print (const char *format, VA... va)
 
template<typename... VA>
static void PrintLine (const char *format, VA... va)
 
static void StartLog (bool wait_for_pc=false)
 

Public Attributes

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

Member Enumeration Documentation

◆ BoardVersion

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.

Enumerator
DAISY_SEED 

Daisy Seed Rev4 This is the original Daisy Seed

DAISY_SEED_1_1 

Daisy Seed 1.1 (aka Daisy Seed Rev5) This is a pin-compatible version of the Daisy Seed that uses the WM8731 codec instead of the AK4430

DAISY_SEED_2_DFM 

Daisy Seed 2 DFM is a software compatible version of the original Daisy Seed that has improvements for manufacturing, as well as an improved audio codec (PCM3060)

Constructor & Destructor Documentation

◆ DaisySeed()

daisy::DaisySeed::DaisySeed ( )
inline

◆ ~DaisySeed()

daisy::DaisySeed::~DaisySeed ( )
inline

Member Function Documentation

◆ AudioBlockSize()

size_t daisy::DaisySeed::AudioBlockSize ( )

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

◆ AudioCallbackRate()

float daisy::DaisySeed::AudioCallbackRate ( ) const

Returns the rate in Hz that the Audio callback is called

◆ 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

◆ AudioSampleRate()

float daisy::DaisySeed::AudioSampleRate ( )

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

◆ ChangeAudioCallback() [1/2]

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

Changes to a new multichannel callback

◆ ChangeAudioCallback() [2/2]

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

Changes to a new interleaved callback

◆ CheckBoardVersion()

BoardVersion daisy::DaisySeed::CheckBoardVersion ( )

Returns the BoardVersion detected during intiialization

◆ Configure()

void daisy::DaisySeed::Configure ( )

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

◆ DeInit()

void daisy::DaisySeed::DeInit ( )

Deinitializes all peripherals automatically handled by Init.

◆ DelayMs()

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

Wait some ms before going on.

Parameters
delDelay time in ms.

◆ GetPin()

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

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

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

◆ Print()

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

Print formatted debug log message

◆ PrintLine()

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

Print formatted debug log message with automatic line termination

◆ SetAudioBlockSize()

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

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

◆ SetAudioSampleRate()

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

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

◆ SetLed()

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

Sets the state of the built in LED

◆ SetTestPoint()

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

Sets the state of the test point near pin 10

◆ StartAudio() [1/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.

◆ StartAudio() [2/2]

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.

◆ StartLog()

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

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

◆ StopAudio()

void daisy::DaisySeed::StopAudio ( )

Stops the audio if it is running.

Member Data Documentation

◆ adc

AdcHandle daisy::DaisySeed::adc

&

◆ audio_handle

AudioHandle daisy::DaisySeed::audio_handle

&

◆ codec

Ak4556 daisy::DaisySeed::codec

◆ dac

DacHandle daisy::DaisySeed::dac

◆ led

GPIO daisy::DaisySeed::led

◆ qspi

QSPIHandle daisy::DaisySeed::qspi

◆ qspi_config

QSPIHandle::Config daisy::DaisySeed::qspi_config

◆ sdram_handle

SdramHandle daisy::DaisySeed::sdram_handle

&

◆ system

System daisy::DaisySeed::system

◆ testpoint

GPIO daisy::DaisySeed::testpoint

◆ usb_handle

UsbHandle daisy::DaisySeed::usb_handle

&


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