-
Notifications
You must be signed in to change notification settings - Fork 0
6. Creating a new module
This tutorial will guide you through the process of cloning the "empty template" module to create a sandbox firmware for your exeriments.
This assumes you have set up your VM and logged in with vagrant ssh
Navigate to the shared vagrant folder:
cd /vagrant
Run the module generation script:
python3 viatools/generate_via_module.py
It will prompt you for a name for the module. Enter something with all lower case, alphanumeric and starting with a non-numeric character. We will refer to your entry from here on out as helloworld.
Navigate back to the module directory:
cd via_hardware_executables
Build the source:
make -f helloworld/makefile
You can flash the new firmware over STLink with:
make -f helloworld/makefile upload
or USB with:
make -f helloworld/makefile upload-usb
Now the fun part! Open via_hardware_executables/hardware_drivers/Via/modules/helloworld.hpp in your text editor of choice.
Scroll down towards the bottom and locate the runtime callback functions starting with mainRisingEdgeCallback. Add this line to that function to turn on an LED when the main logic input is goes high:
setLEDA(1);
Add this line to mainFallingEdgeCallback to turn the LED off when the input goes low:
setLEDA(0);
Back to the terminal, from the via_hardware_executables directory, recompile and flash the new firmware:
make -f helloworld/makefile upload
or upload-usb instead of upload if using USB.
Once the flashing has completed (and you have disconnected the USB and reconnected eurorack power if flashing over USB), you should be able to test your newly implemented feature by patching an LFO into the logic input.
Refer to the non-existant ViaModule class documentation