Subversion Repositories svn.mios32

Rev

Rev 1331 | Rev 1341 | 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 1336 2011-09-28 19:11:58Z 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
//                                <---------------------->
1336 tk 17
#define MIOS32_LCD_BOOT_MSG_LINE1 "MIDIbox SEQ V4.050"
1142 tk 18
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2011 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
 
24
 
308 tk 25
// port used for debugging via MIDI
26
//#define MIOS32_MIDI_DEBUG_PORT USB0
61 tk 27
 
343 tk 28
// function used to output debug messages (must be printf compatible!)
29
#define DEBUG_MSG MIOS32_MIDI_SendDebugMessage
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);
40
#define MIOS32_MINIMAL_STACK_SIZE 1024
134 tk 41
 
248 tk 42
// reserved memory for FreeRTOS pvPortMalloc function
1234 tk 43
#define MIOS32_HEAP_SIZE 14*1024
248 tk 44
 
1318 tk 45
// for LPC17: simplify allocation of large arrays
1234 tk 46
#if defined(MIOS32_FAMILY_LPC17xx)
47
# define AHB_SECTION __attribute__ ((section (".bss_ahb")))
48
#else
49
# define AHB_SECTION
50
#endif
248 tk 51
 
1234 tk 52
 
736 tk 53
// optional performance measuring
737 tk 54
// see documentation under http://www.midibox.org/mios32/manual/group___f_r_e_e_r_t_o_s___u_t_i_l_s.html
736 tk 55
#define configGENERATE_RUN_TIME_STATS           0
56
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS  FREERTOS_UTILS_PerfCounterInit
57
#define portGET_RUN_TIME_COUNTER_VALUE          FREERTOS_UTILS_PerfCounterGet
58
 
59
 
702 tk 60
// maximum idle counter value to be expected
61
#define MAX_IDLE_CTR 223000
62
 
63
 
272 tk 64
// memory alloccation method:
65
// 0: internal static allocation with one byte for each flag
66
// 1: internal static allocation with 8bit flags
67
// 2: internal static allocation with 16bit flags
68
// 3: internal static allocation with 32bit flags
69
// 4: FreeRTOS based pvPortMalloc
70
// 5: malloc provided by library
71
#define SEQ_MIDI_OUT_MALLOC_METHOD 3
72
 
73
// max number of scheduled events which will allocate memory
74
// each event allocates 12 bytes
75
// MAX_EVENTS must be a power of two! (e.g. 64, 128, 256, 512, ...)
1116 tk 76
#define SEQ_MIDI_OUT_MAX_EVENTS 256
272 tk 77
 
78
// enable seq_midi_out_max_allocated and seq_midi_out_dropouts
79
#define SEQ_MIDI_OUT_MALLOC_ANALYSIS 1
80
 
81
 
1336 tk 82
#if defined(MIOS32_FAMILY_STM32F10x)
1071 tk 83
// enable third UART
1336 tk 84
# define MIOS32_UART_NUM 3
85
#else
86
// enable third and fourth UART
87
# define MIOS32_UART_NUM 4
88
#endif
178 tk 89
 
1071 tk 90
 
652 tk 91
// configure IIC_MIDI
92
#define MIOS32_IIC_MIDI_NUM 4
93
// all interfaces are "OUT only"
94
#define MIOS32_IIC_MIDI0_ENABLED    1
95
#define MIOS32_IIC_MIDI1_ENABLED    1
96
#define MIOS32_IIC_MIDI2_ENABLED    1
97
#define MIOS32_IIC_MIDI3_ENABLED    1
98
#define MIOS32_IIC_MIDI4_ENABLED    1
99
#define MIOS32_IIC_MIDI5_ENABLED    1
100
#define MIOS32_IIC_MIDI6_ENABLED    1
101
#define MIOS32_IIC_MIDI7_ENABLED    1
102
 
103
 
