Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
abcc_cfg.h
00001 /******************************************************************************* 00002 ******************************************************************************** 00003 ** ** 00004 ** ABCC Driver version 4.01.01 (2015-12-14) ** 00005 ** ** 00006 ** Delivered with: ** 00007 ** ABP 7.16.01 (2015-10-14) ** 00008 ** */ 00009 /******************************************************************************* 00010 ******************************************************************************** 00011 ** COPYRIGHT NOTIFICATION (c) 2015 HMS Industrial Networks AB ** 00012 ** ** 00013 ** This program is the property of HMS Industrial Networks AB. ** 00014 ** It may not be reproduced, distributed, or used without permission ** 00015 ** of an authorized company official. ** 00016 ******************************************************************************** 00017 ******************************************************************************** 00018 ** Configuration parameters of the driver. 00019 ** 00020 ** The following user definitions are used to control and configure the driver. 00021 ** These defines shall be specified by the user in abcc_drv_cfg.h. 00022 ******************************************************************************** 00023 ******************************************************************************** 00024 ** Services: 00025 ** None 00026 ******************************************************************************** 00027 ******************************************************************************** 00028 */ 00029 00030 #ifndef ABCC_CFG_H_ 00031 #define ABCC_CFG_H_ 00032 00033 /******************************************************************************* 00034 ** Constants 00035 ******************************************************************************** 00036 */ 00037 00038 /*------------------------------------------------------------------------------ 00039 ** #define ABCC_SYS_BIG_ENDIAN 00040 ** 00041 ** Defined in abcc_td.h. 00042 ** 00043 ** Define if an big endian system is used as host. If not defined little endian 00044 ** is assumed. 00045 **------------------------------------------------------------------------------ 00046 */ 00047 00048 /*------------------------------------------------------------------------------ 00049 ** #define ABCC_SYS_16_BIT_CHAR 00050 ** 00051 ** Defined in abcc_td.h. 00052 ** 00053 ** Define if a 16 bit char system is used as host. If not defined 8 bit char 00054 ** system is assumed. 00055 **------------------------------------------------------------------------------ 00056 */ 00057 00058 /*------------------------------------------------------------------------------ 00059 ** #define ABCC_CFG_DRV_SPI (BOOL - TRUE/FALSE) 00060 ** 00061 ** Defined in abcc_drv_cfg.h. 00062 ** 00063 ** Enable/disable driver support for SPI operating mode. 00064 ** Note! Support for multiple operating modes is possible. 00065 ** Depending on module id different operating modes can be activated (see 00066 ** ABCC_CFG_ABCC_OP_MODE_30 and ABCC_CFG_ABCC_OP_MODE_40 configuration further 00067 ** down). Each supported mode increases memory usage. 00068 **------------------------------------------------------------------------------ 00069 */ 00070 00071 /*------------------------------------------------------------------------------ 00072 ** #define ABCC_CFG_DRV_PARALLEL (BOOL - TRUE/FALSE) 00073 ** 00074 ** Defined in abcc_drv_cfg.h. 00075 ** 00076 ** Enable/disable driver support for parallel event operating mode for both 8 00077 ** and 16 bit mode. 00078 ** Note! Support for multiple operating modes is possible. 00079 ** Depending on module id different operating modes can be activated (see 00080 ** ABCC_CFG_ABCC_OP_MODE_30 and ABCC_CFG_ABCC_OP_MODE_40 configuration further 00081 ** down). Each supported mode increases memory usage. 00082 **------------------------------------------------------------------------------ 00083 */ 00084 00085 /*------------------------------------------------------------------------------ 00086 ** #define ABCC_CFG_DRV_PARALLEL_30 (BOOL - TRUE/FALSE) 00087 ** 00088 ** Defined in abcc_drv_cfg.h. 00089 ** 00090 ** Enable/disable driver support for parallel 8-bit ping-pong operating mode. 00091 ** Note! Support for multiple operating modes is possible. 00092 ** Depending on module id different operating modes can be activated (see 00093 ** ABCC_CFG_ABCC_OP_MODE_30 and ABCC_CFG_ABCC_OP_MODE_40 configuration further 00094 ** down). Each supported mode increases memory usage. 00095 **------------------------------------------------------------------------------ 00096 */ 00097 00098 /*------------------------------------------------------------------------------ 00099 ** #define ABCC_CFG_DRV_SERIAL (BOOL - TRUE/FALSE) 00100 ** 00101 ** Defined in abcc_drv_cfg.h. 00102 ** 00103 ** Enable/disable driver support for serial ping/pong operating mode. 00104 ** Note! Support for multiple operating modes is possible. 00105 ** Depending on module id different operating modes can be activated (see 00106 ** ABCC_CFG_ABCC_OP_MODE_30 and ABCC_CFG_ABCC_OP_MODE_40 configuration further 00107 ** down). Each supported mode increases memory usage. 00108 **------------------------------------------------------------------------------ 00109 */ 00110 00111 /*------------------------------------------------------------------------------ 00112 ** #define ABCC_CFG_OP_MODE_GETTABLE (BOOL - TRUE/FALSE ) 00113 ** 00114 ** Defined in abcc_drv_cfg.h. 00115 ** 00116 ** Enable/disable driver to retrieve the operating mode from external hardware. 00117 ** If TRUE the ABCC_SYS_GetOpmode() function must be implemented in the system 00118 ** adaption layer. 00119 ** 00120 ** If this is not TRUE ABCC_CFG_ABCC_OP_MODE_X described above must be defined. 00121 **------------------------------------------------------------------------------ 00122 */ 00123 00124 /*------------------------------------------------------------------------------ 00125 ** #define ABCC_CFG_OP_MODE_SETTABLE (BOOL - TRUE/FALSE ) 00126 ** 00127 ** Defined in abcc_drv_cfg.h. 00128 ** 00129 ** Enable/disable driver to control the operating mode set to the ABCC host 00130 ** connector. Else it is assumed the operating mode signals of the host 00131 ** connector is fixed or controlled by external hardware. 00132 ** If TRUE the ABCC_SYS_SetOpmode() function must be implemented in the system 00133 ** adaption layer. 00134 **------------------------------------------------------------------------------ 00135 */ 00136 00137 /*------------------------------------------------------------------------------ 00138 ** #define ABCC_CFG_ABCC_OP_MODE_30 00139 ** #define ABCC_CFG_ABCC_OP_MODE_40 00140 ** 00141 ** Defined in abcc_drv_cfg.h. 00142 ** 00143 ** These definitions shall be defined if only one operating mode per module type 00144 ** is used. It is only necessary to define the operating mode for the module 00145 ** types to be used. If defined it shall be set to any ABP_OP_MODE_X definition 00146 ** from abp.h. 00147 ** If an operating mode for each module type is set the ABCC_SYS_SetOpmode() 00148 ** has to be implemented. 00149 ** If none of these definitions are set the ABCC_SYS_GetOpmode() must be 00150 ** implemented to retrieve the operating mode from external hardware 00151 ** (e.g. DIP switch) and ABCC_SYS_SetOpmode() must be implemented to set the 00152 ** operating mode to the host connector. 00153 **------------------------------------------------------------------------------ 00154 */ 00155 00156 /*------------------------------------------------------------------------------ 00157 ** #define ABCC_CFG_SPI_MSG_FRAG_LEN ( 32 ) 00158 ** 00159 ** Defined in abcc_drv_cfg.h. 00160 ** 00161 ** Length of SPI message fragment in bytes per SPI transaction. 00162 ** If the message fragment length is shorter than the largest message to be 00163 ** transmitted the sending or receiving of a message may be fragmented and 00164 ** take several SPI transactions to be completed. Each SPI transaction will have 00165 ** a message field of this length regardless if a message is present or not. 00166 ** If messages are important the fragment length should be set to the largest 00167 ** message to avoid fragmentation. If IO data are important the message fragment 00168 ** length should be set to a smaller value to speed up the SPI transaction. 00169 ** For high message performance a fragment length up to 1524 octets is 00170 ** supported. The message header is 12 octets, so 16 or 32 octets will be enough 00171 ** to support small messages without fragmentation. 00172 **------------------------------------------------------------------------------ 00173 */ 00174 00175 /*------------------------------------------------------------------------------ 00176 ** #define ABCC_CFG_MEMORY_MAPPED_ACCESS (BOOL - TRUE/FALSE) 00177 ** 00178 ** Defined in abcc_drv_cfg.h. 00179 ** 00180 ** Enable/disable driver support for memory mapped ABCC interface. If memory 00181 ** direct access is chosen the user will have access directly to the ABCC 00182 ** process data memory i.e. no internal copy is required. 00183 ** If FALSE the following functions must be implemented in the system adaption 00184 ** layer: 00185 ** ABCC_SYS_ParallelRead() 00186 ** ABCC_SYS_ParallelRead8() 00187 ** ABCC_SYS_ParallelRead16() 00188 ** ABCC_SYS_ParallelWrite() 00189 ** ABCC_SYS_ParallelWrite8() 00190 ** ABCC_SYS_ParallelWrite16() 00191 ** ABCC_SYS_ParallelGetRdPdBuffer() 00192 ** ABCC_SYS_ParallelGetWrPdBuffer() 00193 **------------------------------------------------------------------------------ 00194 */ 00195 00196 /*------------------------------------------------------------------------------ 00197 ** #define ABCC_CFG_PARALLEL_BASE_ADR ( 0x00000000 ) 00198 ** 00199 ** Defined in abcc_drv_cfg.h. 00200 ** 00201 ** Define the base address of the ABCC if a memory mapped interface is used. 00202 **------------------------------------------------------------------------------ 00203 */ 00204 00205 /*------------------------------------------------------------------------------ 00206 ** #define ABCC_CFG_ABCC_MODULE_ID 00207 ** 00208 ** Defined in abcc_drv_cfg.h. 00209 ** 00210 ** If the ABCC module detection pins on the host connector are not 00211 ** connected ABCC_CFG_ABCC_MODULE_ID must be defined to the correct 00212 ** ABCC module id that corresponds to the module ID of the used device. 00213 ** If defined it shall be set to any ABP_MODULE_ID_X definition from abp.h. 00214 **----------------------------------------------------------------------------- 00215 */ 00216 00217 /*------------------------------------------------------------------------------ 00218 ** #define ABCC_CFG_MOD_DETECT_PINS_CONN (BOOL - TRUE/FALSE ) 00219 ** 00220 ** Defined in abcc_drv_cfg.h. 00221 ** 00222 ** Set to TRUE if the module detect pins on the ABCC host connector are 00223 ** in use. If TRUE the ABCC_SYS_ModuleDetect() function in the system adaption 00224 ** layer must be implemented. 00225 **------------------------------------------------------------------------------ 00226 */ 00227 00228 /*------------------------------------------------------------------------------ 00229 ** #define ABCC_CFG_MAX_NUM_APPL_CMDS ( 2 ) 00230 ** 00231 ** Defined in abcc_drv_cfg.h. 00232 ** 00233 ** Number of commands that could be sent without receiving a response. 00234 ** At least 2 buffers are required by the driver. 00235 **------------------------------------------------------------------------------ 00236 */ 00237 00238 /*------------------------------------------------------------------------------ 00239 ** #define ABCC_CFG_MAX_NUM_ABCC_CMDS ( 2 ) 00240 ** 00241 ** Defined in abcc_drv_cfg.h. 00242 ** 00243 ** Number of commands that could be received without sending a response. 00244 ** At least 2 buffers are required by the driver. 00245 **------------------------------------------------------------------------------ 00246 */ 00247 00248 /*------------------------------------------------------------------------------ 00249 ** #define ABCC_CFG_MAX_MSG_SIZE ( 255 ) 00250 ** 00251 ** Defined in abcc_drv_cfg.h. 00252 ** 00253 ** Size of largest message in bytes that will be used. 00254 ** 00255 ** Note! ABCC30 supports 255 byte messages and ABCC40 supports 1524 byte 00256 ** messages. ABCC_CFG_MAX_MSG_SIZE should be set to largest size that will be 00257 ** sent or received. If this size is not known it recommended to set the maximum 00258 ** supported size. 00259 **------------------------------------------------------------------------------ 00260 */ 00261 00262 /*------------------------------------------------------------------------------ 00263 ** #define ABCC_CFG_MAX_PROCESS_DATA_SIZE ( 512 ) 00264 ** 00265 ** Defined in abcc_drv_cfg.h. 00266 ** 00267 ** Size of max process data in bytes that will be used in either direction. 00268 **------------------------------------------------------------------------------ 00269 */ 00270 00271 /*------------------------------------------------------------------------------ 00272 ** #define ABCC_CFG_SYNC_ENABLE (BOOL - TRUE/FALSE) 00273 ** 00274 ** Defined in abcc_drv_cfg.h. 00275 ** 00276 ** Enable/disable driver support for sync. 00277 ** If TRUE the ABCC_CbfSyncIsr() must be implemented by the application. 00278 **------------------------------------------------------------------------------ 00279 */ 00280 00281 /*------------------------------------------------------------------------------ 00282 ** #define ABCC_CFG_USE_ABCC_SYNC_SIGNAL (BOOL - TRUE/FALSE) 00283 ** 00284 ** Defined in abcc_drv_cfg.h. 00285 ** 00286 ** Enable/disable driver support to enable and disable sync interrupt using 00287 ** the sync signal from the ABCC. 00288 ** If TRUE ABCC_SYS_SyncInterruptEnable() and ABCC_SYS_SyncInterruptDisable() 00289 ** must be implemented by the application and ABCC_CbfSyncIsr() must be called 00290 ** from the sync interrupt handler. 00291 ** If FALSE the ABCC interrupt sync event will be used as sync source and 00292 ** ABCC_CbfSyncIsr() will be called by the driver. 00293 ** The define is only valid if ABCC_CFG_SYNC_ENABLE is TRUE. 00294 **------------------------------------------------------------------------------ 00295 */ 00296 00297 /*------------------------------------------------------------------------------ 00298 ** #define ABCC_CFG_POLL_ABCC_IRQ_PIN (BOOL - TRUE/FALSE) 00299 ** 00300 ** Defined in abcc_drv_cfg.h. 00301 ** 00302 ** Enable/disable driver support to read the status of the interrupt pin. 00303 ** This function will enable the driver to use the interrupt pin to check if an 00304 ** event has occurred even if the interrupt is disabled. For example the ABCC 00305 ** power up event could be detected this way. 00306 ** If TRUE the user will be forced to implement the 00307 ** ABCC_SYS_IsAbccInterruptActive() function in the system adaption layer. 00308 **------------------------------------------------------------------------------ 00309 */ 00310 00311 /*------------------------------------------------------------------------------ 00312 ** #define ABCC_CFG_INT_ENABLED (BOOL - TRUE/FALSE) 00313 ** 00314 ** Defined in abcc_drv_cfg.h. 00315 ** 00316 ** Enable/disable driver support for ABCC interrupt (IRQ_N pin on the host 00317 ** connector). If TRUE the user will be forced to implement the following 00318 ** functions in the system adaption layer: 00319 ** 00320 ** ABCC_SYS_AbccInterruptEnable() 00321 ** ABCC_SYS_AbccInterruptDisable() 00322 **------------------------------------------------------------------------------ 00323 */ 00324 00325 /*------------------------------------------------------------------------------ 00326 ** #define ABCC_CFG_INT_ENABLE_MASK_PAR ( ABP_INTMASK_RDPDIEN ) 00327 ** 00328 ** Defined in abcc_drv_cfg.h. 00329 ** 00330 ** Defines what ABCC interrupts shall be enabled in parallel operating mode. 00331 ** This is a bit mask built up by the ABP_INTMASK_X definitions in abp.h. 00332 ** If an event is not notified via the ABCC interrupt it must be polled by 00333 ** ABCC_RunDriver(). If not defined in abcc_drv_cfg.h the default mask is 0. 00334 **------------------------------------------------------------------------------ 00335 */ 00336 00337 /*------------------------------------------------------------------------------ 00338 ** #define ABCC_CFG_INT_ENABLE_MASK_SPI ( 0 ) 00339 ** 00340 ** Defined in abcc_drv_cfg.h. 00341 ** 00342 ** Defines what ABCC interrupts shall be enabled in SPI operating mode. 00343 ** The mask is composed of ABP_INTMASK_X definitions in abp.h. 00344 ** If an event is not notified via the ABCC interrupt it must be polled using 00345 ** ABCC_RunDriver(). 00346 ** If not defined in abcc_drv_cfg.h the default mask is 0. 00347 ** 00348 ** Note! There are currently no support in the driver to handle interrupt 00349 ** driven SPI based on ABCC events. 00350 **------------------------------------------------------------------------------ 00351 */ 00352 00353 /*------------------------------------------------------------------------------ 00354 ** #define ABCC_CFG_HANDLE_INT_IN_ISR_MASK ( ABP_INTMASK_RDPDIEN ) 00355 ** 00356 ** Defined in abcc_drv_cfg.h. 00357 ** 00358 ** Defines what interrupt events from the ABCC that should be handled in 00359 ** interrupt context. The mask is composed of ABP_INTMASK_X bits. 00360 ** Events that are enabled in the interrupt enable mask (ABCC_CFG_INT_ENABLE_MASK_X) 00361 ** but not configured to be handled by the ISR will be translated to a bit field 00362 ** of ABCC_ISR_EVENT_X definitions and forwarded to the user via the 00363 ** ABCC_CbfEvent() callback. 00364 ** If not defined in abcc_drv_cfg.h the default value will be: 00365 ** Parallel 16/8: 0 (No events handled by the ISR) 00366 ** Other operating modes N/A 00367 **------------------------------------------------------------------------------ 00368 */ 00369 00370 /*------------------------------------------------------------------------------ 00371 ** #define ABCC_CFG_WD_TIMEOUT_MS ( 1000 ) 00372 ** 00373 ** Defined in abcc_drv_cfg.h. 00374 ** 00375 ** Timeout for ABCC communication watchdog. 00376 ** Note! Currently the watchdog functionality is only supported by SPI-, 00377 ** serial- and paralell30 (ping/pong) operating modes. 00378 **------------------------------------------------------------------------------ 00379 */ 00380 00381 /*------------------------------------------------------------------------------ 00382 ** #define ABCC_CFG_REMAP_SUPPORT_ENABLED (BOOL - TRUE/FALSE) 00383 ** 00384 ** Defined in abcc_drv_cfg.h. 00385 ** 00386 ** Enable/disable driver and AD object support for the re-map command. 00387 ** If TRUE the ABCC_CbfRemapDone() needs to be implemented by the application. 00388 **------------------------------------------------------------------------------ 00389 */ 00390 00391 /*------------------------------------------------------------------------------ 00392 ** #define ABCC_CFG_STRUCT_DATA_TYPE (BOOL - TRUE/FALSE ) 00393 ** 00394 ** Defined in abcc_drv_cfg.h. 00395 ** 00396 ** Enable/disable driver and AD object support for structured data data types. 00397 ** This define will affect the AD_AdiEntryType (abcc_ad_if.h) used for defining 00398 ** the user ADI:s. 00399 **------------------------------------------------------------------------------ 00400 */ 00401 00402 /*------------------------------------------------------------------------------ 00403 ** #define ABCC_CFG_ADI_GET_SET_CALLBACK (BOOL - TRUE/FALSE ) 00404 ** 00405 ** Defined in abcc_drv_cfg.h. 00406 ** 00407 ** Enable/disable driver support for triggering of callback notifications each 00408 ** time an ADI is read or written. This define will affect the AD_AdiEntryType 00409 ** (abcc_ad_if.h) used for defining the user ADI:s. 00410 ** If an ADI is read by the network the callback is invoked before the action. 00411 ** If an ADI is written by the network the callback is invoked after the action. 00412 **------------------------------------------------------------------------------ 00413 */ 00414 00415 /*------------------------------------------------------------------------------ 00416 ** #define ABCC_CFG_64BIT_ADI_SUPPORT 00417 ** 00418 ** Defined in abcc_drv_cfg.h. 00419 ** 00420 ** Define if 64 bit data type in the Application Data object shall be supported. 00421 **------------------------------------------------------------------------------ 00422 */ 00423 00424 /*------------------------------------------------------------------------------ 00425 ** #define ABCC_CFG_ERR_REPORTING_ENABLED (BOOL - TRUE/FALSE ) 00426 ** 00427 ** Defined in abcc_drv_cfg.h. 00428 ** 00429 ** Enable/disable the error reporting callback function (ABCC_CbfDriverError()) 00430 **------------------------------------------------------------------------------ 00431 */ 00432 00433 /*------------------------------------------------------------------------------ 00434 ** #define ABCC_CFG_DEBUG_EVENT_ENABLED (BOOL - TRUE/FALSE ) 00435 ** 00436 ** Defined in abcc_drv_cfg.h. 00437 ** 00438 ** Enable/disable driver support for print out of debug events within the 00439 ** driver. ABCC_PORT_DebugPrint() (abcc_sw_port.h) will be used to print debug 00440 ** information. 00441 **------------------------------------------------------------------------------ 00442 */ 00443 00444 /*------------------------------------------------------------------------------ 00445 ** #define ABCC_CFG_DEBUG_ERR_ENABLED (BOOL - TRUE/FALSE ) 00446 ** 00447 ** Defined in abcc_drv_cfg.h. 00448 ** 00449 ** Enable/disable printout of debug information when ABCC_CbfDriverError() is 00450 ** called such as file name and line number. 00451 **------------------------------------------------------------------------------ 00452 */ 00453 00454 /*------------------------------------------------------------------------------ 00455 ** #define ABCC_CFG_DEBUG_MESSAGING (BOOL - TRUE/FALSE ) 00456 ** 00457 ** Defined in abcc_drv_cfg.h. 00458 ** 00459 ** Enable/disable printout of received and sent messages. Related events such as 00460 ** buffer allocation and qeueing information is also printed. 00461 **------------------------------------------------------------------------------ 00462 */ 00463 00464 /*------------------------------------------------------------------------------ 00465 ** #define ABCC_CFG_STARTUP_TIME_MS ( 1500 ) 00466 ** 00467 ** If the ABCC interrupt pin is connected this define will be used as a timeout 00468 ** while waiting for the ABCC to become ready for communication. If the 00469 ** interrupt pin is not available the define will serve as time to wait before 00470 ** starting to communicate with ABCC. If not defined default will be 1500 ms. 00471 **------------------------------------------------------------------------------ 00472 */ 00473 00474 /*------------------------------------------------------------------------------ 00475 ** #define ABCC_CFG_SYNC_MEASUREMENT_IP (BOOL - TRUE/FALSE ) 00476 ** 00477 ** Defined in abcc_drv_cfg.h. 00478 ** 00479 ** Enable/disable driver support for measurement of input processing time (used 00480 ** for SYNC). This define is used during development by activating it and 00481 ** compiling special test versions of the product. 00482 ** When ABCC_CFG_SYNC_MEASUREMENT_IP is TRUE ABCC_SYS_GpioReset() is 00483 ** called at the WRPD interrupt. If running in SPI operating mode it is 00484 ** instead called when ABCC_SpiRunDriver() has finished sending data to the 00485 ** Anybus. 00486 ** When ABCC_CFG_SYNC_MEASUREMENT_IP is TRUE ABCC_GpioSet() needs to be 00487 ** called at the Input Capture Point. 00488 **------------------------------------------------------------------------------ 00489 */ 00490 00491 /*------------------------------------------------------------------------------ 00492 ** #define ABCC_CFG_SYNC_MEASUREMENT_OP (BOOL - TRUE/FALSE ) 00493 ** 00494 ** Defined in abcc_drv_cfg.h. 00495 ** 00496 ** Enable/disable driver support for measurement of output processing time (used 00497 ** for SYNC). This define is used during development by activating it and 00498 ** compiling special test versions of the product. 00499 ** When ABCC_CFG_SYNC_MEASUREMENT_OP is TRUE ABCC_SYS_GpioSet() is called 00500 ** from the RDPDI interrupt. 00501 ** When ABCC_CFG_SYNC_MEASUREMENT_OP is TRUE ABCC_GpioReset() needs to be 00502 ** called at the Output Valid Point. 00503 **------------------------------------------------------------------------------ 00504 */ 00505 00506 #endif /* inclusion lock */
Generated on Tue Jul 12 2022 15:51:56 by
