Subversion Repositories svn.mios32

Rev

Rev 2502 | Rev 2524 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
61 tk 1
// $Id: mios32_config.h 2509 2017-06-18 14:32:27Z tk $
2
/*
3
 * Local MIOS32 configuration file
4
 *
5
 * this file allows to disable (or re-configure) default functions of MIOS32
6
 * available switches are listed in $MIOS32_PATH/modules/mios32/MIOS32_CONFIG.txt
7
 *
8
 */
9
 
10
#ifndef _MIOS32_CONFIG_H
11
#define _MIOS32_CONFIG_H
12
 
229 tk 13
 
14
// The boot message which is print during startup and returned on a SysEx query
496 tk 15
#define MIOS32_LCD_BOOT_MSG_DELAY 0 // we delay the boot and print a message inside the app
728 tk 16
//                                <---------------------->
2502 tk 17
#define MIOS32_LCD_BOOT_MSG_LINE1 "MIDIbox SEQ V4.093"
2470 tk 18
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2017 T. Klose"
229 tk 19
 
287 tk 20
// USB settings
21
#define MIOS32_USB_PRODUCT_STR  "MIDIbox SEQ V4"
22
#define MIOS32_USB_MIDI_NUM_PORTS 4
229 tk 23
 
308 tk 24
// port used for debugging via MIDI
25
//#define MIOS32_MIDI_DEBUG_PORT USB0
61 tk 26
 
343 tk 27
// function used to output debug messages (must be printf compatible!)
1868 tk 28
extern void APP_SendDebugMessage(char *format, ...);
29
#define DEBUG_MSG APP_SendDebugMessage
343 tk 30
 
31
 
248 tk 32
// Stack size for FreeRTOS tasks as defined by the programming model
33
// Note that each task maintains it's own stack!
34
// If you want to define a different stack size for your application tasks
2432 tk 35
 
36
// memory allocated for tasks (observe this with avstack.pl and "memory" terminal command!)
37
// add +64 for interrupts
2444 tk 38
#define MIOS32_TASK_HOOKS_STACK_SIZE       1000
2432 tk 39
#define MIOS32_TASK_MIDI_HOOKS_STACK_SIZE  1200 // note: avstack.pl shows 500, but actually 1000 for TERMINAL_BrowserUploadCallback have to be considered as well. 1200 should be save (1000 for callback + memory consumed by the caller)
2509 tk 40
#define UIP_TASK_STACK_SIZE                1000
2432 tk 41
#define MIDI_TASK_STACK_SIZE               1400
42
#define PERIOD1MS_TASK_STACK_SIZE          1400
43
#define PERIOD1MS_LOWPRIO_TASK_STACK_SIZE  1400
44
 
45
// only used by idle task
46
#define MIOS32_MINIMAL_STACK_SIZE           384
47
 
48
 
1349 tk 49
// P.S.: in order to check if the stack size is sufficient, store a preset pattern in Event->Presets page
50
// Sequencer could crash with hardfault on a buffer overrun
134 tk 51
 
248 tk 52
// reserved memory for FreeRTOS pvPortMalloc function
2432 tk 53
#define MIOS32_HEAP_SIZE 13*1024
248 tk 54
 
2432 tk 55
 
1318 tk 56
// for LPC17: simplify allocation of large arrays
1234 tk 57
#if defined(MIOS32_FAMILY_LPC17xx)
58
# define AHB_SECTION __attribute__ ((section (".bss_ahb")))
59
#else
60
# define AHB_SECTION
61
#endif
248 tk 62
 
1234 tk 63
 
1864 tk 64
// increased number of SRs (MBSEQ uses 16 SRs by default, but it's possible to increase the number in MBSEQ_HW.V4)
65
#define MIOS32_SRIO_NUM_SR 23
66
 
1440 tk 67
// to save some RAM (only 128 bytes, but "Kleinvieh macht auch Mist" - especially for LPC17)
68
#define MIOS32_ENC_NUM_MAX 32
69
 
70
 
736 tk 71
// optional performance measuring
737 tk 72
// see documentation under http://www.midibox.org/mios32/manual/group___f_r_e_e_r_t_o_s___u_t_i_l_s.html
1744 tk 73
#define configUSE_TRACE_FACILITY                0
736 tk 74
#define configGENERATE_RUN_TIME_STATS           0
2425 tk 75
#if configGENERATE_RUN_TIME_STATS
736 tk 76
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS  FREERTOS_UTILS_PerfCounterInit
77
#define portGET_RUN_TIME_COUNTER_VALUE          FREERTOS_UTILS_PerfCounterGet
2425 tk 78
#endif
736 tk 79
 
