Board support file for DaisyPatchSM hardware. More...
Board support file for DaisyPatchSM hardware.
Daisy Patch SM is a complete Eurorack module DSP engine. Based on the Daisy Seed, with circuits added for interfacing directly with eurorack modular synthesizers.
#include <daisy_patch_sm.h>
Public Types | |
enum class | PinBank { A , B , C , D } |
Static Public Member Functions | |
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) |
|
inline |
|
inline |
size_t daisy::patch_sm::DaisyPatchSM::AudioBlockSize | ( | ) |
Returns the number of samples processed in an audio callback
float daisy::patch_sm::DaisyPatchSM::AudioCallbackRate | ( | ) |
Returns the rate at which the audio callback will be called in Hz
float daisy::patch_sm::DaisyPatchSM::AudioSampleRate | ( | ) |
Returns the audio engine's samplerate in Hz
void daisy::patch_sm::DaisyPatchSM::ChangeAudioCallback | ( | AudioHandle::AudioCallback | cb | ) |
Changes the callback that is executing. This may cause clicks if done while audio is processing.
void daisy::patch_sm::DaisyPatchSM::ChangeAudioCallback | ( | AudioHandle::InterleavingAudioCallback | cb | ) |
Changes the callback that is executing. This may cause clicks if done while audio is processing.
Here are some wrappers around libDaisy Static functions to provide simpler syntax to those who prefer it. Delays for a specified number of milliseconds
Returns the current value for one of the ADCs
Returns the STM32 port/pin combo for the desired pin (or an invalid pin for HW only pins)
Macros at top of file can be used in place of separate arguments (i.e. GetPin(A4), etc.)
bank | should be one of the PinBank options above |
idx | pin number between 1 and 10 for each of the pins on each header. |
Gets a random floating point value between the specified minimum, and maxmimum
|
inline |
Gets a random 32-bit value
void daisy::patch_sm::DaisyPatchSM::Init | ( | ) |
Initializes the memories, and core peripherals for the Daisy Patch SM
|
inlinestatic |
Print formatted debug log message
|
inlinestatic |
Print formatted debug log message with automatic line termination
|
inline |
Does both of the above
void daisy::patch_sm::DaisyPatchSM::ProcessAnalogControls | ( | ) |
Reads and filters all of the analog control inputs
void daisy::patch_sm::DaisyPatchSM::ProcessDigitalControls | ( | ) |
Reads and debounces any of the digital control inputs This does nothing on this board at this time.
Sets the number of samples processed in an audio callback. This will only take effect on the next invocation of StartAudio
Sets the samplerate for the audio engine This will set it to the closest valid samplerate. Options being: 8kHz, 16kHz, 32kHz, 48kHz, and 96kHz
void daisy::patch_sm::DaisyPatchSM::SetAudioSampleRate | ( | SaiHandle::Config::SampleRate | sample_rate | ) |
void daisy::patch_sm::DaisyPatchSM::StartAdc | ( | ) |
Starts the Control ADCs
This is started automatically when Init() is called.
void daisy::patch_sm::DaisyPatchSM::StartAudio | ( | AudioHandle::AudioCallback | cb | ) |
Starts a non-interleaving audio callback
void daisy::patch_sm::DaisyPatchSM::StartAudio | ( | AudioHandle::InterleavingAudioCallback | cb | ) |
Starts an interleaving audio callback
void daisy::patch_sm::DaisyPatchSM::StartDac | ( | DacHandle::DacCallback | callback = nullptr | ) |
Starts the DAC for the CV Outputs
By default this starts by running the internal callback at 48kHz, which will update the values based on the SetCvOut function.
This is started automatically when Init() is called.
Start the logging session. Optionally wait for terminal connection before proceeding.
void daisy::patch_sm::DaisyPatchSM::StopAdc | ( | ) |
Stops the Control ADCs
void daisy::patch_sm::DaisyPatchSM::StopAudio | ( | ) |
Stops the transmission of audio.
void daisy::patch_sm::DaisyPatchSM::StopDac | ( | ) |
Stop the DAC from updating. This will suspend the CV Outputs from changing
Tests the QSPI for validity This will wipe contents of QSPI when testing.
quick | if this is true the test will only test a small piece of the QSPI checking the entire 8MB can take roughly over a minute. |
returns | true if SDRAM is okay, otherwise false |
bool daisy::patch_sm::DaisyPatchSM::ValidateSDRAM | ( | ) |
Tests entirety of SDRAM for validity This will wipe contents of SDRAM when testing.
returns | true if SDRAM is okay, otherwise false |
Sets specified DAC channel to the target voltage. This may not be 100% accurate without calibration.
channel | desired channel to update. 0 is both, otherwise 1 or 2 are valid. |
voltage | value in Volts that you'd like to write to the DAC. The valid range is 0-5V. |
Pin Accessors for the DaisyPatchSM hardware Used for initializing various GPIO, etc. A1 - -12V Power Input
A10 - +3V3 Power Out
A5 - +12V Power Input
A6 - +5V Power Output
AdcHandle daisy::patch_sm::DaisyPatchSM::adc |
AudioHandle daisy::patch_sm::DaisyPatchSM::audio |
B1 - Audio Out Right
Pcm3060 daisy::patch_sm::DaisyPatchSM::codec |
AnalogControl daisy::patch_sm::DaisyPatchSM::controls[ADC_LAST] |
DacHandle daisy::patch_sm::DaisyPatchSM::dac |
GateIn daisy::patch_sm::DaisyPatchSM::gate_in_1 |
GateIn daisy::patch_sm::DaisyPatchSM::gate_in_2 |
GPIO daisy::patch_sm::DaisyPatchSM::gate_out_1 |
GPIO daisy::patch_sm::DaisyPatchSM::gate_out_2 |
QSPIHandle daisy::patch_sm::DaisyPatchSM::qspi |
SdramHandle daisy::patch_sm::DaisyPatchSM::sdram |
System daisy::patch_sm::DaisyPatchSM::system |
Direct Access Structs/Classes
UsbHandle daisy::patch_sm::DaisyPatchSM::usb |
GPIO daisy::patch_sm::DaisyPatchSM::user_led |
Dedicated Function Pins