Subversion Repositories svn.mios32

Rev

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