MIOS32_USB_MIDI


Defines

#define RX_BUFFER_MAX_ANALYSIS   0
#define EP2IDX(bEP)   ((((bEP)&0xF)<<1)|(((bEP)&0x80)>>7))
#define IDX2EP(idx)   ((((idx)<<7)&0x80)|(((idx)>>1)&0xF))

Functions

s32 MIOS32_USB_MIDI_Init (u32 mode)
s32 MIOS32_USB_MIDI_ChangeConnectionState (u8 connected)
s32 MIOS32_USB_MIDI_CheckAvailable (u8 cable)
s32 MIOS32_USB_MIDI_PackageSend_NonBlocking (mios32_midi_package_t package)
s32 MIOS32_USB_MIDI_PackageSend (mios32_midi_package_t package)
s32 MIOS32_USB_MIDI_PackageReceive (mios32_midi_package_t *package)
s32 MIOS32_USB_MIDI_Periodic_mS (void)
void MIOS32_USB_MIDI_EP1_IN_Callback (u8 bEP, u8 bEPStatus)
void MIOS32_USB_MIDI_EP1_OUT_Callback (u8 bEP, u8 bEPStatus)

Detailed Description

USB MIDI layer for MIOS32

Define Documentation

#define EP2IDX ( bEP   )     ((((bEP)&0xF)<<1)|(((bEP)&0x80)>>7))

convert from endpoint address to endpoint index

#define IDX2EP ( idx   )     ((((idx)<<7)&0x80)|(((idx)>>1)&0xF))

convert from endpoint index to endpoint address

#define RX_BUFFER_MAX_ANALYSIS   0


Function Documentation

s32 MIOS32_USB_MIDI_ChangeConnectionState ( u8  connected  ) 

This function is called by the USB driver on cable connection/disconnection

Parameters:
[in] connected status (1 if connected)
Returns:
< 0 on errors
Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

s32 MIOS32_USB_MIDI_CheckAvailable ( u8  cable  ) 

This function returns the connection status of the USB MIDI interface

Parameters:
[in] cable number
Returns:
1: interface available

0: interface not available

Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

void MIOS32_USB_MIDI_EP1_IN_Callback ( u8  bEP,
u8  bEPStatus 
)

Called by USB driver to check for IN streams

Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

void MIOS32_USB_MIDI_EP1_OUT_Callback ( u8  bEP,
u8  bEPStatus 
)

Called by USB driver to check for OUT streams

Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

s32 MIOS32_USB_MIDI_Init ( u32  mode  ) 

Initializes USB MIDI layer

Parameters:
[in] mode currently only mode 0 supported
Returns:
< 0 if initialisation failed
Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

s32 MIOS32_USB_MIDI_PackageReceive ( mios32_midi_package_t package  ) 

This function checks for a new package

Parameters:
[out] package pointer to MIDI package (received package will be put into the given variable)
Returns:
-1 if no package in buffer

>= 0: number of packages which are still in the buffer

Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

s32 MIOS32_USB_MIDI_PackageSend ( mios32_midi_package_t  package  ) 

This function puts a new MIDI package into the Tx buffer (blocking function)

Parameters:
[in] package MIDI package
Returns:
0: no error

-1: USB not connected

Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

s32 MIOS32_USB_MIDI_PackageSend_NonBlocking ( mios32_midi_package_t  package  ) 

This function puts a new MIDI package into the Tx buffer

Parameters:
[in] package MIDI package
Returns:
0: no error

-1: USB not connected

-2: buffer is full caller should retry until buffer is free again

Note:
Applications shouldn't call this function directly, instead please use MIOS32_MIDI layer functions

s32 MIOS32_USB_MIDI_Periodic_mS ( void   ) 

This function should be called periodically each mS to handle timeout and expire counters.

For USB MIDI it also checks for incoming/outgoing USB packages!

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!

Returns:
< 0 on errors


Generated on Tue May 1 19:42:14 2012 for MIOS32 by  doxygen 1.4.7