-
Notifications
You must be signed in to change notification settings - Fork 1
Hardware Abstraction Layer
The Callisto HAL wraps all the hardware GPIO and ADC inputs in contextual and commonly used functions to simplify the development and focus on sound design.
Class Methods:
void update()
This function updates all of the ADC, Button and LED values. It calls updateADC()
, updateButtons()
and updateLEDs()
under the hood.
void updateADC()
This function updates all of the new ADC values and applies calibration compensation to CV inputs.
void updateButtons()
This function updates the button states and updates the corresponding modes, it also fires off any registered button callbacks.
void updateLEDs()
This function updates the LEDs to their new values. LEDs are either automatically updated from their current mode, or by manually calling setLED()
or setTrigLED
.
int readADCRaw(int adcPin)
This function returns the raw ADC value for a given ADC pin.
int readCVRaw(int cvElement)
This function returns the raw ADC value for a given CV input.
float readCVNorm(int cvElement)
This function returns the normalized ADC value for a given CV input from -1.0 to 1.0.
float readCVVolt(int cvElement)
This function returns the ADC value in volts for a given CV input.
float readCVPitch()
This function returns the frequency value in Hz for a 1 V/Oct CV input.
int readPotRaw(int potentiometerElement)
This function returns the raw ADC value for a given potentiometer input.
float readPotNorm(int potentiometerElement)
This function returns the normalized ADC value for a given potentiometer input from 0.0 to 1.0.
float readPotVolt(int potentiometerElement)
This function returns the ADC value in volts for a given potentiometer input.
float readPotPitch()
This function returns the frequency value in Hz for the pitch potentiometer input.
float readPitch()
This function returns the summed frequency value in Hz for the pitch potentiometer and CV inputs.
void setPitchCVSource(int cvElement)
Set which CV input source will track 1 V/ Oct.
void setPitchPotSource(int potentiometerElement)
Set which potentiometer input source will track pitch input.
void setLED(int led, bool state)
Set given LED to a state.
void setTrigLED(int value)
Set trigger LED to a specific value.
bool readButton(int button)
Return the state of a given button.
bool readTrigger()
Return the state of the trigger input.
int getMode(int mode)
Get current value of the given mode.
void setMode(int mode, int value)
Set the value of the given mode. Values from 0 to 2 are valid.
void setAutoModeSwitch(bool enable)
Set the automatic mode switching function. Every time the mode button is pressed the LEDs and appropriate callbacks will be updated.
void setModeCallback(int mode, void (*)(int))
Set callback function for the given mode. Function pointer must be of form void (int mode)
.
void setButtonCallback(int button, void (*)())
Set callback function for the given button.
void setTriggerCallback(void (*)())
Set callback function for the trigger input.