Subversion Repositories svn.mios32

Rev

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

Rev Author Line No. Line
2415 pcbatterij 1
// $Id: mios32_config.h 2216 2015-10-04 16:17:44Z tk $
1857 pcbatterij 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
//                                <---------------------->
2415 pcbatterij 17
#define MIOS32_LCD_BOOT_MSG_LINE1 "MIDIbox SEQ V4.090"
18
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2015 T. Klose"
1857 pcbatterij 19
 
20
// USB settings
21
#define MIOS32_USB_PRODUCT_STR  "MIDIbox SEQ V4"
22
#define MIOS32_USB_MIDI_NUM_PORTS 4
23
 
24
// port used for debugging via MIDI
25
//#define MIOS32_MIDI_DEBUG_PORT USB0
26
 
27
// function used to output debug messages (must be printf compatible!)
2415 pcbatterij 28
extern void APP_SendDebugMessage(char *format, ...);
29
#define DEBUG_MSG APP_SendDebugMessage
1857 pcbatterij 30
 
31
 
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);
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
43
 
44
// reserved memory for FreeRTOS pvPortMalloc function
45
#define MIOS32_HEAP_SIZE 14*1024
46
 
47
// for LPC17: simplify allocation of large arrays
48
#if defined(MIOS32_FAMILY_LPC17xx)
49
# define AHB_SECTION __attribute__ ((section (".bss_ahb")))
50
#else
51
# define AHB_SECTION
52
#endif
53
 
54
 
2415 pcbatterij 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
1857 pcbatterij 57
// to save some RAM (only 128 bytes, but "Kleinvieh macht auch Mist" - especially for LPC17)
58
#define MIOS32_ENC_NUM_MAX 18 //WAS 32
59
 
60
// the default MIDI port for MIDI output
61
#define MIOS32_MIDI_DEFAULT_PORT UART0
62
 
63
// optional performance measuring
64
// see documentation under http://www.midibox.org/mios32/manual/group___f_r_e_e_r_t_o_s___u_t_i_l_s.html
65
#define configUSE_TRACE_FACILITY                0
66
#define configGENERATE_RUN_TIME_STATS           0
2425 tk 67
#if configGENERATE_RUN_TIME_STATS
1857 pcbatterij 68
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS  FREERTOS_UTILS_PerfCounterInit
69
#define portGET_RUN_TIME_COUNTER_VALUE          FREERTOS_UTILS_PerfCounterGet
2425 tk 70
#endif
1857 pcbatterij 71
 
72
 
73
// maximum idle counter value to be expected
74
#if defined(MIOS32_FAMILY_LPC17xx)
75
#define MAX_IDLE_CTR 908500 // LPC1769@120 MHz
76
#else
77
#define MAX_IDLE_CTR 228000 // STM32F103RE@80 MHz
78
#endif
79
 
80
 
81
// memory alloccation method:
82
// 0: internal static allocation with one byte for each flag
83
// 1: internal static allocation with 8bit flags
84
// 2: internal static allocation with 16bit flags
85
// 3: internal static allocation with 32bit flags
86
// 4: FreeRTOS based pvPortMalloc
87
// 5: malloc provided by library
88
#define SEQ_MIDI_OUT_MALLOC_METHOD 3
89
 
90
// max number of scheduled events which will allocate memory
91
// each event allocates 12 bytes
92
// MAX_EVENTS must be a power of two! (e.g. 64, 128, 256, 512, ...)
93
#define SEQ_MIDI_OUT_MAX_EVENTS 256
94
 
95
// enable seq_midi_out_max_allocated and seq_midi_out_dropouts
96
#define SEQ_MIDI_OUT_MALLOC_ANALYSIS 1
97
 
2415 pcbatterij 98
// support delays
99
#define SEQ_MIDI_OUT_SUPPORT_DELAY 1
1857 pcbatterij 100
 
2415 pcbatterij 101
 
1857 pcbatterij 102
#if defined(MIOS32_FAMILY_STM32F10x)
103
// enable third UART
104
# define MIOS32_UART_NUM 3
105
#else
106
// enable third and fourth UART
107
# define MIOS32_UART_NUM 4
108
#endif
109
 
110
 
111
// configure IIC_MIDI
112
#define MIOS32_IIC_MIDI_NUM 4
113
// all interfaces are "OUT only"
114
#define MIOS32_IIC_MIDI0_ENABLED    1
115
#define MIOS32_IIC_MIDI1_ENABLED    1
116
#define MIOS32_IIC_MIDI2_ENABLED    1
117
#define MIOS32_IIC_MIDI3_ENABLED    1
118
#define MIOS32_IIC_MIDI4_ENABLED    1
119
#define MIOS32_IIC_MIDI5_ENABLED    1
120
#define MIOS32_IIC_MIDI6_ENABLED    1
121
#define MIOS32_IIC_MIDI7_ENABLED    1
122
 
