ConOpSys V2970  P004.07
ANVILEX control operating system
abcc_drv_cfg.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ********************************************************************************
3 ** **
4 ** ABCC Starter Kit version 3.04.01 (2018-01-23) **
5 ** **
6 ** Delivered with: **
7 ** ABP 7.55.01 (2017-12-20) **
8 ** ABCC Driver 5.04.01 (2017-12-18) **
9 ** */
10 /*******************************************************************************
11 ********************************************************************************
12 ** COPYRIGHT NOTIFICATION (c) 2015 HMS Industrial Networks AB **
13 ** **
14 ** This code is the property of HMS Industrial Networks AB. **
15 ** The source code may not be reproduced, distributed, or used without **
16 ** permission. When used together with a product from HMS, permission is **
17 ** granted to modify, reproduce and distribute the code in binary form **
18 ** without any restrictions. **
19 ** **
20 ** THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. HMS DOES NOT **
21 ** WARRANT THAT THE FUNCTIONS OF THE CODE WILL MEET YOUR REQUIREMENTS, OR **
22 ** THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR **
23 ** THAT DEFECTS IN IT CAN BE CORRECTED. **
24 ********************************************************************************
25 ********************************************************************************
26 ** User configuration of the ABCC driver. The configuration parameters are
27 ** documented in the driver's public interface abcc_cfg.h.
28 ********************************************************************************
29 ********************************************************************************
30 */
31 
32 #ifndef ABCC_DRV_CFG_H_
33 #define ABCC_DRV_CFG_H_
34 
35 //#include "abcc_td.h"
36 #include "abp.h"
37 
38 /*******************************************************************************
39 ** Constants
40 ********************************************************************************
41 */
42 
43 /*------------------------------------------------------------------------------
44 ** #define ABCC_SYS_BIG_ENDIAN
45 **
46 ** Define if an big endian system is used as host. If not defined little endian
47 ** is assumed.
48 **------------------------------------------------------------------------------
49 */
50 
51 // #define ABCC_SYS_BIG_ENDIAN
52 
53 /*------------------------------------------------------------------------------
54 ** #define ABCC_SYS_16_BIT_CHAR
55 **
56 ** Define if a 16 bit char system is used as host. If not defined 8 bit char
57 ** system is assumed.
58 **------------------------------------------------------------------------------
59 */
60 
61 // #define ABCC_SYS_16_BIT_CHAR
62 
63 /*------------------------------------------------------------------------------
64 ** #define ABCC_CFG_PAR_EXT_BUS_ENDIAN_DIFF (BOOL - TRUE/FALSE)
65 **
66 ** Define as TRUE if the internal and external memory bus of the host
67 ** application processor have different endianess.
68 ** The default behavior, if not defined at all, is 'no endian swap'.
69 **------------------------------------------------------------------------------
70 */
71 
72 #define ABCC_CFG_PAR_EXT_BUS_ENDIAN_DIFF ( FALSE )
73 
74 /*------------------------------------------------------------------------------
75 ** #define ABCC_CFG_DRV_SPI (BOOL - TRUE/FALSE)
76 ** #define ABCC_CFG_DRV_PARALLEL (BOOL - TRUE/FALSE)
77 ** #define ABCC_CFG_DRV_PARALLEL_30 (BOOL - TRUE/FALSE)
78 ** #define ABCC_CFG_DRV_SERIAL (BOOL - TRUE/FALSE)
79 **
80 ** These identifiers enables/disables the inclusion of the corresponding
81 ** low-level application interface driver and handshaking code.
82 **
83 ** These are related to, but are not the same as, the Operating Mode setting.
84 **
85 ** It is possible to include support for multiple low-level drivers. Each
86 ** enabled driver increases ROM and RAM consumption.
87 **
88 ** Depending on the value of the Module Identification pins in the application
89 ** connector different operating modes can be selected automatically at startup.
90 ** See ABCC_CFG_ABCC_OP_MODE_30 and ABCC_CFG_ABCC_OP_MODE_40 configuration
91 ** further down.
92 **------------------------------------------------------------------------------
93 ** Summary of the capabilities of the individual drivers, and the associated
94 ** Operating Modes:
95 **
96 ** "ABCC_CFG_DRV_SPI"
97 **
98 ** - This driver provides support for full-duplex, cycle-based data transfers
99 ** via the SPI application interface on the ABCC.
100 **
101 ** - The SPI interface is only supported by the ABCC40 series.
102 **
103 ** - Extended ABCC40 Process Data (4096 bytes) and Message Data (1536 bytes)
104 ** sizes are supported.
105 **
106 ** - Synchronous operation is supported.
107 **
108 ** - This driver is mandatory to include if the "ABP_OP_MODE_SPI" Operation
109 ** Mode is to be used.
110 **
111 ** "ABCC_CFG_DRV_PARALLEL"
112 **
113 ** - This driver provides support for event-based handshaking and data
114 ** transfers via the parallel memory interface on the ABCC.
115 **
116 ** - The event-based handshaking is only supported by the ABCC40 series.
117 **
118 ** - Extended ABCC40 Process Data (4096 bytes) and Message Data (1536 bytes)
119 ** sizes are supported.
120 **
121 ** - Synchronous operation is supported.
122 **
123 ** - This driver should be the default one if the parallel application
124 ** interface of an ABCC40 is to be used. It supports both 8-bit and 16-bit
125 ** data bus width, i.e. the "ABP_OP_MODE_8_BIT_PARALLEL" and
126 ** "ABP_OP_MODE_16_BIT_PARALLEL" Operation Modes can both be used with this
127 ** driver.
128 **
129 ** - This driver is mandatory to include if 16-bit parallel operation
130 ** ("ABP_OP_MODE_16_BIT_PARALLEL") is to be used since the ABCC30-style
131 ** 'ping-pong' handshake method is not compatible with the 16-bit data bus
132 ** width.
133 **
134 ** "ABCC_CFG_DRV_PARALLEL_30"
135 **
136 ** - This driver provides support for the 'ping-pong' handshake and data
137 ** transfer via the parallel memory interface on the ABCC.
138 **
139 ** - This handshake method is supported by both the ABCC30 and ABCC40 series,
140 ** but is not recommended as the primary one for the ABCC40 series.
141 **
142 ** - Only the 'basic' Process Data (256 bytes) and Message data (255 bytes)
143 ** sizes of the ABCC30 are supported.
144 **
145 ** - Synchronous operation is not supported.
146 **
147 ** - This driver is mandatory to include if the "ABP_OP_MODE_8_BIT_PARALLEL"
148 ** Operation Mode is to be used with an ABCC30.
149 **
150 ** "ABCC_CFG_DRV_SERIAL"
151 **
152 ** - Includes the low-level driver for the 'half-duplex' serial handshake
153 ** method.
154 **
155 ** - This handshake method is supported by both the ABCC30 and ABCC40 series,
156 ** but is not recommended as the primary one for the ABCC40 series.
157 **
158 ** - Only the 'basic' Process Data (256 bytes) and Message data (255 bytes)
159 ** sizes of the ABCC30 are supported.
160 **
161 ** - Synchronous operation is not supported.
162 **
163 ** - This driver is mandatory to include if any of the "ABP_OP_MODE_SERIAL_..."
164 ** Operation Modes are to be used.
165 **------------------------------------------------------------------------------
166 ** Compatibility between the different Operating Modes and the low-level
167 ** drivers:
168 **
169 ** "ABP_OP_MODE_SPI"
170 **
171 ** - Requires that the "ABCC_CFG_DRV_SPI" low-level driver is included.
172 **
173 ** - Only compatible with the ABCC40.
174 **
175 ** "ABP_OP_MODE_16_BIT_PARALLEL"
176 **
177 ** - Requires that the "ABCC_CFG_DRV_PARALLEL" low-level driver is included.
178 **
179 ** - Only compatible with the ABCC40.
180 **
181 ** "ABP_OP_MODE_8_BIT_PARALLEL"
182 **
183 ** - Requires that one or both of the "ABCC_CFG_DRV_PARALLEL" and
184 ** "ABCC_CFG_DRV_PARALLEL_30" low-level drivers are included depending on if
185 ** the attached ABCC is an ABCC30 or an ABCC40.
186 **
187 ** - If both the "ABCC_CFG_DRV_PARALLEL" and "ABCC_CFG_DRV_PARALLEL_30" low-
188 ** level drivers are included the "ABCC_CFG_DRV_PARALLEL" driver will be the
189 ** default one for the ABCC40 unless this is overridden by other settings.
190 **
191 ** - Compatible with both the ABCC30 and ABCC40.
192 **
193 ** "ABP_OP_MODE_SERIAL_..."
194 **
195 ** - Requires that the "ABCC_CFG_DRV_SERIAL" low-level driver is included.
196 **
197 ** - Compatible with both the ABCC30 and ABCC40.
198 **------------------------------------------------------------------------------
199 ** All interface drivers are supported.
200 **------------------------------------------------------------------------------
201 */
202 
203 #ifndef ABCC_CFG_DRV_PARALLEL
204 // ANVILEX : Application specific settings
205 // #define ABCC_CFG_DRV_PARALLEL ( TRUE )
206  #define ABCC_CFG_DRV_PARALLEL ( FALSE )
207 #endif
208 
209 #ifndef ABCC_CFG_DRV_SPI
210  #define ABCC_CFG_DRV_SPI ( TRUE )
211 #endif
212 
213 #ifndef ABCC_CFG_DRV_SERIAL
214 // ANVILEX : Application specific settings
215 // #define ABCC_CFG_DRV_SERIAL ( TRUE )
216  #define ABCC_CFG_DRV_SERIAL ( FALSE )
217 #endif
218 
219 #ifndef ABCC_CFG_DRV_PARALLEL_30
220 // ANVILEX : Application specific settings
221 // #define ABCC_CFG_DRV_PARALLEL_30 ( TRUE )
222  #define ABCC_CFG_DRV_PARALLEL_30 ( FALSE )
223 #endif
224 
225 /*------------------------------------------------------------------------------
226 ** #define ABCC_CFG_OP_MODE_GETTABLE (BOOL - TRUE/FALSE )
227 **
228 ** Enable/disable driver to retrieve the operating mode from external hardware.
229 ** If TRUE the ABCC_SYS_GetOpmode() function must be implemented in the system
230 ** adaption layer.
231 **
232 ** If this is not TRUE ABCC_CFG_ABCC_OP_MODE_X described above must be defined.
233 **------------------------------------------------------------------------------
234 */
235 
236 #ifndef ABCC_CFG_OP_MODE_GETTABLE
237 // ANVILEX : Application specific Settings
238 // #define ABCC_CFG_OP_MODE_GETTABLE ( TRUE )
239  #define ABCC_CFG_OP_MODE_GETTABLE ( FALSE )
240 #endif
241 
242 /*------------------------------------------------------------------------------
243 ** #define ABCC_CFG_OP_MODE_SETTABLE (BOOL - TRUE/FALSE )
244 **
245 ** Enable/disable driver to control the operating mode set to the ABCC host
246 ** connector. Else it is assumed the operating mode signals of the host
247 ** connector is fixed or controlled by external hardware.
248 ** If TRUE the ABCC_SYS_SetOpmode() function must be implemented in the system
249 ** adaption layer.
250 **------------------------------------------------------------------------------
251 */
252 
253 #ifndef ABCC_CFG_OP_MODE_SETTABLE
254 // ANVILEX : Application specific Settings
255 // #define ABCC_CFG_OP_MODE_SETTABLE ( TRUE )
256  #define ABCC_CFG_OP_MODE_SETTABLE ( FALSE )
257 #endif
258 
259 /*------------------------------------------------------------------------------
260 ** #define ABCC_CFG_ABCC_OP_MODE_30
261 ** #define ABCC_CFG_ABCC_OP_MODE_40
262 **
263 ** These definitions shall be defined if only one operating mode per module type
264 ** is used. It is only necessary to define the operating mode for the module
265 ** types to be used. If defined it shall be set to any ABP_OP_MODE_X definition
266 ** from abp.h.
267 ** If an operating mode for each module type is set the ABCC_SYS_SetOpmode()
268 ** has to be implemented.
269 ** If none of these definitions are set the ABCC_SYS_GetOpmode() must be
270 ** implemented to retrieve the operating mode from external hardware
271 ** (e.g. DIP switch) and ABCC_SYS_SetOpmode() must be implemented to set the
272 ** operating mode to the host connector.
273 **------------------------------------------------------------------------------
274 */
275 
276 #if( !ABCC_CFG_OP_MODE_GETTABLE )
277  #ifndef ABCC_CFG_ABCC_OP_MODE_30
278  #define ABCC_CFG_ABCC_OP_MODE_30 ABP_OP_MODE_8_BIT_PARALLEL
279  #endif
280  #ifndef ABCC_CFG_ABCC_OP_MODE_40
281 // ANVILEX : Application specific settings
282 // #define ABCC_CFG_ABCC_OP_MODE_40 ABP_OP_MODE_8_BIT_PARALLEL
283  #define ABCC_CFG_ABCC_OP_MODE_40 ABP_OP_MODE_SPI
284  #endif
285 #endif
286 
287 /*------------------------------------------------------------------------------
288 ** #define ABCC_CFG_SPI_MSG_FRAG_LEN ( 32 )
289 **
290 ** Length of SPI message fragment in bytes per SPI transaction.
291 ** If the message fragment length is shorter than the largest message to be
292 ** transmitted the sending or receiving of a message may be fragmented and
293 ** take several SPI transactions to be completed. Each SPI transaction will have
294 ** a message field of this length regardless if a message is present or not.
295 ** If messages are important the fragment length should be set to the largest
296 ** message to avoid fragmentation. If IO data are important the message fragment
297 ** length should be set to a smaller value to speed up the SPI transaction.
298 ** For high message performance a fragment length up to 1524 octets is
299 ** supported. The message header is 12 octets, so 16 or 32 octets will be enough
300 ** to support small messages without fragmentation.
301 **------------------------------------------------------------------------------
302 */
303 
304 #if( ABCC_CFG_DRV_SPI )
305  #ifndef ABCC_CFG_SPI_MSG_FRAG_LEN
306 // ANVILEX : Application specific settings
307 // #define ABCC_CFG_SPI_MSG_FRAG_LEN ( 16 )
308  #define ABCC_CFG_SPI_MSG_FRAG_LEN ( 32 )
309  #endif
310 #endif
311 
312 /*------------------------------------------------------------------------------
313 ** #define ABCC_CFG_MEMORY_MAPPED_ACCESS (BOOL - TRUE/FALSE)
314 **
315 ** Enable/disable driver support for memory mapped ABCC interface. If memory
316 ** direct access is chosen the user will have access directly to the ABCC
317 ** process data memory i.e. no internal copy is required.
318 ** If FALSE the following functions must be implemented in the system adaption
319 ** layer:
320 ** ABCC_SYS_ParallelRead()
321 ** ABCC_SYS_ParallelRead8()
322 ** ABCC_SYS_ParallelRead16()
323 ** ABCC_SYS_ParallelWrite()
324 ** ABCC_SYS_ParallelWrite8()
325 ** ABCC_SYS_ParallelWrite16()
326 ** ABCC_SYS_ParallelGetRdPdBuffer()
327 ** ABCC_SYS_ParallelGetWrPdBuffer()
328 **------------------------------------------------------------------------------
329 */
330 
331 #ifndef ABCC_CFG_MEMORY_MAPPED_ACCESS
332  #define ABCC_CFG_MEMORY_MAPPED_ACCESS ( FALSE )
333 #endif
334 
335 /*------------------------------------------------------------------------------
336 ** #define ABCC_CFG_PARALLEL_BASE_ADR ( 0x00000000 )
337 **
338 ** Define the base address of the ABCC if a memory mapped interface is used.
339 **------------------------------------------------------------------------------
340 */
341 
342 #if( ABCC_CFG_MEMORY_MAPPED_ACCESS )
343  #ifndef ABCC_CFG_PARALLEL_BASE_ADR
344  #define ABCC_CFG_PARALLEL_BASE_ADR ( 0x00000000 )
345  #endif
346 #endif
347 
348 /*------------------------------------------------------------------------------
349 ** #define ABCC_CFG_MODULE_ID_PINS_CONN (BOOL - TRUE/FALSE )
350 **
351 ** Enable/disable driver to retrieve the module identification from external
352 ** hardware. If TRUE the ABCC_SYS_ReadModuleId() function must be implemented
353 ** in the system adaption layer.
354 **
355 ** If this is not TRUE ABCC_CFG_ABCC_MODULE_ID described below must be defined.
356 **------------------------------------------------------------------------------
357 */
358 
359 #ifndef ABCC_CFG_MODULE_ID_PINS_CONN
360 // ANVILEX : Application specific settings
361 // #define ABCC_CFG_MODULE_ID_PINS_CONN ( TRUE )
362  #define ABCC_CFG_MODULE_ID_PINS_CONN ( FALSE )
363 #endif
364 
365 /*------------------------------------------------------------------------------
366 ** #define ABCC_CFG_ABCC_MODULE_ID
367 **
368 ** If the ABCC module detection pins on the host connector are not
369 ** connected ABCC_CFG_MODULE_ID_PINS_CONN must be set to FALSE and
370 ** ABCC_CFG_ABCC_MODULE_ID must be defined to the correct ABCC module id that
371 ** corresponds to the module ID of the used device.
372 ** If defined it shall be set to any ABP_MODULE_ID_X definition from abp.h.
373 **-----------------------------------------------------------------------------
374 */
375 
376 #if( !ABCC_CFG_MODULE_ID_PINS_CONN )
377  #ifndef ABCC_CFG_ABCC_MODULE_ID
378  #define ABCC_CFG_ABCC_MODULE_ID ABP_MODULE_ID_ACTIVE_ABCC40
379  #endif
380 #endif
381 
382 /*------------------------------------------------------------------------------
383 ** #define ABCC_CFG_MOD_DETECT_PINS_CONN (BOOL - TRUE/FALSE )
384 **
385 ** Set to TRUE if the module detect pins on the ABCC host connector are
386 ** in use. If TRUE the ABCC_SYS_ModuleDetect() function in the system adaption
387 ** layer must be implemented.
388 **------------------------------------------------------------------------------
389 */
390 
391 #ifndef ABCC_CFG_MOD_DETECT_PINS_CONN
392 // ANVILEX : Application specific settings
393 // #define ABCC_CFG_MOD_DETECT_PINS_CONN ( TRUE )
394  #define ABCC_CFG_MOD_DETECT_PINS_CONN ( FALSE )
395 #endif
396 
397 /*------------------------------------------------------------------------------
398 ** #define ABCC_CFG_MAX_NUM_APPL_CMDS ( 2 )
399 **
400 ** Number of commands that could be sent without receiving a response.
401 ** At least 2 buffers are required by the driver.
402 **------------------------------------------------------------------------------
403 */
404 
405 #ifndef ABCC_CFG_MAX_NUM_APPL_CMDS
406  #define ABCC_CFG_MAX_NUM_APPL_CMDS ( 2 )
407 // #define ABCC_CFG_MAX_NUM_APPL_CMDS ( 4 )
408 #endif
409 
410 /*------------------------------------------------------------------------------
411 ** #define ABCC_CFG_MAX_NUM_ABCC_CMDS ( 2 )
412 **
413 ** Number of commands that could be received without sending a response.
414 ** At least 2 buffers are required by the driver.
415 **------------------------------------------------------------------------------
416 */
417 
418 #ifndef ABCC_CFG_MAX_NUM_ABCC_CMDS
419  #define ABCC_CFG_MAX_NUM_ABCC_CMDS ( 2 )
420 // #define ABCC_CFG_MAX_NUM_ABCC_CMDS ( 4 )
421 #endif
422 
423 /*------------------------------------------------------------------------------
424 ** #define ABCC_CFG_MAX_MSG_SIZE ( 255 )
425 **
426 ** Size of largest message in bytes that will be used.
427 **
428 ** Note! ABCC30 supports 255 byte messages and ABCC40 supports 1524 byte
429 ** messages. ABCC_CFG_MAX_MSG_SIZE should be set to largest size that will be
430 ** sent or received. If this size is not known it recommended to set the maximum
431 ** supported size.
432 **------------------------------------------------------------------------------
433 */
434 
435 #ifndef ABCC_CFG_MAX_MSG_SIZE
436  #define ABCC_CFG_MAX_MSG_SIZE ( 255 )
437 #endif
438 
439 /*------------------------------------------------------------------------------
440 ** #define ABCC_CFG_MAX_PROCESS_DATA_SIZE ( 512 )
441 **
442 ** Size of max process data in bytes that will be used in either direction.
443 **------------------------------------------------------------------------------
444 */
445 
446 #ifndef ABCC_CFG_MAX_PROCESS_DATA_SIZE
447  #define ABCC_CFG_MAX_PROCESS_DATA_SIZE ( 512 )
448 #endif
449 
450 /*------------------------------------------------------------------------------
451 ** #define ABCC_CFG_SYNC_ENABLE (BOOL - TRUE/FALSE)
452 **
453 ** Enable/disable driver support for sync.
454 ** If TRUE the ABCC_CbfSyncIsr() must be implemented by the application.
455 **------------------------------------------------------------------------------
456 */
457 
458 #ifndef ABCC_CFG_SYNC_ENABLE
459  #define ABCC_CFG_SYNC_ENABLE ( FALSE )
460 #endif
461 
462 /*------------------------------------------------------------------------------
463 ** #define ABCC_CFG_USE_ABCC_SYNC_SIGNAL (BOOL - TRUE/FALSE)
464 **
465 ** Enable/disable driver support to enable and disable sync interrupt using
466 ** the sync signal from the ABCC.
467 ** If TRUE ABCC_SYS_SyncInterruptEnable() and ABCC_SYS_SyncInterruptDisable()
468 ** must be implemented by the application and ABCC_CbfSyncIsr() must be called
469 ** from the sync interrupt handler.
470 ** If FALSE the ABCC interrupt sync event will be used as sync source and
471 ** ABCC_CbfSyncIsr() will be called by the driver.
472 ** The define is only valid if ABCC_CFG_SYNC_ENABLE is TRUE.
473 **------------------------------------------------------------------------------
474 */
475 
476 #if( ABCC_CFG_SYNC_ENABLE )
477  #ifndef ABCC_CFG_USE_ABCC_SYNC_SIGNAL
478  #define ABCC_CFG_USE_ABCC_SYNC_SIGNAL ( TRUE )
479  #endif
480 #endif
481 
482 /*------------------------------------------------------------------------------
483 ** Startup configuration
484 **------------------------------------------------------------------------------
485 */
486 
487 /*------------------------------------------------------------------------------
488 ** APPL_FW_UPGRADE_STARTUP_TIME_MS (U32)( 120000 )
489 **
490 ** Maximum start up time when the module is upgrading its firmware
491 **------------------------------------------------------------------------------
492 */
493 
494 #define APPL_FW_UPGRADE_STARTUP_TIME_MS (U32)( 120000 )
495 
496 /*------------------------------------------------------------------------------
497 ** Interrupt configuration excluding sync
498 **------------------------------------------------------------------------------
499 */
500 
501 /*------------------------------------------------------------------------------
502 ** #define ABCC_CFG_POLL_ABCC_IRQ_PIN (BOOL - TRUE/FALSE)
503 **
504 ** Enable/disable driver support to read the status of the interrupt pin.
505 ** This function will enable the driver to use the interrupt pin to check if an
506 ** event has occurred even if the interrupt is disabled. For example the ABCC
507 ** power up event could be detected this way.
508 ** If TRUE the user will be forced to implement the
509 ** ABCC_SYS_IsAbccInterruptActive() function in the system adaption layer.
510 **------------------------------------------------------------------------------
511 */
512 
513 #ifndef ABCC_CFG_POLL_ABCC_IRQ_PIN
514 // ANVILEX : Application specific configuration
515 // #define ABCC_CFG_POLL_ABCC_IRQ_PIN ( FALSE )
516  #define ABCC_CFG_POLL_ABCC_IRQ_PIN ( TRUE )
517 #endif
518 
519 /*------------------------------------------------------------------------------
520 ** #define ABCC_CFG_INT_ENABLED (BOOL - TRUE/FALSE)
521 **
522 ** Enable/disable driver support for ABCC interrupt (IRQ_N pin on the host
523 ** connector). If TRUE the user will be forced to implement the following
524 ** functions in the system adaption layer:
525 **
526 ** ABCC_SYS_AbccInterruptEnable()
527 ** ABCC_SYS_AbccInterruptDisable()
528 **------------------------------------------------------------------------------
529 */
530 
531 #ifndef ABCC_CFG_INT_ENABLED
532 // ANVILEX : Application specific configuration
533 // #define ABCC_CFG_INT_ENABLED ( FALSE )
534  #define ABCC_CFG_INT_ENABLED ( TRUE )
535 #endif
536 
537 /*------------------------------------------------------------------------------
538 ** #define ABCC_CFG_INT_ENABLE_MASK_PAR ( ABP_INTMASK_RDPDIEN )
539 **
540 ** Defines what ABCC interrupts shall be enabled in parallel operating mode.
541 ** This is a bit mask built up by the ABP_INTMASK_X definitions in abp.h.
542 ** If an event is not notified via the ABCC interrupt it must be polled by
543 ** ABCC_RunDriver(). If not defined in abcc_drv_cfg.h the default mask is 0.
544 **------------------------------------------------------------------------------
545 */
546 
547 #if( ABCC_CFG_INT_ENABLED )
548  #ifndef ABCC_CFG_INT_ENABLE_MASK_PAR
549  #define ABCC_CFG_INT_ENABLE_MASK_PAR ( ABP_INTMASK_RDPDIEN | ABP_INTMASK_STATUSIEN | ABP_INTMASK_RDMSGIEN | ABP_INTMASK_WRMSGIEN | ABP_INTMASK_ANBRIEN )
550  #endif
551 #endif
552 
553 /*------------------------------------------------------------------------------
554 ** #define ABCC_CFG_INT_ENABLE_MASK_SPI ( 0 )
555 **
556 ** Defines what ABCC interrupts shall be enabled in SPI operating mode.
557 ** The mask is composed of ABP_INTMASK_X definitions in abp.h.
558 ** If an event is not notified via the ABCC interrupt it must be polled using
559 ** ABCC_RunDriver().
560 ** If not defined in abcc_drv_cfg.h the default mask is 0.
561 **
562 ** Note! There are currently no support in the driver to handle interrupt
563 ** driven SPI based on ABCC events.
564 **------------------------------------------------------------------------------
565 */
566 
567 #if( ABCC_CFG_INT_ENABLED )
568  #ifndef ABCC_CFG_INT_ENABLE_MASK_SPI
569  #define ABCC_CFG_INT_ENABLE_MASK_SPI ( 0 )
570  #endif
571 #endif
572 
573 /*------------------------------------------------------------------------------
574 ** #define ABCC_CFG_HANDLE_INT_IN_ISR_MASK ( ABP_INTMASK_RDPDIEN )
575 **
576 ** Defines what interrupt events from the ABCC that should be handled in
577 ** interrupt context. The mask is composed of ABP_INTMASK_X bits.
578 ** Events that are enabled in the interrupt enable mask (ABCC_CFG_INT_ENABLE_MASK_X)
579 ** but not configured to be handled by the ISR will be translated to a bit field
580 ** of ABCC_ISR_EVENT_X definitions and forwarded to the user via the
581 ** ABCC_CbfEvent() callback.
582 ** If not defined in abcc_drv_cfg.h the default value will be:
583 ** Parallel 16/8: 0 (No events handled by the ISR)
584 ** Other operating modes N/A
585 **------------------------------------------------------------------------------
586 */
587 
588 #if( ABCC_CFG_INT_ENABLED )
589  #ifndef ABCC_CFG_HANDLE_INT_IN_ISR_MASK
590  #define ABCC_CFG_HANDLE_INT_IN_ISR_MASK ( ABP_INTMASK_RDPDIEN )
591  #endif
592 #endif
593 
594 /*------------------------------------------------------------------------------
595 ** Watchdog configuration
596 **------------------------------------------------------------------------------
597 */
598 
599 /*------------------------------------------------------------------------------
600 ** #define ABCC_CFG_WD_TIMEOUT_MS ( 1000 )
601 **
602 ** Timeout for ABCC communication watchdog.
603 ** Note! Currently the watchdog functionality is only supported by SPI-,
604 ** serial- and paralell30 (ping/pong) operating modes.
605 **------------------------------------------------------------------------------
606 */
607 
608 #ifndef ABCC_CFG_WD_TIMEOUT_MS
609  #define ABCC_CFG_WD_TIMEOUT_MS ( 1000 )
610 #endif
611 
612 /*------------------------------------------------------------------------------
613 ** Remap support configuration
614 **------------------------------------------------------------------------------
615 */
616 
617 /*------------------------------------------------------------------------------
618 ** #define ABCC_CFG_REMAP_SUPPORT_ENABLED (BOOL - TRUE/FALSE)
619 **
620 ** Enable/disable driver and AD object support for the re-map command.
621 ** If TRUE the ABCC_CbfRemapDone() needs to be implemented by the application.
622 **------------------------------------------------------------------------------
623 */
624 
625 #ifndef ABCC_CFG_REMAP_SUPPORT_ENABLED
626  #define ABCC_CFG_REMAP_SUPPORT_ENABLED ( FALSE )
627 #endif
628 
629 /*------------------------------------------------------------------------------
630 ** The Application data object ADI support configuration
631 **------------------------------------------------------------------------------
632 */
633 
634 /*------------------------------------------------------------------------------
635 ** #define ABCC_CFG_STRUCT_DATA_TYPE (BOOL - TRUE/FALSE )
636 **
637 ** Enable/disable driver and AD object support for structured data data types.
638 ** This define will affect the AD_AdiEntryType (abcc_ad_if.h) used for defining
639 ** the user ADI:s.
640 **------------------------------------------------------------------------------
641 */
642 
643 #ifndef ABCC_CFG_STRUCT_DATA_TYPE
644  #define ABCC_CFG_STRUCT_DATA_TYPE ( FALSE )
645 #endif
646 
647 /*------------------------------------------------------------------------------
648 ** #define ABCC_CFG_ADI_GET_SET_CALLBACK (BOOL - TRUE/FALSE )
649 **
650 ** Enable/disable driver support for triggering of callback notifications each
651 ** time an ADI is read or written. This define will affect the AD_AdiEntryType
652 ** (abcc_ad_if.h) used for defining the user ADI:s.
653 ** If an ADI is read by the network the callback is invoked before the action.
654 ** If an ADI is written by the network the callback is invoked after the action.
655 **------------------------------------------------------------------------------
656 */
657 
658 #ifndef ABCC_CFG_ADI_GET_SET_CALLBACK
659  #define ABCC_CFG_ADI_GET_SET_CALLBACK ( FALSE )
660 #endif
661 
662 /*------------------------------------------------------------------------------
663 ** #define ABCC_CFG_64BIT_ADI_SUPPORT
664 **
665 ** Define if 64 bit data type in the Application Data object shall be supported.
666 **------------------------------------------------------------------------------
667 */
668 
669 #ifndef ABCC_CFG_64BIT_ADI_SUPPORT
670  #define ABCC_CFG_64BIT_ADI_SUPPORT ( FALSE )
671 #endif
672 
673 /*------------------------------------------------------------------------------
674 ** Command sequencer configuration
675 **------------------------------------------------------------------------------
676 */
677 
678 #ifndef ABCC_CFG_DRV_CMD_SEQ_ENABLE
679 // ANVILEX : Application specific settings
680 //#define ABCC_CFG_DRV_CMD_SEQ_ENABLE ( TRUE )
681 #define ABCC_CFG_DRV_CMD_SEQ_ENABLE ( FALSE )
682 #endif
683 
684 /*------------------------------------------------------------------------------
685 ** #define ABCC_CFG_MAX_NUM_CMD_SEQ ( U8 1-254 )
686 **
687 ** Max number of simultaneous command sequences (see abcc_cmd_seq.h).
688 ** Default is 2.
689 **------------------------------------------------------------------------------
690 */
691 
692 #ifndef ABCC_CFG_MAX_NUM_CMD_SEQ
693 // #define ABCC_CFG_MAX_NUM_CMD_SEQ ( 2 )
694  #define ABCC_CFG_MAX_NUM_CMD_SEQ ( 4 )
695 #endif
696 
697 /*------------------------------------------------------------------------------
698 ** #define ABCC_CFG_CMD_SEQ_MAX_NUM_RETRIES ( U8 0-254 )
699 **
700 ** When the command sequencer (abcc_cmd_seq.h) sends a command, it utilizes
701 ** ABCC_GetCmdMsgBuffer() to get a buffer resource. The command sequencer can
702 ** handle temporary resource problems and will re-try each main loop cycle
703 ** (ABCC_RunDriver()). When ABCC_CFG_CMD_SEQ_MAX_NUM_RETRIES number of retries
704 ** has been reached, ABCC_EC_OUT_OF_MSG_BUFFERS error will be reported.
705 **
706 ** Set maximum number of retries for trying to retrieve a message buffer.
707 ** One try will be done each ABCC_RunDriver() call.
708 ** Note that when setting this to more than 0 it will handle temporary
709 ** message resource problems, but all retries will be done from
710 ** ABCC_RunDriver() context.
711 **
712 ** Default is 0.
713 **------------------------------------------------------------------------------
714 */
715 
716 #ifndef ABCC_CFG_CMD_SEQ_MAX_NUM_RETRIES
717  #define ABCC_CFG_CMD_SEQ_MAX_NUM_RETRIES ( 0 )
718 #endif
719 
720 /*------------------------------------------------------------------------------
721 ** #define ABCC_CFG_CMD_SEQ_IMMEDIATE_SEND ( TRUE )
722 **
723 ** Set to TRUE if the first message in a sequence shall be sent
724 ** immediately when the sequence is added. This is to ensure that all messaging
725 ** is done from the same context if no resource problems occurs.
726 **------------------------------------------------------------------------------
727 */
728 
729 #ifndef ABCC_CFG_CMD_SEQ_IMMEDIATE_SEND
730  #define ABCC_CFG_CMD_SEQ_IMMEDIATE_SEND ( TRUE )
731 #endif
732 
733 /*------------------------------------------------------------------------------
734 ** Debug and error macro configuration
735 **------------------------------------------------------------------------------
736 */
737 
738 /*------------------------------------------------------------------------------
739 ** #define ABCC_CFG_ERR_REPORTING_ENABLED (BOOL - TRUE/FALSE )
740 **
741 ** Enable/disable the error reporting callback function (ABCC_CbfDriverError())
742 ** If ABCC_CFG_ERR_REPORTING_ENABLED is FALSE no error handling will be done in
743 ** the driver. It is strongly recommended to have ABCC_CFG_ERR_REPORTING_ENABLED
744 ** set to TRUE.
745 **------------------------------------------------------------------------------
746 */
747 
748 #ifndef ABCC_CFG_ERR_REPORTING_ENABLED
749  #define ABCC_CFG_ERR_REPORTING_ENABLED ( TRUE )
750 #endif
751 
752 /*------------------------------------------------------------------------------
753 ** #define ABCC_CFG_DEBUG_EVENT_ENABLED (BOOL - TRUE/FALSE )
754 **
755 ** Enable/disable driver support for print out of debug events within the
756 ** driver. ABCC_PORT_DebugPrint() (abcc_sw_port.h) will be used to print debug
757 ** information.
758 **------------------------------------------------------------------------------
759 */
760 
761 #ifndef ABCC_CFG_DEBUG_EVENT_ENABLED
762  #define ABCC_CFG_DEBUG_EVENT_ENABLED ( TRUE )
763 #endif
764 
765 /*------------------------------------------------------------------------------
766 ** #define ABCC_CFG_DEBUG_ERR_ENABLED (BOOL - TRUE/FALSE )
767 **
768 ** Enable/disable printout of debug information when an error is detected by the
769 ** driver, such as filename, line number and error information.
770 ** Note! Enabling the debug error handling may significantly increase the code
771 ** size.
772 ** Debug error handling demands that ABCC_CFG_ERR_REPORTING_ENABLED is TRUE.
773 **------------------------------------------------------------------------------
774 */
775 
776 #ifndef ABCC_CFG_DEBUG_ERR_ENABLED
777  #define ABCC_CFG_DEBUG_ERR_ENABLED ( FALSE )
778 #endif
779 
780 /*------------------------------------------------------------------------------
781 ** #define ABCC_CFG_DEBUG_MESSAGING (BOOL - TRUE/FALSE )
782 **
783 ** Enable/disable printout of received and sent messages. Related events such as
784 ** buffer allocation and queue information is also printed.
785 **------------------------------------------------------------------------------
786 */
787 
788 #ifndef ABCC_CFG_DEBUG_MESSAGING
789  #define ABCC_CFG_DEBUG_MESSAGING ( FALSE )
790 #endif
791 
792 /*------------------------------------------------------------------------------
793 ** #define ABCC_CFG_DEBUG_CMD_SEQ_ENABLED (BOOL - TRUE/FALSE )
794 **
795 ** Enable/disable printout of command sequencer actions.
796 **------------------------------------------------------------------------------
797 */
798 
799 #ifndef ABCC_CFG_DEBUG_CMD_SEQ_ENABLED
800  #define ABCC_CFG_DEBUG_CMD_SEQ_ENABLED ( FALSE )
801 #endif
802 
803 /*------------------------------------------------------------------------------
804 ** ABCC_DRV_CFG_MAX_NUM_ERR_LOG (1)
805 **
806 ** Max number of errors to log
807 **------------------------------------------------------------------------------
808 */
809 
810 #ifndef ABCC_DRV_CFG_MAX_NUM_ERR_LOG
811  #define ABCC_DRV_CFG_MAX_NUM_ERR_LOG (1)
812 #endif
813 
814 /*------------------------------------------------------------------------------
815 ** APPL_DEFAULT_IP_NETWORK_ADDRESS { 192, 168, 0, 0 }
816 ** APPL_DEFAULT_NETMASK { 255, 255, 255, 0 }
817 ** APPL_DEFAULT_GATEWAY { 0, 0, 0, 0 }
818 ** APPL_DEFAULT_DHCP_ENABLE { FALSE }
819 **
820 ** Default IP configuration when using HW switches
821 **------------------------------------------------------------------------------
822 */
823 
824 #ifndef APPL_DEFAULT_IP_NETWORK_ADDRESS
825 #define APPL_DEFAULT_IP_NETWORK_ADDRESS { 192, 168, 0, 0 }
826 #endif
827 
828 #ifndef APPL_DEFAULT_NETMASK
829 #define APPL_DEFAULT_NETMASK { 255, 255, 255, 0 }
830 #endif
831 
832 #ifndef APPL_DEFAULT_GATEWAY
833 #define APPL_DEFAULT_GATEWAY { 0, 0, 0, 0 }
834 #endif
835 
836 #ifndef APPL_DEFAULT_DHCP_ENABLE
837 #define APPL_DEFAULT_DHCP_ENABLE { FALSE }
838 #endif
839 
840 #endif /* inclusion lock */
841 
842 //------------------------------------------------------------------------------
843 // End Of File
844 //------------------------------------------------------------------------------