80
 
702 tk 81
// maximum idle counter value to be expected
1531 tk 82
#if defined(MIOS32_FAMILY_LPC17xx)
2275 tk 83
#define MAX_IDLE_CTR 628000 // LPC1769@120 MHz
84
#elif defined(MIOS32_FAMILY_STM32F4xx)
85
#define MAX_IDLE_CTR 962000 // STM32F407VG@160 MHz
1531 tk 86
#else
2275 tk 87
#define MAX_IDLE_CTR 192000 // STM32F103RE@80 MHz
1531 tk 88
#endif
702 tk 89
 
2275 tk 90
// will bypass all tasks to measure minimum load
91
#define MEASURE_IDLE_CTR 0
702 tk 92
 
2275 tk 93
 
272 tk 94
// memory alloccation method:
95
// 0: internal static allocation with one byte for each flag
96
// 1: internal static allocation with 8bit flags
97
// 2: internal static allocation with 16bit flags
98
// 3: internal static allocation with 32bit flags
99
// 4: FreeRTOS based pvPortMalloc
100
// 5: malloc provided by library
101
#define SEQ_MIDI_OUT_MALLOC_METHOD 3
102
 
103
// max number of scheduled events which will allocate memory
104
// each event allocates 12 bytes
105
// MAX_EVENTS must be a power of two! (e.g. 64, 128, 256, 512, ...)
1116 tk 106
#define SEQ_MIDI_OUT_MAX_EVENTS 256
272 tk 107
 
108
// enable seq_midi_out_max_allocated and seq_midi_out_dropouts
109
#define SEQ_MIDI_OUT_MALLOC_ANALYSIS 1
110
 
2206 tk 111
// support delays
112
#define SEQ_MIDI_OUT_SUPPORT_DELAY 1
272 tk 113
 
2206 tk 114
 
1336 tk 115
#if defined(MIOS32_FAMILY_STM32F10x)
1071 tk 116
// enable third UART
1336 tk 117
# define MIOS32_UART_NUM 3
118
#else
119
// enable third and fourth UART
120
# define MIOS32_UART_NUM 4
121
#endif
178 tk 122
 
1071 tk 123
 
652 tk 124
// configure IIC_MIDI
125
#define MIOS32_IIC_MIDI_NUM 4
126
// all interfaces are "OUT only"
127
#define MIOS32_IIC_MIDI0_ENABLED    1
128
#define MIOS32_IIC_MIDI1_ENABLED    1
129
#define MIOS32_IIC_MIDI2_ENABLED    1
130
#define MIOS32_IIC_MIDI3_ENABLED    1
131
#define MIOS32_IIC_MIDI4_ENABLED    1
132
#define MIOS32_IIC_MIDI5_ENABLED    1
133
#define MIOS32_IIC_MIDI6_ENABLED    1
134
#define MIOS32_IIC_MIDI7_ENABLED    1
135
 
136
 
524 tk 137
// configure BLM driver
138
#define BLM_DOUT_L1_SR  255 // dummy, will be changed in seq_file_hw.c
139
#define BLM_DOUT_R1_SR  255 // dummy, will be changed in seq_file_hw.c
140
#define BLM_DOUT_CATHODES_SR1   255 // dummy, will be changed in seq_file_hw.c
141
#define BLM_DOUT_CATHODES_SR2   255 // dummy, will be changed in seq_file_hw.c
142
#define BLM_CATHODES_INV_MASK   0x00
143
#define BLM_DOUT_L2_SR  255 // dummy, will be changed in seq_file_hw.c
144
#define BLM_DOUT_R2_SR  255 // dummy, will be changed in seq_file_hw.c
145
#define BLM_DOUT_L3_SR  0 // not used
146
#define BLM_DOUT_R3_SR  0 // not used
147
#define BLM_DIN_L_SR    255 // dummy, will be changed in seq_file_hw.c
148
#define BLM_DIN_R_SR    255 // dummy, will be changed in seq_file_hw.c
149
#define BLM_NUM_COLOURS 2
150
#define BLM_NUM_ROWS    8
151
#define BLM_DEBOUNCE_MODE 1
152
 
153
 
