Subversion Repositories svn.mios32

Rev

Rev 2206 | Rev 2433 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1313 tk 1
// $Id: mios32_config.h 2425 2016-11-03 00:44:22Z 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
//                                <---------------------->
2030 tk 17
#define MIOS32_LCD_BOOT_MSG_LINE1 "MIDIbox SEQ V4L.085"
1976 tk 18
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2014 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
// (-> xTaskCreate() function), keep in mind that it has to be divided by 4,
41
// since the stack width of ARM is 32bit.
42
// The FreeRTOS define "configMINIMAL_STACK_SIZE" is (MIOS32_MINIMAL_STACK_SIZE/4)
43
// it can be used in applications as well, e.g.
2425 tk 44
// xTaskCreate(TASK_Period1mS, "Period1mS", configMINIMAL_STACK_SIZE, NULL, PRIORITY_TASK_PERIOD1MS, NULL);
1391 tk 45
#define MIOS32_MINIMAL_STACK_SIZE 1100
1313 tk 46
 
47
// reserved memory for FreeRTOS pvPortMalloc function
48
#define MIOS32_HEAP_SIZE 14*1024
49
 
50
// for LPC17: simplify alloction of large arrays
51
#if defined(MIOS32_FAMILY_LPC17xx)
52
# define AHB_SECTION __attribute__ ((section (".bss_ahb")))
53
#else
54
# define AHB_SECTION
55
#endif
56
 
57
 
1864 tk 58
// increased number of SRs (MBSEQ uses 16 SRs by default, but it's possible to increase the number in MBSEQ_HW.V4)
59
#define MIOS32_SRIO_NUM_SR 23
60
 
61
 
1313 tk 62
// optional performance measuring
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
1754 tk 64
#define configUSE_TRACE_FACILITY                0
1313 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
 
70
// maximum idle counter value to be expected
71
#define MAX_IDLE_CTR 223000
72
 
73
 
74
// memory alloccation method:
75
// 0: internal static allocation with one byte for each flag
76
// 1: internal static allocation with 8bit flags
77
// 2: internal static allocation with 16bit flags
78
// 3: internal static allocation with 32bit flags
79
// 4: FreeRTOS based pvPortMalloc
80
// 5: malloc provided by library
81
#define SEQ_MIDI_OUT_MALLOC_METHOD 3
82
 
83
// max number of scheduled events which will allocate memory
84
// each event allocates 12 bytes
85
// MAX_EVENTS must be a power of two! (e.g. 64, 128, 256, 512, ...)
86
#define SEQ_MIDI_OUT_MAX_EVENTS 256
87
 
88
// enable seq_midi_out_max_allocated and seq_midi_out_dropouts
89
#define SEQ_MIDI_OUT_MALLOC_ANALYSIS 1
90
 
2206 tk 91
// support delays
92
#define SEQ_MIDI_OUT_SUPPORT_DELAY 1
1313 tk 93
 
2206 tk 94
 
1524 tk 95
// enable four UARTs
96
#define MIOS32_UART_NUM 4
1313 tk 97
 
98
 
99
// configure IIC_MIDI
100
#define MIOS32_IIC_MIDI_NUM 4
101
// all interfaces are "OUT only"
102
#define MIOS32_IIC_MIDI0_ENABLED    1
103
#define MIOS32_IIC_MIDI1_ENABLED    1
104
#define MIOS32_IIC_MIDI2_ENABLED    1
105
#define MIOS32_IIC_MIDI3_ENABLED    1
106
#define MIOS32_IIC_MIDI4_ENABLED    1
107
#define MIOS32_IIC_MIDI5_ENABLED    1
108
#define MIOS32_IIC_MIDI6_ENABLED    1
109
#define MIOS32_IIC_MIDI7_ENABLED    1
110
 
111
 
