Niklas Läsche / Mbed 2 deprecated SLEEK_Reciever

Dependencies:   BLE_API BufferedSerial mbed nRF51822

Fork of MIDI-to-BLE-MIDI-bridge by Samuele Cornell

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers config.h Source File

config.h

00001 /*
00002  *  Copyright (c) 2016 Samuele Cornell  
00003  *
00004  *  Permission is hereby granted, free of charge, to any person obtaining a copy
00005  *  of this software and associated documentation files (the "Software"), to deal
00006  *  in the Software without restriction, including without limitation the rights
00007  *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00008  *  copies of the Software, and to permit persons to whom the Software is
00009  *  furnished to do so, subject to the following conditions:
00010  *
00011  *  The above copyright notice and this permission notice shall be included in all
00012  *  copies or substantial portions of the Software.
00013  *
00014  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00017  *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018  *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00019  *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00020  *  SOFTWARE.
00021  *
00022  */
00023 
00024 #define UART_RX_PIN D0 // RX  UART Pin  
00025 
00026 #define UART_TX_PIN D1 // TX UART Pin 
00027 
00028 // i have used DFRobot MIDI Shield but there are other commercially available similar products, also it is possible to interface directly a MIDI cable via an optocoupler (several projects are already available online ) 
00029 
00030 #define LIGHT_SHOW 1 // 0 if visual feedback isn't needed  (saves energy )
00031 
00032 #define TX_LED D6 // the state of this led will change whenever a message is to be sent over ble-midi
00033 
00034 #define RX_LED D7 // the state of this led will change whenever a message received over ble-midi
00035 
00036 
00037 /*******************************************************************************************************
00038 PERFORMANCE TWEAKS
00039 *******************************************************************************************************/
00040 
00041 
00042 #define BUFSERIAL_LENGHT 256 // define the software circular buffer lenght used for the UART. 
00043 
00044 
00045 #define ONLY_MIDI_to_BLEMIDI 0 // if only unidirectional MIDI to BLE-MIDI is desired set this to 1  
00046 
00047 
00048 #define ONLY_BLEMIDI_to_MIDI 0 // if only unidirectional BLE-MIDI to MIDI is desired set this to 1 
00049 
00050 // unidirectional operation allows to save energy. It also leads to better performance as if ONLY MIDI to BLE MIDI is required, for example it is  possible to shorten the SENDBLE_INTERVAL
00051 // without reliability issues (to a certain extent).   
00052 
00053 #define SENDBLEMIDI_INTERVAL 0.01 // this defines how frequently MIDI Events from the UART are polled, parsed and then sent via BLE-MIDI. 
00054                                  // a lower value means less latency but it also increase energy comsuption and if is set too low can cause reliability issues in MIDI to BLE-MIDI operation (especially for long SysEx messages).  
00055 
00056 
00057 /***************************************************************************************************************
00058 CONNECTION PARAMETERS 
00059 ***************************************************************************************************************/
00060 
00061 namespace Config { 
00062 
00063 // 
00064 const int minConnectionInterval = 6; // (1.25 ms units)  
00065 const int maxConnectionInterval = 15; // (1.25 ms units)
00066 const int slaveLatency          = 0;
00067 const int supervisionTimeout    = 500; // (10 ms units)
00068 
00069 
00070 
00071 }