Data Structures | |
| struct | midi_rec_t |
Functions | |
| s32 | MIOS32_UART_MIDI_Init (u32 mode) |
| s32 | MIOS32_UART_MIDI_CheckAvailable (u8 uart_port) |
| s32 | MIOS32_UART_MIDI_RS_OptimisationSet (u8 uart_port, u8 enable) |
| s32 | MIOS32_UART_MIDI_RS_OptimisationGet (u8 uart_port) |
| s32 | MIOS32_UART_MIDI_RS_Reset (u8 uart_port) |
| s32 | MIOS32_UART_MIDI_Periodic_mS (void) |
| s32 | MIOS32_UART_MIDI_PackageSend_NonBlocking (u8 uart_port, mios32_midi_package_t package) |
| s32 | MIOS32_UART_MIDI_PackageSend (u8 uart_port, mios32_midi_package_t package) |
| s32 | MIOS32_UART_MIDI_PackageReceive (u8 uart_port, mios32_midi_package_t *package) |
Variables | |
| u8 | midi_rec_t::running_status |
| u8 | midi_rec_t::expected_bytes |
| u8 | midi_rec_t::wait_bytes |
| u8 | midi_rec_t::sysex_ctr |
| u16 | midi_rec_t::timeout_ctr |
Applications shouldn't call these functions directly, instead please use MIOS32_MIDI layer functions
This function can be used to determine, if a UART interface is available
| [in] | uart_port | UART number (0..2) |
0: interface not available
Initializes UART MIDI layer
| [in] | mode | currently only mode 0 supported |
| s32 MIOS32_UART_MIDI_PackageReceive | ( | u8 | uart_port, | |
| mios32_midi_package_t * | package | |||
| ) |
This function checks for a new package
| [in] | uart_port | UART_MIDI module number (0..2) |
| [out] | package | pointer to MIDI package (received package will be put into the given variable |
-1: no package in buffer
-10: incoming MIDI package timed out (incomplete package received)
| s32 MIOS32_UART_MIDI_PackageSend | ( | u8 | uart_port, | |
| mios32_midi_package_t | package | |||
| ) |
This function sends a new MIDI package to the selected UART_MIDI port (blocking function)
| [in] | uart_port | UART_MIDI module number (0..2) |
| [in] | package | MIDI package |
-1: UART_MIDI device not available
| s32 MIOS32_UART_MIDI_PackageSend_NonBlocking | ( | u8 | uart_port, | |
| mios32_midi_package_t | package | |||
| ) |
This function sends a new MIDI package to the selected UART_MIDI port
| [in] | uart_port | UART_MIDI module number (0..2) |
| [in] | package | MIDI package |
-1: UART_MIDI device not available
-2: UART_MIDI buffer is full caller should retry until buffer is free again
| s32 MIOS32_UART_MIDI_Periodic_mS | ( | void | ) |
This function should be called periodically each mS to handle timeout and expire counters.
Not for use in an application - this function is called from MIOS32_MIDI_Periodic_mS(), which is called by a task in the programming model!
This function returns the running status optimisation enable/disable flag for the given MIDI OUT port.
| [in] | uart_port | UART number (0..2) |
0 if optimisation disabled
1 if optimisation enabled
This function enables/disables running status optimisation for a given MIDI OUT port to improve bandwidth if MIDI events with the same status byte are sent back-to-back.
Note that the optimisation is enabled by default.
| [in] | uart_port | UART number (0..2) |
| [in] | enable | 0=optimisation disabled, 1=optimisation enabled |
0 on success
This function resets the current running status, so that it will be sent again with the next MIDI Out package.
| [in] | uart_port | UART number (0..2) |
< 0 on errors
u8 midi_rec_t::expected_bytes [inherited] |
u8 midi_rec_t::running_status [inherited] |
u8 midi_rec_t::sysex_ctr [inherited] |
u16 midi_rec_t::timeout_ctr [inherited] |
u8 midi_rec_t::wait_bytes [inherited] |
1.4.7