Subversion Repositories svn.mios32

Rev

Rev 2455 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1313 tk 1
// $Id: mios32_config.h 2636 2019-01-06 17:15:03Z 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
 
13
 
14
// The boot message which is print during startup and returned on a SysEx query
15
#define MIOS32_LCD_BOOT_MSG_DELAY 0 // we delay the boot and print a message inside the app
16
//                                <---------------------->
2455 tk 17
#define MIOS32_LCD_BOOT_MSG_LINE1 "MIDIbox SEQ V4L.092"
2636 tk 18
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2019 T. Klose"
1313 tk 19
 
20
// USB settings
1345 tk 21
#define MIOS32_USB_PRODUCT_STR  "MIDIbox SEQ V4L"
1655 tk 22
#define MIOS32_USB_MIDI_NUM_PORTS 4
1313 tk 23
 
24
 
25
// disable LCD (BLM_CHEAPO is connected to J15)
26
//#define MIOS32_DONT_USE_LCD 1
27
// not done yet, could be useful for MBSEQ V4 HW variant
28
 
29
// port used for debugging via MIDI
30
//#define MIOS32_MIDI_DEBUG_PORT USB0
31
 
32
// function used to output debug messages (must be printf compatible!)
1868 tk 33
extern void APP_SendDebugMessage(char *format, ...);
34
#define DEBUG_MSG APP_SendDebugMessage
1313 tk 35
 
36
 
37
// Stack size for FreeRTOS tasks as defined by the programming model
38
// Note that each task maintains it's own stack!
39
// If you want to define a different stack size for your application tasks
40
 
2433 tk 41
// memory allocated for tasks (observe this with avstack.pl and "memory" terminal command!)
42
// add +64 for interrupts
2444 tk 43
#define MIOS32_TASK_HOOKS_STACK_SIZE       1000
2433 tk 44
#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)
45
#define UIP_TASK_STACK_SIZE                 512
46
#define MIDI_TASK_STACK_SIZE               1400
47
#define PERIOD1MS_TASK_STACK_SIZE          1400
48
#define PERIOD1MS_LOWPRIO_TASK_STACK_SIZE  1400
49
 
50
// only used by idle task
51
#define MIOS32_MINIMAL_STACK_SIZE           384
52
 
53
 
54
// P.S.: in order to check if the stack size is sufficient, store a preset pattern in Event->Presets page
55
// Sequencer could crash with hardfault on a buffer overrun
56
 
1313 tk 57
// reserved memory for FreeRTOS pvPortMalloc function
2433 tk 58
#define MIOS32_HEAP_SIZE 13*1024
1313 tk 59
 
60
// for LPC17: simplify alloction of large arrays
61
#if defined(MIOS32_FAMILY_LPC17xx)
62
# define AHB_SECTION __attribute__ ((section (".bss_ahb")))
63
#else
64
# define AHB_SECTION
65
#endif
66
 
67
 
1864 tk 68
// increased number of SRs (MBSEQ uses 16 SRs by default, but it's possible to increase the number in MBSEQ_HW.V4)
69
#define MIOS32_SRIO_NUM_SR 23
70
 
71
 
1313 tk 72
// optional performance measuring
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
1754 tk 74
#define configUSE_TRACE_FACILITY                0
1313 tk 75
#define configGENERATE_RUN_TIME_STATS           0
76
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS  FREERTOS_UTILS_PerfCounterInit
77
#define portGET_RUN_TIME_COUNTER_VALUE          FREERTOS_UTILS_PerfCounterGet
78
 
79
 
80
// maximum idle counter value to be expected
81
#define MAX_IDLE_CTR 223000
82
 
83
 
84
// memory alloccation method:
85
// 0: internal static allocation with one byte for each flag
86
// 1: internal static allocation with 8bit flags
87
// 2: internal static allocation with 16bit flags
88
// 3: internal static allocation with 32bit flags
89
// 4: FreeRTOS based pvPortMalloc
90
// 5: malloc provided by library
91
#define SEQ_MIDI_OUT_MALLOC_METHOD 3
92
 
93
// max number of scheduled events which will allocate memory
94
// each event allocates 12 bytes
95
// MAX_EVENTS must be a power of two! (e.g. 64, 128, 256, 512, ...)
96
#define SEQ_MIDI_OUT_MAX_EVENTS 256
97
 
98
// enable seq_midi_out_max_allocated and seq_midi_out_dropouts
99
#define SEQ_MIDI_OUT_MALLOC_ANALYSIS 1
100
 
2206 tk 101
// support delays
102
#define SEQ_MIDI_OUT_SUPPORT_DELAY 1
1313 tk 103
 
2206 tk 104
 
1524 tk 105
// enable four UARTs
106
#define MIOS32_UART_NUM 4
1313 tk 107
 
108
 
109
// configure IIC_MIDI
110
#define MIOS32_IIC_MIDI_NUM 4
111
// all interfaces are "OUT only"
112
#define MIOS32_IIC_MIDI0_ENABLED    1
113
#define MIOS32_IIC_MIDI1_ENABLED    1
114
#define MIOS32_IIC_MIDI2_ENABLED    1
115
#define MIOS32_IIC_MIDI3_ENABLED    1
116
#define MIOS32_IIC_MIDI4_ENABLED    1
117
#define MIOS32_IIC_MIDI5_ENABLED    1
118
#define MIOS32_IIC_MIDI6_ENABLED    1
119
#define MIOS32_IIC_MIDI7_ENABLED    1
120
 
