uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
Variables
config.c File Reference

Device configuration. More...

#include <stddef.h>
#include "lib/adc.h"
#include "lib/background_tasks.h"
#include "lib/gpio.h"
#include "lib/leds.h"
#include "lib/midi.h"
#include "lib/serial_communication.h"
#include "lib/usb.h"
#include "config.h"
#include "expression.h"
Include dependency graph for config.c:

Variables

struct adc_config adc_config
 
const struct adc_conversion_config expression_conversion
 
background_task_t high_frequency_tasks []
 
uint8_t high_frequency_tasks_size = sizeof(high_frequency_tasks)/sizeof(background_task_t)
 
background_task_t mid_frequency_tasks []
 
uint8_t mid_frequency_tasks_size = sizeof(mid_frequency_tasks)/sizeof(background_task_t)
 
background_task_t low_frequency_tasks []
 
uint8_t low_frequency_tasks_size = sizeof(low_frequency_tasks)/sizeof(background_task_t)
 
static const char cmd_string_cal [] = "cal"
 
static const char help_string_cal []
 
static const char cmd_string_echo [] = "echo"
 
static const char help_string_echo []
 
static const char cmd_string_mute [] = "mute"
 
static const char help_string_mute []
 
struct serial_command serial_commands []
 
uint8_t serial_commands_size = sizeof(serial_commands) / sizeof(struct serial_command)
 
struct gpio_mapping gpio_mappings []
 
uint8_t gpio_mappings_size = sizeof(gpio_mappings)/sizeof(struct gpio_mapping)
 
struct led power_led
 
struct led status_led
 
struct midi_config midi_config
 

Detailed Description

Device configuration.

Variable Documentation

◆ adc_config

Initial value:
= {
.prescaler = ADC_PRESCALER_DIV512_gc,
}
ADC conversion yields unsigned values.
Definition: adc.h:42

◆ cmd_string_cal

const char cmd_string_cal[] = "cal"
static

◆ cmd_string_echo

const char cmd_string_echo[] = "echo"
static

◆ cmd_string_mute

const char cmd_string_mute[] = "mute"
static

◆ expression_conversion

const struct adc_conversion_config expression_conversion
Initial value:
= {
.channel = ADC_CHANNEL_0,
.input = ADC_INPUT_4,
.callback_unsigned = &update_expression_value,
}
Use ADC input pin 4.
Definition: adc.h:64
ADC channel 0.
Definition: adc.h:51
void update_expression_value(uint16_t adc_value)
Updates the stored expression value.
Definition: expression.c:220

◆ gpio_mappings

struct gpio_mapping gpio_mappings[]
Initial value:
= {
{ .pin = &gpio.header1.pin6, .type = GPIO_INPUT },
{ .pin = & gpio.header3.pin5 , .type = GPIO_OUTPUT },
{ .pin = & gpio.header3.pin6 , .type = GPIO_OUTPUT },
{ .pin = & gpio.header3.pin7 , .type = GPIO_INPUT_PULLUP },
}
The GPIO pin acts as an output.
Definition: gpio.h:50
const struct gpio_pin pin7
Pin 7 in the pin header on the PCB.
Definition: gpio.h:80
The GPIO pin acts as an input and is pulled up.
Definition: gpio.h:49
const struct gpio_pin pin5
Pin 5 in the pin header on the PCB.
Definition: gpio.h:78
const struct gpio_header header1
Pin header GPIO1 on the PCB.
Definition: gpio.h:97
Configurations for all available GPIO pins.
Definition: gpio.h:95
const struct gpio_pin pin6
Pin 6 in the pin header on the PCB.
Definition: gpio.h:79
const struct gpio_header header3
Pin header GPIO3 on the PCB.
Definition: gpio.h:99
The GPIO pin acts as an input.
Definition: gpio.h:47

◆ gpio_mappings_size

uint8_t gpio_mappings_size = sizeof(gpio_mappings)/sizeof(struct gpio_mapping)

◆ help_string_cal

const char help_string_cal[]
static
Initial value:
= "<m>\n"
"Calibrate the pedal (in the following order):\n"
"<m> : \"adc\" calibrates the ADC offset\n"
" \"min\" sets the minimum registered ADC value\n"
" \"max\" sets the maximum registered ADC value\n"
" \"dmp\" dumps currently active values\n"
" \"sav\" saves active values to EEPROM\n"