123
 
124
// configure BLM driver
125
#define BLM_DOUT_L1_SR  255 // dummy, will be changed in seq_file_hw.c
126
#define BLM_DOUT_R1_SR  255 // dummy, will be changed in seq_file_hw.c
127
#define BLM_DOUT_CATHODES_SR1   255 // dummy, will be changed in seq_file_hw.c
128
#define BLM_DOUT_CATHODES_SR2   255 // dummy, will be changed in seq_file_hw.c
129
#define BLM_CATHODES_INV_MASK   0x00
130
#define BLM_DOUT_L2_SR  255 // dummy, will be changed in seq_file_hw.c
131
#define BLM_DOUT_R2_SR  255 // dummy, will be changed in seq_file_hw.c
132
#define BLM_DOUT_L3_SR  0 // not used
133
#define BLM_DOUT_R3_SR  0 // not used
134
#define BLM_DIN_L_SR    255 // dummy, will be changed in seq_file_hw.c
135
#define BLM_DIN_R_SR    255 // dummy, will be changed in seq_file_hw.c
136
#define BLM_NUM_COLOURS 2
137
#define BLM_NUM_ROWS    8
138
#define BLM_DEBOUNCE_MODE 1
139
 
140
 
141
// configure BLM_X driver
142
#define BLM_X_NUM_ROWS            8
143
#define BLM_X_BTN_NUM_COLS        8
144
#define BLM_X_LED_NUM_COLS        8
145
#define BLM_X_LED_NUM_COLORS      1
146
#define BLM_X_ROWSEL_DOUT_SR      255 // dummy, will be changed in seq_file_hw.c
147
#define BLM_X_LED_FIRST_DOUT_SR   255 // dummy, will be changed in seq_file_hw.c
148
#define BLM_X_BTN_FIRST_DIN_SR    255 // dummy, will be changed in seq_file_hw.c
149
#define BLM_X_ROWSEL_INV_MASK     0   // dummy, will be changed in seq_file_hw.c
150
#define BLM_X_DEBOUNCE_MODE       1
151
 
152
 
153
// optional for Francois' 4 * 20x2 LCD configuration
154
// currently this option cannot be enabled in the MBSEQ_HW.V4 file - this will be possible later
155
#if 0
156
#define LCD_NUM_DEVICES          1
157
#define LCD_COLUMNS_PER_DEVICE  20
158
#define MIOS32_BOARD_LCD_E3_PORT GPIOB       // J15C.A10
159
#define MIOS32_BOARD_LCD_E3_PIN  GPIO_Pin_0
160
 
161
#define MIOS32_BOARD_LCD_E4_PORT GPIOB       // J15C.A11
162
#define MIOS32_BOARD_LCD_E4_PIN  GPIO_Pin_1
163
#endif
164
 
165
// LPC17 Ethernet driver: locate buffers to lower (default) section
166
// (no attribute passed to this variable)
167
#define LPC17XX_EMAC_MEM_SECTION
168
// reduce number of buffers to save memory
169
#define LPC17XX_EMAC_NUM_RX_FRAG 2
170
#define LPC17XX_EMAC_NUM_TX_FRAG 2
171
#define LPC17XX_EMAC_FRAG_SIZE   1024
172
 
173
 
174
// map MIDI mutex to UIP task
175
// located in tasks.c to access MIDI IN/OUT mutex from external
176
extern void TASKS_MUTEX_MIDIOUT_Take(void);
177
extern void TASKS_MUTEX_MIDIOUT_Give(void);
178
extern void TASKS_MUTEX_MIDIIN_Take(void);
179
extern void TASKS_MUTEX_MIDIIN_Give(void);
180
#define UIP_TASK_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
181
#define UIP_TASK_MUTEX_MIDIOUT_GIVE { TASKS_MUTEX_MIDIOUT_Give(); }
182
#define UIP_TASK_MUTEX_MIDIIN_TAKE  { TASKS_MUTEX_MIDIIN_Take(); }
183
#define UIP_TASK_MUTEX_MIDIIN_GIVE  { TASKS_MUTEX_MIDIIN_Give(); }
184
 
185
// Mutex for J16 access
186
extern void TASKS_J16SemaphoreTake(void);
187
extern void TASKS_J16SemaphoreGive(void);
188
#define MIOS32_SDCARD_MUTEX_TAKE   { TASKS_J16SemaphoreTake(); }
189
#define MIOS32_SDCARD_MUTEX_GIVE   { TASKS_J16SemaphoreGive(); }
190
#define MIOS32_ENC28J60_MUTEX_TAKE { TASKS_J16SemaphoreTake(); }
191
#define MIOS32_ENC28J60_MUTEX_GIVE { TASKS_J16SemaphoreGive(); }
192
 
193
#endif /* _MIOS32_CONFIG_H */