Subversion Repositories svn.mios32

Rev

Rev 2425 | Rev 2435 | 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 2432 2016-11-03 16:49:39Z 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
//                                <---------------------->
2274 tk 17
#define MIOS32_LCD_BOOT_MSG_LINE1 "MIDIbox SEQ V4.091"
18
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2016 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
38
#define MIOS32_TASK_HOOKS_STACK_SIZE        256
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)
40
#define UIP_TASK_STACK_SIZE                 512
41
#define MIDI_TASK_STACK_SIZE               1400
42
#define PERIOD1MS_TASK_STACK_SIZE          1400
43
#define PERIOD1MS_LOWPRIO_TASK_STACK_SIZE  1400
44
#define PATTERN_TASK_STACK_SIZE             512
45
 
46
// only used by idle task
47
#define MIOS32_MINIMAL_STACK_SIZE           384
48
 
49
 
1349 tk 50
// P.S.: in order to check if the stack size is sufficient, store a preset pattern in Event->Presets page
51
// Sequencer could crash with hardfault on a buffer overrun
134 tk 52
 
248 tk 53
// reserved memory for FreeRTOS pvPortMalloc function
2432 tk 54
#define MIOS32_HEAP_SIZE 13*1024
248 tk 55
 
2432 tk 56
 
1318 tk 57
// for LPC17: simplify allocation of large arrays
1234 tk 58
#if defined(MIOS32_FAMILY_LPC17xx)
59
# define AHB_SECTION __attribute__ ((section (".bss_ahb")))
60
#else
61
# define AHB_SECTION
62
#endif
248 tk 63
 
1234 tk 64
 
1864 tk 65
// increased number of SRs (MBSEQ uses 16 SRs by default, but it's possible to increase the number in MBSEQ_HW.V4)
66
#define MIOS32_SRIO_NUM_SR 23
67
 
1440 tk 68
// to save some RAM (only 128 bytes, but "Kleinvieh macht auch Mist" - especially for LPC17)
69
#define MIOS32_ENC_NUM_MAX 32
70
 
71
 
736 tk 72
// optional performance measuring
737 tk 73
// 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 74
#define configUSE_TRACE_FACILITY                0
736 tk 75
#define configGENERATE_RUN_TIME_STATS           0
2425 tk 76
#if configGENERATE_RUN_TIME_STATS
736 tk 77
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS  FREERTOS_UTILS_PerfCounterInit
78
#define portGET_RUN_TIME_COUNTER_VALUE          FREERTOS_UTILS_PerfCounterGet
2425 tk 79
#endif
736 tk 80
 
81
 
702 tk 82
// maximum idle counter value to be expected
1531 tk 83
#if defined(MIOS32_FAMILY_LPC17xx)
2275 tk 84
#define MAX_IDLE_CTR 628000 // LPC1769@120 MHz
85
#elif defined(MIOS32_FAMILY_STM32F4xx)
86
#define MAX_IDLE_CTR 962000 // STM32F407VG@160 MHz
1531 tk 87
#else
2275 tk 88
#define MAX_IDLE_CTR 192000 // STM32F103RE@80 MHz
1531 tk 89
#endif
702 tk 90
 
2275 tk 91
// will bypass all tasks to measure minimum load
92
#define MEASURE_IDLE_CTR 0
702 tk 93
 
2275 tk 94
 
272 tk 95
// memory alloccation method:
96
// 0: internal static allocation with one byte for each flag
97
// 1: internal static allocation with 8bit flags
98
// 2: internal static allocation with 16bit flags
99
// 3: internal static allocation with 32bit flags
100
// 4: FreeRTOS based pvPortMalloc
101
// 5: malloc provided by library
102
#define SEQ_MIDI_OUT_MALLOC_METHOD 3
103
 
104
// max number of scheduled events which will allocate memory
105
// each event allocates 12 bytes
106
// MAX_EVENTS must be a power of two! (e.g. 64, 128, 256, 512, ...)
1116 tk 107
#define SEQ_MIDI_OUT_MAX_EVENTS 256
272 tk 108
 
109
// enable seq_midi_out_max_allocated and seq_midi_out_dropouts
110
#define SEQ_MIDI_OUT_MALLOC_ANALYSIS 1
111
 
2206 tk 112
// support delays
113
#define SEQ_MIDI_OUT_SUPPORT_DELAY 1
272 tk 114
 
2206 tk 115
 
1336 tk 116
#if defined(MIOS32_FAMILY_STM32F10x)
1071 tk 117
// enable third UART
1336 tk 118
# define MIOS32_UART_NUM 3
119
#else
120
// enable third and fourth UART
121
# define MIOS32_UART_NUM 4
122
#endif
178 tk 123
 
1071 tk 124
 
652 tk 125
// configure IIC_MIDI
126
#define MIOS32_IIC_MIDI_NUM 4
127
// all interfaces are "OUT only"
128
#define MIOS32_IIC_MIDI0_ENABLED    1
129
#define MIOS32_IIC_MIDI1_ENABLED    1
130
#define MIOS32_IIC_MIDI2_ENABLED    1
131
#define MIOS32_IIC_MIDI3_ENABLED    1
132
#define MIOS32_IIC_MIDI4_ENABLED    1
133
#define MIOS32_IIC_MIDI5_ENABLED    1
134
#define MIOS32_IIC_MIDI6_ENABLED    1
135
#define MIOS32_IIC_MIDI7_ENABLED    1
136
 
137
 
