daisy::patch_sm::DaisyPatchSM¶
Board support file for DaisyPatchSM hardware. More...
#include <daisy_patch_sm.h>
Public Types¶
Name | |
---|---|
enum class | PinBank |
Public Functions¶
Name | |
---|---|
DaisyPatchSM() | |
~DaisyPatchSM() | |
void | Init() |
void | StartAudio(AudioHandle::AudioCallback cb) |
void | StartAudio(AudioHandle::InterleavingAudioCallback cb) |
void | ChangeAudioCallback(AudioHandle::AudioCallback cb) |
void | ChangeAudioCallback(AudioHandle::InterleavingAudioCallback cb) |
void | StopAudio() |
void | SetAudioBlockSize(size_t size) |
void | SetAudioSampleRate(float sr) |
void | SetAudioSampleRate(SaiHandle::Config::SampleRate sample_rate) |
size_t | AudioBlockSize() |
float | AudioSampleRate() |
float | AudioCallbackRate() |
void | StartAdc() |
void | StopAdc() |
void | ProcessAnalogControls() |
void | ProcessDigitalControls() |
void | ProcessAllControls() |
float | GetAdcValue(int idx) |
dsy_gpio_pin | GetPin(const PinBank bank, const int idx) |
void | StartDac(DacHandle::DacCallback callback =nullptr) |
void | StopDac() |
void | WriteCvOut(const int channel, float voltage) |
void | Delay(uint32_t milliseconds) |
uint32_t | GetRandomValue() |
float | GetRandomFloat(float min =0.f, float max =1.f) |
void | SetLed(bool state) |
bool | ValidateSDRAM() Tests entirety of SDRAM for validity This will wipe contents of SDRAM when testing. |
bool | ValidateQSPI(bool quick =true) Tests the QSPI for validity This will wipe contents of QSPI when testing. |
template <typename... VA> void |
Print(const char * format, VA... va) |
template <typename... VA> void |
PrintLine(const char * format, VA... va) |
void | StartLog(bool wait_for_pc =false) |
Public Attributes¶
Name | |
---|---|
System | system |
SdramHandle | sdram |
QSPIHandle | qspi |
AudioHandle | audio |
AdcHandle | adc |
UsbHandle | usb |
Pcm3060 | codec |
DacHandle | dac |
dsy_gpio | user_led |
AnalogControl[ADC_LAST] | controls |
GateIn | gate_in_1 |
GateIn | gate_in_2 |
dsy_gpio | gate_out_1 |
dsy_gpio | gate_out_2 |
constexpr static Pin | A1 |
constexpr static Pin | A2 |
constexpr static Pin | A3 |
constexpr static Pin | A4 |
constexpr static Pin | A5 |
constexpr static Pin | A6 |
constexpr static Pin | A7 |
constexpr static Pin | A8 |
constexpr static Pin | A9 |
constexpr static Pin | A10 |
constexpr static Pin | B1 |
constexpr static Pin | B2 |
constexpr static Pin | B3 |
constexpr static Pin | B4 |
constexpr static Pin | B5 |
constexpr static Pin | B6 |
constexpr static Pin | B7 |
constexpr static Pin | B8 |
constexpr static Pin | B9 |
constexpr static Pin | B10 |
constexpr static Pin | C1 |
constexpr static Pin | C2 |
constexpr static Pin | C3 |
constexpr static Pin | C4 |
constexpr static Pin | C5 |
constexpr static Pin | C6 |
constexpr static Pin | C7 |
constexpr static Pin | C8 |
constexpr static Pin | C9 |
constexpr static Pin | C10 |
constexpr static Pin | D1 |
constexpr static Pin | D2 |
constexpr static Pin | D3 |
constexpr static Pin | D4 |
constexpr static Pin | D5 |
constexpr static Pin | D6 |
constexpr static Pin | D7 |
constexpr static Pin | D8 |
constexpr static Pin | D9 |
constexpr static Pin | D10 |
Detailed Description¶
Board support file for DaisyPatchSM hardware.
Author: shensley
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.
Public Types Documentation¶
enum PinBank¶
Enumerator | Value | Description |
---|---|---|
A | ||
B | ||
C | ||
D |
Helper for mapping pins, and accessing them using the GetPin
function
Public Functions Documentation¶
function DaisyPatchSM¶
function ~DaisyPatchSM¶
function Init¶
Initializes the memories, and core peripherals for the Daisy Patch SM
function StartAudio¶
Starts a non-interleaving audio callback
function StartAudio¶
Starts an interleaving audio callback
function ChangeAudioCallback¶
Changes the callback that is executing. This may cause clicks if done while audio is processing.
function ChangeAudioCallback¶
Changes the callback that is executing. This may cause clicks if done while audio is processing.
function StopAudio¶
Stops the transmission of audio.
function SetAudioBlockSize¶
Sets the number of samples processed in an audio callback. This will only take effect on the next invocation of StartAudio
function SetAudioSampleRate¶
Sets the samplerate for the audio engine This will set it to the closest valid samplerate. Options being: 8kHz, 16kHz, 32kHz, 48kHz, and 96kHz
function SetAudioSampleRate¶
function AudioBlockSize¶
Returns the number of samples processed in an audio callback
function AudioSampleRate¶
Returns the audio engine's samplerate in Hz
function AudioCallbackRate¶
Returns the rate at which the audio callback will be called in Hz
function StartAdc¶
Starts the Control ADCs
This is started automatically when Init() is called.
function StopAdc¶
Stops the Control ADCs
function ProcessAnalogControls¶
Reads and filters all of the analog control inputs
function ProcessDigitalControls¶
Reads and debounces any of the digital control inputs This does nothing on this board at this time.
function ProcessAllControls¶
Does both of the above
function GetAdcValue¶
Returns the current value for one of the ADCs
function GetPin¶
Parameters:
- bank should be one of the PinBank options above
- idx pin number between 1 and 10 for each of the pins on each header.
Deprecated:
please use the Pin definitions in daisy::patch_sm instead
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.)
function StartDac¶
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.
function StopDac¶
Stop the DAC from updating. This will suspend the CV Outputs from changing
function WriteCvOut¶
Parameters:
- 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.
Todo: Add Calibration to CV Outputs
Sets specified DAC channel to the target voltage. This may not be 100% accurate without calibration.
function Delay¶
Here are some wrappers around libDaisy Static functions to provide simpler syntax to those who prefer it. Delays for a specified number of milliseconds
function GetRandomValue¶
Gets a random 32-bit value
function GetRandomFloat¶
Gets a random floating point value between the specified minimum, and maxmimum
function SetLed¶
function ValidateSDRAM¶
Tests entirety of SDRAM for validity This will wipe contents of SDRAM when testing.
Returns:
- returns true if SDRAM is okay, otherwise false
Note: If using the SDRAM for the default bss, or heap, and using constructors as initializers do not call this function. Otherwise, it could overwrite changes performed by constructors.
function ValidateQSPI¶
Tests the QSPI for validity This will wipe contents of QSPI when testing.
Parameters:
- 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:
- returns true if SDRAM is okay, otherwise false
Note: If called with quick = false, this will erase all memory the "quick" test starts 0x400000 bytes into the memory and test 16kB of data
function Print¶
Print formatted debug log message
function PrintLine¶
Print formatted debug log message with automatic line termination
function StartLog¶
Start the logging session. Optionally wait for terminal connection before proceeding.
Public Attributes Documentation¶
variable system¶
Direct Access Structs/Classes
variable sdram¶
variable qspi¶
variable audio¶
variable adc¶
variable usb¶
variable codec¶
variable dac¶
variable user_led¶
Dedicated Function Pins
variable controls¶
variable gate_in_1¶
variable gate_in_2¶
variable gate_out_1¶
variable gate_out_2¶
variable A1¶
Pin Accessors for the DaisyPatchSM hardware Used for initializing various GPIO, etc. A1 - -12V Power Input
variable A2¶
A2 - UART1 Rx
variable A3¶
A3 - UART1 Tx
variable A4¶
A4 - GND
variable A5¶
A5 - +12V Power Input
variable A6¶
A6 - +5V Power Output
variable A7¶
A7 - GND
variable A8¶
A8 - USB DM
variable A9¶
A9 - USB DP
variable A10¶
A10 - +3V3 Power Out
variable B1¶
B1 - Audio Out Right
variable B2¶
B2 - Audio Out Left
variable B3¶
B3 - Audio In Right
variable B4¶
B4 - Audio In Left
variable B5¶
B5 - GATE OUT 1
variable B6¶
B6 - GATE OUT 2
variable B7¶
B7 - I2C1 SCL
variable B8¶
B8 - I2C1 SDA
variable B9¶
B9 - GATE IN 2
variable B10¶
B10 - GATE IN 1
variable C1¶
C1 - CV Out 2
variable C2¶
C2 - CV In 4
variable C3¶
C3 - CV In 3
variable C4¶
C4 - CV In 2
variable C5¶
C5 - CV In 1
variable C6¶
C6 - CV In 5
variable C7¶
C7 - CV In 6
variable C8¶
C8 - CV In 7
variable C9¶
C9 - CV In 8
variable C10¶
C10 - CV Out 1
variable D1¶
D1 - SPI2 CS
variable D2¶
D2 - SDMMC D3
variable D3¶
D3 - SDMMC D2
variable D4¶
D4 - SDMMC D1
variable D5¶
D5 - SDMMC D0
variable D6¶
D6 - SDMMC CK
variable D7¶
D7 - SDMMC CMD
variable D8¶
D8 - SPI2 MISO
variable D9¶
D9 - SPI2 MOSI
variable D10¶
D10 - SPI2 SCK
Updated on 2024-01-03 at 19:41:01 +0000