uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
|
API of the uMIDI-HMI module. More...
Go to the source code of this file.
Data Structures | |
struct | hmi_config |
Configuration structure for the HMI module. More... | |
Typedefs | |
typedef uint8_t | hmi_led_pattern_t |
A bitmask that specifies an LED pattern to display. More... | |
Enumerations | |
enum | hmi_led { HMI_LED1 = 1, HMI_LED2 = 3, HMI_LED3 = 5, HMI_LED4 = 7, HMI_LED5 = 6, HMI_LED6 = 4, HMI_LED7 = 2, HMI_LED8 = 0 } |
Enumeration for the available LEDs on the HMI board. More... | |
enum | hmi_bar_graph_percentage { HMI_BAR_000_PERCENT, HMI_BAR_013_PERCENT, HMI_BAR_025_PERCENT, HMI_BAR_038_PERCENT, HMI_BAR_050_PERCENT, HMI_BAR_063_PERCENT, HMI_BAR_075_PERCENT, HMI_BAR_088_PERCENT, HMI_BAR_100_PERCENT } |
Enumeration for possible percentages to display. More... | |
Functions | |
void | init_hmi_module (const struct hmi_config *config) |
Initializes the HMI module according to the provided configuration. More... | |
void | show_bar_graph (enum hmi_bar_graph_percentage percentage) |
Uses the HMI's LEDs to display a nice "bar graph". More... | |
void | show_led_pattern (hmi_led_pattern_t pattern) |
Displays the specified pattern on the HMI's LEDs. More... | |
void | set_hmi_led (enum hmi_led led, bool value) |
Turns a specific LED on or off. More... | |
void | poll_hmi (void) |
Polls the HMI inputs and executes registered callbacks if an event occurred. More... | |
API of the uMIDI-HMI module.
To use the uMIDI HMI, please follow these steps:
typedef uint8_t hmi_led_pattern_t |
A bitmask that specifies an LED pattern to display.
Counting from LSB to MSB: 1 → LED on; 0 → LED off
Enumeration for possible percentages to display.
enum hmi_led |
Enumeration for the available LEDs on the HMI board.
Provides a pin mapping to the GPIO header. The values can be used to get a pointer to a specific LED output pin "by name":
Enumerator | |
---|---|
HMI_LED1 | LED1. |
HMI_LED2 | LED2. |
HMI_LED3 | LED3. |
HMI_LED4 | LED4. |
HMI_LED5 | LED5. |
HMI_LED6 | LED6. |
HMI_LED7 | LED7. |
HMI_LED8 | LED8. |
void init_hmi_module | ( | const struct hmi_config * | config | ) |
Initializes the HMI module according to the provided configuration.
Registers event callbacks and configures GPIO ports used by the HMI module.
config | the HMI module configuration |
void poll_hmi | ( | void | ) |
Polls the HMI inputs and executes registered callbacks if an event occurred.
This procedure must be called in a slow background task to be able to process input events from the HMI board.
void set_hmi_led | ( | enum hmi_led | led, |
bool | value | ||
) |
Turns a specific LED on or off.
led | the LED to control |
value | true → LED on; false → LED off |
void show_bar_graph | ( | enum hmi_bar_graph_percentage | percentage | ) |
Uses the HMI's LEDs to display a nice "bar graph".
percentage | the percentage to display |
void show_led_pattern | ( | hmi_led_pattern_t | pattern | ) |
Displays the specified pattern on the HMI's LEDs.
pattern | the pattern to show |