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/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 "switcher.h"
Include dependency graph for config.c:

Variables

struct gpio_mapping gpio_mappings []
 
uint8_t gpio_mappings_size = sizeof(gpio_mappings)/sizeof(struct gpio_mapping)
 
struct led save_led
 
struct midi_config midi_config
 
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_backup [] = "backup"
 
static const char help_string_backup [] = "Backs up all programs, one bank per line"
 
static const char cmd_string_load [] = "load"
 
static const char help_string_load []
 
static const char cmd_string_relay [] = "rel"
 
static const char help_string_relay []
 
static const char cmd_string_restore [] = "restore"
 
static const char help_string_restore []
 
static const char cmd_string_save [] = "save"
 
static const char help_string_save [] = "Saves the current program configuration"
 
struct serial_command serial_commands []
 
uint8_t serial_commands_size = sizeof(serial_commands) / sizeof(struct serial_command)
 

Detailed Description

Device configuration.

Variable Documentation

◆ cmd_string_backup

const char cmd_string_backup[] = "backup"
static

◆ cmd_string_load

const char cmd_string_load[] = "load"
static

◆ cmd_string_relay

const char cmd_string_relay[] = "rel"
static

◆ cmd_string_restore

const char cmd_string_restore[] = "restore"
static

◆ cmd_string_save

const char cmd_string_save[] = "save"
static

◆ gpio_mappings

struct gpio_mapping gpio_mappings[]
Initial value:
= {
{ .pin = &gpio.header1.pin2, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin3, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin4, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin5, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin6, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin7, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin8, .type = GPIO_OUTPUT },
{ .pin = &gpio.header1.pin9, .type = GPIO_OUTPUT },
{ .pin = &gpio.header2.pin2, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin3, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin4, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin5, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin6, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin7, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin8, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header2.pin9, .type = GPIO_INPUT_PULLUP },
{ .pin = &gpio.header3.pin3, .type = GPIO_INPUT_PULLUP },
}
The GPIO pin acts as an output.
Definition: gpio.h:50
const struct gpio_header header2
Pin header GPIO2 on the PCB.
Definition: gpio.h:98
const struct gpio_pin pin8
Pin 8 in the pin header on the PCB.
Definition: gpio.h:81
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 pin2
Pin 2 in the pin header on the PCB.
Definition: gpio.h:75
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_pin pin9
Pin 9 in the pin header on the PCB.
Definition: gpio.h:82
const struct gpio_pin pin3
Pin 3 in the pin header on the PCB.
Definition: gpio.h:76
const struct gpio_header header3
Pin header GPIO3 on the PCB.
Definition: gpio.h:99
const struct gpio_pin pin4
Pin 4 in the pin header on the PCB.
Definition: gpio.h:77

◆ gpio_mappings_size

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

◆ help_string_backup

const char help_string_backup[] = "Backs up all programs, one bank per line"
static

◆ help_string_load

const char help_string_load[]
static
Initial value:
= "<n>\n"
"Loads the specified program:\n"
"<n> : program number"

◆ help_string_relay

const char help_string_relay[]
static
Initial value:
= "<r> <s>\n"
"Manipulates the switchers relays:\n"
"<r> : Relay to manipulate\n"
" 'tm' = Tune/Mute\n"
" 'l1' = Loop 1\n"
" 'l2' = Loop 2\n"
" 'l3' = Loop 3\n"
" 'l4' = Loop 4\n"
" 'l5' = Loop 5\n"
" 's1' = Switch 1\n"
" 's2' = Switch 2\n"
"<s> : Relay status\n"
" 'a' = activate relay\n"
" 'd' = deactivate relay"

◆ help_string_restore

const char help_string_restore[]
static
Initial value:
= "<n> <d>\n"
"Restores a bank given as a hex-string to EEPROM:\n"
"<n> : Number of the bank to restore,\n"
" padded with 0 if smaller than 10\n"
"<d> : Program bank data"

◆ help_string_save

const char help_string_save[] = "Saves the current program configuration"
static

◆ 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 poll_switches(void)
Definition: switcher.c:247
void update_leds(void)
State machine task that updates the LEDs.
Definition: leds.c:195

◆ 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

◆ mid_frequency_tasks_size

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

◆ midi_config

Initial value:
= {
.event_handlers = {
.program_change = handle_program_change,
.control_change = (void*) unknown_midi_message_handler,
.note_on = (void*) unknown_midi_message_handler,
.note_off = (void*) unknown_midi_message_handler,
},
.omni_mode = false,
.signal_rx = false,
}
void handle_program_change(uint8_t program)
Callback for unimplemented midi messages.
Definition: switcher.c:226
static enum midi_channel tx_channel
The MIDI transmit channel.
Definition: midi.c:53
static bool omni_mode
Omni mode state.
Definition: midi.c:45
static enum midi_channel rx_channel
The MIDI receive channel.
Definition: midi.c:49
void unknown_midi_message_handler(void)
Task for polling all switches and update current program.
Definition: switcher.c:241
static bool signal_rx
If set to true, the red on-board LED flashes on every received MIDI message.
Definition: midi.c:57
MIDI channel 1.
Definition: midi.h:61

◆ save_led

struct led save_led
Initial value:
= {
.pin = &gpio.header3.pin2,
}
const struct gpio_pin pin2
Pin 2 in the pin header on the PCB.
Definition: gpio.h:75
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_backup , .help_string = help_string_backup, .handler = &exec_backup },
{ .cmd_string = cmd_string_load, .help_string = help_string_load, .handler = &exec_load },
{ .cmd_string = cmd_string_relay, .help_string = help_string_relay, .handler = &exec_relay },
{ .cmd_string = cmd_string_restore, .help_string = help_string_restore, .handler = &exec_restore },
{ .cmd_string = cmd_string_save, .help_string = help_string_save, .handler = &exec_save },
}
static const char help_string_load[]
Definition: config.c:107
static const char help_string_backup[]
Definition: config.c:105
bool exec_backup(const char *command)
Handler for the backup command.
Definition: switcher.c:92
static const char cmd_string_load[]
Definition: config.c:106
bool exec_load(const char *command)
Handler for the load command.
Definition: switcher.c:106
static const char help_string_relay[]
Definition: config.c:111
static const char cmd_string_save[]
Definition: config.c:131
bool exec_save(const char *command)
Handler for the save command.
Definition: switcher.c:214
bool exec_restore(const char *command)
Handler for the restore command.
Definition: switcher.c:198
static const char cmd_string_restore[]
Definition: config.c:125
static const char cmd_string_relay[]
Definition: config.c:110
bool exec_relay(const char *command)
Handler for the relays command.
Definition: switcher.c:119
static const char cmd_string_backup[]
Definition: config.c:104
static const char help_string_restore[]
Definition: config.c:126
static const char help_string_save[]
Definition: config.c:132

◆ serial_commands_size

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