112
// configure BLM driver
113
#define BLM_DOUT_L1_SR  255 // dummy, will be changed in seq_file_hw.c
114
#define BLM_DOUT_R1_SR  255 // dummy, will be changed in seq_file_hw.c
115
#define BLM_DOUT_CATHODES_SR1   255 // dummy, will be changed in seq_file_hw.c
116
#define BLM_DOUT_CATHODES_SR2   255 // dummy, will be changed in seq_file_hw.c
117
#define BLM_CATHODES_INV_MASK   0x00
118
#define BLM_DOUT_L2_SR  255 // dummy, will be changed in seq_file_hw.c
119
#define BLM_DOUT_R2_SR  255 // dummy, will be changed in seq_file_hw.c
120
#define BLM_DOUT_L3_SR  0 // not used
121
#define BLM_DOUT_R3_SR  0 // not used
122
#define BLM_DIN_L_SR    255 // dummy, will be changed in seq_file_hw.c
123
#define BLM_DIN_R_SR    255 // dummy, will be changed in seq_file_hw.c
124
#define BLM_NUM_COLOURS 2
125
#define BLM_NUM_ROWS    8
126
#define BLM_DEBOUNCE_MODE 1
127
 
128
 
129
// configure BLM_X driver
130
#define BLM_X_NUM_ROWS            8
131
#define BLM_X_BTN_NUM_COLS        8
132
#define BLM_X_LED_NUM_COLS        8
133
#define BLM_X_LED_NUM_COLORS      1
134
#define BLM_X_ROWSEL_DOUT_SR      255 // dummy, will be changed in seq_file_hw.c
135
#define BLM_X_LED_FIRST_DOUT_SR   255 // dummy, will be changed in seq_file_hw.c
136
#define BLM_X_BTN_FIRST_DIN_SR    255 // dummy, will be changed in seq_file_hw.c
137
#define BLM_X_ROWSEL_INV_MASK     0   // dummy, will be changed in seq_file_hw.c
138
#define BLM_X_DEBOUNCE_MODE       1
139
 
140
 
141
// optional for Francois' 4 * 20x2 LCD configuration
142
// currently this option cannot be enabled in the MBSEQ_HW.V4 file - this will be possible later
143
#if 0
144
#define LCD_NUM_DEVICES          4
145
#define LCD_COLUMNS_PER_DEVICE  20
146
#define MIOS32_BOARD_LCD_E3_PORT GPIOB       // J15C.A10
147
#define MIOS32_BOARD_LCD_E3_PIN  GPIO_Pin_0
148
 
149
#define MIOS32_BOARD_LCD_E4_PORT GPIOB       // J15C.A11
150
#define MIOS32_BOARD_LCD_E4_PIN  GPIO_Pin_1
151
#endif
152
 
153
// LPC17 Ethernet driver: locate buffers to lower (default) section
154
// (no attribute passed to this variable)
155
#define LPC17XX_EMAC_MEM_SECTION
156
// reduce number of buffers to save memory
157
#define LPC17XX_EMAC_NUM_RX_FRAG 2
158
#define LPC17XX_EMAC_NUM_TX_FRAG 2
159
#define LPC17XX_EMAC_FRAG_SIZE   1024
160
 
161
 
162
// map MIDI mutex to UIP task
163
// located in tasks.c to access MIDI IN/OUT mutex from external
164
extern void TASKS_MUTEX_MIDIOUT_Take(void);
165
extern void TASKS_MUTEX_MIDIOUT_Give(void);
166
extern void TASKS_MUTEX_MIDIIN_Take(void);
167
extern void TASKS_MUTEX_MIDIIN_Give(void);
168
#define UIP_TASK_MUTEX_MIDIOUT_TAKE { TASKS_MUTEX_MIDIOUT_Take(); }
169
#define UIP_TASK_MUTEX_MIDIOUT_GIVE { TASKS_MUTEX_MIDIOUT_Give(); }
170
#define UIP_TASK_MUTEX_MIDIIN_TAKE  { TASKS_MUTEX_MIDIIN_Take(); }
171
#define UIP_TASK_MUTEX_MIDIIN_GIVE  { TASKS_MUTEX_MIDIIN_Give(); }
172
 
173
// Mutex for J16 access
174
extern void TASKS_J16SemaphoreTake(void);
175
extern void TASKS_J16SemaphoreGive(void);
176
#define MIOS32_SDCARD_MUTEX_TAKE   { TASKS_J16SemaphoreTake(); }
177
#define MIOS32_SDCARD_MUTEX_GIVE   { TASKS_J16SemaphoreGive(); }
178
#define MIOS32_ENC28J60_MUTEX_TAKE { TASKS_J16SemaphoreTake(); }
179
#define MIOS32_ENC28J60_MUTEX_GIVE { TASKS_J16SemaphoreGive(); }
180
 
181
#endif /* _MIOS32_CONFIG_H */