121
 
122
// configure BLM driver
123
#define BLM_DOUT_L1_SR  255 // dummy, will be changed in seq_file_hw.c
124
#define BLM_DOUT_R1_SR  255 // dummy, will be changed in seq_file_hw.c
125
#define BLM_DOUT_CATHODES_SR1   255 // dummy, will be changed in seq_file_hw.c
126
#define BLM_DOUT_CATHODES_SR2   255 // dummy, will be changed in seq_file_hw.c
127
#define BLM_CATHODES_INV_MASK   0x00
128
#define BLM_DOUT_L2_SR  255 // dummy, will be changed in seq_file_hw.c
129
#define BLM_DOUT_R2_SR  255 // dummy, will be changed in seq_file_hw.c
130
#define BLM_DOUT_L3_SR  0 // not used
131
#define BLM_DOUT_R3_SR  0 // not used
132
#define BLM_DIN_L_SR    255 // dummy, will be changed in seq_file_hw.c
133
#define BLM_DIN_R_SR    255 // dummy, will be changed in seq_file_hw.c
134
#define BLM_NUM_COLOURS 2
135
#define BLM_NUM_ROWS    8
136
#define BLM_DEBOUNCE_MODE 1
137
 
138
 
139
// configure BLM_X driver
140
#define BLM_X_NUM_ROWS            8
141
#define BLM_X_BTN_NUM_COLS        8
142
#define BLM_X_LED_NUM_COLS        8
143
#define BLM_X_LED_NUM_COLORS      1
144
#define BLM_X_ROWSEL_DOUT_SR      255 // dummy, will be changed in seq_file_hw.c
145
#define BLM_X_LED_FIRST_DOUT_SR   255 // dummy, will be changed in seq_file_hw.c
146
#define BLM_X_BTN_FIRST_DIN_SR    255 // dummy, will be changed in seq_file_hw.c
147
#define BLM_X_ROWSEL_INV_MASK     0   // dummy, will be changed in seq_file_hw.c
148
#define BLM_X_DEBOUNCE_MODE       1
149
 
150
 
151
// optional for Francois' 4 * 20x2 LCD configuration
152
// currently this option cannot be enabled in the MBSEQ_HW.V4 file - this will be possible later
153
#if 0
154
#define LCD_NUM_DEVICES          4
155
#define LCD_COLUMNS_PER_DEVICE  20
156
#define MIOS32_BOARD_LCD_E3_PORT GPIOB       // J15C.A10
157
#define MIOS32_BOARD_LCD_E3_PIN  GPIO_Pin_0
158
 
159
#define MIOS32_BOARD_LCD_E4_PORT GPIOB       // J15C.A11
160
#define MIOS32_BOARD_LCD_E4_PIN  GPIO_Pin_1
161
#endif
162
 
163
// LPC17 Ethernet driver: locate buffers to lower (default) section
164
// (no attribute passed to this variable)
165
#define LPC17XX_EMAC_MEM_SECTION
166
// reduce number of buffers to save memory
167
#define LPC17XX_EMAC_NUM_RX_FRAG 2
168
#define LPC17XX_EMAC_NUM_TX_FRAG 2
169
#define LPC17XX_EMAC_FRAG_SIZE   1024
170
 
171
 
172
// map MIDI mutex to UIP task
173
// located in tasks.c to access MIDI IN/OUT mutex from external
174
extern void TASKS_MUTEX_MIDIOUT_Take(void);
175
extern void TASKS_MUTEX_MIDIOUT_Give(void);
176
extern void TASKS_MUTEX_MIDIIN_Take(void);
177
extern void TASKS_MUTEX_MIDIIN_Give(void);
178
#define UIP_TASK_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
179
#define UIP_TASK_MUTEX_MIDIOUT_GIVE { TASKS_MUTEX_MIDIOUT_Give(); }
180
#define UIP_TASK_MUTEX_MIDIIN_TAKE  { TASKS_MUTEX_MIDIIN_Take(); }
181
#define UIP_TASK_MUTEX_MIDIIN_GIVE  { TASKS_MUTEX_MIDIIN_Give(); }
182
 
183
// Mutex for J16 access
184
extern void TASKS_J16SemaphoreTake(void);
185
extern void TASKS_J16SemaphoreGive(void);
186
#define MIOS32_SDCARD_MUTEX_TAKE   { TASKS_J16SemaphoreTake(); }
187
#define MIOS32_SDCARD_MUTEX_GIVE   { TASKS_J16SemaphoreGive(); }
188
#define MIOS32_ENC28J60_MUTEX_TAKE { TASKS_J16SemaphoreTake(); }
189
#define MIOS32_ENC28J60_MUTEX_GIVE { TASKS_J16SemaphoreGive(); }
190
 
191
#endif /* _MIOS32_CONFIG_H */