Class daisy::patch_sm::DaisyPatchSM¶
ClassList > daisy > patch_sm > DaisyPatchSM
Board support file for DaisyPatchSM hardware.More...
#include <daisy_patch_sm.h>
Public Types¶
Type | Name |
---|---|
enum | PinBank |
Public Attributes¶
Public Static Attributes¶
Type | Name |
---|---|
constexpr Pin | A1 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | A10 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | A2 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 1) |
constexpr Pin | A3 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 0) |
constexpr Pin | A4 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | A5 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | A6 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | A7 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | A8 = [**Pin**](structdaisy_1_1Pin.md)(PORTB, 14) |
constexpr Pin | A9 = [**Pin**](structdaisy_1_1Pin.md)(PORTB, 15) |
constexpr Pin | B1 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | B10 = [**Pin**](structdaisy_1_1Pin.md)(PORTG, 13) |
constexpr Pin | B2 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | B3 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | B4 = [**Pin**](structdaisy_1_1Pin.md)(PORTX, 0) |
constexpr Pin | B5 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 14) |
constexpr Pin | B6 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 13) |
constexpr Pin | B7 = [**Pin**](structdaisy_1_1Pin.md)(PORTB, 8) |
constexpr Pin | B8 = [**Pin**](structdaisy_1_1Pin.md)(PORTB, 9) |
constexpr Pin | B9 = [**Pin**](structdaisy_1_1Pin.md)(PORTG, 14) |
constexpr Pin | C1 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 5) |
constexpr Pin | C10 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 4) |
constexpr Pin | C2 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 7) |
constexpr Pin | C3 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 2) |
constexpr Pin | C4 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 6) |
constexpr Pin | C5 = [**Pin**](structdaisy_1_1Pin.md)(PORTA, 3) |
constexpr Pin | C6 = [**Pin**](structdaisy_1_1Pin.md)(PORTB, 1) |
constexpr Pin | C7 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 4) |
constexpr Pin | C8 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 0) |
constexpr Pin | C9 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 1) |
constexpr Pin | D1 = [**Pin**](structdaisy_1_1Pin.md)(PORTB, 4) |
constexpr Pin | D10 = [**Pin**](structdaisy_1_1Pin.md)(PORTD, 3) |
constexpr Pin | D2 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 11) |
constexpr Pin | D3 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 10) |
constexpr Pin | D4 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 9) |
constexpr Pin | D5 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 8) |
constexpr Pin | D6 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 12) |
constexpr Pin | D7 = [**Pin**](structdaisy_1_1Pin.md)(PORTD, 2) |
constexpr Pin | D8 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 2) |
constexpr Pin | D9 = [**Pin**](structdaisy_1_1Pin.md)(PORTC, 3) |
Public Functions¶
Public Static Functions¶
Type | Name |
---|---|
void | Print (const char * format, VA... va) |
void | PrintLine (const char * format, VA... va) |
void | StartLog (bool wait_for_pc=false) |
Detailed Description¶
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¶
Helper for mapping pins, and accessing them using the GetPin
function
Public Attributes Documentation¶
variable adc¶
variable audio¶
variable codec¶
variable controls¶
variable dac¶
variable gate_in_1¶
variable gate_in_2¶
variable gate_out_1¶
variable gate_out_2¶
variable qspi¶
variable sdram¶
variable system¶
Direct Access Structs/Classes
variable usb¶
variable user_led¶
Dedicated Function Pins
Public Static Attributes Documentation¶
variable A1¶
Pin Accessors for the DaisyPatchSM hardware Used for initializing various GPIO, etc. A1 - -12V Power Input
variable A10¶
A10 - +3V3 Power Out
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 B1¶
B1 - Audio Out Right
variable B10¶
B10 - GATE IN 1
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 C1¶
C1 - CV Out 2
variable C10¶
C10 - CV Out 1
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 D1¶
D1 - SPI2 CS
variable D10¶
D10 - SPI2 SCK
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
Public Functions Documentation¶
function AudioBlockSize¶
Returns the number of samples processed in an audio callback
function AudioCallbackRate¶
Returns the rate at which the audio callback will be called in Hz
function AudioSampleRate¶
Returns the audio engine's samplerate in Hz
function ChangeAudioCallback [½]¶
Changes the callback that is executing. This may cause clicks if done while audio is processing.
function ChangeAudioCallback [2/2]¶
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.
function DaisyPatchSM¶
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 GetAdcValue¶
Returns the current value for one of the ADCs
function GetPin¶
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.)
Parameters:
bank
should be one of the PinBank options aboveidx
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
function GetRandomFloat¶
Gets a random floating point value between the specified minimum, and maxmimum
function GetRandomValue¶
Gets a random 32-bit value
function Init¶
Initializes the memories, and core peripherals for the Daisy Patch SM
function ProcessAllControls¶
Does both of the above
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 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 [2/2]¶
void daisy::patch_sm::DaisyPatchSM::SetAudioSampleRate (
SaiHandle::Config::SampleRate sample_rate
)
function SetLed¶
function StartAdc¶
Starts the Control ADCs
This is started automatically when Init() is called.
function StartAudio [½]¶
Starts a non-interleaving audio callback
function StartAudio [2/2]¶
Starts an interleaving audio callback
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 StopAdc¶
Stops the Control ADCs
function StopAudio¶
Stops the transmission of audio.
function StopDac¶
Stop the DAC from updating. This will suspend the CV Outputs from changing
function ValidateQSPI¶
Tests the QSPI for validity This will wipe contents of QSPI when testing.
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
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.
Return value:
returns
true if SDRAM is okay, otherwise false
function ValidateSDRAM¶
Tests entirety of SDRAM for validity This will wipe contents of SDRAM when testing.
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.
Return value:
returns
true if SDRAM is okay, otherwise false
function WriteCvOut¶
Sets specified DAC channel to the target voltage. This may not be 100% accurate without calibration.
Todo
Add Calibration to CV Outputs
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.
function ~DaisyPatchSM¶
Public Static Functions Documentation¶
function Print¶
template<typename... VA>
static inline void daisy::patch_sm::DaisyPatchSM::Print (
const char * format,
VA... va
)
Print formatted debug log message
function PrintLine¶
template<typename... VA>
static inline void daisy::patch_sm::DaisyPatchSM::PrintLine (
const char * format,
VA... va
)
Print formatted debug log message with automatic line termination
function StartLog¶
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_patch_sm.h