◆ help_string_echo

const char help_string_echo[]
static
Initial value:
= "<v>\n"
"Switch expression value console output on / off\n"
"<v> : \"on\" or \"off\"\n"

◆ help_string_mute

const char help_string_mute[]
static
Initial value:
= "<v>\n"
"Mute CC message transmission when status LED is off.\n"
"Should only be enabled if there is an enable switch.\n"
"This setting is immediately stored to EEPROM.\n"
"<m> : \"on\" mute if not enabled\n"
" \"off\" always transmit\n"
" \"stat\" show current setting\n"

◆ high_frequency_tasks

background_task_t high_frequency_tasks[]
Initial value:
= {
}
void serial_communication_task(void)
Main task for USB communication.
Definition: serial_communication.c:477

◆ high_frequency_tasks_size

uint8_t high_frequency_tasks_size = sizeof(high_frequency_tasks)/sizeof(background_task_t)

◆ low_frequency_tasks

background_task_t low_frequency_tasks[]
Initial value:
= {
}
void update_leds(void)
State machine task that updates the LEDs.
Definition: leds.c:195
void handle_enable_switch(void)
A background task that handles the enable switch.
Definition: expression.c:167

◆ low_frequency_tasks_size

uint8_t low_frequency_tasks_size = sizeof(low_frequency_tasks)/sizeof(background_task_t)

◆ mid_frequency_tasks

background_task_t mid_frequency_tasks[]
Initial value:
= {
}
void usb_main_task(void)
Main background task for USB CDC operation.
Definition: usb.c:181
void trigger_expression_conversion(void)
Triggers an ADC conversion of the expression pedal input.
Definition: expression.c:215

◆ mid_frequency_tasks_size

uint8_t mid_frequency_tasks_size = sizeof(mid_frequency_tasks)/sizeof(background_task_t)

◆ midi_config

Initial value:
= {
.event_handlers = {
.control_change = NULL,
.note_off = NULL,
.note_on = NULL,
.program_change = NULL
},
.omni_mode = false,
.rx_channel = MIDI_CHANNEL_01,
.signal_rx = false,
.tx_channel = MIDI_CHANNEL_01,
}
MIDI channel 1.
Definition: midi.h:61

◆ power_led

struct led power_led
Initial value:
= {
.pin = & gpio.header3.pin5 ,
}
const struct gpio_pin pin5
Pin 5 in the pin header on the PCB.
Definition: gpio.h:78
Configurations for all available GPIO pins.
Definition: gpio.h:95
const struct gpio_header header3
Pin header GPIO3 on the PCB.
Definition: gpio.h:99

◆ serial_commands

struct serial_command serial_commands[]
Initial value:
= {
{ .cmd_string = cmd_string_cal, .help_string = help_string_cal, .handler = &exec_cal },
{ .cmd_string = cmd_string_echo, .help_string = help_string_echo, .handler = &exec_echo },
{ .cmd_string = cmd_string_mute, .help_string = help_string_mute, .handler = &exec_mute },
}
bool exec_mute(const char *command)
Handler for the serial command &#39;mute&#39;.
Definition: expression.c:140
static const char cmd_string_cal[]
Definition: config.c:72
bool exec_cal(const char *command)
Handler for the serial command &#39;cal&#39;.
Definition: expression.c:81
static const char help_string_mute[]
Definition: config.c:85
static const char cmd_string_mute[]
Definition: config.c:84
static const char help_string_echo[]
Definition: config.c:81
static const char cmd_string_echo[]
Definition: config.c:80
static const char help_string_cal[]
Definition: config.c:73
bool exec_echo(const char *command)
Handler for the serial command &#39;echo&#39;.
Definition: expression.c:122

◆ serial_commands_size

uint8_t serial_commands_size = sizeof(serial_commands) / sizeof(struct serial_command)

◆ status_led

struct led status_led
Initial value:
= {
.pin = & gpio.header3.pin6 ,
}
Configurations for all available GPIO pins.
Definition: gpio.h:95
const struct gpio_pin pin6
Pin 6 in the pin header on the PCB.
Definition: gpio.h:79
const struct gpio_header header3
Pin header GPIO3 on the PCB.
Definition: gpio.h:99