|
Mockbird
Interface Libarary and Synthesizer Setup Tool for Mockingbird-OTTO
|
MPU401-compatible ODIE communication port in UART mode. More...
#include <sndscape.h>
Public Member Functions | |
| MPU401Port (std::uint16_t base) | |
| Constructs a port. | |
| void | ensure_uart_mode () |
| Ensures the MPU401 port is set to operate in UART mode. | |
| void | out (std::uint8_t data) |
| Sends a MIDI (OUT) byte. | |
| bool | in_avail () |
| Polls whether a MIDI (IN) byte is available. | |
| std::uint8_t | in () |
| Reads a MIDI (IN) byte (blocking). | |
MPU401-compatible ODIE communication port in UART mode.
This class represents an ODIE communication port set to MPU401-compatible mode. This mode is typically used on the first port in DOS environments.
| Soundscape::MPU401Port::MPU401Port | ( | std::uint16_t | base | ) |
Constructs a port.
| base | I/O base address of the port. 0x330 for the primary port of a Soundscape in default config. |
| void Soundscape::MPU401Port::ensure_uart_mode | ( | ) |
Ensures the MPU401 port is set to operate in UART mode.
This mode is used for "dumb" MIDI communication without any processing by the MIDI Processing Unit, and the standard mode used in DOS environments.
This function should be called before the other methods, unless there is prior knowledge that the port already is in UART mode.
| HWMissingException | There obviously is no Sounscape port in MPU401 mode at the given address. |
| Timeout | Sending the reset or UART command took more than half a second. Likely the hardware is not present. |
| std::uint8_t Soundscape::MPU401Port::in | ( | ) |
Reads a MIDI (IN) byte (blocking).
| Timeout | No byte was received within half a second. |
| bool Soundscape::MPU401Port::in_avail | ( | ) |
Polls whether a MIDI (IN) byte is available.
| void Soundscape::MPU401Port::out | ( | std::uint8_t | data | ) |
Sends a MIDI (OUT) byte.
| data | MIDI byte to send. |
| Timeout | The output buffer was stuck full for half a second. |