464 tk 154
// configure BLM_X driver
155
#define BLM_X_NUM_ROWS            8
156
#define BLM_X_BTN_NUM_COLS        8
157
#define BLM_X_LED_NUM_COLS        8
158
#define BLM_X_LED_NUM_COLORS      1
513 tk 159
#define BLM_X_ROWSEL_DOUT_SR      255 // dummy, will be changed in seq_file_hw.c
160
#define BLM_X_LED_FIRST_DOUT_SR   255 // dummy, will be changed in seq_file_hw.c
161
#define BLM_X_BTN_FIRST_DIN_SR    255 // dummy, will be changed in seq_file_hw.c
162
#define BLM_X_ROWSEL_INV_MASK     0   // dummy, will be changed in seq_file_hw.c
1281 tk 163
#define BLM_X_DEBOUNCE_MODE       1
134 tk 164
 
821 tk 165
 
2461 tk 166
// WS2816 LEDs (only supported by STM32F4)
167
#if defined(MIOS32_FAMILY_STM32F4xx)
168
# define WS2812_NUM_LEDS 64
169
#else
170
# define WS2812_NUM_LEDS 0
171
#endif
172
 
173
 
2263 tk 174
// BLM_SCALAR master driver: enable this switch if the application supports OSC (based on osc_server module)
175
#define BLM_SCALAR_MASTER_OSC_SUPPORT 1
176
 
177
// map MIDI mutex to BLM_SCALAR master
178
// located in tasks.c to access MIDI IN/OUT mutex from external
179
extern void TASKS_MUTEX_MIDIOUT_Take(void);
180
extern void TASKS_MUTEX_MIDIOUT_Give(void);
181
#define BLM_SCALAR_MASTER_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
182
#define BLM_SCALAR_MASTER_MUTEX_MIDIOUT_GIVE       { TASKS_MUTEX_MIDIOUT_Give(); }
183
 
184
 
821 tk 185
// optional for Francois' 4 * 20x2 LCD configuration
186
// currently this option cannot be enabled in the MBSEQ_HW.V4 file - this will be possible later
187
#if 0
188
#define LCD_NUM_DEVICES          4
189
#define LCD_COLUMNS_PER_DEVICE  20
190
#define MIOS32_BOARD_LCD_E3_PORT GPIOB       // J15C.A10
191
#define MIOS32_BOARD_LCD_E3_PIN  GPIO_Pin_0
192
 
193
#define MIOS32_BOARD_LCD_E4_PORT GPIOB       // J15C.A11
194
#define MIOS32_BOARD_LCD_E4_PIN  GPIO_Pin_1
195
#endif
196
 
1241 tk 197
// LPC17 Ethernet driver: locate buffers to lower (default) section
198
// (no attribute passed to this variable)
199
#define LPC17XX_EMAC_MEM_SECTION
200
// reduce number of buffers to save memory
201
#define LPC17XX_EMAC_NUM_RX_FRAG 2
202
#define LPC17XX_EMAC_NUM_TX_FRAG 2
203
#define LPC17XX_EMAC_FRAG_SIZE   1024
1049 tk 204
 
205
 
1311 tk 206
// map MIDI mutex to UIP task
207
// located in tasks.c to access MIDI IN/OUT mutex from external
208
extern void TASKS_MUTEX_MIDIOUT_Take(void);
209
extern void TASKS_MUTEX_MIDIOUT_Give(void);
210
extern void TASKS_MUTEX_MIDIIN_Take(void);
211
extern void TASKS_MUTEX_MIDIIN_Give(void);
212
#define UIP_TASK_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
213
#define UIP_TASK_MUTEX_MIDIOUT_GIVE { TASKS_MUTEX_MIDIOUT_Give(); }
214
#define UIP_TASK_MUTEX_MIDIIN_TAKE  { TASKS_MUTEX_MIDIIN_Take(); }
215
#define UIP_TASK_MUTEX_MIDIIN_GIVE  { TASKS_MUTEX_MIDIIN_Give(); }
216
 
1049 tk 217
// Mutex for J16 access
218
extern void TASKS_J16SemaphoreTake(void);
219
extern void TASKS_J16SemaphoreGive(void);
220
#define MIOS32_SDCARD_MUTEX_TAKE   { TASKS_J16SemaphoreTake(); }
221
#define MIOS32_SDCARD_MUTEX_GIVE   { TASKS_J16SemaphoreGive(); }
222
#define MIOS32_ENC28J60_MUTEX_TAKE { TASKS_J16SemaphoreTake(); }
223
#define MIOS32_ENC28J60_MUTEX_GIVE { TASKS_J16SemaphoreGive(); }
224
 
61 tk 225
#endif /* _MIOS32_CONFIG_H */