524 tk 138
// configure BLM driver
139
#define BLM_DOUT_L1_SR  255 // dummy, will be changed in seq_file_hw.c
140
#define BLM_DOUT_R1_SR  255 // dummy, will be changed in seq_file_hw.c
141
#define BLM_DOUT_CATHODES_SR1   255 // dummy, will be changed in seq_file_hw.c
142
#define BLM_DOUT_CATHODES_SR2   255 // dummy, will be changed in seq_file_hw.c
143
#define BLM_CATHODES_INV_MASK   0x00
144
#define BLM_DOUT_L2_SR  255 // dummy, will be changed in seq_file_hw.c
145
#define BLM_DOUT_R2_SR  255 // dummy, will be changed in seq_file_hw.c
146
#define BLM_DOUT_L3_SR  0 // not used
147
#define BLM_DOUT_R3_SR  0 // not used
148
#define BLM_DIN_L_SR    255 // dummy, will be changed in seq_file_hw.c
149
#define BLM_DIN_R_SR    255 // dummy, will be changed in seq_file_hw.c
150
#define BLM_NUM_COLOURS 2
151
#define BLM_NUM_ROWS    8
152
#define BLM_DEBOUNCE_MODE 1
153
 
154
 
464 tk 155
// configure BLM_X driver
156
#define BLM_X_NUM_ROWS            8
157
#define BLM_X_BTN_NUM_COLS        8
158
#define BLM_X_LED_NUM_COLS        8
159
#define BLM_X_LED_NUM_COLORS      1
513 tk 160
#define BLM_X_ROWSEL_DOUT_SR      255 // dummy, will be changed in seq_file_hw.c
161
#define BLM_X_LED_FIRST_DOUT_SR   255 // dummy, will be changed in seq_file_hw.c
162
#define BLM_X_BTN_FIRST_DIN_SR    255 // dummy, will be changed in seq_file_hw.c
163
#define BLM_X_ROWSEL_INV_MASK     0   // dummy, will be changed in seq_file_hw.c
1281 tk 164
#define BLM_X_DEBOUNCE_MODE       1
134 tk 165
 
821 tk 166
 
2263 tk 167
// BLM_SCALAR master driver: enable this switch if the application supports OSC (based on osc_server module)
168
#define BLM_SCALAR_MASTER_OSC_SUPPORT 1
169
 
170
// map MIDI mutex to BLM_SCALAR master
171
// located in tasks.c to access MIDI IN/OUT mutex from external
172
extern void TASKS_MUTEX_MIDIOUT_Take(void);
173
extern void TASKS_MUTEX_MIDIOUT_Give(void);
174
#define BLM_SCALAR_MASTER_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
175
#define BLM_SCALAR_MASTER_MUTEX_MIDIOUT_GIVE       { TASKS_MUTEX_MIDIOUT_Give(); }
176
 
177
 
821 tk 178
// optional for Francois' 4 * 20x2 LCD configuration
179
// currently this option cannot be enabled in the MBSEQ_HW.V4 file - this will be possible later
180
#if 0
181
#define LCD_NUM_DEVICES          4
182
#define LCD_COLUMNS_PER_DEVICE  20
183
#define MIOS32_BOARD_LCD_E3_PORT GPIOB       // J15C.A10
184
#define MIOS32_BOARD_LCD_E3_PIN  GPIO_Pin_0
185
 
186
#define MIOS32_BOARD_LCD_E4_PORT GPIOB       // J15C.A11
187
#define MIOS32_BOARD_LCD_E4_PIN  GPIO_Pin_1
188
#endif
189
 
1241 tk 190
// LPC17 Ethernet driver: locate buffers to lower (default) section
191
// (no attribute passed to this variable)
192
#define LPC17XX_EMAC_MEM_SECTION
193
// reduce number of buffers to save memory
194
#define LPC17XX_EMAC_NUM_RX_FRAG 2
195
#define LPC17XX_EMAC_NUM_TX_FRAG 2
196
#define LPC17XX_EMAC_FRAG_SIZE   1024
1049 tk 197
 
198
 
1311 tk 199
// map MIDI mutex to UIP task
200
// located in tasks.c to access MIDI IN/OUT mutex from external
201
extern void TASKS_MUTEX_MIDIOUT_Take(void);
202
extern void TASKS_MUTEX_MIDIOUT_Give(void);
203
extern void TASKS_MUTEX_MIDIIN_Take(void);
204
extern void TASKS_MUTEX_MIDIIN_Give(void);
205
#define UIP_TASK_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
206
#define UIP_TASK_MUTEX_MIDIOUT_GIVE { TASKS_MUTEX_MIDIOUT_Give(); }
207
#define UIP_TASK_MUTEX_MIDIIN_TAKE  { TASKS_MUTEX_MIDIIN_Take(); }
208
#define UIP_TASK_MUTEX_MIDIIN_GIVE  { TASKS_MUTEX_MIDIIN_Give(); }
209
 
1049 tk 210
// Mutex for J16 access
211
extern void TASKS_J16SemaphoreTake(void);
212
extern void TASKS_J16SemaphoreGive(void);
213
#define MIOS32_SDCARD_MUTEX_TAKE   { TASKS_J16SemaphoreTake(); }
214
#define MIOS32_SDCARD_MUTEX_GIVE   { TASKS_J16SemaphoreGive(); }
215
#define MIOS32_ENC28J60_MUTEX_TAKE { TASKS_J16SemaphoreTake(); }
216
#define MIOS32_ENC28J60_MUTEX_GIVE { TASKS_J16SemaphoreGive(); }
217
 
61 tk 218
#endif /* _MIOS32_CONFIG_H */