My Project
Loading...
Searching...
No Matches
midi_driver.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
20#ifndef __MIDI_H
21#define __MIDI_H
22#include "stm32f3xx_hal.h"
23#include <vector>
24
25class midi
26{
27public:
29 typedef struct midi_struct{
30 uint32_t channel;
33
35 typedef struct midi_messages{
36 uint8_t note_on;
37 uint8_t note_off;
38 uint8_t midi_cc;
39 }midi_messages;
40
42 std::vector<uint8_t> msg_buf;
43
44 void note_on(uint32_t note);
45 void note_off(uint32_t note);
46 void cc_msg(uint32_t cc_num, uint32_t value);
47 void send_midi();
48
49 // Instantiation of midi_struct for constructor to modifyb
51 // Class constructor
52 midi(uint32_t channel,UART_HandleTypeDef* uart_ptr) : midi_struct{channel,uart_ptr}{
53 }
54
55};
56
57#endif __MIDI_H
Definition: midi_driver.h:26
midi(uint32_t channel, UART_HandleTypeDef *uart_ptr)
Definition: midi_driver.h:52
void note_off(uint32_t note)
Create and buffer a MIDI note on message.
Definition: midi_driver.cpp:75
std::vector< uint8_t > msg_buf
Buffer that holds all of the messages to be sent.
Definition: midi_driver.h:42
void send_midi()
Create and buffer a MIDI CC message.
Definition: midi_driver.cpp:110
struct midi::midi_struct midi_t
Struct that contains information relating to this particular instance of midi.
void note_on(uint32_t note)
Create and buffer a MIDI note on message.
Definition: midi_driver.cpp:54
void cc_msg(uint32_t cc_num, uint32_t value)
Create and buffer a MIDI CC message.
Definition: midi_driver.cpp:98
This file contains all the functions prototypes for the HAL module driver.
UART handle Structure definition.
Definition: stm32f3xx_hal_uart.h:212
Struct that holds useful messgae template information.
Definition: midi_driver.h:35
uint8_t note_off
Definition: midi_driver.h:37
uint8_t note_on
Definition: midi_driver.h:36
uint8_t midi_cc
Definition: midi_driver.h:38
Struct that contains information relating to this particular instance of midi.
Definition: midi_driver.h:29
uint32_t channel
Definition: midi_driver.h:30
UART_HandleTypeDef * uartptr
Definition: midi_driver.h:31