524 tk 104
// configure BLM driver
105
#define BLM_DOUT_L1_SR  255 // dummy, will be changed in seq_file_hw.c
106
#define BLM_DOUT_R1_SR  255 // dummy, will be changed in seq_file_hw.c
107
#define BLM_DOUT_CATHODES_SR1   255 // dummy, will be changed in seq_file_hw.c
108
#define BLM_DOUT_CATHODES_SR2   255 // dummy, will be changed in seq_file_hw.c
109
#define BLM_CATHODES_INV_MASK   0x00
110
#define BLM_DOUT_L2_SR  255 // dummy, will be changed in seq_file_hw.c
111
#define BLM_DOUT_R2_SR  255 // dummy, will be changed in seq_file_hw.c
112
#define BLM_DOUT_L3_SR  0 // not used
113
#define BLM_DOUT_R3_SR  0 // not used
114
#define BLM_DIN_L_SR    255 // dummy, will be changed in seq_file_hw.c
115
#define BLM_DIN_R_SR    255 // dummy, will be changed in seq_file_hw.c
116
#define BLM_NUM_COLOURS 2
117
#define BLM_NUM_ROWS    8
118
#define BLM_DEBOUNCE_MODE 1
119
 
120
 
464 tk 121
// configure BLM_X driver
122
#define BLM_X_NUM_ROWS            8
123
#define BLM_X_BTN_NUM_COLS        8
124
#define BLM_X_LED_NUM_COLS        8
125
#define BLM_X_LED_NUM_COLORS      1
513 tk 126
#define BLM_X_ROWSEL_DOUT_SR      255 // dummy, will be changed in seq_file_hw.c
127
#define BLM_X_LED_FIRST_DOUT_SR   255 // dummy, will be changed in seq_file_hw.c
128
#define BLM_X_BTN_FIRST_DIN_SR    255 // dummy, will be changed in seq_file_hw.c
129
#define BLM_X_ROWSEL_INV_MASK     0   // dummy, will be changed in seq_file_hw.c
1281 tk 130
#define BLM_X_DEBOUNCE_MODE       1
134 tk 131
 
821 tk 132
 
133
// optional for Francois' 4 * 20x2 LCD configuration
134
// currently this option cannot be enabled in the MBSEQ_HW.V4 file - this will be possible later
135
#if 0
136
#define LCD_NUM_DEVICES          4
137
#define LCD_COLUMNS_PER_DEVICE  20
138
#define MIOS32_BOARD_LCD_E3_PORT GPIOB       // J15C.A10
139
#define MIOS32_BOARD_LCD_E3_PIN  GPIO_Pin_0
140
 
141
#define MIOS32_BOARD_LCD_E4_PORT GPIOB       // J15C.A11
142
#define MIOS32_BOARD_LCD_E4_PIN  GPIO_Pin_1
143
#endif
144
 
1241 tk 145
// LPC17 Ethernet driver: locate buffers to lower (default) section
146
// (no attribute passed to this variable)
147
#define LPC17XX_EMAC_MEM_SECTION
148
// reduce number of buffers to save memory
149
#define LPC17XX_EMAC_NUM_RX_FRAG 2
150
#define LPC17XX_EMAC_NUM_TX_FRAG 2
151
#define LPC17XX_EMAC_FRAG_SIZE   1024
1049 tk 152
 
153
 
1311 tk 154
// map MIDI mutex to UIP task
155
// located in tasks.c to access MIDI IN/OUT mutex from external
156
extern void TASKS_MUTEX_MIDIOUT_Take(void);
157
extern void TASKS_MUTEX_MIDIOUT_Give(void);
158
extern void TASKS_MUTEX_MIDIIN_Take(void);
159
extern void TASKS_MUTEX_MIDIIN_Give(void);
160
#define UIP_TASK_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
161
#define UIP_TASK_MUTEX_MIDIOUT_GIVE { TASKS_MUTEX_MIDIOUT_Give(); }
162
#define UIP_TASK_MUTEX_MIDIIN_TAKE  { TASKS_MUTEX_MIDIIN_Take(); }
163
#define UIP_TASK_MUTEX_MIDIIN_GIVE  { TASKS_MUTEX_MIDIIN_Give(); }
164
 
1049 tk 165
// Mutex for J16 access
166
extern void TASKS_J16SemaphoreTake(void);
167
extern void TASKS_J16SemaphoreGive(void);
168
#define MIOS32_SDCARD_MUTEX_TAKE   { TASKS_J16SemaphoreTake(); }
169
#define MIOS32_SDCARD_MUTEX_GIVE   { TASKS_J16SemaphoreGive(); }
170
#define MIOS32_ENC28J60_MUTEX_TAKE { TASKS_J16SemaphoreTake(); }
171
#define MIOS32_ENC28J60_MUTEX_GIVE { TASKS_J16SemaphoreGive(); }
172
 
61 tk 173
#endif /* _MIOS32_CONFIG_H */