Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Olimex STM32-H103 USB MIDI example #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions examples/stm32/f1/stm32-h103/usb_midi/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
##
## This file is part of the libopencm3 project.
##
## Copyright (C) 2009 Uwe Hermann <[email protected]>
##
## This library is free software: you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public License
## along with this library. If not, see <http://www.gnu.org/licenses/>.
##

BINARY = usbmidi

LDSCRIPT = ../stm32-h103.ld

include ../../Makefile.include

47 changes: 47 additions & 0 deletions examples/stm32/f1/stm32-h103/usb_midi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# README

This example implements a USB MIDI device to demonstrate the use of the
USB device stack. It implements the device configuration found in Appendix
B of the Universal Serial Bus Device Class Definition for MIDI Devices.

The 'USER' button sends note on/note off messages.

The board will also react to identity request (or any other data sent to
the board) by transmitting an identity message in reply.

## Board connections

| Port | Function | Description |
| ----- | -------------- | ----------------------------------------- |
| `CN5` | `(USB_OTG_FS)` | USB acting as device, connect to computer |

## Testing

To list midi devices, which should include this demo device

$ amidi -l
Dir Device Name
IO hw:2,0,0 MIDI demo MIDI 1
$

To record events, while pushing the user button

$ amidi -d -p hw:2,0,0

90 3C 40 -- key down
80 3C 40 -- key up
90 3C 40
80 3C 40^C
12 bytes read
$

To query the system identity, note this dump matches sysex\_identity[] in the
source.

$ amidi -d -p hw:2,0,0 -s Sysexdump.syx

F0 7E 00 7D 66 66 51 19 00 00 01 00 F7
^C
13 bytes read
$

Loading