summaryrefslogtreecommitdiffstats
path: root/Master/Masterarbeit/src
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Master/Masterarbeit/src
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Master/Masterarbeit/src')
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool.avrsln20
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/CANVerificationTool.avrgccproj553
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/Framework.config71
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/__TemplateIcon.pngbin0 -> 935 bytes
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/AVR_COMPILER.H2
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.c657
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.h322
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.c314
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.h38
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANDCI.h89
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.c126
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.h24
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.c415
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.h79
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1ce.h58
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.c57
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.h28
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1ce.h30
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.c1419
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.h27
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.c34
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.h23
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1ce.h16
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.c230
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.h104
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1ce.h32
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.c51
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.h15
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1ce.h36
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.c148
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.h17
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.c122
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.h143
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1ce.h31
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf.h64
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/led.h185
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/uc3c_ek.h323
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.c115
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.h331
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.c1136
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.h1018
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.c649
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.h680
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/exception.S237
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.c214
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.h90
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.c277
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.h392
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.c575
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.h381
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/sleep.h149
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.c784
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.h761
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.c312
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.h589
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt.h140
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt4.c165
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.c464
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.h183
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/compiler.h1233
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds288
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/parts.h253
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/mrepeat.h326
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/preprocessor.h53
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/stringz.h73
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/tpaste.h93
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/startup_uc3.S118
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.S75
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.h52
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/status_codes.h81
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/boards/board.h196
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/genclk.h136
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/osc.h145
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/pll.h279
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/sysclk.h150
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/genclk.h132
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.c169
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.h600
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.c76
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.h228
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.c407
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.h1169
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt.h132
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt/interrupt_avr32.h342
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/can1ce.h141
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/cdef.h70
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/CANDCI.h89
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_board.h11
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_can.h97
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_clock.h55
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/main.c29
-rw-r--r--Master/Masterarbeit/src/CANVerificationTool/doc/Doxyfile1813
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln20
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj369
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user65
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp766
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h133
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.apsbin0 -> 41568 bytes
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp489
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def13
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h53
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.icobin0 -> 766 bytes
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc256
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp236
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h34
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp94
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h81
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp107
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h17
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp32
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h48
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h125
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp233
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h58
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp4
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h41
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp382
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h72
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h6487
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.libbin0 -> 98640 bytes
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc213
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h42
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.icobin0 -> 2238 bytes
-rw-r--r--Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile1604
-rw-r--r--Master/Masterarbeit/src/XorayaLogPlugin/.cproject149
-rw-r--r--Master/Masterarbeit/src/XorayaLogPlugin/.project83
-rw-r--r--Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.cpp309
-rw-r--r--Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h67
-rw-r--r--Master/Masterarbeit/src/XorayaLogPlugin/bounded_buffer.hpp87
-rw-r--r--Master/Masterarbeit/src/XorayaLogPlugin/doc/Doxyfile1814
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/.cproject215
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/.project.default90
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.cpp271
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.h68
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.cpp577
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.h176
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.cpp378
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.h101
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.cpp90
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h48
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.cpp62
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.h51
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/doc/Doxyfile1814
-rw-r--r--Master/Masterarbeit/src/XorayaPluginExecutor/main.cpp108
-rw-r--r--Master/Masterarbeit/src/XorayaTestPlugin/.cproject219
-rw-r--r--Master/Masterarbeit/src/XorayaTestPlugin/.project84
-rw-r--r--Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp127
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.sln20
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.suobin0 -> 48128 bytes
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/ReadMe.txt36
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.cpp89
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.h33
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.cpp47
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.h20
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.cpp34
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.h17
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.cpp37
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.h19
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.cpp14
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj259
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj.SCHLEISSHEIMER.Eisenhauer.user65
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.cpp8
-rw-r--r--Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.h17
-rw-r--r--Master/Masterarbeit/src/common/cpu_load.sh10
-rw-r--r--Master/Masterarbeit/src/common/inc/CNetworkStream.h189
-rw-r--r--Master/Masterarbeit/src/common/inc/IPluginExecutor.h26
-rw-r--r--Master/Masterarbeit/src/common/inc/NetworkMessages.h282
-rw-r--r--Master/Masterarbeit/src/common/inc/NetworkTypes.h467
-rw-r--r--Master/Masterarbeit/src/common/inc/global.h162
-rw-r--r--Master/Masterarbeit/src/common/inc/interface_manager.h99
-rw-r--r--Master/Masterarbeit/src/common/inc/plugin_api.h138
-rw-r--r--Master/Masterarbeit/src/common/inc/plugin_api_heap.h53
-rw-r--r--Master/Masterarbeit/src/common/inc/protocol.h70
-rw-r--r--Master/Masterarbeit/src/common/src/CNetworkStream.cpp203
-rw-r--r--Master/Masterarbeit/src/common/src/NetworkTypes.cpp540
175 files changed, 46472 insertions, 0 deletions
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool.avrsln b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool.avrsln
new file mode 100644
index 0000000..c382db3
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool.avrsln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# AvrStudio Solution File, Format Version 11.00
+Project("{D1100916-62DA-4D80-A9B4-55A1E7CCEEB3}") = "CANVerificationTool", "CANVerificationTool\CANVerificationTool.avrgccproj", "{C800AB44-876A-11E0-BB03-000C2967FA5F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|AVR = Debug|AVR
+ Release|AVR = Release|AVR
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C800AB44-876A-11E0-BB03-000C2967FA5F}.Debug|AVR.ActiveCfg = Debug|AVR
+ {C800AB44-876A-11E0-BB03-000C2967FA5F}.Debug|AVR.Build.0 = Debug|AVR
+ {C800AB44-876A-11E0-BB03-000C2967FA5F}.Release|AVR.ActiveCfg = Release|AVR
+ {C800AB44-876A-11E0-BB03-000C2967FA5F}.Release|AVR.Build.0 = Release|AVR
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/CANVerificationTool.avrgccproj b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/CANVerificationTool.avrgccproj
new file mode 100644
index 0000000..89c0c85
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/CANVerificationTool.avrgccproj
@@ -0,0 +1,553 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
+ <PropertyGroup>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectVersion>5.0</ProjectVersion>
+ <ProjectGuid>c800ab44-876a-11e0-bb03-000c2967fa5f</ProjectGuid>
+ <avrdevice>AT32UC3C0512C</avrdevice>
+ <avrdeviceseries>uc3c</avrdeviceseries>
+ <OutputFile>$(MSBuildProjectName).elf</OutputFile>
+ <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+ <AvrGccProjectExtensions />
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <Name>$(MSBuildProjectName)</Name>
+ <RootNamespace>$(MSBuildProjectName)</RootNamespace>
+ <OutputType>Executable</OutputType>
+ <Language>C</Language>
+ <UseGlobalToolchain>True</UseGlobalToolchain>
+ <GlobalToolchainPath>C:\Programme\Atmel\AVR Studio 5.0\AVR ToolChain\bin</GlobalToolchainPath>
+ <ToolchainDirPath />
+ <MakeDirPath />
+ <avrtool>com.atmel.avrdbg.tool.avrdragon</avrtool>
+ <avrtoolinterface>JTAG</avrtoolinterface>
+ <com_atmel_avrdbg_tool_avrdragon>
+ <ToolType>com.atmel.avrdbg.tool.avrdragon</ToolType>
+ <ToolName>AVR Dragon</ToolName>
+ <ToolNumber>00A200019255</ToolNumber>
+ <Channel>
+ <host>127.0.0.1</host>
+ <port>1317</port>
+ <ssl>False</ssl>
+ </Channel>
+ <ToolOptions>
+ <InterfaceName>JTAG</InterfaceName>
+ <InterfaceProperties>
+ <JtagDbgClock>1000000</JtagDbgClock>
+ <JtagProgClock>1000000</JtagProgClock>
+ <IspClock>150000</IspClock>
+ <JtagInChain>false</JtagInChain>
+ <JtagEnableExtResetOnStartSession>false</JtagEnableExtResetOnStartSession>
+ <JtagDevicesBefore>0</JtagDevicesBefore>
+ <JtagDevicesAfter>0</JtagDevicesAfter>
+ <JtagInstrBitsBefore>0</JtagInstrBitsBefore>
+ <JtagInstrBitsAfter>0</JtagInstrBitsAfter>
+ </InterfaceProperties>
+ </ToolOptions>
+ </com_atmel_avrdbg_tool_avrdragon>
+ <com_atmel_avrdbg_tool_jtagicemkii>
+ <ToolType>com.atmel.avrdbg.tool.jtagicemkii</ToolType>
+ <ToolName>JTAGICE mkII</ToolName>
+ <ToolNumber>070000002558</ToolNumber>
+ <Channel>
+ <host>127.0.0.1</host>
+ <port>1586</port>
+ <ssl>False</ssl>
+ </Channel>
+ <ToolOptions>
+ <InterfaceName>JTAG</InterfaceName>
+ <InterfaceProperties>
+ <JtagDbgClock>0</JtagDbgClock>
+ <JtagProgClock>1000000</JtagProgClock>
+ <IspClock>150000</IspClock>
+ <JtagInChain>false</JtagInChain>
+ <JtagEnableExtResetOnStartSession>true</JtagEnableExtResetOnStartSession>
+ <JtagDevicesBefore>0</JtagDevicesBefore>
+ <JtagDevicesAfter>0</JtagDevicesAfter>
+ <JtagInstrBitsBefore>0</JtagInstrBitsBefore>
+ <JtagInstrBitsAfter>0</JtagInstrBitsAfter>
+ </InterfaceProperties>
+ </ToolOptions>
+ </com_atmel_avrdbg_tool_jtagicemkii>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <ToolchainSettings>
+ <Avr32Gcc>
+ <avr32gcc.compiler.symbols.DefSymbols>
+ <ListValues>
+ <Value>BOARD=UC3C_EK</Value>
+ </ListValues>
+ </avr32gcc.compiler.symbols.DefSymbols>
+ <avr32gcc.compiler.directories.IncludePaths>
+ <ListValues>
+ <Value>../src</Value>
+ <Value>../src/asf/avr32/boards</Value>
+ <Value>../src/asf/avr32/boards/uc3c_ek</Value>
+ <Value>../src/asf/avr32/drivers/canif</Value>
+ <Value>../src/asf/avr32/drivers/flashc</Value>
+ <Value>../src/asf/avr32/drivers/gpio</Value>
+ <Value>../src/asf/avr32/drivers/intc</Value>
+ <Value>../src/asf/avr32/drivers/pm</Value>
+ <Value>../src/asf/avr32/drivers/scif</Value>
+ <Value>../src/asf/avr32/services/network/can</Value>
+ <Value>../src/asf/avr32/services/network/can/example2/conf</Value>
+ <Value>../src/asf/avr32/utils</Value>
+ <Value>../src/asf/avr32/utils/preprocessor</Value>
+ <Value>../src/asf/common/boards</Value>
+ <Value>../src/asf/common/utils</Value>
+ <Value>../src/config</Value>
+ <Value>../src/asf/avr32/drivers/wdt</Value>
+ <Value>../src/asf/common/services/clock</Value>
+ <Value>../src/asf/avr32/drivers/tc</Value>
+ </ListValues>
+ </avr32gcc.compiler.directories.IncludePaths>
+ <avr32gcc.compiler.optimization.level>Optimize for size (-Os)</avr32gcc.compiler.optimization.level>
+ <avr32gcc.compiler.optimization.OtherFlags>-fdata-sections</avr32gcc.compiler.optimization.OtherFlags>
+ <avr32gcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</avr32gcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+ <avr32gcc.compiler.warnings.AllWarnings>True</avr32gcc.compiler.warnings.AllWarnings>
+ <avr32gcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax</avr32gcc.compiler.miscellaneous.OtherFlags>
+ <avr32gcc.linker.general.DoNotUseStandardStartFiles>True</avr32gcc.linker.general.DoNotUseStandardStartFiles>
+ <avr32gcc.linker.general.DoNotUseDefaultLibraries />
+ <avr32gcc.linker.optimization.GarbageCollectUnusedSections>True</avr32gcc.linker.optimization.GarbageCollectUnusedSections>
+ <avr32gcc.linker.miscellaneous.LinkerFlags>-T../src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds -Wl,-section-start=.hsb_ram_loc=0xA0000000 -Wl,--relax -Wl,-e,_trampoline</avr32gcc.linker.miscellaneous.LinkerFlags>
+ <avr32gcc.assembler.general.AssemblerFlags>-mrelax</avr32gcc.assembler.general.AssemblerFlags>
+ <avr32gcc.assembler.general.IncludePaths>
+ <ListValues>
+ <Value>../src</Value>
+ <Value>../src/asf/avr32/boards</Value>
+ <Value>../src/asf/avr32/boards/uc3c_ek</Value>
+ <Value>../src/asf/avr32/drivers/canif</Value>
+ <Value>../src/asf/avr32/drivers/flashc</Value>
+ <Value>../src/asf/avr32/drivers/gpio</Value>
+ <Value>../src/asf/avr32/drivers/intc</Value>
+ <Value>../src/asf/avr32/drivers/pm</Value>
+ <Value>../src/asf/avr32/drivers/scif</Value>
+ <Value>../src/asf/avr32/services/network/can</Value>
+ <Value>../src/asf/avr32/services/network/can/example2/conf</Value>
+ <Value>../src/asf/avr32/utils</Value>
+ <Value>../src/asf/avr32/utils/preprocessor</Value>
+ <Value>../src/asf/common/boards</Value>
+ <Value>../src/asf/common/utils</Value>
+ <Value>../src/config</Value>
+ <Value>../src/asf/avr32/drivers/wdt</Value>
+ <Value>../src/asf/common/services/clock</Value>
+ <Value>../src/asf/avr32/drivers/tc</Value>
+ </ListValues>
+ </avr32gcc.assembler.general.IncludePaths>
+ <avr32gcc.preprocessingassembler.general.AssemblerFlags>-mrelax</avr32gcc.preprocessingassembler.general.AssemblerFlags>
+ <avr32gcc.preprocessingassembler.general.IncludePaths>
+ <ListValues>
+ <Value>../src</Value>
+ <Value>../src/asf/avr32/boards</Value>
+ <Value>../src/asf/avr32/boards/uc3c_ek</Value>
+ <Value>../src/asf/avr32/drivers/canif</Value>
+ <Value>../src/asf/avr32/drivers/flashc</Value>
+ <Value>../src/asf/avr32/drivers/gpio</Value>
+ <Value>../src/asf/avr32/drivers/intc</Value>
+ <Value>../src/asf/avr32/drivers/pm</Value>
+ <Value>../src/asf/avr32/drivers/scif</Value>
+ <Value>../src/asf/avr32/services/network/can</Value>
+ <Value>../src/asf/avr32/services/network/can/example2/conf</Value>
+ <Value>../src/asf/avr32/utils</Value>
+ <Value>../src/asf/avr32/utils/preprocessor</Value>
+ <Value>../src/asf/common/boards</Value>
+ <Value>../src/asf/common/utils</Value>
+ <Value>../src/config</Value>
+ <Value>../src/asf/avr32/drivers/wdt</Value>
+ <Value>../src/asf/common/services/clock</Value>
+ <Value>../src/asf/avr32/drivers/tc</Value>
+ </ListValues>
+ </avr32gcc.preprocessingassembler.general.IncludePaths>
+</Avr32Gcc>
+ </ToolchainSettings>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <ToolchainSettings>
+ <Avr32Gcc>
+ <avr32gcc.compiler.symbols.DefSymbols>
+ <ListValues>
+ <Value>BOARD=UC3C_EK</Value>
+ </ListValues>
+ </avr32gcc.compiler.symbols.DefSymbols>
+ <avr32gcc.compiler.directories.IncludePaths>
+ <ListValues>
+ <Value>../src</Value>
+ <Value>../src/asf/avr32/boards</Value>
+ <Value>../src/asf/avr32/boards/uc3c_ek</Value>
+ <Value>../src/asf/avr32/drivers/canif</Value>
+ <Value>../src/asf/avr32/drivers/flashc</Value>
+ <Value>../src/asf/avr32/drivers/gpio</Value>
+ <Value>../src/asf/avr32/drivers/intc</Value>
+ <Value>../src/asf/avr32/drivers/pm</Value>
+ <Value>../src/asf/avr32/drivers/scif</Value>
+ <Value>../src/asf/avr32/services/network/can</Value>
+ <Value>../src/asf/avr32/services/network/can/example2/conf</Value>
+ <Value>../src/asf/avr32/utils</Value>
+ <Value>../src/asf/avr32/utils/preprocessor</Value>
+ <Value>../src/asf/common/boards</Value>
+ <Value>../src/asf/common/utils</Value>
+ <Value>../src/config</Value>
+ <Value>../src/asf/avr32/drivers/wdt</Value>
+ <Value>../src/asf/common/services/clock</Value>
+ <Value>../src/asf/avr32/drivers/tc</Value>
+ </ListValues>
+ </avr32gcc.compiler.directories.IncludePaths>
+ <avr32gcc.compiler.optimization.OtherFlags>-fdata-sections</avr32gcc.compiler.optimization.OtherFlags>
+ <avr32gcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</avr32gcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+ <avr32gcc.compiler.optimization.DebugLevel>Maximum (-g3)</avr32gcc.compiler.optimization.DebugLevel>
+ <avr32gcc.compiler.warnings.AllWarnings>True</avr32gcc.compiler.warnings.AllWarnings>
+ <avr32gcc.compiler.miscellaneous.OtherFlags>-std=gnu99 -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax</avr32gcc.compiler.miscellaneous.OtherFlags>
+ <avr32gcc.linker.general.DoNotUseStandardStartFiles>True</avr32gcc.linker.general.DoNotUseStandardStartFiles>
+ <avr32gcc.linker.optimization.GarbageCollectUnusedSections>True</avr32gcc.linker.optimization.GarbageCollectUnusedSections>
+ <avr32gcc.linker.miscellaneous.LinkerFlags>-T../src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds -Wl,-section-start=.hsb_ram_loc=0xA0000000 -Wl,--relax -Wl,-e,_trampoline</avr32gcc.linker.miscellaneous.LinkerFlags>
+ <avr32gcc.assembler.general.AssemblerFlags>-mrelax</avr32gcc.assembler.general.AssemblerFlags>
+ <avr32gcc.assembler.general.IncludePaths>
+ <ListValues>
+ <Value>../src</Value>
+ <Value>../src/asf/avr32/boards</Value>
+ <Value>../src/asf/avr32/boards/uc3c_ek</Value>
+ <Value>../src/asf/avr32/drivers/canif</Value>
+ <Value>../src/asf/avr32/drivers/flashc</Value>
+ <Value>../src/asf/avr32/drivers/gpio</Value>
+ <Value>../src/asf/avr32/drivers/intc</Value>
+ <Value>../src/asf/avr32/drivers/pm</Value>
+ <Value>../src/asf/avr32/drivers/scif</Value>
+ <Value>../src/asf/avr32/services/network/can</Value>
+ <Value>../src/asf/avr32/services/network/can/example2/conf</Value>
+ <Value>../src/asf/avr32/utils</Value>
+ <Value>../src/asf/avr32/utils/preprocessor</Value>
+ <Value>../src/asf/common/boards</Value>
+ <Value>../src/asf/common/utils</Value>
+ <Value>../src/config</Value>
+ <Value>../src/asf/avr32/drivers/wdt</Value>
+ <Value>../src/asf/common/services/clock</Value>
+ <Value>../src/asf/avr32/drivers/tc</Value>
+ </ListValues>
+ </avr32gcc.assembler.general.IncludePaths>
+ <avr32gcc.preprocessingassembler.general.AssemblerFlags>-mrelax</avr32gcc.preprocessingassembler.general.AssemblerFlags>
+ <avr32gcc.preprocessingassembler.general.IncludePaths>
+ <ListValues>
+ <Value>../src</Value>
+ <Value>../src/asf/avr32/boards</Value>
+ <Value>../src/asf/avr32/boards/uc3c_ek</Value>
+ <Value>../src/asf/avr32/drivers/canif</Value>
+ <Value>../src/asf/avr32/drivers/flashc</Value>
+ <Value>../src/asf/avr32/drivers/gpio</Value>
+ <Value>../src/asf/avr32/drivers/intc</Value>
+ <Value>../src/asf/avr32/drivers/pm</Value>
+ <Value>../src/asf/avr32/drivers/scif</Value>
+ <Value>../src/asf/avr32/services/network/can</Value>
+ <Value>../src/asf/avr32/services/network/can/example2/conf</Value>
+ <Value>../src/asf/avr32/utils</Value>
+ <Value>../src/asf/avr32/utils/preprocessor</Value>
+ <Value>../src/asf/common/boards</Value>
+ <Value>../src/asf/common/utils</Value>
+ <Value>../src/config</Value>
+ <Value>../src/asf/avr32/drivers/wdt</Value>
+ <Value>../src/asf/common/services/clock</Value>
+ <Value>../src/asf/avr32/drivers/tc</Value>
+ </ListValues>
+ </avr32gcc.preprocessingassembler.general.IncludePaths>
+</Avr32Gcc>
+ </ToolchainSettings>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="src\asf.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\boards\uc3c_ek\led.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\boards\uc3c_ek\uc3c_ek.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\canif\canif.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\canif\canif.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\flashc\flashc.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\flashc\flashc.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\gpio\gpio.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\gpio\gpio.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\intc\exception.S">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\intc\intc.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\intc\intc.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\pm\pm_uc3c.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\pm\pm_uc3c.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\pm\power_clocks_lib.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\pm\power_clocks_lib.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\pm\sleep.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\scif\scif_uc3c.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\scif\scif_uc3c.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\tc\tc.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\tc\tc.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\wdt\wdt.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\drivers\wdt\wdt4.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\services\network\can\can.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\services\network\can\can.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\compiler.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\linker_scripts\at32uc3c\0512c\gcc\link_uc3c0512c.lds">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\parts.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\preprocessor\mrepeat.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\preprocessor\preprocessor.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\preprocessor\stringz.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\preprocessor\tpaste.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\startup\startup_uc3.S">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\startup\trampoline_uc3.S">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\startup\trampoline_uc3.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\avr32\utils\status_codes.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\boards\board.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\genclk.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\osc.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\pll.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\sysclk.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\genclk.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\osc.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\osc.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\pll.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\pll.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\sysclk.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\services\clock\uc3c\sysclk.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\utils\interrupt.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\asf\common\utils\interrupt\interrupt_avr32.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\AVR_COMPILER.H">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CAN1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CAN1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\can1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CAND1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CAND1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CANDCI.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CANIF1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\CANIF1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\cdef.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\config\CANDCI.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\config\conf_board.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\config\conf_can.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\config\conf_clock.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\EVHD1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\EVHD1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\EVHD1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\EXEA1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\EXEA1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\EXEA1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\IL1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\IL1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\IVECT1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\IVECT1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\IVECT1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\main.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\OS1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\OS1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\OS1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\PINT1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\PINT1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\PINT1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\START1C1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\START1C1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\TIMER1c1.c">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\TIMER1c1.h">
+ <SubType>compile</SubType>
+ </Compile>
+ <Compile Include="src\TIMER1ce.h">
+ <SubType>compile</SubType>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="src\" />
+ <Folder Include="src\asf\" />
+ <Folder Include="src\asf\avr32\" />
+ <Folder Include="src\asf\avr32\boards\" />
+ <Folder Include="src\asf\avr32\boards\uc3c_ek\" />
+ <Folder Include="src\asf\avr32\drivers\" />
+ <Folder Include="src\asf\avr32\drivers\canif\" />
+ <Folder Include="src\asf\avr32\drivers\flashc\" />
+ <Folder Include="src\asf\avr32\drivers\gpio\" />
+ <Folder Include="src\asf\avr32\drivers\intc\" />
+ <Folder Include="src\asf\avr32\drivers\pm\" />
+ <Folder Include="src\asf\avr32\drivers\scif\" />
+ <Folder Include="src\asf\avr32\drivers\tc\" />
+ <Folder Include="src\asf\avr32\drivers\usart\" />
+ <Folder Include="src\asf\avr32\drivers\wdt\" />
+ <Folder Include="src\asf\avr32\services\" />
+ <Folder Include="src\asf\avr32\services\network\" />
+ <Folder Include="src\asf\avr32\services\network\can\" />
+ <Folder Include="src\asf\avr32\utils\" />
+ <Folder Include="src\asf\avr32\utils\debug\" />
+ <Folder Include="src\asf\avr32\utils\linker_scripts\" />
+ <Folder Include="src\asf\avr32\utils\linker_scripts\at32uc3c\" />
+ <Folder Include="src\asf\avr32\utils\linker_scripts\at32uc3c\0512c\" />
+ <Folder Include="src\asf\avr32\utils\linker_scripts\at32uc3c\0512c\gcc\" />
+ <Folder Include="src\asf\avr32\utils\preprocessor\" />
+ <Folder Include="src\asf\avr32\utils\startup\" />
+ <Folder Include="src\asf\common\" />
+ <Folder Include="src\asf\common\boards\" />
+ <Folder Include="src\asf\common\services\" />
+ <Folder Include="src\asf\common\services\clock\" />
+ <Folder Include="src\asf\common\services\clock\uc3c\" />
+ <Folder Include="src\asf\common\utils\" />
+ <Folder Include="src\asf\common\utils\interrupt\" />
+ <Folder Include="src\config\" />
+ </ItemGroup>
+ <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\AvrGCC32.targets" />
+</Project> \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/Framework.config b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/Framework.config
new file mode 100644
index 0000000..b8dcc18
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/Framework.config
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<framework-data>
+ <options>
+ <option id="com.atmel.avr32.sf.uc3c.drivers.intc" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.common.utils.interrupt" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.drivers.pm" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.drivers.scif" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.drivers.gpio" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.drivers.tc" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.drivers.wdt" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.common.boards" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.services.network.can" value="true" />
+ <option id="com.atmel.avr32.sf.uc3c.common.services.basic.clock" value="true" />
+ </options>
+ <files>
+ <file path="src/asf/avr32/utils/preprocessor/stringz.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/preprocessor/stringz.h" changed="False" />
+ <file path="src/asf/avr32/drivers/pm/power_clocks_lib.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/pm/power_clocks_lib.c" changed="False" />
+ <file path="src/asf/avr32/drivers/pm/pm_uc3c.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/pm/pm_uc3c.c" changed="False" />
+ <file path="src/asf/avr32/drivers/pm/power_clocks_lib.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/pm/power_clocks_lib.h" changed="False" />
+ <file path="src/asf/avr32/utils/parts.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/parts.h" changed="False" />
+ <file path="src/asf/avr32/drivers/pm/pm_uc3c.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/pm/pm_uc3c.h" changed="False" />
+ <file path="src/asf/avr32/utils/preprocessor/preprocessor.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/preprocessor/preprocessor.h" changed="False" />
+ <file path="src/asf/avr32/drivers/pm/sleep.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/pm/sleep.h" changed="False" />
+ <file path="src/asf/common/utils/interrupt.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="common/utils/interrupt.h" changed="False" />
+ <file path="src/config/conf_can.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/services/network/can/example2/conf/conf_can.h" changed="False" />
+ <file path="src/asf/avr32/boards/uc3c_ek/led.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/boards/uc3c_ek/led.h" changed="False" />
+ <file path="src/asf/avr32/drivers/intc/intc.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/intc/intc.c" changed="False" />
+ <file path="src/asf/avr32/drivers/gpio/gpio.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/gpio/gpio.h" changed="False" />
+ <file path="src/asf/avr32/drivers/canif/canif.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/canif/canif.h" changed="False" />
+ <file path="src/asf/avr32/utils/status_codes.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/status_codes.h" changed="False" />
+ <file path="src/asf/avr32/drivers/canif/canif.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/canif/canif.c" changed="False" />
+ <file path="src/asf/avr32/drivers/gpio/gpio.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/gpio/gpio.c" changed="False" />
+ <file path="src/asf/avr32/drivers/intc/intc.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/intc/intc.h" changed="False" />
+ <file path="src/asf/avr32/utils/compiler.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/compiler.h" changed="False" />
+ <file path="src/asf/avr32/utils/preprocessor/mrepeat.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/preprocessor/mrepeat.h" changed="False" />
+ <file path="src/asf/avr32/drivers/flashc/flashc.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/flashc/flashc.h" changed="False" />
+ <file path="src/asf/avr32/utils/startup/trampoline_uc3.S" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/startup/trampoline_uc3.S" changed="False" />
+ <file path="src/asf/avr32/drivers/flashc/flashc.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/flashc/flashc.c" changed="False" />
+ <file path="src/config/conf_can_example.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/services/network/can/example2/conf/conf_can_example.h" changed="False" />
+ <file path="src/asf/avr32/utils/preprocessor/tpaste.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/preprocessor/tpaste.h" changed="False" />
+ <file path="src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds" changed="False" />
+ <file path="src/asf/common/utils/interrupt/interrupt_avr32.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="common/utils/interrupt/interrupt_avr32.h" changed="False" />
+ <file path="src/asf/avr32/utils/startup/startup_uc3.S" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/startup/startup_uc3.S" changed="False" />
+ <file path="src/asf.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="./avr32/services/network/can/example2/at32uc3c0512c_uc3c_ek/as5_32/asf.h" changed="False" />
+ <file path="src/asf/common/boards/board.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="common/boards/board.h" changed="False" />
+ <file path="src/asf/avr32/services/network/can/can.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/services/network/can/can.h" changed="False" />
+ <file path="src/asf/avr32/boards/uc3c_ek/uc3c_ek.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/boards/uc3c_ek/uc3c_ek.h" changed="False" />
+ <file path="src/asf/avr32/drivers/scif/scif_uc3c.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/scif/scif_uc3c.h" changed="False" />
+ <file path="src/asf/avr32/utils/startup/trampoline_uc3.h" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/utils/startup/trampoline_uc3.h" changed="False" />
+ <file path="src/can_example2.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/services/network/can/example2/can_example2.c" changed="False" />
+ <file path="src/asf/avr32/drivers/intc/exception.S" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/intc/exception.S" changed="False" />
+ <file path="src/asf/avr32/services/network/can/can.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/services/network/can/can.c" changed="False" />
+ <file path="src/asf/avr32/drivers/scif/scif_uc3c.c" framework="com.atmel.avr32.sf.uc3c" version="2.5.1-17860" source="avr32/drivers/scif/scif_uc3c.c" changed="False" />
+ <file path="src/asf/avr32/drivers/wdt/wdt4.c" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="avr32/drivers/wdt/wdt4.c" changed="False" />
+ <file path="src/asf/avr32/drivers/wdt/wdt.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="avr32/drivers/wdt/wdt.h" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/sysclk.c" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/sysclk.c" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/osc.c" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/osc.c" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/pll.c" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/pll.c" changed="False" />
+ <file path="src/asf/common/services/clock/genclk.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/genclk.h" changed="False" />
+ <file path="src/asf/common/services/clock/osc.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/osc.h" changed="False" />
+ <file path="src/asf/common/services/clock/sysclk.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/sysclk.h" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/osc.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/osc.h" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/genclk.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/genclk.h" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/pll.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/pll.h" changed="False" />
+ <file path="src/asf/common/services/clock/uc3c/sysclk.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/uc3c/sysclk.h" changed="False" />
+ <file path="src/asf/common/services/clock/pll.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="common/services/clock/pll.h" changed="False" />
+ <file path="src/asf/avr32/drivers/tc/tc.c" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="avr32/drivers/tc/tc.c" changed="False" />
+ <file path="src/asf/avr32/drivers/tc/tc.h" framework="com.atmel.avr32.sf.uc3c" version="2.2.2" source="avr32/drivers/tc/tc.h" changed="False" />
+ </files>
+ <documentation help="http://asf.atmel.com/docs/2.5.1/avr32/services/network/can/example2/at32uc3c0512c_uc3c_ek/doxygen/html/" />
+</framework-data> \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/__TemplateIcon.png b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/__TemplateIcon.png
new file mode 100644
index 0000000..c9b04d5
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/__TemplateIcon.png
Binary files differ
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/AVR_COMPILER.H b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/AVR_COMPILER.H
new file mode 100644
index 0000000..0531c1f
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/AVR_COMPILER.H
@@ -0,0 +1,2 @@
+#include "compiler.h"
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.c
new file mode 100644
index 0000000..78b6913
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.c
@@ -0,0 +1,657 @@
+
+#include "CAN1c1.h"
+#include "CAND1c1.h"
+#include "CANIF1c1.h"
+
+
+void CAN_vNoRxIndication_Cb( CAN_tenMessage enMsg, CAN_tId CanId )
+{
+}
+
+void CAN_vNoPreTx_Cb( CAN_tenMessage enMsg )
+{
+}
+
+/**********************/
+/*Signal Konfiguration*/
+/**********************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+ { MSG_ID, START_BIT, SIZE, DEFAULT }, \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+const CAN__tstSignalConfig CAN__astSignalConfig[CAN_nenSig_NoOfSignals] =
+{
+ CAN_MakeDbConfig
+};
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+
+/*****************************************************/
+/*extern-Deklaration der Rx/Tx-Callback-Funktionen */
+/*****************************************************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+ extern void PRE_TX_CALLBACK( CAN_tenMessage enMsgId ); \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+ extern void RX_CALLBACK( CAN_tenMessage enMsgId, CAN_tId CanId ); \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+ CAN_MakeDbConfig
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+/******************************************/
+/*Message Daten Speicher (RAM) */
+/******************************************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+ uint8_t CAN__au8MsgData_##MSG_ID[DLC]; \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+ uint8_t CAN__au8MsgData_##MSG_ID[DLC]; \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+ CAN_MakeDbConfig
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+
+/***************************/
+/*Rx-Messages Konfiguration*/
+/***************************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+ { DLC, TIMEOUT/CAN__nPollCycle, CAN__au8MsgData_##MSG_ID, RX_CALLBACK }, \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+const CAN__tstRxMessageConfig CAN__astRxMessageConfig[CAN_nenMsg_NoOfRxMessages] =
+{
+ CAN_MakeDbConfig
+};
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+
+/***************************/
+/*Tx-Messages Konfiguration*/
+/***************************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+ { CAN_CH, DLC, CYCLE/CAN__nPollCycle, CAN__au8MsgData_##MSG_ID, PRE_TX_CALLBACK }, \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+const CAN__tstTxMessageConfig CAN__astTxMessageConfig[CAN_nenMsg_NoOfTxMessages] =
+{
+ CAN_MakeDbConfig
+};
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+/***************************/
+/*Tx CAN-ID Konfiguration */
+/***************************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+ CAN_ID, \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+CAN_tTxId CAN__aTxIds[CAN_nenMsg_NoOfTxMessages] =
+{
+ CAN_MakeDbConfig
+};
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+
+
+/***************************/
+/*Rx CAN-ID Konfiguration */
+/***************************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+ { CAN_ID_START, CAN_ID_END }, \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+CAN__tstRxCanIds CAN__astRxIds[CAN_nenMsg_NoOfRxMessages] =
+{
+ CAN_MakeDbConfig
+};
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+/******************************/
+/* Timeout Counter */
+/******************************/
+uint16_t CAN__au16TimeoutCounter[CAN_nenMsg_NoOfRxMessages];
+
+void CAN__vResetTimeoutCounter( CAN_tenMessage u8RxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( u8RxMsgId >= CAN_nenMsg_RxMessagesStart
+ && u8RxMsgId <= CAN_nenMsg_RxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8RxMsgIdToMsgIndex( u8RxMsgId );
+ CAN__au16TimeoutCounter[u8MsgIndex] = CAN__astRxMessageConfig[u8MsgIndex].u16Timout;
+ }
+}
+
+bool CAN_boIsTimeout( CAN_tenMessage u8RxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( u8RxMsgId >= CAN_nenMsg_RxMessagesStart
+ && u8RxMsgId <= CAN_nenMsg_RxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8RxMsgIdToMsgIndex( u8RxMsgId );
+ return CAN__au16TimeoutCounter[ u8MsgIndex ] == 0;
+ }
+ return false;
+}
+
+void CAN__vCountAllTimeoutCounters( void )
+{
+ uint8_t u8MsgIndex;
+
+ for( u8MsgIndex=0; u8MsgIndex<CAN_nenMsg_NoOfRxMessages; u8MsgIndex++ )
+ {
+ if( CAN__au16TimeoutCounter[u8MsgIndex] )
+ {
+ CAN__au16TimeoutCounter[u8MsgIndex]--;
+ }
+ }
+}
+
+void CAN__vInitAllTimeoutCounters( void )
+{
+ CAN_tenMessage u8MsgId;
+
+ for( u8MsgId=CAN_nenMsg_RxMessagesStart; u8MsgId<CAN_nenMsg_RxMessagesEnd; u8MsgId++ )
+ {
+ CAN__vResetTimeoutCounter( u8MsgId );
+ }
+}
+
+/******************************/
+/* Cycle Counter */
+/******************************/
+
+uint16_t CAN__au16CycleCounter[CAN_nenMsg_NoOfTxMessages];
+
+void CAN__vInitAllCycleCounter( void )
+{
+ uint8_t u8MsgIndex;
+
+ for( u8MsgIndex=0; u8MsgIndex<CAN_nenMsg_NoOfTxMessages; u8MsgIndex++ )
+ {
+ CAN__au16CycleCounter[u8MsgIndex] = CAN__astTxMessageConfig[u8MsgIndex].u16Cycle;
+ }
+}
+
+void CAN__vCheckAllCycleCounter( void )
+{
+ uint8_t u8MsgIndex;
+ CAN_tenMessage enTxMsgId;
+
+ for( u8MsgIndex=0; u8MsgIndex<=CAN_nenMsg_TxMessagesEnd; u8MsgIndex++ )
+ {
+ enTxMsgId = CAN__enMsgIndexToTxMsgId( u8MsgIndex );
+
+ if( CAN__boIsCyclicSendActive( enTxMsgId ) )
+ {
+ if( CAN__au16CycleCounter[u8MsgIndex] )
+ { /*noch nicht abgelaufe*/
+ CAN__au16CycleCounter[u8MsgIndex]--;
+ }
+ else
+ { /*abgelaufe*/
+ CAN__au16CycleCounter[u8MsgIndex] = CAN__astTxMessageConfig[u8MsgIndex].u16Cycle - 1;
+ /*Send-Request-Flag setzen*/
+ CAN__vSetSendRequestFlag( enTxMsgId );
+ }
+ }
+ }
+}
+
+
+/***********************************/
+/*First-Value-Flags */
+/***********************************/
+
+uint8_t CAN__abiFirstValueFlags[ (CAN_nenMsg_NoOfRxMessages + 7) / 8 ];
+
+void CAN__vInitAllFirstValueFlags( void )
+{
+ uint8_t u8Index;
+
+ for( u8Index=0; u8Index<sizeof(CAN__abiFirstValueFlags); u8Index++ )
+ {
+ CAN__abiFirstValueFlags[u8Index] = 0;
+ }
+}
+
+
+void CAN__vSetFirstValueFlag( CAN_tenMessage u8TxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( u8TxMsgId >= CAN_nenMsg_RxMessagesStart
+ && u8TxMsgId <= CAN_nenMsg_RxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( u8TxMsgId );
+ CAN__abiFirstValueFlags[ u8MsgIndex >> 3 ] |= 1 << (u8MsgIndex & 0x07);
+ }
+}
+
+void CAN__vClearFirstValueFlag( CAN_tenMessage u8TxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( u8TxMsgId >= CAN_nenMsg_RxMessagesStart
+ && u8TxMsgId <= CAN_nenMsg_RxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( u8TxMsgId );
+ CAN__abiFirstValueFlags[ u8MsgIndex >> 3 ] &= ~(1 << (u8MsgIndex & 0x07));
+ }
+}
+
+bool CAN_boIsFirstValue( CAN_tenMessage u8TxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( u8TxMsgId >= CAN_nenMsg_RxMessagesStart
+ && u8TxMsgId <= CAN_nenMsg_RxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( u8TxMsgId );
+ return (CAN__abiFirstValueFlags[ u8MsgIndex >> 3 ] & (1 << (u8MsgIndex & 0x07))) != 0;
+ }
+ return false;
+}
+
+
+/***********************************/
+/*Send-Request Flags */
+/***********************************/
+uint8_t CAN__abiSendRequestFlags[ (CAN_nenMsg_NoOfTxMessages + 7) / 8 ];
+
+void CAN__vInitAllSendRequestFlags( void )
+{
+ uint8_t u8Index;
+
+ for( u8Index=0; u8Index<CAN_nenMsg_NoOfTxMessages; u8Index++ )
+ {
+ if( 0 /*CAN__astTxMessageConfig[u8Index].enMode == CAN_nenTxMode_Cyclic*/)
+ {
+ CAN__vSetSendRequestFlag( CAN__enMsgIndexToTxMsgId(u8Index) );
+ }
+ else
+ {
+ CAN__vClearSendRequestFlag( CAN__enMsgIndexToTxMsgId(u8Index) );
+ }
+ }
+}
+
+void CAN__vSetSendRequestFlag( CAN_tenMessage enTxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( enTxMsgId >= CAN_nenMsg_TxMessagesStart
+ && enTxMsgId <= CAN_nenMsg_TxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( enTxMsgId );
+ CAN__abiSendRequestFlags[ u8MsgIndex >> 3 ] |= 1 << (u8MsgIndex & 0x07);
+ }
+}
+
+void CAN__vClearSendRequestFlag( CAN_tenMessage enTxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( enTxMsgId >= CAN_nenMsg_TxMessagesStart
+ && enTxMsgId <= CAN_nenMsg_TxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( enTxMsgId );
+ CAN__abiSendRequestFlags[ u8MsgIndex >> 3 ] &= ~(1 << (u8MsgIndex & 0x07));
+ }
+}
+
+bool CAN__boIsSendRequestActive( CAN_tenMessage enTxMsgId )
+{
+ uint8_t u8MsgIndex;
+ bool boIsSendRequestActive = false;
+
+ if( enTxMsgId >= CAN_nenMsg_TxMessagesStart
+ && enTxMsgId <= CAN_nenMsg_TxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( enTxMsgId );
+ boIsSendRequestActive = ( CAN__abiSendRequestFlags[ u8MsgIndex >> 3 ] & 1 << (u8MsgIndex & 0x07) ) != 0;
+ }
+ return boIsSendRequestActive;
+}
+
+
+/***********************************/
+/*Cyclic Send-Request Flags */
+/***********************************/
+
+uint8_t CAN__abiCyclicSendFlags[ (CAN_nenMsg_NoOfTxMessages + 7) / 8 ];
+
+void CAN__vInitAllCyclicSendFlags( void )
+{
+ uint8_t u8Index;
+
+ for( u8Index=0; u8Index<CAN_nenMsg_NoOfTxMessages; u8Index++ )
+ {
+ if( /*CAN__astTxMessageConfig[u8Index].enMode == CAN_nenTxMode_Cyclic*/
+ CAN__astTxMessageConfig[u8Index].u16Cycle
+ )
+ {
+ CAN__vSetCyclicSendFlag( CAN__enMsgIndexToTxMsgId(u8Index) );
+ }
+ else
+ {
+ CAN__vClearCyclicSendFlag( CAN__enMsgIndexToTxMsgId(u8Index) );
+ }
+ }
+}
+
+void CAN__vSetCyclicSendFlag( CAN_tenMessage enTxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( enTxMsgId >= CAN_nenMsg_TxMessagesStart
+ && enTxMsgId <= CAN_nenMsg_TxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( enTxMsgId );
+ CAN__abiCyclicSendFlags[ u8MsgIndex >> 3 ] |= 1 << (u8MsgIndex & 0x07);
+ }
+}
+
+void CAN__vClearCyclicSendFlag( CAN_tenMessage enTxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( enTxMsgId >= CAN_nenMsg_TxMessagesStart
+ && enTxMsgId <= CAN_nenMsg_TxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( enTxMsgId );
+ CAN__abiCyclicSendFlags[ u8MsgIndex >> 3 ] &= ~(1 << (u8MsgIndex & 0x07));
+ }
+}
+
+bool CAN__boIsCyclicSendActive( CAN_tenMessage enTxMsgId )
+{
+ uint8_t u8MsgIndex;
+
+ if( enTxMsgId >= CAN_nenMsg_TxMessagesStart
+ && enTxMsgId <= CAN_nenMsg_TxMessagesEnd
+ )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex( enTxMsgId );
+ return ( CAN__abiCyclicSendFlags[ u8MsgIndex >> 3 ] & 1 << (u8MsgIndex & 0x07) ) != 0;
+ }
+ return false;
+}
+
+/**********************************************/
+/*Zuordnung CAN-Konfiguration zu CAN-Channels */
+/**********************************************/
+
+#define MakeCanChannel( CAN_CH, BAUD, RX_CALLBACK, TX_CALLBACK ) \
+ { BAUD, RX_CALLBACK, TX_CALLBACK }, \
+
+#define MakeMsgBox( MSG_BOX_ID, ID_VALUE, ID_MASK, MB_MODE ) \
+
+#define MakeRxMsg( MSG_ID ) \
+
+#define MakeMsgBoxEnd() \
+
+#define MakeCanChannelEnd() \
+
+const CAN__tstCanChannelConfig CAN__astCanChannelConfig[CAN__nenCh_NoOfChannels] =
+{
+ CAN_MessageBoxConfig
+};
+
+#undef MakeCanChannel
+#undef MakeMsgBox
+#undef MakeRxMsg
+#undef MakeMsgBoxEnd
+#undef MakeCanChannelEnd
+
+
+/*****************************************/
+/*Zuordnung Rx-Message.IDs zu Msg.-Box */
+/*****************************************/
+#define MakeCanChannel( CAN_CH, BAUD, RX_CALLBACK, TX_CALLBACK ) \
+
+#define MakeMsgBox( MSG_BOX_ID, ID_VALUE, ID_MASK, MB_MODE ) \
+ CAN_tenMessage CAN__ap##MSG_BOX_ID##_RxMsgList[] = { \
+
+#define MakeRxMsg( MSG_ID ) \
+ MSG_ID,
+
+#define MakeMsgBoxEnd() \
+ CAN_nenMsg_Invalid }; \
+
+#define MakeCanChannelEnd() \
+
+CAN_MessageBoxConfig
+
+#undef MakeCanChannel
+#undef MakeMsgBox
+#undef MakeRxMsg
+#undef MakeMsgBoxEnd
+#undef MakeCanChannelEnd
+
+
+/*****************************************/
+/*Message-Box Konfiguration */
+/*****************************************/
+#define MakeCanChannel( CAN_CH, BAUD, RX_CALLBACK, TX_CALLBACK ) \
+
+#define MakeMsgBox( MSG_BOX_ID, ID_VALUE, ID_MASK, MB_MODE ) \
+ { ID_VALUE, ID_MASK, MB_MODE, CAN__ap##MSG_BOX_ID##_RxMsgList }, \
+
+#define MakeRxMsg( MSG_ID ) \
+
+#define MakeMsgBoxEnd() \
+
+#define MakeCanChannelEnd() \
+
+const CAN__tstMessageBoxConfig CAN__astMessageBoxConfig[CAN__nenMb_NoOfMessageBoxes] =
+{
+ CAN_MessageBoxConfig
+};
+
+
+#undef MakeCanChannel
+#undef MakeMsgBox
+#undef MakeRxMsg
+#undef MakeMsgBoxEnd
+#undef MakeCanChannelEnd
+
+
+
+void CAN_vInit( void )
+{
+// CAN__vInitAllMsgDataBuffer();
+// CAN__vInitAllSigValues();
+ CAN__vInitAllTimeoutCounters();
+ CAN__vInitAllCycleCounter();
+ CAN__vInitAllFirstValueFlags();
+ CAN__vInitAllSendRequestFlags();
+ CAN__vInitAllCyclicSendFlags();
+
+ CAND_vInit();
+ CANIF_vInit();
+}
+
+void CAN_vMain( void )
+{
+ CANIF_vMain();
+}
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.h
new file mode 100644
index 0000000..b1eac98
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAN1c1.h
@@ -0,0 +1,322 @@
+#ifndef CAN_C1_H
+#define CAN_C1_H
+
+
+#include "cdef.h"
+#include "CAN1ce.h"
+
+/************************/
+/*global type definition*/
+/************************/
+typedef uint16_t CAN_tId;
+typedef uint16_t CAN_tTxId;
+
+typedef struct
+{
+ CAN_tTxId StartId;
+ CAN_tTxId EndId;
+}CAN__tstRxCanIds;
+
+
+/**********************/
+/*Signal IDs (enum) */
+/**********************/
+#define MakeTxMessages() \
+
+#define MakeTxMessagesEnd() \
+
+#define MakeRxMessages() \
+
+#define MakeRxMessagesEnd() \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+ SIG_ID, \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+
+
+typedef enum
+{
+ CAN_MakeDbConfig
+
+ CAN_nenSig_NoOfSignals,
+ CAN_nenSig_Invalid
+}CAN_tenSignal;
+
+#undef MakeTxMsg
+#undef MakeRxMsg
+#undef MakeSignal
+#undef MakeTxMsgEnd
+#undef MakeRxMsgEnd
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+/**********************/
+/*Message IDs (enum) */
+/**********************/
+#define MakeTxMessages() \
+ CAN_nenMsg_TxMessagesStart, \
+ CAN__nenMsg_DummyTxMessagesStart = CAN_nenMsg_TxMessagesStart -1, \
+
+#define MakeTxMessagesEnd() \
+ CAN__nenMsg_DummyTxMessagesEnd, \
+ CAN_nenMsg_TxMessagesEnd = CAN__nenMsg_DummyTxMessagesEnd-1, \
+
+#define MakeRxMessages() \
+ CAN_nenMsg_RxMessagesStart, \
+ CAN__nenMsg_DummyRxMessagesStart = CAN_nenMsg_RxMessagesStart -1, \
+
+#define MakeRxMessagesEnd() \
+ CAN__nenMsg_DummyRxMessagesEnd, \
+ CAN_nenMsg_RxMessagesEnd = CAN__nenMsg_DummyRxMessagesEnd-1, \
+
+#define MakeTxMsg( MSG_ID, CAN_CH, CAN_ID, DLC, TX_MODE, CYCLE, PRE_TX_CALLBACK ) \
+ MSG_ID,
+
+#define MakeRxMsg( MSG_ID, CAN_CH, CAN_ID_START, CAN_ID_END, DLC, TIMEOUT, RX_CALLBACK ) \
+ MSG_ID,
+
+#define MakeSignal( MSG_ID, SIG_ID, START_BIT, SIZE, DEFAULT ) \
+
+#define MakeTxMsgEnd() \
+
+#define MakeRxMsgEnd() \
+
+
+typedef enum
+{
+ CAN_MakeDbConfig
+
+ CAN_nenMsg_NoOfMessages,
+ CAN_nenMsg_Invalid
+}CAN_tenMessage;
+
+#undef MakeTxMsg
+#undef MakeTxMsgEnd
+#undef MakeRxMsg
+#undef MakeRxMsgEnd
+#undef MakeSignal
+#undef MakeTxMessages
+#undef MakeTxMessagesEnd
+#undef MakeRxMessages
+#undef MakeRxMessagesEnd
+
+#define CAN_nenMsg_NoOfTxMessages (CAN_nenMsg_TxMessagesEnd - CAN_nenMsg_TxMessagesStart + 1)
+#define CAN_nenMsg_NoOfRxMessages (CAN_nenMsg_RxMessagesEnd - CAN_nenMsg_RxMessagesStart + 1)
+
+#define CAN__enMsgIndexToRxMsgId( u8MSG_INDEX ) ( (u8MSG_INDEX) + CAN_nenMsg_RxMessagesStart )
+#define CAN__enMsgIndexToTxMsgId( u8MSG_INDEX ) ( (u8MSG_INDEX) + CAN_nenMsg_TxMessagesStart )
+#define CAN__u8RxMsgIdToMsgIndex( enMSG_ID ) ( (enMSG_ID) - CAN_nenMsg_RxMessagesStart )
+#define CAN__u8TxMsgIdToMsgIndex( enMSG_ID ) ( (enMSG_ID) - CAN_nenMsg_TxMessagesStart )
+
+#define CAN__boIsTxMsg( enMSG_ID ) ( (enMSG_ID) >= CAN_nenMsg_TxMessagesStart && (enMSG_ID) <= CAN_nenMsg_TxMessagesEnd )
+#define CAN__boIsRxMsg( enMSG_ID ) ( (enMSG_ID) >= CAN_nenMsg_RxMessagesStart && (enMSG_ID) <= CAN_nenMsg_RxMessagesEnd )
+#define CAN__boIsMsg( enMSG_ID ) ( CAN__boIsRxMsg( enMSG_ID ) || CAN__boIsTxMsg( enMSG_ID ) )
+
+#define CAN_boIsSignal( enSIG_ID ) ( (enSIG_ID) >= 0 && (enSIG_ID) < CAN_nenSig_NoOfSignals )
+
+/**********************/
+/*Signal Konfiguration*/
+/**********************/
+typedef struct
+{
+ uint16_t enMsgId;
+ uint8_t u8StartBit;
+ uint8_t u8BitSize;
+ uint32_t u32DefaultValue;
+}CAN__tstSignalConfig;
+
+extern const CAN__tstSignalConfig CAN__astSignalConfig[CAN_nenSig_NoOfSignals];
+
+/******************************************/
+/* Prototypes of empty callback fucntions */
+/******************************************/
+void CAN_vNoRxIndication_Cb( CAN_tenMessage enMsg, CAN_tId CanId );
+void CAN_vNoPreTx_Cb( CAN_tenMessage enMsg );
+
+/**************************/
+/*Rx Message Konfiguration*/
+/**************************/
+typedef struct
+{
+ uint8_t u8Dlc;
+ uint16_t u16Timout;
+ volatile uint8_t *pu8Data;
+ void (*pfctRxIndicationCb)( CAN_tenMessage enMsgId, CAN_tId enCanId );
+}CAN__tstRxMessageConfig;
+
+extern const CAN__tstRxMessageConfig CAN__astRxMessageConfig[CAN_nenMsg_NoOfRxMessages];
+
+
+/**************************/
+/*Tx Message Konfiguration*/
+/**************************/
+typedef struct
+{
+ uint8_t enCanChannel;
+ uint8_t u8Dlc;
+ uint16_t u16Cycle;
+ volatile uint8_t *pu8Data;
+ void (*pfctPreTransmitCb)( CAN_tenMessage enMsgId );
+}CAN__tstTxMessageConfig;
+
+extern const CAN__tstTxMessageConfig CAN__astTxMessageConfig[CAN_nenMsg_NoOfTxMessages];
+
+extern CAN_tTxId CAN__aTxIds[CAN_nenMsg_NoOfTxMessages];
+extern CAN__tstRxCanIds CAN__astRxIds[CAN_nenMsg_NoOfRxMessages];
+
+/******************************/
+/* Timeout Counter */
+/******************************/
+void CAN__vResetTimeoutCounter( CAN_tenMessage u8RxMsgId );
+bool CAN_boIsTimeout( CAN_tenMessage u8RxMsgId );
+void CAN__vCountAllTimeoutCounters( void );
+void CAN__vInitAllTimeoutCounters( void );
+
+/******************************/
+/* Cycle Counter */
+/******************************/
+void CAN__vCheckAllCycleCounter( void );
+
+/***********************************/
+/*First-Value-Flags */
+/***********************************/
+void CAN__vSetFirstValueFlag( CAN_tenMessage u8TxMsgId );
+void CAN__vClearFirstValueFlag( CAN_tenMessage u8TxMsgId );
+bool CAN_boIsFirstValue( CAN_tenMessage u8TxMsgId );
+
+/***********************************/
+/*Send-Request Flags */
+/***********************************/
+void CAN__vSetSendRequestFlag( CAN_tenMessage enMessage );
+void CAN__vClearSendRequestFlag( CAN_tenMessage enMessage );
+bool CAN__boIsSendRequestActive( CAN_tenMessage enMessage );
+
+/***********************************/
+/*Cyclic Send-Request Flags */
+/***********************************/
+void CAN__vSetCyclicSendFlag( CAN_tenMessage enMessage );
+void CAN__vClearCyclicSendFlag( CAN_tenMessage enMessage );
+bool CAN__boIsCyclicSendActive( CAN_tenMessage enMessage );
+
+
+
+/*****************************/
+/*CAN-HW-Channel IDs (enum) */
+/*****************************/
+#define MakeCanChannel( CAN_CH, BAUD, RX_CALLBACK, TX_CALLBACK ) \
+ CAN_CH, \
+
+#define MakeMsgBox( MSG_BOX_ID, ID_VALUE, ID_MASK, MB_MODE ) \
+
+#define MakeRxMsg( MSG_ID ) \
+
+#define MakeMsgBoxEnd() \
+
+#define MakeCanChannelEnd() \
+
+typedef enum
+{
+ CAN_MessageBoxConfig
+
+ CAN__nenCh_NoOfChannels,
+ CAN__nenCh_Invalid
+}CAN_tenChannel;
+
+
+#undef MakeCanChannel
+#undef MakeMsgBox
+#undef MakeRxMsg
+#undef MakeMsgBoxEnd
+#undef MakeCanChannelEnd
+
+
+/***********************/
+/*Msg.-Box IDs (enum) */
+/***********************/
+#define MakeCanChannel( CAN_CH, BAUD, RX_CALLBACK, TX_CALLBACK ) \
+
+#define MakeMsgBox( MSG_BOX_ID, ID_VALUE, ID_MASK, MB_MODE ) \
+ MSG_BOX_ID, \
+
+#define MakeRxMsg( MSG_ID ) \
+
+#define MakeMsgBoxEnd() \
+
+#define MakeCanChannelEnd() \
+
+typedef enum
+{
+ CAN_MessageBoxConfig
+
+ CAN__nenMb_NoOfMessageBoxes,
+ CAN__nenMb_Invalid
+}CAN__tenMessageBox;
+
+
+#undef MakeCanChannel
+#undef MakeMsgBox
+#undef MakeRxMsg
+#undef MakeMsgBoxEnd
+#undef MakeCanChannelEnd
+
+typedef enum
+{
+ CAN__nenMbMode_Rx = 0,
+ CAN__nenMbMode_Tx = 1,
+ CAN__nenMbMode_NotUsed = 2
+}CAN__tenMbMode;
+
+typedef struct
+{
+ CAN_tTxId IdValue;
+ CAN_tTxId IdMask;
+ const CAN__tenMbMode enMode;
+ const CAN_tenMessage *(paenRxMsgIdList);
+}CAN__tstMessageBoxConfig;
+
+extern const CAN__tstMessageBoxConfig CAN__astMessageBoxConfig[CAN__nenMb_NoOfMessageBoxes];
+
+
+typedef struct
+{
+ uint8_t au8Data[8];
+ uint8_t u8Dlc;
+ CAN_tId CanId;
+}CAN_tstMessage;
+
+
+
+
+
+/**********************************************/
+/*Konfiguration zu CAN-Channels */
+/**********************************************/
+typedef void (*CAN__tpfctTxConfirmation)(CAN_tenChannel enChannel, CAN_tId CanId);
+typedef void (*CAN__tpfctRxIndication)( CAN_tenChannel enChannel, CAN__tenMessageBox enMsgBox, CAN_tstMessage *pstMessage );
+
+typedef struct
+{
+ uint32_t u32Baudrate;
+ CAN__tpfctRxIndication pfctRxIndication;
+ CAN__tpfctTxConfirmation pfctTxConfirmation;
+} CAN__tstCanChannelConfig;
+
+extern const CAN__tstCanChannelConfig CAN__astCanChannelConfig[CAN__nenCh_NoOfChannels];
+
+
+void CAN_vInit( void );
+void CAN_vMain( void );
+
+
+
+#endif /*CAN_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.c
new file mode 100644
index 0000000..e7214f2
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.c
@@ -0,0 +1,314 @@
+
+#include "cdef.h"
+#include "CAND1c1.h"
+#include "CANIF1c1.h"
+#ifndef _WINECU_
+#include "CANDCI.h"
+
+//! Local Mob Declaration
+volatile can_msg_t mob_ram_ch[CAN__nenCh_NoOfChannels][NB_MOB_CHANNEL];
+
+void can_out_callback_channel0(U8 handle, U8 event,U8 dir);
+void can_out_callback_channel1(U8 handle, U8 event,U8 dir);
+
+#endif /* !_WINECU */
+
+
+/*Konfigurationstest*/
+compile_time_assert( CAN__nenMb_NoOfMessageBoxes == 32 );
+compile_time_assert( CAN__nenCh_NoOfChannels == 2 );
+
+
+
+void CAND_vInit( void ) /*CAN_Zelle Initialisieren noch nicht starten*/
+{
+#ifndef _WINECU_
+ U8 u8Mode=0;
+ U8 u8ChIndex=0;
+ U8 u8MobIndex =0;
+
+ // Setup the generic clock for CAN
+ scif_gc_setup(AVR32_SCIF_GCLK_CANIF,
+ SCIF_GCCTRL_OSC0,
+ AVR32_SCIF_GC_NO_DIV_CLOCK,
+ 0);
+ // Now enable the generic clock
+ scif_gc_enable(AVR32_SCIF_GCLK_CANIF);
+ static const gpio_map_t CAN_GPIO_MAP = {
+ {AVR32_CANIF_RXLINE_0_0_PIN, AVR32_CANIF_RXLINE_0_0_FUNCTION},
+ {AVR32_CANIF_TXLINE_0_0_PIN, AVR32_CANIF_TXLINE_0_0_FUNCTION}
+ ,
+ {AVR32_CANIF_RXLINE_1_2_PIN, AVR32_CANIF_RXLINE_1_2_FUNCTION},
+ {AVR32_CANIF_TXLINE_1_2_PIN, AVR32_CANIF_TXLINE_1_2_FUNCTION}
+ };
+ // Assign GPIO to CAN.
+ gpio_enable_module(CAN_GPIO_MAP,
+ sizeof(CAN_GPIO_MAP) / sizeof(CAN_GPIO_MAP[0]));
+
+ for (u8ChIndex=0; u8ChIndex<CAN__nenCh_NoOfChannels;u8ChIndex++)
+ {
+ if(u8ChIndex==0)
+ {
+ can_init(0,
+ ((U32)&mob_ram_ch[0][0]),
+ CANIF_CHANNEL_MODE_NORMAL,
+ can_out_callback_channel0);
+ }
+ else
+ {
+ can_init(1,
+ ((U32)&mob_ram_ch[1][0]),
+ CANIF_CHANNEL_MODE_NORMAL,
+ can_out_callback_channel1);
+
+ }
+
+ for (u8MobIndex=0;u8MobIndex<NB_MOB_CHANNEL; u8MobIndex++)
+ {
+ u8Mode = CAN__astMessageBoxConfig[u8MobIndex+u8ChIndex*NB_MOB_CHANNEL].enMode;
+ appli_tx_msg[u8ChIndex][u8MobIndex].handle = can_mob_alloc(u8ChIndex);
+
+ pcan_msg[u8ChIndex][u8MobIndex].id = CAN__astMessageBoxConfig[u8MobIndex+u8ChIndex*NB_MOB_CHANNEL].IdValue;
+ pcan_msg[u8ChIndex][u8MobIndex].id_mask = CAN__astMessageBoxConfig[u8MobIndex+u8ChIndex*NB_MOB_CHANNEL].IdMask;
+ appli_tx_msg[u8ChIndex][u8MobIndex].dlc = 8;
+ appli_tx_msg[u8ChIndex][u8MobIndex].req_type = CAN_DATA_FRAME;
+ appli_tx_msg[u8ChIndex][u8MobIndex].status = CAN_STATUS_NOT_COMPLETED;
+ appli_tx_msg[u8ChIndex][u8MobIndex].can_msg = &(pcan_msg[u8ChIndex][u8MobIndex]);
+
+ switch(u8Mode)
+ {
+ case CAN__nenMbMode_Rx:
+ can_rx(u8ChIndex,appli_tx_msg[u8ChIndex][u8MobIndex].handle,appli_tx_msg[u8ChIndex][u8MobIndex].req_type,appli_tx_msg[u8ChIndex][u8MobIndex].can_msg);
+ break;
+ case CAN__nenMbMode_Tx:
+ CANIF_config_tx(u8ChIndex,appli_tx_msg[u8ChIndex][u8MobIndex].handle);
+ #ifdef CAN_LIB_UNDER_INTERRUPT
+ CANIF_mob_enable_interrupt(u8ChIndex,appli_tx_msg[u8ChIndex][u8MobIndex].handle);
+ #endif
+ break;
+ default:
+ break;
+ }
+ }
+ }
+#endif /* !_WINECU_ */
+}
+
+void CAND_vStart( CAN_tenChannel enChannel ) /*CAN-Channel starten Rx und Tx*/
+{
+#ifndef _WINECU_
+ CANIF_enable(enChannel);
+ while(!CANIF_channel_enable_status(enChannel));
+#endif /* !_WINECU */
+}
+
+void CAND_vStop( CAN_tenChannel enChannel ) /*CAN-Channel stoppen Rx und Tx*/
+{
+#ifndef _WINECU_
+ CANIF_disable(enChannel);
+#endif /* !_WINECU */
+}
+
+void CAND_vDeinit( void )
+{
+
+}
+
+#ifndef _WINECU_
+/*! \brief CAN Call Back when message is received\ */
+void can_out_callback_channel0(U8 handle, U8 event,U8 dir)
+{
+ uint16_t u16CanId;
+ uint8_t u8dlc;
+
+ //gpio_tgl_gpio_pin(LED3_GPIO);
+
+ CAN_tstMessage stMessage;
+ switch(dir)
+ { // Reception
+ case CAN__nenMbMode_Rx:
+ u8dlc = can_get_mob_dlc(0,handle);
+ stMessage.u8Dlc = u8dlc;
+ stMessage.CanId = can_get_mob_id(0,handle);
+ for (U8 i=0; i<u8dlc;i++)
+ {
+ stMessage.au8Data[i] = can_get_mob_data(0,handle).u8[i];
+ }
+ CANIF_vRxIndication(0,handle,&stMessage);
+ CANIF_mob_clr_dlc(0,handle);
+ CANIF_clr_mob(0,handle);
+ appli_tx_msg[0][handle].can_msg->id = CAN__astMessageBoxConfig[handle+0*NB_MOB_CHANNEL].IdValue;
+ appli_tx_msg[0][handle].can_msg->id_mask = CAN__astMessageBoxConfig[handle+0*NB_MOB_CHANNEL].IdMask;
+ can_rx(0,handle,appli_tx_msg[0][handle].req_type,appli_tx_msg[0][handle].can_msg);
+ break;
+ // Transmission
+ case CAN__nenMbMode_Tx:
+ u16CanId = can_get_mob_id(0,handle);
+ CANIF_vTxConfirmation(0,u16CanId);
+ CANIF_mob_clr_dlc(0,handle);
+ CANIF_clr_mob(0,handle);
+ break;
+ default:
+ break;
+ }
+}
+
+
+
+/*! \brief CAN Call Back when message is transmitted
+ *
+ */
+void can_out_callback_channel1(U8 handle, U8 event,U8 dir)
+{
+ uint16_t u16CanId;
+ uint8_t u8dlc;
+ CAN_tstMessage stMessage;
+
+ //gpio_tgl_gpio_pin(LED2_GPIO);
+ switch(dir)
+ { // Reception
+ case CAN__nenMbMode_Rx:
+ u8dlc = can_get_mob_dlc(1,handle);
+ stMessage.u8Dlc = u8dlc;
+ stMessage.CanId = can_get_mob_id(1,handle);
+ for (U8 i=0; i<u8dlc;i++)
+ {
+ stMessage.au8Data[i] = can_get_mob_data(1,handle).u8[i];
+ }
+ CANIF_vRxIndication(1,handle,&stMessage);
+ CANIF_mob_clr_dlc(1,handle);
+ CANIF_clr_mob(1,handle);
+ appli_tx_msg[1][handle].can_msg->id = CAN__astMessageBoxConfig[handle+1*NB_MOB_CHANNEL].IdValue;
+ appli_tx_msg[1][handle].can_msg->id_mask = CAN__astMessageBoxConfig[handle+1*NB_MOB_CHANNEL].IdMask;
+ can_rx(1,handle,appli_tx_msg[1][handle].req_type,appli_tx_msg[1][handle].can_msg);
+ break;
+ // Transmission
+ case CAN__nenMbMode_Tx:
+ u16CanId = can_get_mob_id(1,handle);
+ CANIF_vTxConfirmation(1,u16CanId);
+ CANIF_mob_clr_dlc(1,handle);
+ CANIF_clr_mob(1,handle);
+ break;
+ default:
+ break;
+ }
+}
+
+#endif /* !WINECU */
+
+bool CAND_boSend( CAN_tenChannel enChannel, CAN_tstMessage *pstMessage )
+{
+#ifdef _WINECU_
+ HW_CAN_tstCanMessage stCanMsg;
+
+ stCanMsg.u32Id = pstMessage->CanId;
+ stCanMsg.u8Length = pstMessage->u8Dlc;
+
+ *((uint32_t *)&(stCanMsg.au8Data[0]) ) = *( (uint32_t *)&pstMessage->au8Data[0] );
+ *((uint32_t *)&(stCanMsg.au8Data[4]) ) = *( (uint32_t *)&pstMessage->au8Data[4] );
+
+ stCanMsg.boRemoteFrame = false;
+
+ HW_CAN_vTransmit( enChannel, &stCanMsg );
+
+ /*Callback an CANIF schicken*/
+ CANIF_vTxConfirmation( enChannel, pstMessage->CanId );
+
+ return false;
+#else /* !_WINECU */
+ U8 dir;
+ U8 u8Dlc=0;
+ bool success = false;
+
+ for(U8 u8MobIndex=0; (u8MobIndex < NB_MOB_CHANNEL) && (!success) ; u8MobIndex++)
+ {
+ dir = CANIF_mob_get_dir(enChannel,u8MobIndex);
+ if(dir == CAN__nenMbMode_Tx)
+ {
+ appli_tx_msg[enChannel][u8MobIndex].can_msg->id = pstMessage->CanId;
+ u8Dlc = pstMessage->u8Dlc;
+ appli_tx_msg[enChannel][u8MobIndex].dlc = u8Dlc;
+ for(U8 i=0; i<u8Dlc;i++)
+ {
+ appli_tx_msg[enChannel][u8MobIndex].can_msg->data.u8[i] = pstMessage->au8Data[i];
+ }
+ can_tx(enChannel,
+ appli_tx_msg[enChannel][u8MobIndex].handle,
+ appli_tx_msg[enChannel][u8MobIndex].dlc,
+ appli_tx_msg[enChannel][u8MobIndex].req_type,
+ appli_tx_msg[enChannel][u8MobIndex].can_msg);
+ success = true;
+ }
+ }
+ return success;
+#endif /* !_WINECU */
+}
+
+void CAND_boGetOverflow( CAN_tenChannel enChannel )
+{
+}
+
+#ifdef _WINECU_
+void CAND__vRxInterruptCh0( HW_CAN_tstCanMessage* pMsg )
+{
+ CAN__tenMessageBox enMbId;
+ CAN_tstMessage stCanMsg;
+
+ for( enMbId = CAN_enCh0MBox0; enMbId <= CAN_enCh0MBox15 ;enMbId ++ )
+ {
+ if( /*ist RX Box?*/
+ CAN__astMessageBoxConfig[enMbId].enMode == CAN__nenMbMode_Rx
+ )
+ {
+ if( /*Maske prüfen*/
+ (pMsg->u32Id & CAN__astMessageBoxConfig[enMbId].IdMask)
+ == (CAN__astMessageBoxConfig[enMbId].IdValue & CAN__astMessageBoxConfig[enMbId].IdMask)
+ )
+ {
+ stCanMsg.CanId = (CAN_tId)pMsg->u32Id;
+ stCanMsg.u8Dlc = pMsg->u8Length;
+ *((uint32_t *)&(stCanMsg.au8Data[0])) = *((uint32_t *)(&pMsg->au8Data[0]));
+ *((uint32_t *)&(stCanMsg.au8Data[4])) = *((uint32_t *)(&pMsg->au8Data[4]));
+ /*Callback an CANIF schicken*/
+ CANIF_vRxIndication( 0, enMbId, &stCanMsg );
+ }
+ }
+ }
+}
+
+void CAND__vRxInterruptCh1( HW_CAN_tstCanMessage* pMsg )
+{
+ CAN__tenMessageBox enMbId;
+ CAN_tstMessage stCanMsg;
+ for( enMbId = CAN_enCh1MBox0; enMbId <= CAN_enCh1MBox15 ;enMbId ++ )
+ {
+ if( /*ist RX Box?*/
+ CAN__astMessageBoxConfig[enMbId].enMode == CAN__nenMbMode_Rx
+ )
+ {
+ if( /*Maske prüfen*/
+ (pMsg->u32Id & CAN__astMessageBoxConfig[enMbId].IdMask)
+ == (CAN__astMessageBoxConfig[enMbId].IdValue & CAN__astMessageBoxConfig[enMbId].IdMask)
+ )
+ {
+ stCanMsg.CanId = (CAN_tId)pMsg->u32Id;
+ stCanMsg.u8Dlc = pMsg->u8Length;
+ *((uint32_t *)&(stCanMsg.au8Data[0])) = *((uint32_t *)(&pMsg->au8Data[0]));
+ *((uint32_t *)&(stCanMsg.au8Data[4])) = *((uint32_t *)(&pMsg->au8Data[4]));
+ /*Callback an CANIF schicken*/
+ CANIF_vRxIndication( 1, enMbId, &stCanMsg );
+ }
+ }
+ }
+}
+
+#else /*!_WINECU_*/
+void CAND_vEnableInterrupt( CAN_tenChannel enChannel )
+{
+ CANIF_enable_interrupt(enChannel);
+}
+void CAND_vDisableInterrupt( CAN_tenChannel enChannel )
+{
+ CANIF_disable_interrupt(enChannel);
+}
+#endif /*!_WINECU_*/ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.h
new file mode 100644
index 0000000..e793bcc
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CAND1c1.h
@@ -0,0 +1,38 @@
+#ifndef CAND_C1_H
+#define CAND_C1_H
+#ifndef _WINECU_
+#include <stddef.h>
+#include <stdio.h>
+#include <avr32/io.h>
+#include "compiler.h"
+#include "board.h"
+#include "power_clocks_lib.h"
+#include "gpio.h"
+#include "pm_uc3c.h"
+#include "scif_uc3c.h"
+#include "can.h"
+#include "canif.h"
+#include "CANIF1c1.h"
+#endif /* !_WINECU_ */
+#include "CAN1c1.h"
+
+void can_task(void);
+void CAND_vInit( void ); /*CAN_Zelle Initialisieren noch nicht starten*/
+void CAND_vStart( CAN_tenChannel enChannel ); /*CAN-Channel starten Rx und Tx*/
+void CAND_vStop( CAN_tenChannel enChannel ); /*CAN-Channel stoppen Rx und Tx*/
+void CAND_vDeinit( void );
+
+bool CAND_boSend( CAN_tenChannel enChannel, CAN_tstMessage *pstMessage );
+void CAND_boGetOverflow( CAN_tenChannel enChannel );
+
+#ifdef _WINECU_
+#include "HW_CAN_API.h"
+void CAND__vRxInterruptCh0( HW_CAN_tstCanMessage *pMsg );
+void CAND__vRxInterruptCh1( HW_CAN_tstCanMessage *pMsg );
+#else /*_WINECU_*/
+void CAND_vEnableInterrupt( CAN_tenChannel enChannel );
+void CAND_vDisableInterrupt( CAN_tenChannel enChannel );
+#endif /*_WINECU_*/
+
+
+#endif /*CAND_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANDCI.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANDCI.h
new file mode 100644
index 0000000..fcfc926
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANDCI.h
@@ -0,0 +1,89 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CAN driver for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CAN module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+
+#ifndef _CANDCI_H
+#define _CANDCI_H
+
+//_____ I N C L U D E S ________________________________________________________
+#include "avr32/io.h"
+#include "compiler.h"
+#include "can.h"
+#include "board.h"
+
+/*
+ *
+ *//*
+ * Mail Box Definition
+ */
+// -----------------------------------------------------------------
+// CAN Message Definition: Tx Message
+#if defined (__ICCAVR32__)
+can_msg_t msg_tx_sot =
+{
+ 0x000, // Identifier
+ 0x000, // Mask
+ 0x0000000000000000LL, // Data
+};
+#else
+can_msg_t msg_tx_sot =
+{
+ {
+ {
+ .id = 0x000, // Identifier
+ .id_mask = 0x000, // Mask
+ },
+ },
+ .data.u64 = 0x0000000000000000LL, // Data
+};
+#endif
+can_msg_t pcan_msg[2][16];
+// MOB Message Definition: Tx Message
+can_mob_t appli_tx_msg[2][16];
+
+#endif // _CANDCI_H
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.c
new file mode 100644
index 0000000..1a36784
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.c
@@ -0,0 +1,126 @@
+
+#include "cdef.h"
+#include "IL1c1.h"
+#include "CAND1c1.h"
+#include "CANIF1c1.h"
+
+
+volatile bool CANIF__aboSendingActive[CAN__nenCh_NoOfChannels];
+
+void CANIF__vCheckSendRequests( void )
+{
+ CAN_tenMessage enTxMsgId;
+ CAN_tstMessage stMessage;
+
+ for( enTxMsgId=CAN_nenMsg_TxMessagesStart; enTxMsgId<=CAN_nenMsg_TxMessagesEnd; enTxMsgId++ )
+ {
+ if( /*Sende Request gesetzt*/
+ CAN__boIsSendRequestActive( enTxMsgId )
+ /*und keine laufende Sendung auf dem Kanal */
+ && !CANIF__aboSendingActive[ CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enTxMsgId) ].enCanChannel ]
+ )
+ {
+
+ CAN__vClearSendRequestFlag( enTxMsgId );
+ /*Kanal auf Sendung aktive setzen*/
+ CANIF__aboSendingActive[ CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enTxMsgId) ].enCanChannel ] = true;
+
+ stMessage.CanId = CAN__aTxIds[CAN__u8TxMsgIdToMsgIndex(enTxMsgId)];
+ stMessage.u8Dlc = CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enTxMsgId) ].u8Dlc;
+ IL_vGetMessageData( enTxMsgId, stMessage.au8Data );
+
+ /* check if pretransmit callback is set */
+ if (CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enTxMsgId) ].pfctPreTransmitCb != CAN_vNoPreTx_Cb)
+ {
+ /* call pretransmit callback */
+ CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enTxMsgId) ].pfctPreTransmitCb(enTxMsgId);
+ }
+ CAND_boSend( CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enTxMsgId) ].enCanChannel, &stMessage );
+ }
+ }
+}
+
+
+void CANIF_vInit( void )
+{
+ CAN_tenChannel enChannle;
+
+ /*alle CAN-HW_Kanaele auf "keine Sendeuing aktive" setzen*/
+ for( enChannle=0; enChannle<CAN__nenCh_NoOfChannels ;enChannle++ )
+ {
+ CANIF__aboSendingActive[enChannle] = false;
+ }
+
+}
+
+void CANIF_vMain( void ) //Zyklisch Verarbeitung (Sendezyklen, Timeouts)
+{
+ CAN__vCountAllTimeoutCounters();
+ CAN__vCheckAllCycleCounter();
+ CANIF__vCheckSendRequests();
+}
+
+/*Sendeverarbeitung triggern*/
+void CANIF_vSendRequest( void )
+{
+ CANIF__vCheckSendRequests();
+}
+
+
+/*Callbacks für CAN-Treiber*/
+void CANIF_vTxConfirmation( CAN_tenChannel enChannel, CAN_tId CanId )
+{
+ /*Keine Sendung aktive auf diesem Kanal*/
+ CANIF__aboSendingActive[enChannel] = false;
+ /*Naechste Msg. Senden*/
+ //CANIF__vCheckSendRequests();
+}
+
+void CANIF_vRxIndication( CAN_tenChannel enChannel, CAN__tenMessageBox enMsgBox, CAN_tstMessage *pstMessage )
+{
+ CAN_tenMessage enMsgId;
+ uint8_t u8MsgIndex;
+ uint8_t u8ListIndex=0;
+ bool boFound = false;
+
+ /*Msg.-ID suchen*/
+ const CAN_tenMessage *aenRxMsgIdList = CAN__astMessageBoxConfig[(enChannel * NB_MOB_CHANNEL)+enMsgBox].paenRxMsgIdList;
+
+ /*erste Msg.-ID holen*/
+ enMsgId = aenRxMsgIdList[u8ListIndex];
+
+ while( enMsgId != CAN_nenMsg_Invalid
+ && !boFound
+ )
+ {
+ u8MsgIndex = CAN__u8RxMsgIdToMsgIndex( enMsgId );
+
+ if( /*Pruefen ob die CAN_ID uebereinstimmt */
+ pstMessage->CanId >= CAN__astRxIds[ u8MsgIndex ].StartId
+ && pstMessage->CanId <= CAN__astRxIds[ u8MsgIndex ].EndId
+ )
+ {
+ boFound = true;
+
+ /*Daten in Msg.-Dante speichern*/
+ IL_vSetMessageData( enMsgId, pstMessage->au8Data );
+
+ CAN__vSetFirstValueFlag( enMsgId );
+ CAN__vResetTimeoutCounter( enMsgId );
+
+ /*Callback aufrufen wenn konfiguriert*/
+ if( CAN__astRxMessageConfig[u8MsgIndex].pfctRxIndicationCb )
+ {
+ if( CAN__astRxMessageConfig[u8MsgIndex].pfctRxIndicationCb != CAN_vNoRxIndication_Cb )
+ {
+ CAN__astRxMessageConfig[u8MsgIndex].pfctRxIndicationCb( enMsgId, pstMessage->CanId );
+ }
+ }
+ }
+
+ /*Naechset MSG ID aus Liste holen */
+ u8ListIndex++;
+ enMsgId = aenRxMsgIdList[u8ListIndex];
+ }
+}
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.h
new file mode 100644
index 0000000..2c06dd1
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/CANIF1c1.h
@@ -0,0 +1,24 @@
+#ifndef CANIF_C1_H
+#define CANIF_C1_H
+
+#include "CAN1c1.h"
+
+
+void CANIF_vInit( void );
+void CANIF_vMain( void ); //Zyklisch Verarbeitung (Sendezyklen, Timeouts)
+
+void CANIF_vSendRequest( void ); // Sendeverarbeitung triggern
+
+/*Callbacks für CAN-Treiber*/
+void CANIF_vTxConfirmation( CAN_tenChannel enChannel, CAN_tId CanId );
+void CANIF_vRxIndication( CAN_tenChannel enChannel, CAN__tenMessageBox enMsgBox, CAN_tstMessage *pstMessage );
+
+/*
+Beispiele für aufgerufene Callbacks:
+void MODUL_vRxIndication_Cb( CAN_tenMessageId enMsgId );
+void MODUL_vPreTransmit_Cb( CAN_tenMessageId enMsgId );
+*/
+
+
+
+#endif /*CANIF_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.c
new file mode 100644
index 0000000..8b175bf
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.c
@@ -0,0 +1,415 @@
+#include "OS1c1.h"
+#include "EXEA1c1.h"
+#include "EVHD1c1.h"
+
+
+/***********************************/
+/* Rx-Event Listen fuer Tx-Events */
+/***********************************/
+#define MakeSendEvent( TX_EVENT ) \
+ EVHD_tenReceiveEvent EVHD__aenRxEventList_##TX_EVENT[] = \
+ { \
+
+#define MakeReceiveEvent( TX_EVENT, CALLBACK ) \
+ TX_EVENT##_##CALLBACK, \
+
+#define MakeSendEventEnd( P ) \
+ EVHD_nenReceiveEventNone \
+ }; \
+
+EVHD_EventConfig
+
+#undef MakeSendEvent
+#undef MakeReceiveEvent
+#undef MakeSendEventEnd
+
+/************************************/
+/* Rx-Events Listen fuer Tasks */
+/************************************/
+#define MakeEventTask( OS_TASK_ID, TASK_FCT, EVHD_TASK_ID ) \
+ EVHD_tenReceiveEvent EVHD__aenRxEventList_##EVHD_TASK_ID[] = \
+ { \
+
+#define MakeSynchronCalls() \
+ EVHD_tenReceiveEvent EVHD__aenRxEventList_SynchronCalls[] = \
+ { \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK ) \
+ TX_EVENT##_##CALLBACK, \
+
+#define MakeEventTaskEnd( P ) \
+ EVHD_nenReceiveEventNone \
+ }; \
+
+#define MakeSynchronCallsEnd( ) \
+ EVHD_nenReceiveEventNone \
+ }; \
+
+
+ EVHD_CallbackConfig
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
+
+
+/**********************************/
+/* Tx-Events Config */
+/**********************************/
+#define MakeSendEvent( TX_EVENT ) \
+ EVHD__aenRxEventList_##TX_EVENT, \
+
+#define MakeReceiveEvent( TX_EVENT, CALLBACK ) \
+
+#define MakeSendEventEnd( P ) \
+
+EVHD_tenReceiveEvent *EVHD__paenReceiveEventLists[EVHD_nenNoOfSendEvents] =
+{
+ EVHD_EventConfig
+};
+
+#undef MakeSendEvent
+#undef MakeReceiveEventAsync
+#undef MakeReceiveEventSync
+#undef MakeSendEventEnd
+
+/**********************************/
+/* EVHD-Task IDs (Enum) */
+/**********************************/
+#define MakeEventTask( OS_TASK_ID, TASK_FCT, EVHD_TASK_ID ) \
+ EVHD_TASK_ID, \
+
+#define MakeSynchronCalls() \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK ) \
+
+#define MakeEventTaskEnd( P ) \
+
+#define MakeSynchronCallsEnd( ) \
+
+typedef enum
+{
+ EVHD_CallbackConfig
+
+ EVHD__nenNoOfTasks,
+ EVHD__nenSynchron
+}EVHD__tenTask;
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
+
+/************************************/
+/* Task Config EVDH-Task -> OS-Task */
+/************************************/
+typedef struct
+{
+ OS_tenTaskId enOsTaskId;
+ EVHD_tenReceiveEvent *aenRxEventList;
+ uint8_t biActivated : 1;
+ uint8_t biReserve1 : 7;
+}EVHD__tstTaskConfig;
+
+#define MakeEventTask( OS_TASK_ID, TASK_FCT, EVHD_TASK_ID ) \
+ { OS_TASK_ID, EVHD__aenRxEventList_##EVHD_TASK_ID, 0, 0 }, \
+
+#define MakeSynchronCalls() \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK ) \
+
+#define MakeEventTaskEnd( P ) \
+
+#define MakeSynchronCallsEnd( ) \
+
+EVHD__tstTaskConfig EVHD__astTaskConfig[EVHD__nenNoOfTasks] =
+{
+ EVHD_CallbackConfig
+};
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
+
+
+/************************************/
+/* extern Declaration der Callbacks */
+/************************************/
+#define MakeEventTask( OS_TASK_ID, TASK_FCT, EVHD_TASK_ID ) \
+
+#define MakeSynchronCalls() \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK ) \
+ extern void CALLBACK( EVHD_tenReceiveEvent ); \
+
+#define MakeEventTaskEnd( P ) \
+
+#define MakeSynchronCallsEnd( ) \
+
+ EVHD_CallbackConfig
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
+
+
+
+/**********************************/
+/* Rx-Event Configuration */
+/**********************************/
+typedef struct
+{
+ const void (*pfctCallback)( EVHD_tenReceiveEvent );
+ const EVHD__tenTask enEvhdTask;
+ uint8_t biRegistered :1;
+ uint8_t biActive :1;
+ const uint8_t biSynchron :1;
+ uint8_t biReserve1 :5;
+}EVHD__tstReceiveEventConfig;
+
+
+#define MakeEventTask( OS_TASK_ID, TASK_FCT, EVHD_TASK_ID ) \
+
+#define MakeSynchronCalls() \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK_ID ) \
+ { CALLBACK, EVHD_TASK_ID, REGISTERED, 0, (EVHD_TASK_ID == EVHD__nenSynchron ? 1 : 0), 0, }, \
+
+#define MakeEventTaskEnd( P ) \
+
+#define MakeSynchronCallsEnd( ) \
+
+EVHD__tstReceiveEventConfig EVHD__astReceiveEventConfig[EVHD_nenNoOfReceiveEvents] =
+{
+ EVHD_CallbackConfig
+};
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
+
+void EVHD__vActivateTask( EVHD__tenTask enEvhdTask )
+{
+ EVHD__tstTaskConfig *pstTaskConfig = &(EVHD__astTaskConfig[enEvhdTask]);
+
+ EVHD__mcDisableInterrupt();
+ if( !(pstTaskConfig->biActivated) )
+ {
+ pstTaskConfig->biActivated = 1;
+ EVHD__mcEnableInterrupt();
+ OS_vActivateTask( pstTaskConfig->enOsTaskId );
+ }
+ else
+ {
+ EVHD__mcEnableInterrupt();
+ }
+}
+
+void EVHD__vHandleReceivEvent( EVHD_tenReceiveEvent enReceiveEvent )
+{
+ EVHD__tstReceiveEventConfig *pstReceiveEventConfig = &EVHD__astReceiveEventConfig[enReceiveEvent];
+
+ if( pstReceiveEventConfig->biRegistered )
+ {
+ if( pstReceiveEventConfig->biSynchron )
+ {
+ EVHD__mcDisableInterrupt();
+ pstReceiveEventConfig->biActive = 0;
+ EVHD__mcEnableInterrupt();
+
+ pstReceiveEventConfig->pfctCallback( enReceiveEvent );
+ }
+ else
+ {
+ EVHD__vActivateTask( pstReceiveEventConfig->enEvhdTask );
+ }
+ }
+}
+
+void EVHD__vHandleTask( EVHD__tenTask enEvhdTask )
+{
+ EVHD_tenReceiveEvent *aenReceiveEvent;
+ EVHD_tenReceiveEvent enReceiveEvent;
+ EVHD__tstReceiveEventConfig *pstReceiveEventConfig;
+ uint8_t u8Index;
+
+ aenReceiveEvent = EVHD__astTaskConfig[enEvhdTask].aenRxEventList;
+
+ u8Index = 0;
+ while( (enReceiveEvent = aenReceiveEvent[u8Index]) != EVHD_nenReceiveEventNone )
+ {
+ u8Index++;
+ pstReceiveEventConfig = &EVHD__astReceiveEventConfig[enReceiveEvent];
+
+ if( pstReceiveEventConfig->biRegistered )
+ {
+ EVHD__mcDisableInterrupt();
+ if( pstReceiveEventConfig->biActive )
+ {
+ pstReceiveEventConfig->biActive = 0;
+ EVHD__mcEnableInterrupt();
+
+ pstReceiveEventConfig->pfctCallback( enReceiveEvent );
+ }
+ }
+ }
+}
+
+
+void EVHD_vSendEvent( EVHD_tenSendEvent enSendEvent )
+{
+ uint8_t u8Index = 0;
+
+ EVHD_tenReceiveEvent *aenReceiveEventList;
+ EVHD_tenReceiveEvent enReceiveEvent;
+
+ if( enSendEvent < EVHD_nenNoOfSendEvents )
+ {
+ aenReceiveEventList = EVHD__paenReceiveEventLists[enSendEvent];
+ if( aenReceiveEventList )
+ {
+ while( (enReceiveEvent = aenReceiveEventList[u8Index]) != EVHD_nenReceiveEventNone )
+ {
+ EVHD__mcDisableInterrupt();
+ EVHD__astReceiveEventConfig[enReceiveEvent].biActive = 1;
+ EVHD__mcEnableInterrupt();
+
+ EVHD__vHandleReceivEvent( enReceiveEvent );
+
+ u8Index++;
+ }
+ }
+ }
+ else
+ {
+ if( enSendEvent != EVHD_nenSendEventNone )
+ {
+ EXEA_vThrowException( EXEA_nenEVHD_InvalidSendEvent );
+ }
+ }
+}
+
+void EVHD_vRegisterEvent( EVHD_tenReceiveEvent enReceiveEvent, bool boGetPending )
+{
+ EVHD__tstReceiveEventConfig *pstReceiveEvent;
+
+ if( enReceiveEvent < EVHD_nenNoOfReceiveEvents )
+ {
+ pstReceiveEvent = &EVHD__astReceiveEventConfig[enReceiveEvent];
+
+ EVHD__mcDisableInterrupt();
+
+ pstReceiveEvent->biRegistered = 1;
+
+ if( !boGetPending )
+ {
+ pstReceiveEvent->biActive = 0;
+ EVHD__mcEnableInterrupt();
+ }
+ else if( pstReceiveEvent->biActive )
+ {
+ EVHD__mcEnableInterrupt();
+ EVHD__vHandleReceivEvent( enReceiveEvent );
+ }
+ else
+ {
+ EVHD__mcEnableInterrupt();
+ }
+ }
+ else
+ {
+ if( enReceiveEvent != EVHD_nenReceiveEventNone )
+ {
+ EXEA_vThrowException( EXEA_nenEVHD_InvalidReceiveEvent );
+ }
+ }
+}
+
+void EVHD_vDeregisterEvent( EVHD_tenReceiveEvent enReceiveEvent )
+{
+ if( enReceiveEvent < EVHD_nenNoOfReceiveEvents )
+ {
+ EVHD__mcDisableInterrupt();
+ EVHD__astReceiveEventConfig[enReceiveEvent].biRegistered = 0;
+ EVHD__mcEnableInterrupt();
+ }
+ else
+ {
+ if( enReceiveEvent != EVHD_nenReceiveEventNone )
+ {
+ EXEA_vThrowException( EXEA_nenEVHD_InvalidReceiveEvent );
+ }
+ }
+}
+
+
+bool EVHD_boIsReceiveEventSet( EVHD_tenReceiveEvent enReceiveEvent )
+{
+ if( enReceiveEvent < EVHD_nenNoOfReceiveEvents )
+ {
+ return EVHD__astReceiveEventConfig[enReceiveEvent].biActive;
+ }
+ else
+ {
+ if( enReceiveEvent != EVHD_nenReceiveEventNone )
+ {
+ EXEA_vThrowException( EXEA_nenEVHD_InvalidReceiveEvent );
+ }
+ return 0;
+ }
+}
+
+void EVHD_vClearReceiveEvent( EVHD_tenReceiveEvent enReceiveEvent )
+{
+ if( enReceiveEvent < EVHD_nenNoOfReceiveEvents )
+ {
+ EVHD__mcDisableInterrupt();
+ EVHD__astReceiveEventConfig[enReceiveEvent].biActive = 0;
+ EVHD__mcEnableInterrupt();
+ }
+ else
+ {
+ if( enReceiveEvent != EVHD_nenReceiveEventNone )
+ {
+ EXEA_vThrowException( EXEA_nenEVHD_InvalidReceiveEvent );
+ }
+ }
+}
+
+
+/************************************/
+/* Task Funktionen */
+/************************************/
+#define MakeEventTask( OS_TASK_ID, TASK_FCT, EVHD_TASK_ID ) \
+ OS_TASK( TASK_FCT ) \
+ { \
+ EVHD__mcDisableInterrupt(); \
+ EVHD__astTaskConfig[EVHD_TASK_ID].biActivated = 0; \
+ EVHD__mcEnableInterrupt(); \
+ EVHD__vHandleTask( EVHD_TASK_ID ); \
+ } \
+
+#define MakeSynchronCalls() \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK ) \
+
+#define MakeEventTaskEnd( P ) \
+
+#define MakeSynchronCallsEnd( ) \
+
+ EVHD_CallbackConfig
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.h
new file mode 100644
index 0000000..b22173c
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1c1.h
@@ -0,0 +1,79 @@
+#ifndef EVHD_C1_H
+#define EVHD_C1_H
+
+
+#include "cdef.h"
+#include "EVHD1ce.h"
+
+
+/**************************/
+/* Send Event IDs (enum) */
+/**************************/
+#define MakeSendEvent( TX_EVENT ) \
+ TX_EVENT,
+
+#define MakeReceiveEvent( TX_EVENT, CALLBACK ) \
+
+#define MakeSendEventEnd( TX_EVENT ) \
+
+typedef enum
+{
+ EVHD_EventConfig
+
+ EVHD_nenNoOfSendEvents,
+ EVHD_nenSendEventNone
+}EVHD_tenSendEvent;
+
+#undef MakeSendEvent
+#undef MakeReceiveEvent
+#undef MakeSendEventEnd
+
+
+/*****************************/
+/* Receive Event IDs (enum) */
+/*****************************/
+#define MakeEventTask( OS_TASK, TASK_FCT, EVHD_TASK ) \
+
+#define MakeSynchronCalls() \
+
+#define MakeCallbackCall( TX_EVENT, CALLBACK, REGISTERED, EVHD_TASK ) \
+ TX_EVENT##_##CALLBACK, \
+
+#define MakeEventTaskEnd( P ) \
+
+#define MakeSynchronCallsEnd( ) \
+
+typedef enum
+{
+ EVHD_CallbackConfig
+
+ EVHD_nenNoOfReceiveEvents,
+ EVHD_nenReceiveEventNone
+}EVHD_tenReceiveEvent;
+
+#undef MakeEventTask
+#undef MakeSynchronCalls
+#undef MakeCallbackCall
+#undef MakeEventTaskEnd
+#undef MakeSynchronCallsEnd
+
+
+
+
+/*API*/
+void EVHD_vSendEvent( EVHD_tenSendEvent enEvent );
+void EVHD_vRegisterEvent( EVHD_tenReceiveEvent enEvent, bool boGetPending );
+void EVHD_vDeregisterEvent( EVHD_tenReceiveEvent enEvent );
+
+bool EVHD_boIsReceiveEventSet( EVHD_tenReceiveEvent enEvent );
+void EVHD_vClearReceiveEvent( EVHD_tenReceiveEvent enEvent );
+
+#if 0
+/*Beispiele für aufgerufene Callbacks*/
+void MODUL_vOnEvent_Cb( EVHD_tenReceiveEvent enEvent );
+#endif
+
+
+
+
+#endif /*EVHD_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1ce.h
new file mode 100644
index 0000000..bf0cbe7
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EVHD1ce.h
@@ -0,0 +1,58 @@
+#ifndef EVHD_CE_H
+#define EVHD_CE_H
+
+#define EVDH_nRegister 1
+#define EVDH_nUnregister 0
+
+#if 0
+/*****************************/
+/*Noetige EXEA-Konfiguration */
+/*****************************/
+MakeException( EXEA_nenEVHD_InvalidReceiveEvent, EXEA__vBlink ) \
+MakeException( EXEA_nenEVHD_InvalidSendEvent, EXEA__vBlink ) \
+
+#endif
+
+
+#define EVHD__mcDisableInterrupt()
+#define EVHD__mcEnableInterrupt()
+
+
+/*Konfiguration für Event-Handler*/
+
+#define EVHD_EventConfig \
+MakeSendEvent( EVHD_nenAVR32_TC0_IRQ0 ) \
+ MakeReceiveEvent( EVHD_nenAVR32_TC0_IRQ0, TIMER_v1msCallback ) \
+MakeSendEventEnd( EVHD_nenAVR32_TC0_IRQ0 ) \
+MakeSendEvent( EVHD_nenAVR32_GPIO_IRQ_1 ) \
+ MakeReceiveEvent( EVHD_nenAVR32_GPIO_IRQ_1, PINT_vIrqHandler_AVR32_GPIO_IRQ_1 ) \
+MakeSendEventEnd( EVHD_nenAVR32_GPIO_IRQ_1 ) \
+MakeSendEvent( EVHD_nenAVR32_GPIO_IRQ_3 ) \
+ MakeReceiveEvent( EVHD_nenAVR32_GPIO_IRQ_3, PINT_vIrqHandler_AVR32_GPIO_IRQ_3 ) \
+MakeSendEventEnd( EVHD_nenAVR32_GPIO_IRQ_3 ) \
+MakeSendEvent( EVHD_nenBtn0 ) \
+ MakeReceiveEvent( EVHD_nenBtn0, START_vBtn0Callback ) \
+MakeSendEventEnd( EVHD_nenBtn0 ) \
+MakeSendEvent( EVHD_nenBtn1 ) \
+ MakeReceiveEvent( EVHD_nenBtn1, START_vBtn1Callback ) \
+MakeSendEventEnd( EVHD_nenBtn1 ) \
+
+
+#define EVHD_CallbackConfig \
+MakeEventTask( OS_nenEvhdHigh, EVHD_vHigh, EVHD__nenTaskHigh ) \
+ MakeCallbackCall( EVHD_nenBtn0, START_vBtn0Callback, EVDH_nRegister, EVHD__nenTaskHigh ) \
+ MakeCallbackCall( EVHD_nenBtn1, START_vBtn1Callback, EVDH_nRegister, EVHD__nenTaskHigh ) \
+MakeEventTaskEnd( EVHD_nenTaskHigh ) \
+ \
+MakeEventTask( OS_nenEvhdLow, EVHD_vLow, EVHD__nenTaskLow ) \
+MakeEventTaskEnd( EVHD__nenTaskLow ) \
+ \
+MakeSynchronCalls( ) \
+ MakeCallbackCall( EVHD_nenAVR32_TC0_IRQ0, TIMER_v1msCallback, EVDH_nRegister, EVHD__nenSynchron ) \
+ MakeCallbackCall( EVHD_nenAVR32_GPIO_IRQ_1, PINT_vIrqHandler_AVR32_GPIO_IRQ_1, EVDH_nRegister, EVHD__nenSynchron ) \
+ MakeCallbackCall( EVHD_nenAVR32_GPIO_IRQ_3, PINT_vIrqHandler_AVR32_GPIO_IRQ_3, EVDH_nRegister, EVHD__nenSynchron ) \
+MakeSynchronCallsEnd( ) \
+
+
+
+#endif /*EVHD_CE_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.c
new file mode 100644
index 0000000..d2228bc
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.c
@@ -0,0 +1,57 @@
+
+#include "TIMER1c1.h"
+#include "EXEA1c1.h"
+
+void EXEA__vBlink( void )
+{
+ TIMER_vSet( TIMER_nenExea_Blitz, 100 );
+ TIMER_vStart( TIMER_nenExea_Blitz );
+ while( 1 )
+ {
+ if( TIMER_boIsTimeExpired( TIMER_nenExea_Blitz ) )
+ {
+ TIMER_vSubValue( TIMER_nenExea_Blitz, 100 );
+ EXEA__nenDioOutput();
+ }
+ }
+}
+
+void EXEA__vReset( void )
+{
+ /*Reset durch Watchdog*/
+ while( 1 );
+}
+
+void EXEA__vDontCare( void )
+{
+ /*Do nothing*/
+}
+
+typedef struct
+{
+ void (*pFctAciton)( void );
+}EXEA__tstConfig;
+
+
+
+/*Konfigurations Tabelle*/
+
+#define MakeException( ExceId, Action ) \
+ Action,
+
+EXEA__tstConfig EXEA__astCondfig[EXEA_nenNoOfChannles] =
+{
+ EXEA_MakeConfig
+};
+
+
+#undef MakeException
+
+
+void EXEA__vThrowException( EXEA_tenChannels enChannel )
+{
+ if( EXEA__astCondfig[enChannel].pFctAciton )
+ {
+ EXEA__astCondfig[enChannel].pFctAciton();
+ }
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.h
new file mode 100644
index 0000000..ae488f7
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1c1.h
@@ -0,0 +1,28 @@
+#ifndef EXEA_C1_H
+#define EXEA_C1_H
+
+
+#include "cdef.h"
+#include "EXEA1ce.h"
+
+
+#define MakeException( ExceId, Action ) \
+ ExceId,
+
+typedef enum
+{
+ EXEA_MakeConfig
+
+ EXEA_nenNoOfChannles
+}EXEA_tenChannels;
+
+#undef MakeException
+
+
+#define EXEA_vThrowException( EXEA_Channel ) EXEA__vThrowException( EXEA_Channel )
+
+/*Kein Aufruf von extern!*/
+void EXEA__vThrowException( EXEA_tenChannels enChannel );
+
+
+#endif /*EXEA_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1ce.h
new file mode 100644
index 0000000..04feb6b
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/EXEA1ce.h
@@ -0,0 +1,30 @@
+#ifndef EXEA_CE_H
+#define EXEA_CE_H
+
+#if 0
+/*********************************************************/
+/*Benoetigt folgende Konfigurationen von anderen Modulen!*/
+/*********************************************************/
+TIMER_Make( TIMER_nenExea_Blintz, TIMER_nenUnit1ms, NULL ) \
+
+#endif
+
+//#include "DIO1c1.h"
+
+/*Output des Blitzens*/
+//#define EXEA__nenDioOutput() DIO_vSetValue( DIO_nenModeLed, !DIO_xGetValueSet( DIO_nenModeLed ) );
+#define EXEA__nenDioOutput()
+
+
+/*Konfiguration für EXEA*/
+#define EXEA_MakeConfig \
+/* EXEA-Kanal, Aktion */\
+MakeException( EXEA_nenCAN_MsgId_Invalid, EXEA__vBlink ) \
+MakeException( EXEA_nenCAN_SigId_Invalid, EXEA__vReset ) \
+MakeException( EXEA_nenCAND_SendWhilBusy, EXEA__vDontCare ) \
+MakeException( EXEA_nenEVHD_InvalidReceiveEvent, EXEA__vBlink ) \
+MakeException( EXEA_nenEVHD_InvalidSendEvent, EXEA__vBlink ) \
+
+
+
+#endif /*EXEA_CE_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.c
new file mode 100644
index 0000000..5b15750
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.c
@@ -0,0 +1,1419 @@
+#include "IL1c1.h"
+
+
+
+
+/* Wie sind die Bytes zu interpretieren */
+typedef enum
+{
+ IL__nenLittleEndian, /*Intel*/
+ IL__nenBigEndian /*Motorola*/
+}CAN__tenByteOrderBitAccess;
+
+
+#ifdef _WINECU_ /*means littleendian CPU*/
+
+void vBitWrite( uint8_t *pMsgData,
+ uint8_t *pSigData,
+ uint8_t u8MsgLength,
+ uint8_t u8SigDataLength,
+ uint32_t dwBitCount,
+ uint32_t dwStartBit,
+ CAN__tenByteOrderBitAccess enOrder
+ )
+{
+ //****************************************
+ //********Lokale Variablen anlegen********
+ //****************************************
+ //Bitoffset in erstem Byte (Anzahl der Bits bis erstes Bit des Wertes beginnt)
+ uint8_t u8BitOffset;
+ //Startadresse erstes relevantes Byte in Speicher
+ uint8_t* pau8SpeicherStart;
+ //Relevante Laenge des Speichers in Byte
+ uint8_t u8SpeicherLaengeRelevant;
+ //Berechnete Lange des Wert-Speichers in Byte
+ uint8_t u8WertByteLaenge;
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ uint8_t u8WertRestBits;
+ //Maskierungen fuer erstes und letztes Byte
+ uint8_t u8MaskeStartByte;
+ uint8_t u8MaskeEndByte;
+ //Zaehlvariable fuer For-Schleifen (@StRi: Guter Name!)
+ uint8_t u8ForCount;
+
+ uint8_t u8SpeicherLaengeBenötigt;
+ uint8_t msgOverflow;
+ uint8_t sigOverflow;
+
+
+
+ // Wenn keine Daten vorhanden sind, kann auch nichts geschrieben werden.
+ if(u8MsgLength == 0)
+ return;
+
+
+ //****************************************************************************************
+ //********Berechnen lokaler Variablen Gueltigkeit fuer LittleEndian und BigEndian*********
+ //****************************************************************************************
+ //berechnen der ByteLaenge des Wert-Speichers
+ u8WertByteLaenge = ((unsigned char)((dwBitCount - 1) >> 3)) + 1;
+ //pruefen, ob die Laenge des uebergebenen Speichers groß genug ist um den maxWert des Signals zu beinhalten
+// ASSERT(u8WertByteLaenge <= u8SigDataLength);
+
+ //Offset berechnen (Bits in erstem Byte bis 1.Bit des Wertes beginnt)
+ u8BitOffset = (unsigned char)((dwStartBit)%8);
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ u8WertRestBits = (uint8_t)(((dwBitCount) + (u8BitOffset))%8);
+
+ //Laenge in Byte des relevanten Speicherbereichs ermitteln
+ u8SpeicherLaengeRelevant = ((unsigned char)(((dwBitCount) + (unsigned short)(u8BitOffset))>>3));
+ if (//stehen die letzten Bits des Wertes in einem Teil des letzten Bytes
+ u8WertRestBits > 0)
+ {
+ //Im letzten Byte des relevanten Speichers stehen letzte Bit des Wertes (kleiner 8)
+ u8SpeicherLaengeRelevant++;
+ }
+
+ // BTP 5360: Es sollen nur so viele Daten übertragen werden wie vorhanden sind oder ins Ziel passen.
+ u8SpeicherLaengeBenötigt = u8SpeicherLaengeRelevant + (unsigned char)((dwStartBit)>>3);
+// ASSERT(u8SpeicherLaengeBenötigt <= u8MsgLength);
+ if(u8SpeicherLaengeBenötigt > u8MsgLength || u8WertByteLaenge > u8SigDataLength)
+ {
+ // Wenn Restbits, zuerst diese weg lassen.
+ if(u8WertRestBits != 0)
+ {
+ u8WertRestBits = 0;
+ --u8SpeicherLaengeRelevant;
+ --u8SpeicherLaengeBenötigt;
+ }
+ // Zu übertragende Bytes auf Botschaftslänge oder Ziellänge kürzen.
+ msgOverflow = u8SpeicherLaengeBenötigt > u8MsgLength ? u8SpeicherLaengeBenötigt - u8MsgLength : 0;
+ sigOverflow = u8WertByteLaenge > u8SigDataLength ? u8WertByteLaenge - u8SigDataLength : 0;
+ if(msgOverflow < sigOverflow)
+ msgOverflow = sigOverflow;
+ if(msgOverflow >= u8WertByteLaenge)// Nichts zu übertragen.
+ return;
+ u8SpeicherLaengeRelevant -= msgOverflow;
+ u8WertByteLaenge -= msgOverflow;
+ }
+
+ if(u8WertByteLaenge == 0)// Nichts zu übertragen.
+ return;
+
+ if(dwBitCount > (unsigned)(u8SigDataLength * 8))
+ dwBitCount = u8SigDataLength * 8;
+
+ //**************************************************************
+ //********null setzen ungenutzter Bits im Wert-Speicher*********
+ //**************************************************************
+ if (//enthält das letzte Byte des Wert-Speichers ungenutzte Bits
+ (dwBitCount % 8) == 0)
+ {
+ // letztes Byte in Wert-Speicher enthält keine ungenutzten Bits
+ }
+ else
+ {
+ //letztes Byte in Wert-Speicer enthaelt ungenutzten Bits
+ //null setzen der ungenutzten Bits
+ *((pSigData) + u8WertByteLaenge - 1) &= (0xff >> (8 - (dwBitCount % 8)) );
+ }
+
+
+ switch(enOrder)
+ {
+ case IL__nenLittleEndian:
+ {
+ //**************************************************************
+ //********Byteorder ist INTEL***********************************
+ //**************************************************************
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (unsigned char)((dwStartBit)>>3);
+
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //*******************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher
+ //*******************************************************
+ //Maske anlegen um Wert-Bereich in Speicher null zu setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = 0xff << u8WertRestBits;
+ }
+ //BitOffset in Maske beruecksichtigen
+ u8MaskeStartByte |= ( ~(0xff << u8BitOffset));
+
+ //Wert-Bereich in Speicher null setzen
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+ //Wert in Wert-Bereich im Speicher schreiben
+ *pau8SpeicherStart |= ((*pSigData)<<u8BitOffset);
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt****
+ //*********************************************************
+
+ //relevante Bits in letztem relevanten Byte null setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ *(pau8SpeicherStart + u8SpeicherLaengeRelevant - 1) = 0;
+ }
+ else
+ {
+ //RestBits enthalten
+ //Maske erstellen
+ u8MaskeEndByte = 0xff << u8WertRestBits;
+ //letztes relevantes Byte in Speicher mit Maske verunden
+ *(pau8SpeicherStart + u8SpeicherLaengeRelevant - 1) &= u8MaskeEndByte;
+ }
+
+ //Loeschen von (StartByte+1) bis (Startbyte+LaengeRelevant-2)
+ if (//gibt es zwischen erstem und letztem Relevanten Byte noch Bytes die komplett null gesetzt werden koennen
+ u8SpeicherLaengeRelevant > 2)
+ {
+ // @StRi: Die inneren Bytes auf 0 setzen. So einfacher
+ //::ZeroMemory(*(pau8SpeicherStart + 1), u8SpeicherLaengeRelevant - 3);
+
+ //Ja es gibt Bytes die mit Sicherheit null gesetzt werden muessen
+ for (u8ForCount = 1; u8ForCount <= (u8SpeicherLaengeRelevant - 2) ; u8ForCount++)
+ {
+ *(pau8SpeicherStart + u8ForCount) = 0;
+ }
+ }
+ else
+ {
+ //Nein es sind keine Bytes null zu setzen
+ }
+
+ //relevante Bits in erstem relevanten SpeicherByte null setzen
+ //Maske erstellen
+ u8MaskeStartByte = ~(0xff << u8BitOffset);
+ //verunden
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //***********************************************************
+ //schreiben aller WertBytes in Speicher beide ab Startadresse
+ //***********************************************************
+ u8ForCount = 0;
+ while (//schreiben aller WertBytes bis auf das letzte (muss verodert werden, da
+ //dort Bits enthalten sein koennen die nicht angetastet werden duerfen
+ u8ForCount < (u8WertByteLaenge - 1))
+ {
+ *(pau8SpeicherStart + u8ForCount) = *(pSigData + u8ForCount);
+ u8ForCount++;
+ }
+ //verodern des letzten WertBytes in letztes relevantes Byte in Speicher
+ *((pau8SpeicherStart) + u8ForCount) |= *(pSigData + u8ForCount);
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+
+
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge)
+ {
+ //schreiben lowBits
+ *(pau8SpeicherStart + u8ForCount) |= (*(pSigData + u8ForCount)) << u8BitOffset;
+ //schreiben highBits
+ *(pau8SpeicherStart + u8ForCount + 1) |= (*(pSigData + u8ForCount)) >> (8-u8BitOffset);
+
+ u8ForCount++;
+ }
+ }
+ }
+ }
+ break;
+ case IL__nenBigEndian:
+ {
+ //**************************************************************
+ //********Byteorder ist MOTOROLA********************************
+ //**************************************************************
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (u8MsgLength - 1) - (unsigned char)(dwStartBit >> 3);
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //*********************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher********
+ //*********************************************************
+ // Maske anlegen um Wert-Bereich in Speicher null zu setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = 0xff << u8WertRestBits;
+ }
+ //BitOffset beruecksichtigen
+ u8MaskeStartByte |= ~(0xff << u8BitOffset);
+
+ //Wert-Bereich in Speicher null setzen
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+ //Wert in Wert-Bereich im Speicher schreiben
+ *pau8SpeicherStart |= *pSigData << u8BitOffset;
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt
+ //*********************************************************
+ //letzte Bits des Wert-Bereich in Speicher null setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ *(pau8SpeicherStart - u8SpeicherLaengeRelevant + 1) = 0;
+ }
+ else
+ {
+ //RestBits sind enthalten
+ //Maske erstellen
+ u8MaskeEndByte = (0xff << u8WertRestBits);
+ //letztes relevantes Byte in Speicher mit Maske verunden
+ *(pau8SpeicherStart - u8SpeicherLaengeRelevant + 1) &= u8MaskeEndByte;
+ }
+
+ //Loeschen von (StartByte+1) bis (Startbyte+LaengeRelevant-2)
+ if (//gibt es zwischen erstem und letztem Relevanten Byte noch Bytes die komplett null gesetzt werden k”nnen
+ u8SpeicherLaengeRelevant > 2)
+ {
+ // @StRi. Hier ZeroMemory einbauen!
+ //Ja es gibt Bytes die mit sicherheit null gesetzt werden muessen
+ for (u8ForCount = 1; u8ForCount <= (u8SpeicherLaengeRelevant - 2) ; u8ForCount++)
+ {
+ *(pau8SpeicherStart - u8ForCount) = 0;
+ }
+ }
+ else
+ {
+ //Nein, es sind keine Bytes null zu setzen
+ }
+
+ //relevante Bits in erstem relevanten Byte null setzen
+ //Maske erstellen
+ u8MaskeStartByte = ~(0xff << u8BitOffset);
+ //verunden
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //schreiben aller WertBytes bis auf das letzte (muss verodert werden, da
+ //dort Bits enthalten sein koennen die nicht angetastet werden duerfen
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge - 1)
+ {
+ *((pau8SpeicherStart) - u8ForCount) = *((pSigData) + u8ForCount);
+
+ u8ForCount++;
+ }
+ //verodern des letzten WertBytes in letztes relevantes Byte in Speicher
+ *((pau8SpeicherStart) - u8ForCount) |= *((pSigData) + u8ForCount);
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge)
+ {
+ //schreiben lowBits
+ *((pau8SpeicherStart) - u8ForCount) |= ((*((pSigData) + u8ForCount))<<u8BitOffset);
+ //schreiben highBits
+ *((pau8SpeicherStart) - u8ForCount - 1) |= ((*((pSigData) + u8ForCount))>>(8-u8BitOffset));
+ u8ForCount++;
+ }
+ }
+ }
+ }
+ break;
+ }
+}
+
+
+void vBitRead(const uint8_t* pMsgData,
+ uint8_t* pSigData,
+ uint8_t u8MsgLength,
+ uint8_t u8SigDataLength,
+ uint32_t dwBitCount,
+ uint32_t dwStartBit,
+ CAN__tenByteOrderBitAccess enOrder)
+{
+ //**************************************************************
+ //************anlegen Lokaler Variablen*************************
+ //**************************************************************
+
+ //Bitoffset in erstem Byte (Anzahl der Bits bis erstes Bit des Wertes beginnt)
+ uint8_t u8BitOffset;
+ //Startadresse erstes relevantes Byte in Speicher
+ const uint8_t* pau8SpeicherStart;
+ //Relevante Laenge des Speichers in Byte
+ uint8_t u8SpeicherLaengeRelevant;
+ //Berechnete Lange des Wert-Speichers in Byte
+ uint8_t u8WertByteLaenge;
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ uint8_t u8WertRestBits;
+ //Maskierungen fuer erstes und letztes Byte
+ uint8_t u8MaskeEndByte;
+ uint8_t u8MaskeStartByte;
+ //Zaehlvariable fuer For-Schleifen
+ uint8_t u8ForCount;
+
+ uint8_t u8SpeicherLaengeBenoetigt;
+ uint8_t msgOverflow;
+ uint8_t sigOverflow;
+ uint8_t u8Pos;
+
+
+ //*************************************************************
+ //******* berechnen lokaler Variablen fuer READ **************
+ //*************************************************************
+ //Berechnen der Laenge des benoetigten Wert-Speichers in Byte
+ u8WertByteLaenge = ((unsigned char)((dwBitCount - 1) >> 3)) + 1;
+
+ //Offset berechnen (Bits in erstem Byte bis 1.Bit des Wertes beginnt)
+ u8BitOffset = (unsigned char)((dwStartBit)%8);
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ u8WertRestBits = (uint8_t)(((dwBitCount) + (u8BitOffset))%8);
+
+ //Laenge in Byte des relevanten Speicherbereichs ermitteln
+ u8SpeicherLaengeRelevant = ((unsigned char)(((dwBitCount) + (unsigned short)(u8BitOffset))>>3));
+ if (//stehen die letzten Bits des Wertes in einem Teil des letzten Bytes
+ u8WertRestBits > 0)
+ {
+ //Im letzten Byte des relevanten Speichers stehen letzte Bit des Wertes (kleiner 8)
+ u8SpeicherLaengeRelevant++;
+ }
+
+ // BTP 5360: Es sollen nur so viele Daten übertragen werden wie vorhanden sind oder ins Ziel passen.
+ u8SpeicherLaengeBenoetigt = u8SpeicherLaengeRelevant + (unsigned char)((dwStartBit)>>3);
+ if(u8SpeicherLaengeBenoetigt > u8MsgLength || u8WertByteLaenge > u8SigDataLength)
+ {
+ // Wenn Restbits, zuerst diese weg lassen.
+ if(u8WertRestBits != 0)
+ {
+ u8WertRestBits = 0;
+ --u8SpeicherLaengeRelevant;
+ --u8SpeicherLaengeBenoetigt;
+ }
+ // Zu übertragende Bytes auf Botschaftslänge oder Ziellänge kürzen.
+ msgOverflow = u8SpeicherLaengeBenoetigt > u8MsgLength ? u8SpeicherLaengeBenoetigt - u8MsgLength : 0;
+ sigOverflow = u8WertByteLaenge > u8SigDataLength ? u8WertByteLaenge - u8SigDataLength : 0;
+ if(msgOverflow < sigOverflow)
+ msgOverflow = sigOverflow;
+ if(msgOverflow >= u8WertByteLaenge)// Nichts zu übertragen.
+ return;
+ u8SpeicherLaengeRelevant -= msgOverflow;
+ u8WertByteLaenge -= msgOverflow;
+ }
+
+ //Null setzen des Wert speichers ueber die errechnete Bytelaenge
+ for( u8Pos=0; u8Pos<u8SigDataLength; u8Pos++ )
+ {
+ pSigData[u8Pos] = 0;
+ }
+
+ if(u8WertByteLaenge == 0)// Nichts zu übertragen.
+ return;
+
+ switch(enOrder)
+ {
+ case IL__nenLittleEndian:
+ {
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (unsigned char)((dwStartBit)>>3);
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //********************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher*
+ //********************************************************
+
+ //Maske anlegen um Wert-Bereich aus Speicher zu lesen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = ~(0xff << u8WertRestBits);
+ }
+ //BitOffset beruecksichtigen
+ u8MaskeStartByte &= (0xff << u8BitOffset);
+
+ //Wert-Bereich aus Speicher lesen um den Offset nach rechts verschieben und in Wert speichern
+ *pSigData = ((*pau8SpeicherStart) & u8MaskeStartByte) >> u8BitOffset;
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt
+ //*********************************************************
+
+ //Bitmaske fuer Bits aus letztem relevanten SpeicherByte erstellen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten (alle Bits des letzten Byte muessen ausgelesen werden)
+ u8MaskeEndByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+
+ //Maske erstellen(Maskiert alle relevanten Bits des letzten Bytes)
+ u8MaskeEndByte = ~(0xff << u8WertRestBits);
+ }
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //lesen aller WertBytes in Speicher beide ab Startadresse
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge-1)
+ {
+ *((pSigData) + u8ForCount) = *((pau8SpeicherStart) + u8ForCount);
+ u8ForCount++;
+ }
+ //lesen des letzten relevanten Bytes Maskiert, um nur relevante bits zu lesen
+ *((pSigData) + u8ForCount) = ((*((pau8SpeicherStart) + u8ForCount)) & u8MaskeEndByte);
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+ u8ForCount = 0;
+ while (u8ForCount < u8SpeicherLaengeRelevant -2)
+ {
+ //lesen lowBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) + u8ForCount))>>u8BitOffset);
+ //lesen highBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) + u8ForCount + 1))<<(8-u8BitOffset)) ;
+ u8ForCount++;
+ }
+ //lesen lowBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) + u8ForCount))>>u8BitOffset);
+ //lesen highBits mit Maske für letztes Byte
+ (*((pSigData) + u8ForCount)) |= (((*((pau8SpeicherStart) + u8ForCount + 1)) & u8MaskeEndByte)<<(8-u8BitOffset)) ;
+ //lesen lowBits mit Maske für letztes Byte
+ (*((pSigData) + u8ForCount+1)) |= (((*((pau8SpeicherStart) + u8ForCount +1)) & u8MaskeEndByte)>>u8BitOffset);
+ }
+ }
+
+ }
+ break;
+ case IL__nenBigEndian:
+ {
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (u8MsgLength - 1) - (unsigned char)((dwStartBit)>>3);
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //*********************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher
+ //*********************************************************
+
+ //Maske anlegen um Wert-Bereich aus Speicher zu lesen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = ~(0xff << u8WertRestBits);
+ }
+ //BitOffset beruecksichtigen
+ u8MaskeStartByte &= (0xff << u8BitOffset);
+
+ //Wert-Bereich aus Speicher lesen um den Offset nach rechts verschieben und in Wert speichern
+ *pSigData = ((*pau8SpeicherStart) & u8MaskeStartByte) >> u8BitOffset;
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt
+ //*********************************************************
+
+ //Bitmaske fuer Bits aus letztem relevanten SpeicherByte erstellen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten (alle Bits des letzten Byte muessen ausgelesen werden)
+ u8MaskeEndByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+
+ //Maske erstellen(Maskiert alle relevanten Bits des letzten Bytes)
+ u8MaskeEndByte = ~(0xff << u8WertRestBits);
+ }
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //lesen aller WertBytes in Speicher beide ab Startadresse
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge-1)
+ {
+ *((pSigData) + u8ForCount) = *((pau8SpeicherStart) - u8ForCount);
+ u8ForCount++;
+ }
+ //lesen des letzten relevanten Bytes Maskiert, um nur relevante bits zu lesen
+ *((pSigData) + u8ForCount) = (*((pau8SpeicherStart) - u8ForCount)) & u8MaskeEndByte;
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+ u8ForCount = 0;
+ while (u8ForCount < u8SpeicherLaengeRelevant -2)
+ {
+ //lesen lowBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) - u8ForCount))>>u8BitOffset);
+ //lesen highBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) - u8ForCount - 1))<<(8-u8BitOffset)) ;
+ u8ForCount++;
+ }
+ //lesen lowBits
+ (*((pSigData) + u8ForCount)) |= (((*((pau8SpeicherStart) - u8ForCount))>>u8BitOffset) );
+ //lesen highBits mit Maske für letztes Byte
+ (*((pSigData) + u8ForCount)) |= (((*((pau8SpeicherStart) - u8ForCount - 1)) & u8MaskeEndByte)<<(8-u8BitOffset)) ;
+ //lesen lowBits mit Maske für letztes Byte
+ (*((pSigData) + u8ForCount + 1)) |= (((*((pau8SpeicherStart) - u8ForCount - 1)) & u8MaskeEndByte)>>u8BitOffset);
+ }
+ }
+
+ }
+ break;
+ }
+}
+
+#else /*!_WINECU_ means bigendian CPU*/
+
+void vBitWrite( uint8_t *pMsgData,
+ uint8_t *pSigData,
+ uint8_t u8MsgLength,
+ uint8_t u8SigDataLength,
+ uint32_t dwBitCount,
+ uint32_t dwStartBit,
+ CAN__tenByteOrderBitAccess enOrder
+ )
+{
+ //****************************************
+ //********Lokale Variablen anlegen********
+ //****************************************
+ //Bitoffset in erstem Byte (Anzahl der Bits bis erstes Bit des Wertes beginnt)
+ uint8_t u8BitOffset;
+ //Startadresse erstes relevantes Byte in Speicher
+ uint8_t* pau8SpeicherStart;
+ //Relevante Laenge des Speichers in Byte
+ uint8_t u8SpeicherLaengeRelevant;
+ //Berechnete Lange des Wert-Speichers in Byte
+ uint8_t u8WertByteLaenge;
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ uint8_t u8WertRestBits;
+ //Maskierungen fuer erstes und letztes Byte
+ uint8_t u8MaskeStartByte;
+ uint8_t u8MaskeEndByte;
+ //Zaehlvariable fuer For-Schleifen (@StRi: Guter Name!)
+ uint8_t u8ForCount;
+
+ uint8_t u8SpeicherLaengeBenoetigt;
+ uint8_t msgOverflow;
+ uint8_t sigOverflow;
+
+
+
+ // Wenn keine Daten vorhanden sind, kann auch nichts geschrieben werden.
+ if(u8MsgLength == 0)
+ return;
+
+
+ //****************************************************************************************
+ //********Berechnen lokaler Variablen Gueltigkeit fuer LittleEndian und BigEndian*********
+ //****************************************************************************************
+ //berechnen der ByteLaenge des Wert-Speichers
+ u8WertByteLaenge = ((unsigned char)((dwBitCount - 1) >> 3)) + 1;
+ //pruefen, ob die Laenge des uebergebenen Speichers groß genug ist um den maxWert des Signals zu beinhalten
+// ASSERT(u8WertByteLaenge <= u8SigDataLength);
+
+ //Offset berechnen (Bits in erstem Byte bis 1.Bit des Wertes beginnt)
+ u8BitOffset = (unsigned char)((dwStartBit)%8);
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ u8WertRestBits = (uint8_t)(((dwBitCount) + (u8BitOffset))%8);
+
+ //Laenge in Byte des relevanten Speicherbereichs ermitteln
+ u8SpeicherLaengeRelevant = ((unsigned char)(((dwBitCount) + (unsigned short)(u8BitOffset))>>3));
+ if (//stehen die letzten Bits des Wertes in einem Teil des letzten Bytes
+ u8WertRestBits > 0)
+ {
+ //Im letzten Byte des relevanten Speichers stehen letzte Bit des Wertes (kleiner 8)
+ u8SpeicherLaengeRelevant++;
+ }
+
+ // BTP 5360: Es sollen nur so viele Daten übertragen werden wie vorhanden sind oder ins Ziel passen.
+ u8SpeicherLaengeBenoetigt = u8SpeicherLaengeRelevant + (unsigned char)((dwStartBit)>>3);
+// ASSERT(u8SpeicherLaengeBenötigt <= u8MsgLength);
+ if(u8SpeicherLaengeBenoetigt > u8MsgLength || u8WertByteLaenge > u8SigDataLength)
+ {
+ // Wenn Restbits, zuerst diese weg lassen.
+ if(u8WertRestBits != 0)
+ {
+ u8WertRestBits = 0;
+ --u8SpeicherLaengeRelevant;
+ --u8SpeicherLaengeBenoetigt;
+ }
+ // Zu übertragende Bytes auf Botschaftslänge oder Ziellänge kürzen.
+ msgOverflow = u8SpeicherLaengeBenoetigt > u8MsgLength ? u8SpeicherLaengeBenoetigt - u8MsgLength : 0;
+ sigOverflow = u8WertByteLaenge > u8SigDataLength ? u8WertByteLaenge - u8SigDataLength : 0;
+ if(msgOverflow < sigOverflow)
+ msgOverflow = sigOverflow;
+ if(msgOverflow >= u8WertByteLaenge)// Nichts zu übertragen.
+ return;
+ u8SpeicherLaengeRelevant -= msgOverflow;
+ u8WertByteLaenge -= msgOverflow;
+ }
+
+ if(u8WertByteLaenge == 0)// Nichts zu übertragen.
+ return;
+
+ if(dwBitCount > (unsigned)(u8SigDataLength * 8))
+ dwBitCount = u8SigDataLength * 8;
+
+ //**************************************************************
+ //********null setzen ungenutzter Bits im Wert-Speicher*********
+ //**************************************************************
+ if (//enthält das letzte Byte des Wert-Speichers ungenutzte Bits
+ (dwBitCount % 8) == 0)
+ {
+ // letztes Byte in Wert-Speicher enthält keine ungenutzten Bits
+ }
+ else
+ {
+ //letztes Byte in Wert-Speicer enthaelt ungenutzten Bits
+ //null setzen der ungenutzten Bits
+ *((pSigData) + u8WertByteLaenge - 1) &= (0xff >> (8 - (dwBitCount % 8)) );
+ }
+
+
+ switch(enOrder)
+ {
+ case IL__nenLittleEndian:
+ {
+ //**************************************************************
+ //********Byteorder ist INTEL***********************************
+ //**************************************************************
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (unsigned char)((dwStartBit)>>3);
+
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //*******************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher
+ //*******************************************************
+ //Maske anlegen um Wert-Bereich in Speicher null zu setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = 0xff << u8WertRestBits;
+ }
+ //BitOffset in Maske beruecksichtigen
+ u8MaskeStartByte |= ( ~(0xff << u8BitOffset));
+
+ //Wert-Bereich in Speicher null setzen
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+ //Wert in Wert-Bereich im Speicher schreiben
+ *pau8SpeicherStart |= ((*(pSigData + u8SigDataLength - 1))<<u8BitOffset);
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt****
+ //*********************************************************
+
+ //relevante Bits in letztem relevanten Byte null setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ *(pau8SpeicherStart + u8SpeicherLaengeRelevant - 1) = 0;
+ }
+ else
+ {
+ //RestBits enthalten
+ //Maske erstellen
+ u8MaskeEndByte = 0xff << u8WertRestBits;
+ //letztes relevantes Byte in Speicher mit Maske verunden
+ *(pau8SpeicherStart + u8SpeicherLaengeRelevant - 1) &= u8MaskeEndByte;
+ }
+
+ //Loeschen von (StartByte+1) bis (Startbyte+LaengeRelevant-2)
+ if (//gibt es zwischen erstem und letztem Relevanten Byte noch Bytes die komplett null gesetzt werden koennen
+ u8SpeicherLaengeRelevant > 2)
+ {
+ // @StRi: Die inneren Bytes auf 0 setzen. So einfacher
+ //::ZeroMemory(*(pau8SpeicherStart + 1), u8SpeicherLaengeRelevant - 3);
+
+ //Ja es gibt Bytes die mit Sicherheit null gesetzt werden muessen
+ for (u8ForCount = 1; u8ForCount <= (u8SpeicherLaengeRelevant - 2) ; u8ForCount++)
+ {
+ *(pau8SpeicherStart + u8ForCount) = 0;
+ }
+ }
+ else
+ {
+ //Nein es sind keine Bytes null zu setzen
+ }
+
+ //relevante Bits in erstem relevanten SpeicherByte null setzen
+ //Maske erstellen
+ u8MaskeStartByte = ~(0xff << u8BitOffset);
+ //verunden
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //***********************************************************
+ //schreiben aller WertBytes in Speicher beide ab Startadresse
+ //***********************************************************
+ u8ForCount = 0;
+ while (//schreiben aller WertBytes bis auf das letzte (muss verodert werden, da
+ //dort Bits enthalten sein koennen die nicht angetastet werden duerfen
+ u8ForCount < (u8WertByteLaenge - 1))
+ {
+ *(pau8SpeicherStart + u8ForCount) = *(pSigData + u8SigDataLength - 1 - u8ForCount);
+ u8ForCount++;
+ }
+ //verodern des letzten WertBytes in letztes relevantes Byte in Speicher
+ *((pau8SpeicherStart) + u8ForCount) |= *(pSigData + u8SigDataLength - 1 - u8ForCount);
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+
+
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge)
+ {
+ //schreiben lowBits
+ *(pau8SpeicherStart + u8ForCount) |= (*(pSigData + u8SigDataLength - 1 - u8ForCount)) << u8BitOffset;
+ //schreiben highBits
+ *(pau8SpeicherStart + u8ForCount + 1) |= (*(pSigData + u8SigDataLength - 1 - u8ForCount)) >> (8-u8BitOffset);
+
+ u8ForCount++;
+ }
+ }
+ }
+ }
+ break;
+ case IL__nenBigEndian:
+ {
+ //**************************************************************
+ //********Byteorder ist MOTOROLA********************************
+ //**************************************************************
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (u8MsgLength - 1) - (unsigned char)(dwStartBit >> 3);
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //*********************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher********
+ //*********************************************************
+ // Maske anlegen um Wert-Bereich in Speicher null zu setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = 0xff << u8WertRestBits;
+ }
+ //BitOffset beruecksichtigen
+ u8MaskeStartByte |= ~(0xff << u8BitOffset);
+
+ //Wert-Bereich in Speicher null setzen
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+ //Wert in Wert-Bereich im Speicher schreiben
+ *pau8SpeicherStart |= *(pSigData + u8SigDataLength - 1) << u8BitOffset;
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt
+ //*********************************************************
+ //letzte Bits des Wert-Bereich in Speicher null setzen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ *(pau8SpeicherStart - u8SpeicherLaengeRelevant + 1) = 0;
+ }
+ else
+ {
+ //RestBits sind enthalten
+ //Maske erstellen
+ u8MaskeEndByte = (0xff << u8WertRestBits);
+ //letztes relevantes Byte in Speicher mit Maske verunden
+ *(pau8SpeicherStart - u8SpeicherLaengeRelevant + 1) &= u8MaskeEndByte;
+ }
+
+ //Loeschen von (StartByte+1) bis (Startbyte+LaengeRelevant-2)
+ if (//gibt es zwischen erstem und letztem Relevanten Byte noch Bytes die komplett null gesetzt werden k”nnen
+ u8SpeicherLaengeRelevant > 2)
+ {
+ // @StRi. Hier ZeroMemory einbauen!
+ //Ja es gibt Bytes die mit sicherheit null gesetzt werden muessen
+ for (u8ForCount = 1; u8ForCount <= (u8SpeicherLaengeRelevant - 2) ; u8ForCount++)
+ {
+ *(pau8SpeicherStart - u8ForCount) = 0;
+ }
+ }
+ else
+ {
+ //Nein, es sind keine Bytes null zu setzen
+ }
+
+ //relevante Bits in erstem relevanten Byte null setzen
+ //Maske erstellen
+ u8MaskeStartByte = ~(0xff << u8BitOffset);
+ //verunden
+ *pau8SpeicherStart &= u8MaskeStartByte;
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //schreiben aller WertBytes bis auf das letzte (muss verodert werden, da
+ //dort Bits enthalten sein koennen die nicht angetastet werden duerfen
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge - 1)
+ {
+ *((pau8SpeicherStart) - u8ForCount) = *((pSigData) + u8SigDataLength - 1 - u8ForCount);
+
+ u8ForCount++;
+ }
+ //verodern des letzten WertBytes in letztes relevantes Byte in Speicher
+ *((pau8SpeicherStart) - u8ForCount) |= *((pSigData) + u8SigDataLength - 1 - u8ForCount);
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge)
+ {
+ //schreiben lowBits
+ *((pau8SpeicherStart) - u8ForCount) |= ((*((pSigData) + u8SigDataLength - 1 - u8ForCount))<<u8BitOffset);
+ //schreiben highBits
+ *((pau8SpeicherStart) - u8ForCount - 1) |= ((*((pSigData) + u8SigDataLength - 1 - u8ForCount))>>(8-u8BitOffset));
+ u8ForCount++;
+ }
+ }
+ }
+ }
+ break;
+ }
+}
+
+
+void vBitRead(const uint8_t* pMsgData,
+ uint8_t* pSigData,
+ uint8_t u8MsgLength,
+ uint8_t u8SigDataLength,
+ uint32_t dwBitCount,
+ uint32_t dwStartBit,
+ CAN__tenByteOrderBitAccess enOrder)
+{
+ //**************************************************************
+ //************anlegen Lokaler Variablen*************************
+ //**************************************************************
+
+ //Bitoffset in erstem Byte (Anzahl der Bits bis erstes Bit des Wertes beginnt)
+ uint8_t u8BitOffset;
+ //Startadresse erstes relevantes Byte in Speicher
+ const uint8_t* pau8SpeicherStart;
+ //Relevante Laenge des Speichers in Byte
+ uint8_t u8SpeicherLaengeRelevant;
+ //Berechnete Lange des Wert-Speichers in Byte
+ uint8_t u8WertByteLaenge;
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ uint8_t u8WertRestBits;
+ //Maskierungen fuer erstes und letztes Byte
+ uint8_t u8MaskeEndByte;
+ uint8_t u8MaskeStartByte;
+ //Zaehlvariable fuer For-Schleifen
+ uint8_t u8ForCount;
+
+ uint8_t u8SpeicherLaengeBenoetigt;
+ uint8_t msgOverflow;
+ uint8_t sigOverflow;
+ uint8_t u8Pos;
+
+
+ //*************************************************************
+ //******* berechnen lokaler Variablen fuer READ **************
+ //*************************************************************
+ //Berechnen der Laenge des benoetigten Wert-Speichers in Byte
+ u8WertByteLaenge = ((unsigned char)((dwBitCount - 1) >> 3)) + 1;
+
+ //Offset berechnen (Bits in erstem Byte bis 1.Bit des Wertes beginnt)
+ u8BitOffset = (unsigned char)((dwStartBit)%8);
+ //Anzahl der Bits in letztem relevanten Byte des Speichers bis zum letzten Bit des Wertes
+ u8WertRestBits = (uint8_t)(((dwBitCount) + (u8BitOffset))%8);
+
+ //Laenge in Byte des relevanten Speicherbereichs ermitteln
+ u8SpeicherLaengeRelevant = ((unsigned char)(((dwBitCount) + (unsigned short)(u8BitOffset))>>3));
+ if (//stehen die letzten Bits des Wertes in einem Teil des letzten Bytes
+ u8WertRestBits > 0)
+ {
+ //Im letzten Byte des relevanten Speichers stehen letzte Bit des Wertes (kleiner 8)
+ u8SpeicherLaengeRelevant++;
+ }
+
+ // BTP 5360: Es sollen nur so viele Daten übertragen werden wie vorhanden sind oder ins Ziel passen.
+ u8SpeicherLaengeBenoetigt = u8SpeicherLaengeRelevant + (unsigned char)((dwStartBit)>>3);
+ if(u8SpeicherLaengeBenoetigt > u8MsgLength || u8WertByteLaenge > u8SigDataLength)
+ {
+ // Wenn Restbits, zuerst diese weg lassen.
+ if(u8WertRestBits != 0)
+ {
+ u8WertRestBits = 0;
+ --u8SpeicherLaengeRelevant;
+ --u8SpeicherLaengeBenoetigt;
+ }
+ // Zu übertragende Bytes auf Botschaftslänge oder Ziellänge kürzen.
+ msgOverflow = u8SpeicherLaengeBenoetigt > u8MsgLength ? u8SpeicherLaengeBenoetigt - u8MsgLength : 0;
+ sigOverflow = u8WertByteLaenge > u8SigDataLength ? u8WertByteLaenge - u8SigDataLength : 0;
+ if(msgOverflow < sigOverflow)
+ msgOverflow = sigOverflow;
+ if(msgOverflow >= u8WertByteLaenge)// Nichts zu übertragen.
+ return;
+ u8SpeicherLaengeRelevant -= msgOverflow;
+ u8WertByteLaenge -= msgOverflow;
+ }
+
+ //Null setzen des Wert speichers ueber die errechnete Bytelaenge
+ for( u8Pos=0; u8Pos<u8SigDataLength; u8Pos++ )
+ {
+ pSigData[u8Pos] = 0;
+ }
+
+ if(u8WertByteLaenge == 0)// Nichts zu übertragen.
+ return;
+
+ switch(enOrder)
+ {
+ case IL__nenLittleEndian:
+ {
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (unsigned char)((dwStartBit)>>3);
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //********************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher*
+ //********************************************************
+
+ //Maske anlegen um Wert-Bereich aus Speicher zu lesen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = ~(0xff << u8WertRestBits);
+ }
+ //BitOffset beruecksichtigen
+ u8MaskeStartByte &= (0xff << u8BitOffset);
+
+ //Wert-Bereich aus Speicher lesen um den Offset nach rechts verschieben und in Wert speichern
+ *(pSigData + u8SigDataLength - 1) = ((*pau8SpeicherStart) & u8MaskeStartByte) >> u8BitOffset;
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt
+ //*********************************************************
+
+ //Bitmaske fuer Bits aus letztem relevanten SpeicherByte erstellen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten (alle Bits des letzten Byte muessen ausgelesen werden)
+ u8MaskeEndByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+
+ //Maske erstellen(Maskiert alle relevanten Bits des letzten Bytes)
+ u8MaskeEndByte = ~(0xff << u8WertRestBits);
+ }
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //lesen aller WertBytes in Speicher beide ab Startadresse
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge-1)
+ {
+ *((pSigData) + u8SigDataLength - 1 - u8ForCount) = *((pau8SpeicherStart) + u8ForCount);
+ u8ForCount++;
+ }
+ //lesen des letzten relevanten Bytes Maskiert, um nur relevante bits zu lesen
+ *((pSigData) + u8SigDataLength - 1 - u8ForCount) = ((*((pau8SpeicherStart) + u8ForCount)) & u8MaskeEndByte);
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+ u8ForCount = 0;
+ while (u8ForCount < u8SpeicherLaengeRelevant -2)
+ {
+ //lesen lowBits
+ (*((pSigData) + u8SigDataLength - 1 - u8ForCount)) |= ((*((pau8SpeicherStart) + u8ForCount))>>u8BitOffset);
+ //lesen highBits
+ (*((pSigData) + u8SigDataLength - 1 - u8ForCount)) |= ((*((pau8SpeicherStart) + u8ForCount + 1))<<(8-u8BitOffset)) ;
+ u8ForCount++;
+ }
+ //lesen lowBits
+ (*((pSigData) + u8SigDataLength - 1 - u8ForCount)) |= ((*((pau8SpeicherStart) + u8ForCount))>>u8BitOffset);
+ //lesen highBits mit Maske für letztes Byte
+ (*((pSigData) + u8SigDataLength - 1 - u8ForCount)) |= (((*((pau8SpeicherStart) + u8ForCount + 1)) & u8MaskeEndByte)<<(8-u8BitOffset)) ;
+ //lesen lowBits mit Maske für letztes Byte
+ (*((pSigData) + u8SigDataLength - 1 - u8ForCount - 1)) |= (((*((pau8SpeicherStart) + u8ForCount +1)) & u8MaskeEndByte)>>u8BitOffset);
+ }
+ }
+
+ }
+ break;
+ case IL__nenBigEndian:
+ {
+
+ //Startadresse des relevanten Speicherbereichs ermitteln
+ pau8SpeicherStart = pMsgData + (u8MsgLength - 1) - (unsigned char)((dwStartBit)>>3);
+
+ if (//Steht der gesamte Wert nur in einem Byte im Speicher
+ u8SpeicherLaengeRelevant == 1)
+ {
+ //*********************************************************
+ //gesamter Wert steht in nur einem Byte im Speicher
+ //*********************************************************
+
+ //Maske anlegen um Wert-Bereich aus Speicher zu lesen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten
+ u8MaskeStartByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+ u8MaskeStartByte = ~(0xff << u8WertRestBits);
+ }
+ //BitOffset beruecksichtigen
+ u8MaskeStartByte &= (0xff << u8BitOffset);
+
+ //Wert-Bereich aus Speicher lesen um den Offset nach rechts verschieben und in Wert speichern
+ *pSigData = ((*pau8SpeicherStart) & u8MaskeStartByte) >> u8BitOffset;
+ }
+ else
+ {
+ //*********************************************************
+ //Wert ist ueber mehr als ein Byte im Speicher verteilt
+ //*********************************************************
+
+ //Bitmaske fuer Bits aus letztem relevanten SpeicherByte erstellen
+ if (//Sind RestBits enthalten
+ u8WertRestBits == 0)
+ {
+ //keine RestBits enthalten (alle Bits des letzten Byte muessen ausgelesen werden)
+ u8MaskeEndByte = 0xff;
+ }
+ else
+ {
+ //RestBits enthalten
+
+ //Maske erstellen(Maskiert alle relevanten Bits des letzten Bytes)
+ u8MaskeEndByte = ~(0xff << u8WertRestBits);
+ }
+
+ if (//muss ein Offset beruecksichtigt werden
+ u8BitOffset == 0)
+ {
+ //es muss kein Offset beruecksichtigt werden
+ //lesen aller WertBytes in Speicher beide ab Startadresse
+ u8ForCount = 0;
+ while (u8ForCount < u8WertByteLaenge-1)
+ {
+ *((pSigData) + u8ForCount) = *((pau8SpeicherStart) - u8ForCount);
+ u8ForCount++;
+ }
+ //lesen des letzten relevanten Bytes Maskiert, um nur relevante bits zu lesen
+ *((pSigData) + u8ForCount) = (*((pau8SpeicherStart) - u8ForCount)) & u8MaskeEndByte;
+ }
+ else
+ {
+ //es muss ein Offset beruecksichtigt werden
+ u8ForCount = 0;
+ while (u8ForCount < u8SpeicherLaengeRelevant -2)
+ {
+ //lesen lowBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) - u8ForCount))>>u8BitOffset);
+ //lesen highBits
+ (*((pSigData) + u8ForCount)) |= ((*((pau8SpeicherStart) - u8ForCount - 1))<<(8-u8BitOffset)) ;
+ u8ForCount++;
+ }
+ //lesen lowBits
+ (*((pSigData) + u8ForCount)) |= (((*((pau8SpeicherStart) - u8ForCount))>>u8BitOffset) );
+ //lesen highBits mit Maske für letztes Byte
+ (*((pSigData) + u8ForCount)) |= (((*((pau8SpeicherStart) - u8ForCount - 1)) & u8MaskeEndByte)<<(8-u8BitOffset)) ;
+ //lesen lowBits mit Maske für letztes Byte
+ (*((pSigData) + u8ForCount + 1)) |= (((*((pau8SpeicherStart) - u8ForCount - 1)) & u8MaskeEndByte)>>u8BitOffset);
+ }
+ }
+
+ }
+ break;
+ }
+}
+
+#endif /*!_WINECU_ means bigendian CPU*/
+
+/*API*/
+void IL_vSetSignal( CAN_tenSignal enSigId, uint32_t u32Value )
+{
+ CAN_tenMessage enMsgId;
+
+ if( CAN_boIsSignal( enSigId ) )
+ {
+ enMsgId = CAN__astSignalConfig[enSigId].enMsgId;
+ if( CAN__boIsTxMsg( enMsgId ) )
+ {
+ vBitWrite( CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enMsgId) ].pu8Data, //*pMsgData,
+ (uint8_t *)&u32Value, //uint8_t *pSigData,
+ CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enMsgId) ].u8Dlc, //u8MsgLength,
+ sizeof( u32Value ), //u8SigDataLength in Byte,
+ CAN__astSignalConfig[enSigId].u8BitSize, // dwBitCount,
+ CAN__astSignalConfig[enSigId].u8StartBit, // dwStartBit,
+ IL__nenLittleEndian // bit order
+ );
+ }
+ else
+ {
+ vBitWrite( CAN__astRxMessageConfig[ CAN__u8RxMsgIdToMsgIndex(enMsgId) ].pu8Data, //*pMsgData,
+ (uint8_t *)&u32Value, //uint8_t *pSigData,
+ CAN__astRxMessageConfig[ CAN__u8RxMsgIdToMsgIndex(enMsgId) ].u8Dlc, //u8MsgLength,
+ sizeof( u32Value ), //u8SigDataLength in Byte,
+ CAN__astSignalConfig[enSigId].u8BitSize, // dwBitCount,
+ CAN__astSignalConfig[enSigId].u8StartBit, // dwStartBit,
+ IL__nenLittleEndian // bit order
+ );
+ }
+ }
+}
+
+uint32_t IL_u32GetSignal( CAN_tenSignal enSigId )
+{
+ CAN_tenMessage enMsgId;
+ uint32_t u32Value=0;
+
+ if( CAN_boIsSignal( enSigId ) )
+ {
+ enMsgId = CAN__astSignalConfig[enSigId].enMsgId;
+ if( CAN__boIsTxMsg( enMsgId ) )
+ {
+ vBitRead( CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enMsgId) ].pu8Data, //*pMsgData,
+ (uint8_t *)&u32Value, //uint8_t *pSigData,
+ CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enMsgId) ].u8Dlc, //u8MsgLength,
+ sizeof( u32Value ), //u8SigDataLength in Byte,
+ CAN__astSignalConfig[enSigId].u8BitSize, // dwBitCount,
+ CAN__astSignalConfig[enSigId].u8StartBit, // dwStartBit,
+ IL__nenLittleEndian // bit order
+ );
+ }
+ else
+ {
+ vBitRead( CAN__astRxMessageConfig[ CAN__u8RxMsgIdToMsgIndex(enMsgId) ].pu8Data, //*pMsgData,
+ (uint8_t *)&u32Value, //uint8_t *pSigData,
+ CAN__astRxMessageConfig[ CAN__u8RxMsgIdToMsgIndex(enMsgId) ].u8Dlc, //u8MsgLength,
+ sizeof( u32Value ), //u8SigDataLength in Byte,
+ CAN__astSignalConfig[enSigId].u8BitSize, // dwBitCount,
+ CAN__astSignalConfig[enSigId].u8StartBit, // dwStartBit,
+ IL__nenLittleEndian // bit order
+ );
+ }
+ }
+ return u32Value;
+}
+
+
+bool IL_boGetSignalTo (CAN_tenSignal enSigId )
+{
+ return IL_boGetMessageTo( CAN__astSignalConfig[enSigId].enMsgId );
+}
+
+bool IL_boGetSignalFv( CAN_tenSignal enSigId )
+{
+ return IL_boGetMessageFv( CAN__astSignalConfig[enSigId].enMsgId );
+}
+
+void IL_vSetSignalSendRequest( CAN_tenSignal enSigId )
+{
+ IL_vSetMessageSendRequest( CAN__astSignalConfig[enSigId].enMsgId );
+}
+
+
+void IL_vSetMessageData( CAN_tenMessage enMsgId, uint8_t *pu8Data )
+{
+ uint8_t u8Index;
+ uint8_t u8MsgIndex;
+
+ uint8_t u8SrcData,u8DstData;
+
+ if( CAN__boIsTxMsg( enMsgId ) )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex(enMsgId);
+ for( u8Index=0; u8Index<CAN__astTxMessageConfig[u8MsgIndex].u8Dlc; u8Index++ )
+ {
+ CAN__astTxMessageConfig[u8MsgIndex].pu8Data[u8Index] = pu8Data[u8Index];
+ }
+ }
+ else if( CAN__boIsRxMsg( enMsgId ) )
+ {
+ u8MsgIndex = CAN__u8RxMsgIdToMsgIndex(enMsgId);
+ for( u8Index=0; u8Index<CAN__astRxMessageConfig[u8MsgIndex].u8Dlc; u8Index++ )
+ {
+ CAN__astRxMessageConfig[u8MsgIndex].pu8Data[u8Index] = pu8Data[u8Index];
+ u8SrcData = pu8Data[u8Index];
+ u8DstData = CAN__astRxMessageConfig[u8MsgIndex].pu8Data[u8Index];
+ }
+ }
+}
+
+void IL_vGetMessageData( CAN_tenMessage enMsgId, uint8_t *pu8Data )
+{
+ uint8_t u8Index;
+ uint8_t u8MsgIndex;
+
+ if( CAN__boIsTxMsg( enMsgId ) )
+ {
+ u8MsgIndex = CAN__u8TxMsgIdToMsgIndex(enMsgId);
+ for( u8Index=0; u8Index<CAN__astTxMessageConfig[u8MsgIndex].u8Dlc; u8Index++ )
+ {
+ pu8Data[u8Index] = CAN__astTxMessageConfig[u8MsgIndex].pu8Data[u8Index];
+ }
+ }
+ else if( CAN__boIsRxMsg( enMsgId ) )
+ {
+ u8MsgIndex = CAN__u8RxMsgIdToMsgIndex(enMsgId);
+ for( u8Index=0; u8Index<CAN__astRxMessageConfig[u8MsgIndex].u8Dlc; u8Index++ )
+ {
+ pu8Data[u8Index] = CAN__astRxMessageConfig[u8MsgIndex].pu8Data[u8Index];
+ }
+ }
+}
+
+uint8_t IL_u8GetMessageDlc( CAN_tenMessage enMsgId, uint8_t *pu8Data[8] )
+{
+ uint8_t u8Dlc=0;
+
+ if( CAN__boIsTxMsg( enMsgId ) )
+ {
+ u8Dlc = CAN__astTxMessageConfig[ CAN__u8TxMsgIdToMsgIndex(enMsgId) ].u8Dlc;
+ }
+ else if( CAN__boIsRxMsg( enMsgId ) )
+ {
+ u8Dlc = CAN__astRxMessageConfig[ CAN__u8RxMsgIdToMsgIndex(enMsgId) ].u8Dlc;
+ }
+ return u8Dlc;
+}
+
+bool IL_boGetMessageTo( CAN_tenMessage enMsgId )
+{
+ return CAN_boIsTimeout( enMsgId );
+}
+
+bool IL_boGetMessageFv( CAN_tenMessage enMsgId )
+{
+ return CAN_boIsFirstValue( enMsgId );
+}
+
+void IL_vSetMessageSendRequest( CAN_tenMessage enMsgId )
+{
+ CAN__vSetSendRequestFlag( enMsgId );
+}
+
+void IL_vSetMessageSendCyclic( CAN_tenMessage enMsgId, bool boActivate )
+{
+ if( boActivate )
+ {
+ CAN__vSetCyclicSendFlag( enMsgId );
+ }
+ else
+ {
+ CAN__vClearCyclicSendFlag( enMsgId );
+ }
+}
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.h
new file mode 100644
index 0000000..587db09
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IL1c1.h
@@ -0,0 +1,27 @@
+#ifndef IL_C1_H
+#define IL_C1_H
+
+#include "cdef.h"
+#include "CAN1c1.h"
+
+
+
+
+
+
+void IL_vSetSignal( CAN_tenSignal enSigId, uint32_t u32Value );
+uint32_t IL_u32GetSignal( CAN_tenSignal enSigId );
+bool IL_boGetSignalTo (CAN_tenSignal enSigId );
+bool IL_boGetSignalFv( CAN_tenSignal enSigId );
+void IL_vSetSignalSendRequest( CAN_tenSignal enSigId );
+
+void IL_vSetMessageData( CAN_tenMessage enMsgId, uint8_t *pu8Data );
+void IL_vGetMessageData( CAN_tenMessage enMsgId, uint8_t *pu8Data );
+bool IL_boGetMessageTo( CAN_tenMessage enMsgId );
+bool IL_boGetMessageFv( CAN_tenMessage enMsgId );
+void IL_vSetMessageSendRequest( CAN_tenMessage enMsgId );
+void IL_vSetMessageSendCyclic( CAN_tenMessage enMsgId, bool boActivate );
+
+
+
+#endif /*IL_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.c
new file mode 100644
index 0000000..9d925c3
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.c
@@ -0,0 +1,34 @@
+#include <asf.h>
+#include "avr_compiler.h"
+#include "avr32/io.h"
+#include "tc.h"
+
+
+#include "EVHD1c1.h"
+#include "IVECT1c1.h"
+
+/* ISR routines */
+#define IVECT_MakeInterrupt(IRQLINE,PRIO) \
+ __attribute__((__interrupt__)) \
+ static void IVECT__v##IRQLINE##_isr( void ) \
+ { \
+ EVHD_vSendEvent( EVHD_nen##IRQLINE ); \
+ } \
+
+
+ IVECT_MakeConfig
+#undef IVECT_MakeInterrupt
+
+void IVECT_vInit( void ) {
+
+ Disable_global_interrupt();
+ INTC_init_interrupts();
+
+#define IVECT_MakeInterrupt(IRQLINE,PRIO) \
+ INTC_register_interrupt(IVECT__v##IRQLINE##_isr,IRQLINE, PRIO); \
+
+ IVECT_MakeConfig
+#undef IVECT_MakeInterrupt
+
+ Enable_global_interrupt();
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.h
new file mode 100644
index 0000000..9908337
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1c1.h
@@ -0,0 +1,23 @@
+#ifndef IVECT_C1_H
+#define IVECT_C1_H
+
+#include "IVECT1ce.h"
+#include <asf.h>
+
+/* Interrupt Channels*/
+typedef enum
+{
+#define IVECT_MakeInterrupt(IRQLINE,PRIO) \
+ IVECT_nen##IRQLINE, \
+
+ IVECT_MakeConfig
+
+#undef IVECT_MakeInterrupt
+ /*must be the last entry*/
+ IVECT_nenNoOfChannels
+} IVECT_tenChannels;
+
+/* interface prototypes */
+void IVECT_vInit( void );
+
+#endif /*IVECT_C1_H*/ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1ce.h
new file mode 100644
index 0000000..fdb68ec
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/IVECT1ce.h
@@ -0,0 +1,16 @@
+#ifndef IVECT_CE_H
+#define IVECT_CE_H
+
+#include "cdef.h"
+
+#define IVECT_MakeConfig \
+ /* IRQ-Line, priority*/ \
+ IVECT_MakeInterrupt( AVR32_TC0_IRQ0, AVR32_INTC_INT3 ) \
+ IVECT_MakeInterrupt( AVR32_GPIO_IRQ_1, AVR32_INTC_INT0 ) \
+ IVECT_MakeInterrupt( AVR32_GPIO_IRQ_3, AVR32_INTC_INT0 ) \
+
+#define IVECT_MakeInterrupt( IRQLINE, PRIO ) \
+
+#undef IVECT_MakeInterrupt
+
+#endif /*IVECT_CE_H*/ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.c
new file mode 100644
index 0000000..c04bba7
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.c
@@ -0,0 +1,230 @@
+
+#include "TIMER1c1.h"
+
+#include "OS1c1.h"
+
+
+
+typedef struct
+{
+ void (*const pTaskFunc) ( void );
+ const uint16_t u16ActivationCycle;
+ uint8_t u8Activation_cnt;
+ OS_tenTaskState enState;
+}OS__tstConfig;
+
+
+//Vorwärtsdeklaration der Task-Funktionen
+#define OS_MakeNormalTask( TaskId, pFunc ) \
+ extern void pFunc ( void );
+
+#define OS_MakeAutostartTask( TaskId, pFunc ) \
+ extern void pFunc ( void );
+
+#define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ extern void pFunc ( void );
+
+#define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ extern void pFunc ( void );
+
+
+OS_MakeConfig
+
+#undef OS_MakeNormalTask
+#undef OS_MakeAutostartTask
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+
+
+//Konfiguration
+#define OS_MakeNormalTask( TaskId, pFunc ) \
+ { pFunc, 0, 0, OS_nenSleeping },
+
+#define OS_MakeAutostartTask( TaskId, pFunc ) \
+ { pFunc, 0, 1, OS_nenActivated },
+
+#define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ { pFunc, Cycle, 0, OS_nenSleeping },
+
+#define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ { pFunc, Cycle, 0, OS_nenSleeping },
+
+OS__tstConfig OS__astConfig[OS_nenNoOfTasks] =
+{
+ OS_MakeConfig
+};
+
+#undef OS_MakeNormalTask
+#undef OS_MakeAutostartTask
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+
+
+OS_tenTaskId OS__enCurrentTask;
+
+
+void OS_vActivateTask( OS_tenTaskId enTask )
+{
+ OS__vDisableInterrups();
+
+ OS__astConfig[enTask].u8Activation_cnt++;
+
+ OS__vEnableInterrups();
+}
+
+void OS_vSchedule( void )
+{
+ OS_tenTaskId enHighestTask;
+ OS_tenTaskId enPreeptedTask = OS_nenNoOfTasks;
+ bool boExit=false;
+
+ /*Abfragen der Timer für Taskaktivierung*/
+ #define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ TIMER_boIsTimeExpired( TIMER_nenCyclic##TaskId ) ? OS_vActivateTask( TaskId ), TIMER_vSubValue( TIMER_nenCyclic##TaskId, Cycle) : 0;
+
+ #define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ TIMER_boIsTimeExpired( TIMER_nenAlarm##TaskId ) ? OS_vActivateTask( TaskId ) : 0;
+
+ #define OS_MakeNormalTask( TaskId, pFunc )
+
+ #define OS_MakeAutostartTask( TaskId, pFunc )
+
+ OS_MakeConfig
+
+ #undef OS_MakeCyclicTask
+ #undef OS_MakeAlarmTask
+ #undef OS_MakeNormalTask
+ #undef OS_MakeAutostartTask
+
+ /*Suche aktivierten Task mit höchster Prio*/
+ enHighestTask = 0;
+ do /*solange noch höherpriore aktivierete Tasks forhanden sind */
+ {
+ while( /*ist der Activation Zaehler nicht gesetzt?*/
+ OS__astConfig[enHighestTask].u8Activation_cnt == 0
+ /*abbruch wenn Ende der Task-Liste erreicht */
+ && enHighestTask < OS_nenNoOfTasks
+ )
+ {
+ ++enHighestTask;
+ }
+
+ /* Faelle:
+ 1) Kein Task ist an laufen
+ Kein neuen Task gefunden
+ -> OS_Schedule() beenden, Dadurch wird auch OS_vRun() beendet
+ Bedingung: enHighestTask == OS_nenNoOfTasks
+ OS__enCurrentTask == OS_nenNoOfTasks
+ 2) Kein Task ist an laufen
+ neuen Task gefunden
+ -> neuen Task starten, neue Task-Funktion in OS_Schedul aufrufen
+ Bedingung: enHighestTask < OS_nenNoOfTasks
+ OS__enCurrentTask == OS_nenNoOfTasks
+ 3) ein Task ist an laufen
+ Kein neuen Task gefunden
+ -> alter Task laeuft weiter, OS_Schedule() beenden
+ Bedingung: enHighestTask == OS_nenNoOfTasks
+ OS__enCurrentTask < OS_nenNoOfTasks
+ 4) ein Task ist an laufen
+ neuen Task hat kleinere prio
+ -> alter Task laeuft weiter, OS_Schedule() beenden
+ Bedingung: enHighestTask > OS__enCurrentTask
+ OS__enCurrentTask < OS_nenNoOfTasks
+ 5) ein Task ist an laufen
+ neuen Task hat groessere prio
+ -> neuer Task laeuft weiter, neue Task-Funktion in OS_Schedul aufrufen
+ Bedingung: enHighestTask < OS__enCurrentTask
+ OS__enCurrentTask < OS_nenNoOfTasks
+ */
+ if( /*ist die Prio es neuen Task größer als die Proi des laufenden Task*/
+ enHighestTask < OS__enCurrentTask
+ )
+ {
+ /*Zustand des alten Task auf unterbrochen setzen*/
+ if( OS__enCurrentTask < OS_nenNoOfTasks )
+ {
+ OS__astConfig[OS__enCurrentTask].enState = OS_nenPreempted;
+ }
+ /*zu unterbrechenden Task merken */
+ enPreeptedTask = OS__enCurrentTask;
+ /*aktueller Task ist neuer Task */
+ OS__enCurrentTask = enHighestTask;
+ /*euen Task-State auf "running" */
+ OS__astConfig[enHighestTask].enState = OS_nenRunning;
+ OS__vDisableInterrups();
+ OS__astConfig[enHighestTask].u8Activation_cnt--;
+ OS__vEnableInterrups();
+ /*Task-Funk aufrufen */
+ OS__astConfig[enHighestTask].pTaskFunc();
+ /*nach verlassen der Task-Funktion ist der Task wieder schlafend*/
+ OS__astConfig[enHighestTask].enState = OS_nenSleeping;
+ /*laufenden Task ist der unterbrochenen Task */
+ if( enPreeptedTask < OS_nenNoOfTasks )
+ {
+ OS__astConfig[enPreeptedTask].enState = OS_nenRunning;
+ }
+ OS__enCurrentTask = enPreeptedTask;
+ }
+ else
+ {
+ boExit = true;
+ }
+ }
+ while( /*solange noch höherpriore aktivierete Tasks forhanden sind */
+ !boExit
+ );
+
+}
+
+OS_tenTaskState OS_enGetTaskState( OS_tenTaskId enTask )
+{
+ OS__vDisableInterrups();
+ if( OS__astConfig[enTask].enState == OS_nenSleeping
+ && OS__astConfig[enTask].u8Activation_cnt > 0
+ )
+ {
+ OS__vEnableInterrups();
+ return OS_nenActivated;
+ }
+ else
+ {
+ OS__vEnableInterrups();
+ return OS__astConfig[enTask].enState;
+ }
+}
+
+OS_tenTaskId OS_enGetCurrentTaskId( void )
+{
+ return OS__enCurrentTask;
+}
+
+void OS_vInit( void )
+{
+ OS__enCurrentTask = OS_nenNoOfTasks;
+
+ /*Starten der Timer für zyklische Task-Aktivierung*/
+ #define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ TIMER_vStart( TIMER_nenCyclic##TaskId );
+
+ #define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+
+ #define OS_MakeNormalTask( TaskId, pFunc ) \
+
+ #define OS_MakeAutostartTask( TaskId, pFunc ) \
+
+ OS_MakeConfig
+
+ #undef OS_MakeCyclicTask
+ #undef OS_MakeAlarmTask
+ #undef OS_MakeNormalTask
+ #undef OS_MakeAutostartTask
+}
+
+void OS_vRun( void )
+{
+ OS_vSchedule();
+}
+
+
+
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.h
new file mode 100644
index 0000000..c6ab0ca
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1c1.h
@@ -0,0 +1,104 @@
+#ifndef OS_C1_H
+#define OS_C1_H
+
+#include "cdef.h"
+
+#include "OS1ce.h"
+
+
+typedef enum
+{
+ OS_nenSleeping,
+ OS_nenActivated,
+ OS_nenRunning,
+ OS_nenPreempted
+}OS_tenTaskState;
+
+/*enum für Task-ID*/
+#define OS_MakeNormalTask( TaskId, pFunc ) \
+ TaskId,
+
+#define OS_MakeAutostartTask( TaskId, pFunc ) \
+ TaskId,
+
+#define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ TaskId,
+
+#define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ TaskId,
+
+
+typedef enum
+{
+ OS_MakeConfig
+
+ /*Muss der letzte Eintrag sein!*/
+ OS_nenNoOfTasks
+}OS_tenTaskId;
+
+#undef OS_MakeNormalTask
+#undef OS_MakeAutostartTask
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+
+/*extern Deklaration für Task-Funktionen*/
+#define OS_MakeNormalTask( TaskId, pFunc ) \
+ extern void pFunc( void );
+
+#define OS_MakeAutostartTask( TaskId, pFunc ) \
+ extern void pFunc( void );
+
+#define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ extern void pFunc( void );
+
+#define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ extern void pFunc( void );
+
+ OS_MakeConfig
+
+#undef OS_MakeNormalTask
+#undef OS_MakeAutostartTask
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+
+
+/*
+typedef struct
+{
+ void (*const pTaskFunc) ( void );
+ const uint16_t u16ActivationCycle;
+ uint8_t u8Activation_cnt;
+ OS_tenTaskState enState;
+}OS__tstConfig;
+*/
+
+#include "TIMER1c1.h" /*nur für die folgenden Makros noetig*/
+
+#define OS_vActivateAlarm( TaskId, u32Delay ) \
+( TIMER_vSet( TIMER_nenAlarm##TaskId, u32Delay ), TIMER_vStart( TIMER_nenAlarm##TaskId ) )
+
+#define OS_vCancelAlarm( TaskId ) \
+ TIMER_vStop( TIMER_nenAlarm##TaskId )
+
+#define OS_boIsAlarmActive( TaskId ) \
+ TIMER_boIsTimeRunning( TIMER_nenAlarm##TaskId )
+
+
+
+
+void OS_vActivateTask( OS_tenTaskId enTask );
+
+void OS_vSchedule( void );
+
+OS_tenTaskState OS_enGetTaskState( OS_tenTaskId enTask );
+
+OS_tenTaskId OS_enGetCurrentTaskId( void );
+
+void OS_vInit( void );
+
+void OS_vRun( void );
+
+#define OS_TASK( NAME ) void NAME##_fkt( void )
+
+
+#endif /*OS_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1ce.h
new file mode 100644
index 0000000..b8d0496
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/OS1ce.h
@@ -0,0 +1,32 @@
+#ifndef OS_CE_H
+#define OS_CE_H
+
+/*Höchste Prio ganz oben
+ kleinste Prio nach unten*/
+#define OS_MakeConfig \
+/* Task ID *pTaskFunc, Delay, Unit */ \
+OS_MakeNormalTask( OS_nenEvhdHigh, EVHD_vHigh_fkt ) \
+OS_MakeNormalTask( OS_nenEvhdLow, EVHD_vLow_fkt ) \
+OS_MakeAutostartTask( OS_nenTaskIdle, START_vIdle_fkt ) \
+
+
+
+#define OS__vDisableInterrups()
+
+#define OS__vEnableInterrups()
+
+#define OS_MakeCyclicTask( TaskId, ActiveType, pFunc, Cycle, Unit ) \
+ TaskId,
+
+#define OS_MakeAlarmTask( TaskId, ActiveType, pFunc, Cycle, Unit ) \
+ TaskId,
+
+#define OS_MakeNormalTask( TaskId, ActiveType, pFunc ) \
+ TaskId,
+
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+#undef OS_MakeNormalTask
+
+#endif /*OS_CE_H*/
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.c
new file mode 100644
index 0000000..a8b12fe
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.c
@@ -0,0 +1,51 @@
+#ifdef _WINECU_
+#include "HW_VIPER_c1.h"
+#else /* !_WINECU_, means target*/
+#include <avr_compiler.h>
+#include <asf.h>
+#include "gpio.h"
+#endif /* !_WINECU_ */
+
+#include "EVHD1c1.h"
+#include "PINT1c1.h"
+
+/* functions to receive interrupt group events (callbacks for EVHD) */
+#define PINT_MakeIRQHandlerStart(HWIRQGRP) \
+ void PINT_vIrqHandler_##HWIRQGRP( EVHD_tenReceiveEvent enIrqGrpRxEvent ) \
+ { \
+
+#define PINT_MakePin(PinID, HWPin, Mode, Glitch, SendEvent) \
+ if( gpio_get_pin_interrupt_flag( HWPin ) ) \
+ { \
+ EVHD_vSendEvent( SendEvent ); \
+ gpio_clear_pin_interrupt_flag( HWPin ); \
+ } \
+
+#define PINT_MakeIRQHandlerEnd(HWIRGGRP) \
+ } \
+
+PINT_MakeConfig
+
+#undef PINT_MakeIRQHandlerStart
+#undef PINT_MakePin
+#undef PINT_MakeIRQHandlerEnd
+
+/* interface functions */
+#define PINT_MakeIRQHandlerStart(HWIRGGRP) \
+
+#define PINT_MakePin(PinID, HWPin, Mode, Glitch, SendEvent) \
+ if( Glitch != 0) \
+ {\
+ gpio_enable_pin_glitch_filter(HWPin);\
+ }\
+ gpio_enable_pin_interrupt( HWPin, Mode ); \
+
+#define PINT_MakeIRQHandlerEnd(HWIRGGRP) \
+
+void PINT_vInit( void )
+{
+ PINT_MakeConfig
+}
+#undef PINT_MakeIRQHandlerStart
+#undef PINT_MakePin
+#undef PINT_MakeIRQHandlerEnd
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.h
new file mode 100644
index 0000000..30be496
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1c1.h
@@ -0,0 +1,15 @@
+#ifndef PINT_C1_H
+#define PINT_C1_H
+
+#include "PINT1ce.h"
+
+typedef enum {
+ PINT_nenPinChange = 0,
+ PINT_nenRisingEdge = 1,
+ PINT_nenFallingEdge = 2
+} PINT_tenPinMode;
+
+/* interface prototypes */
+void PINT_vInit( void );
+
+#endif /*PINT_C1_H*/ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1ce.h
new file mode 100644
index 0000000..9a1aff1
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/PINT1ce.h
@@ -0,0 +1,36 @@
+#ifndef PINT_CE_H
+#define PINT_CE_H
+
+#include "cdef.h"
+
+#define PINT_MakeConfig \
+ PINT_MakeIRQHandlerStart(AVR32_GPIO_IRQ_1) \
+ /* PinID, HW-Pin, Mode, Glitch, SendEvent */\
+ PINT_MakePin( PINT_nenBtn0, GPIO_PUSH_BUTTON_0, PINT_nenFallingEdge, 0x1, EVHD_nenBtn0 ) \
+ PINT_MakeIRQHandlerEnd(AVR32_GPIO_IRQ_1) \
+ PINT_MakeIRQHandlerStart(AVR32_GPIO_IRQ_3) \
+ /* PinID, HW-Pin, Mode, Glitch, SendEvent */\
+ PINT_MakePin( PINT_nenBtn1, GPIO_PUSH_BUTTON_1, PINT_nenFallingEdge, 0x1, EVHD_nenBtn1 ) \
+ PINT_MakeIRQHandlerEnd(AVR32_GPIO_IRQ_3) \
+
+
+#define PINT_MakeIRQHandlerStart(HWIRQGRP) \
+
+#define PINT_MakePin(PinID, HWPin, Mode, Glitch, SendEvent) \
+
+#define PINT_MakeIRQHandlerEnd(HWIRQGRP) \
+
+#undef PINT_MakeIRQHandlerStart
+#undef PINT_MakePin
+#undef PINT_MakeIRQHandlerEnd
+
+#if 0 /* example */
+#define PINT_MakeConfig \
+ PINT_MakeIRQHandlerStart(AVR32_GPIO_IRQ_4) \
+ /* PinID, HW-Pin, Mode, Glitch, SendEvent */\
+ PINT_MakePin( PINT_nenAD7607_Busy, AVR32_PIN_PB06, PINT_nenFallingEdge, 0x0, EVHD_nenAD7607_ConversionReady ) \
+ PINT_MakeIRQHandlerEnd(AVR32_GPIO_IRQ_4) \
+
+#endif /* example */
+
+#endif /*PINT_CE_H*/ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.c
new file mode 100644
index 0000000..e1fba85
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.c
@@ -0,0 +1,148 @@
+#include "START1c1.h"
+#include <asf.h>
+
+#include "OS1c1.h"
+#include "IVECT1c1.h"
+#include "PINT1c1.h"
+
+/*CAN Subsystem*/
+#include "CAN1c1.h"
+#include "IL1c1.h"
+#include "CANIF1c1.h"
+#include "CAND1c1.h"
+
+#define START_nTX_LOOPS (100)
+
+typedef enum
+{
+ START__nenOperationCyclic,
+ START__nenOperationBurst,
+ START__nenOperationNone
+} START__tenOperationMode;
+
+volatile uint8_t START__u8MsgCount = 0;
+volatile bool START__boSend100msMsg = false;
+volatile START__tenOperationMode START__enOperationMode = START__nenOperationNone;
+
+extern bool CANIF__aboSendingActive[CAN__nenCh_NoOfChannels];
+
+/*Clock initialisieren*/
+void START__vInitClock( void )
+{
+ sysclk_init();
+ wdt_disable();
+}
+
+
+
+/*Start von Allem*/
+void START_vMain( void )
+{
+ gpio_enable_gpio_pin(LED0_GPIO);
+ gpio_configure_pin(LED0_GPIO, GPIO_DIR_OUTPUT | GPIO_INIT_LOW);
+ gpio_enable_gpio_pin(LED1_GPIO);
+ gpio_configure_pin(LED1_GPIO,GPIO_DIR_OUTPUT|GPIO_INIT_HIGH);
+ gpio_enable_gpio_pin(LED3_GPIO);
+ gpio_configure_pin(LED3_GPIO, GPIO_DIR_OUTPUT | GPIO_INIT_LOW);
+ START__vInitClock();
+ TIMER_vInit();
+ IVECT_vInit();
+ PINT_vInit();
+ OS_vInit();
+ OS_vRun();
+}
+
+
+/*Tasks*/
+OS_TASK( START_vIdle )
+{
+ static uint8_t u8InitState = 0;
+
+ if( u8InitState == 0)
+ {
+ /*Initialisierung der Module*/
+ /*--------------------------*/
+
+ CAN_vInit();
+ IL_vSetMessageSendCyclic(CAN_nenMsg_Dummy001,false);
+ CAND_vStart(CAN_nenCh0);
+ CAND_vEnableInterrupt(CAN_nenCh0);
+
+ u8InitState = 1;
+ }
+
+ /*Endlosschleife*/
+ /*--------------*/
+ while( 1 )
+ {
+ OS_vSchedule();
+ }
+}
+
+void START_vSend100msMsg()
+{
+ static CAN_tstMessage stMsg = { { 0,0,0,0,0,0,0,0 },8,0x103 };
+ if( START__boSend100msMsg && ( START__u8MsgCount <= START_nTX_LOOPS ) )
+ {
+ stMsg.au8Data[0] = START__u8MsgCount;
+ CAND_boSend(CAN_nenCh0,&stMsg);
+ START__u8MsgCount++;
+ }
+ else
+ {
+ START__u8MsgCount = 0;
+ START__boSend100msMsg = false;
+ gpio_clr_gpio_pin(LED0_GPIO);
+ START__enOperationMode = START__nenOperationNone;
+ }
+}
+
+void START_vBtn0Callback( EVHD_tenReceiveEvent enRxEvent )
+{
+ if( START__enOperationMode != START__nenOperationNone )
+ {
+ return;
+ }
+ START__enOperationMode = START__nenOperationCyclic;
+ gpio_set_gpio_pin(LED0_GPIO);
+ START__boSend100msMsg = true;
+}
+
+void START__vCanBurst( void );
+
+void START_vBtn1Callback( EVHD_tenReceiveEvent enRxEvent )
+{
+ if( START__enOperationMode != START__nenOperationNone )
+ {
+ return;
+ }
+ START__enOperationMode = START__nenOperationBurst;
+ gpio_set_gpio_pin(LED3_GPIO);
+ START__vCanBurst();
+ gpio_clr_gpio_pin(LED3_GPIO);
+ START__enOperationMode = START__nenOperationNone;
+}
+void START__vCanBurst( void )
+{
+ #define START__nNOOFBURSTMESSAGES (0xFFFF)
+
+ uint16_t u16Cnt = 0;
+ CAN_tstMessage stMsg;
+ stMsg.u8Dlc = 2;
+ stMsg.CanId = 0x001;
+
+ for( ; u16Cnt < START__nNOOFBURSTMESSAGES; u16Cnt++ )
+ {
+ stMsg.au8Data[0] = (uint8_t) (0xFF & u16Cnt);
+ stMsg.au8Data[1] = (uint8_t) (0xFF & (u16Cnt>>8));
+ CANIF__aboSendingActive[CAN_nenCh0] = true;
+ while( !CAND_boSend( CAN_nenCh0, &stMsg) )
+ {
+ asm volatile ("nop");
+ }
+ while( CANIF__aboSendingActive[CAN_nenCh0] )
+ {
+ asm volatile ("nop");
+ }
+ }
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.h
new file mode 100644
index 0000000..37a9e5b
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/START1C1.h
@@ -0,0 +1,17 @@
+#ifndef START_H
+#define START_H
+
+#include "cdef.h"
+
+#include "EVHD1c1.h"
+
+#define START_n100ms (100)
+
+/* Start des gesamten Systems */
+void START_vMain( void );
+
+void START_vSend100msMsg();
+void START_vBtn0Callback( EVHD_tenReceiveEvent enRxEvent );
+void START_vBtn1Callback( EVHD_tenReceiveEvent enRxEvent );
+
+#endif /*START_H*/ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.c
new file mode 100644
index 0000000..1520935
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.c
@@ -0,0 +1,122 @@
+#include <asf.h>
+#include <avr32/io.h>
+#include "compiler.h"
+#include "board.h"
+#include "tc.h"
+#include "gpio.h"
+
+#include "TIMER1c1.h"
+#include "START1c1.h"
+
+#define TIMER_Make( TimerId, Unit, Callback ) \
+ { Unit, Callback, 0, 0, 0, 0 },
+
+#define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ { Unit, NULL, 0, 0, Cycle, 0 },
+
+#define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ { Unit, NULL, 0, 0, Cycle, 0 },
+
+#define OS_MakeNormalTask( TaskId, pFunc ) /*nix zu tun!*/
+
+#define OS_MakeAutostartTask( TaskId, pFunc ) /*nix zu tun!*/
+
+
+
+TIMER_tstConfig TIMER_astConfig[TIMER_nenNoOfChannels] =
+{
+ OS_MakeConfig
+
+ TIMER_MakeConfig
+};
+
+#undef TIMER_Make
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+#undef OS_MakeNormalTask
+#undef OS_MakeAutostartTask
+
+
+/*Freilaufender Zähler*/
+TIMER_tstCounter TIMER__stCounter = {0,0,0};
+volatile uint32_t TIMER__u32TimerTicks1ms = 0;
+
+#define TC_CHANNEL 0
+#define FALSE 0
+
+
+void TIMER__vReadCurrentCounter( void )
+{
+ static uint32_t u32LastHwTimer=0;
+ uint32_t u32Dif;
+
+ u32Dif = (TIMER__u32TimerTicks1ms - u32LastHwTimer);
+ u32LastHwTimer = TIMER__u32TimerTicks1ms;
+ TIMER__stCounter.u32mSek += u32Dif;
+
+ TIMER__stCounter.u32uSek = TIMER__stCounter.u32mSek * 1000;
+ TIMER__stCounter.u32Sek = TIMER__stCounter.u32mSek / 1000;
+
+}
+
+
+void TIMER_vInit ( void )
+{
+ volatile avr32_tc_t *tc = &AVR32_TC0;
+ // Options for waveform generation.
+ static const tc_waveform_opt_t WAVEFORM_OPT =
+ {
+ .channel = TC_CHANNEL, // Channel selection.
+
+ .bswtrg = TC_EVT_EFFECT_NOOP, // Software trigger effect on TIOB.
+ .beevt = TC_EVT_EFFECT_NOOP, // External event effect on TIOB.
+ .bcpc = TC_EVT_EFFECT_NOOP, // RC compare effect on TIOB.
+ .bcpb = TC_EVT_EFFECT_NOOP, // RB compare effect on TIOB.
+
+ .aswtrg = TC_EVT_EFFECT_NOOP, // Software trigger effect on TIOA.
+ .aeevt = TC_EVT_EFFECT_NOOP, // External event effect on TIOA.
+ .acpc = TC_EVT_EFFECT_NOOP, // RC compare effect on TIOA: toggle.
+ .acpa = TC_EVT_EFFECT_NOOP, // RA compare effect on TIOA: toggle (other possibilities are none, set and clear).
+
+ .wavsel = TC_WAVEFORM_SEL_UP_MODE_RC_TRIGGER,// Waveform selection: Up mode with automatic trigger(reset) on RC compare.
+ .enetrg = FALSE, // External event trigger enable.
+ .eevt = 0, // External event selection.
+ .eevtedg = TC_SEL_NO_EDGE, // External event edge selection.
+ .cpcdis = FALSE, // Counter disable when RC compare.
+ .cpcstop = FALSE, // Counter clock stopped with RC compare.
+
+ .burst = FALSE, // Burst signal selection.
+ .clki = FALSE, // Clock inversion.
+ //.tcclks = TC_CLOCK_SOURCE_TC3 // Internal source clock 3, connected to fPBA / 8.
+ .tcclks = TC_CLOCK_SOURCE_TC2 // Internal source clock 3, connected to fPBC / 8.
+ };
+
+ static const tc_interrupt_t TC_INTERRUPT =
+ {
+ .etrgs = 0,
+ .ldrbs = 0,
+ .ldras = 0,
+ .cpcs = 1,
+ .cpbs = 0,
+ .cpas = 0,
+ .lovrs = 0,
+ .covfs = 0
+ };
+
+
+ tc_init_waveform(tc, &WAVEFORM_OPT); // Initialize the timer/counter waveform.
+ tc_write_rc(tc,TC_CHANNEL, 32000);
+ tc_configure_interrupts(tc,TC_CHANNEL,&TC_INTERRUPT);
+ tc_start(tc, TC_CHANNEL);
+}
+
+void TIMER_v1msCallback( EVHD_tenReceiveEvent enRxEvent )
+{
+ TIMER__u32TimerTicks1ms++;
+ tc_read_sr(&AVR32_TC0, TC_CHANNEL);
+ if( (TIMER__u32TimerTicks1ms % START_n100ms) == 0)
+ {
+ START_vSend100msMsg();
+ }
+}
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.h
new file mode 100644
index 0000000..0458ff8
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1c1.h
@@ -0,0 +1,143 @@
+#ifndef TIMER_C1_H
+#define TIMER_C1_H
+
+#include "cdef.h"
+
+#include "OS1ce.h"
+#include "TIMER1ce.h"
+#include "EVHD1c1.h"
+
+#define TCD0 AVR32_TC0
+
+#define TIMER_Make( TimerId, Unit, Callback ) \
+ TimerId,
+
+#define OS_MakeCyclicTask( TaskId, pFunc, Cycle, Unit ) \
+ TIMER_nenCyclic##TaskId,
+
+#define OS_MakeAlarmTask( TaskId, pFunc, Cycle, Unit ) \
+ TIMER_nenAlarm##TaskId,
+
+#define OS_MakeNormalTask( TaskId, pFunc ) \
+
+#define OS_MakeAutostartTask( TaskId, pFunc ) \
+
+typedef enum
+{
+ OS_MakeConfig
+
+ TIMER_MakeConfig
+
+ /*Muss der letzte Eintrag sein!*/
+ TIMER_nenNoOfChannels
+}TIMER_tenChannel;
+
+#undef TIMER_Make
+#undef OS_MakeCyclicTask
+#undef OS_MakeAlarmTask
+#undef OS_MakeNormalTask
+#undef OS_MakeAutostartTask
+
+
+typedef enum
+{
+ TIMER_nenUnit1us,
+ TIMER_nenUnit1ms,
+ TIMER_nenUnit1s,
+}TIMER_tenUnit;
+
+typedef struct
+{
+ uint32_t u32uSek;
+ uint32_t u32mSek;
+ uint32_t u32Sek;
+}TIMER_tstCounter;
+
+typedef struct
+{
+ const TIMER_tenUnit enUnit;
+ void (* const pfctCbExpired)( void ); //Callback, die aufgrufen wird, wenn ein Timer abgelaufen ist
+ uint32_t u32StartValue;
+ uint32_t u32StopValue;
+ uint32_t u32SetValue;
+ uint8_t biRunning : 1;
+}TIMER_tstConfig;
+
+/*Konfiguration des TIMER-Moduls*/
+extern TIMER_tstConfig TIMER_astConfig[TIMER_nenNoOfChannels];
+
+/*Freilaufender Zähler*/
+extern TIMER_tstCounter TIMER__stCounter;
+
+extern volatile uint32_t TIMER__u32TimerTicks1ms;
+
+void TIMER_vInit ( void );
+
+void TIMER_v1msCallback( EVHD_tenReceiveEvent enRxEvent );
+
+#define TIMER_u32GetSystemTime( /*TIMER_tenUnit*/ enUnit ) \
+( TIMER__vReadCurrentCounter(), \
+ enUnit == TIMER_nenUnit1us ? TIMER__stCounter.u32uSek \
+ : enUnit == TIMER_nenUnit1ms ? TIMER__stCounter.u32mSek \
+ : /*TIMER_nenUnit1s*/ TIMER__stCounter.u32Sek \
+) \
+
+#define TIMER_vStart( /*TIMER_tenChannel*/ enChannel ) \
+( TIMER__vReadCurrentCounter(), \
+ TIMER_astConfig[enChannel].biRunning = 1, \
+ TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1us ? (TIMER_astConfig[enChannel].u32StartValue = TIMER__stCounter.u32uSek) \
+ : TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1ms ? (TIMER_astConfig[enChannel].u32StartValue = TIMER__stCounter.u32mSek) \
+ : /*TIMER_nenUnit1s*/ (TIMER_astConfig[enChannel].u32StartValue = TIMER__stCounter.u32Sek ) \
+) \
+
+#define TIMER_vStop( /*TIMER_tenChannel*/ enChannel ) \
+( TIMER__vReadCurrentCounter(), \
+ TIMER_astConfig[enChannel].biRunning = 0, \
+ TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1us ? (TIMER_astConfig[enChannel].u32StopValue = TIMER__stCounter.u32uSek) \
+ : TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1ms ? (TIMER_astConfig[enChannel].u32StopValue = TIMER__stCounter.u32mSek) \
+ : /*TIMER_nenUnit1s*/ (TIMER_astConfig[enChannel].u32StopValue = TIMER__stCounter.u32Sek ) \
+) \
+
+#define TIMER_vRestart( /*TIMER_tenChannel*/ enChannel ) \
+( TIMER__vReadCurrentCounter(), \
+ TIMER_astConfig[enChannel].biRunning = 1, \
+ TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1us ? (TIMER_astConfig[enChannel].u32StartValue = TIMER__stCounter.u32uSek - TIMER_u32GetValue( enChannel ) )\
+ : TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1ms ? (TIMER_astConfig[enChannel].u32StartValue = TIMER__stCounter.u32mSek - TIMER_u32GetValue( enChannel ) )\
+ : /*TIMER_nenUnit1s*/ (TIMER_astConfig[enChannel].u32StartValue = TIMER__stCounter.u32Sek - TIMER_u32GetValue( enChannel ) )\
+)
+
+#define TIMER_u32GetValue( enChannel ) \
+( TIMER_astConfig[enChannel].u32StopValue - TIMER_astConfig[enChannel].u32StartValue) \
+
+#define TIMER_vSet( /*TIMER_tenChannel*/ enChannel, /*uint32_t*/ u32Value ) \
+( TIMER_astConfig[enChannel].u32SetValue = u32Value ) \
+
+#define TIMER_vReset TIMER_vStart
+
+#define TIMER_boIsTimeRunning( /*TIMER_tenChannel*/ enChannel ) \
+( TIMER_astConfig[enChannel].biRunning == 1 ) \
+
+
+#define TIMER__boIsTimeExpired( /*TIMER_tenChannel*/ enChannel ) \
+( TIMER__vReadCurrentCounter(), \
+ TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1us ? ((TIMER__stCounter.u32uSek - TIMER_astConfig[enChannel].u32StartValue) >= TIMER_astConfig[enChannel].u32SetValue) \
+ : TIMER_astConfig[enChannel].enUnit == TIMER_nenUnit1ms ? ((TIMER__stCounter.u32mSek - TIMER_astConfig[enChannel].u32StartValue) >= TIMER_astConfig[enChannel].u32SetValue) \
+ : /*TIMER_nenUnit1s*/ ((TIMER__stCounter.u32Sek - TIMER_astConfig[enChannel].u32StartValue) >= TIMER_astConfig[enChannel].u32SetValue) \
+)
+
+#define TIMER_boIsTimeExpired( /*TIMER_tenChannel*/ enChannel ) \
+( TIMER_astConfig[enChannel].biRunning ? TIMER__boIsTimeExpired(enChannel) ? TIMER_astConfig[enChannel].biRunning = 0, true \
+ : false /*Timer noch nicht abgelaufen*/ \
+ : false /*Timer wurde nicht gestartet*/ \
+)
+
+
+
+#define TIMER_vSubValue( /*TIMER_tenChannel*/ enChannel, /*uint32_t*/ u32Vaule ) \
+( TIMER_astConfig[enChannel].u32StartValue += u32Vaule, \
+ TIMER_astConfig[enChannel].biRunning = 1 \
+) \
+
+void TIMER__vReadCurrentCounter( void );
+
+#endif /*TIMER_C1_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1ce.h
new file mode 100644
index 0000000..6e19c8b
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/TIMER1ce.h
@@ -0,0 +1,31 @@
+#ifndef TIMER_CE_H
+#define TIMER_CE_H
+
+#include "cdef.h"
+
+/******************************************************************
+ * *
+ * Timer C0 - PWM Display siehe PWM1Ce.h *
+ * Timer C1 - Multiplex-(ISR) PWM1Ce.h *
+ * Timer D0 - Mastertimer siehe TIMER1c1.c *
+ * Timer D1 - Extension Timer D0 " *
+ * *
+ ******************************************************************/
+
+
+
+#define TIMER_MakeConfig \
+/* TimerID, Unint, pCallback */ \
+TIMER_Make( TIMER_nenIdleTime, TIMER_nenUnit1us, NULL ) \
+TIMER_Make( TIMER_nenIdle1s, TIMER_nenUnit1ms, NULL ) \
+TIMER_Make( TIMER_nenExea_Blitz, TIMER_nenUnit1ms, NULL ) \
+
+
+
+#define TIMER_Make( TimerId, Unit, Callback ) \
+
+#undef TIMER_Make
+
+
+
+#endif /*TIMER_CE_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf.h
new file mode 100644
index 0000000..0c9292d
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf.h
@@ -0,0 +1,64 @@
+/**
+ * \file
+ *
+ * \brief Autogenerated API include file for the AVR Software Framework (ASF)
+ *
+ * Copyright (C) 2011 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+#ifndef ASF_H
+#define ASF_H
+
+/*
+ * This file includes all API header files for the selected drivers from ASF.
+ *
+ * The file is automatically generated and will be re-written when
+ * running the ASF driver selector tool. Any changes will be discarded.
+ */
+
+#include <board.h>
+
+#include <canif.h>
+#include <intc.h>
+#include <interrupt.h>
+#include <power_clocks_lib.h>
+#include <sleep.h>
+#include <scif_uc3c.h>
+#include <gpio.h>
+#include <tc.h>
+#include <compiler.h>
+#include <status_codes.h>
+#include <can.h>
+#include <sysclk.h>
+#include <wdt.h>
+#endif // ASF_H
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/led.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/led.h
new file mode 100644
index 0000000..0b9713f
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/led.h
@@ -0,0 +1,185 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief AT32UC3C UC3C_EK board LEDs support package.
+ *
+ * This file contains definitions and services related to the LED features of
+ * the UC3C-EK board.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 AT32UC3A devices can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _LED_H_
+#define _LED_H_
+
+#include "compiler.h"
+
+
+/*! \name Identifiers of LEDs to Use with LED Functions
+ */
+//! @{
+#define LED0 0x01
+#define LED1 0x02
+#define LED2 0x04
+#define LED3 0x08
+//! @}
+
+
+/*! \brief Gets the last state of all LEDs set through the LED API.
+ *
+ * \return State of all LEDs (1 bit per LED).
+ *
+ * \note The GPIO pin configuration of all LEDs is left unchanged.
+ */
+extern U32 LED_Read_Display(void);
+
+/*! \brief Sets the state of all LEDs.
+ *
+ * \param leds New state of all LEDs (1 bit per LED).
+ *
+ * \note The pins of all LEDs are set to GPIO output mode.
+ */
+extern void LED_Display(U32 leds);
+
+/*! \brief Gets the last state of the specified LEDs set through the LED API.
+ *
+ * \param mask LEDs of which to get the state (1 bit per LED).
+ *
+ * \return State of the specified LEDs (1 bit per LED).
+ *
+ * \note The GPIO pin configuration of all LEDs is left unchanged.
+ */
+extern U32 LED_Read_Display_Mask(U32 mask);
+
+/*! \brief Sets the state of the specified LEDs.
+ *
+ * \param mask LEDs of which to set the state (1 bit per LED).
+ *
+ * \param leds New state of the specified LEDs (1 bit per LED).
+ *
+ * \note The pins of the specified LEDs are set to GPIO output mode.
+ */
+extern void LED_Display_Mask(U32 mask, U32 leds);
+
+/*! \brief Tests the last state of the specified LEDs set through the LED API.
+ *
+ * \param leds LEDs of which to test the state (1 bit per LED).
+ *
+ * \return \c true if at least one of the specified LEDs has a state on, else
+ * \c false.
+ *
+ * \note The GPIO pin configuration of all LEDs is left unchanged.
+ */
+extern bool LED_Test(U32 leds);
+
+/*! \brief Turns off the specified LEDs.
+ *
+ * \param leds LEDs to turn off (1 bit per LED).
+ *
+ * \note The pins of the specified LEDs are set to GPIO output mode.
+ */
+extern void LED_Off(U32 leds);
+
+/*! \brief Turns on the specified LEDs.
+ *
+ * \param leds LEDs to turn on (1 bit per LED).
+ *
+ * \note The pins of the specified LEDs are set to GPIO output mode.
+ */
+extern void LED_On(U32 leds);
+
+/*! \brief Toggles the specified LEDs.
+ *
+ * \param leds LEDs to toggle (1 bit per LED).
+ *
+ * \note The pins of the specified LEDs are set to GPIO output mode.
+ */
+extern void LED_Toggle(U32 leds);
+
+/*! \brief Gets as a bit-field the last state of the specified LEDs set through
+ * the LED API.
+ *
+ * \param field LEDs of which to get the state (1 bit per LED).
+ *
+ * \return State of the specified LEDs (1 bit per LED, beginning with the first
+ * specified LED).
+ *
+ * \note The GPIO pin configuration of all LEDs is left unchanged.
+ */
+extern U32 LED_Read_Display_Field(U32 field);
+
+/*! \brief Sets as a bit-field the state of the specified LEDs.
+ *
+ * \param field LEDs of which to set the state (1 bit per LED).
+ * \param leds New state of the specified LEDs (1 bit per LED, beginning with
+ * the first specified LED).
+ *
+ * \note The pins of the specified LEDs are set to GPIO output mode.
+ */
+extern void LED_Display_Field(U32 field, U32 leds);
+
+/*! \brief Gets the intensity of the specified LED.
+ *
+ * \param led LED of which to get the intensity (1 bit per LED; only the least
+ * significant set bit is used).
+ *
+ * \return Intensity of the specified LED (0x00 to 0xFF).
+ *
+ * \warning The PWM channel of the specified LED is supposed to be used only by
+ * this module.
+ *
+ * \note The GPIO pin configuration of all LEDs is left unchanged.
+ */
+extern U8 LED_Get_Intensity(U32 led);
+
+/*! \brief Sets the intensity of the specified LEDs.
+ *
+ * \param leds LEDs of which to set the intensity (1 bit per LED).
+ * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).
+ *
+ * \warning The PWM channels of the specified LEDs are supposed to be used only
+ * by this module.
+ *
+ * \note The pins of the specified LEDs are set to PWM output mode.
+ */
+extern void LED_Set_Intensity(U32 leds, U8 intensity);
+
+
+#endif // _LED_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/uc3c_ek.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/uc3c_ek.h
new file mode 100644
index 0000000..48c3430
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/boards/uc3c_ek/uc3c_ek.h
@@ -0,0 +1,323 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief AT32UC3C UC3C_EK board header file.
+ *
+ * This file contains definitions and services related to the features of the
+ * UC3C_EK board.
+ *
+ * To use this board, define BOARD=UC3C_EK.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 AT32UC3C devices can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _UC3C_EK_H_
+#define _UC3C_EK_H_
+
+#include "compiler.h"
+
+#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
+# include "led.h"
+#endif // __AVR32_ABI_COMPILER__
+
+
+#ifdef AVR32_SCIF_101_H_INCLUDED
+#define AVR32_SCIF_OSCCTRL0_STARTUP_2048_RCOSC 0x00000003
+#define AVR32_SCIF_OSCCTRL0_STARTUP_16384_RCOSC 0x00000006
+#define AVR32_SCIF_OSCCTRL32_STARTUP_8192_RCOSC 0x00000002
+#endif
+
+
+/*! \name Oscillator Definitions
+ */
+//! @{
+
+#define FOSC32 AVR32_SCIF_OSC32_FREQUENCY //!< Osc32 frequency: Hz.
+#define OSC32_STARTUP AVR32_SCIF_OSCCTRL32_STARTUP_8192_RCOSC //!< Osc32 startup time: RCOsc periods.
+
+// Osc0 crystal is not mounted by default. Set the following definitions to the
+// appropriate values if a custom Osc0 crystal is mounted on your STK600
+#define FOSC0 16000000 //!< Osc0 frequency: Hz.
+#define OSC0_STARTUP AVR32_SCIF_OSCCTRL0_STARTUP_2048_RCOSC //!< Osc0 startup time: RCOsc periods.
+
+// Osc1 crystal is not mounted by default. Set the following definitions to the
+// appropriate values if a custom Osc1 crystal is mounted on your board.
+// #define FOSC1 12000000 //!< Osc1 frequency: Hz.
+// #define OSC1_STARTUP AVR32_SCIF_OSCCTRL1_STARTUP_2048_RCOSC //!< Osc1 startup time: RCOsc periods.
+
+//! @}
+
+#define BOARD_OSC0_HZ 16000000
+#define BOARD_OSC0_STARTUP_US 2000
+#define BOARD_OSC0_IS_XTAL true
+#define BOARD_OSC32_HZ 32768
+#define BOARD_OSC32_STARTUP_US 71000
+#define BOARD_OSC32_IS_XTAL true
+
+/*! \name SDRAM Definitions
+ */
+//! @{
+
+//! Part header file of used SDRAM(s).
+#define SDRAM_PART_HDR "mt48lc16m16a2tg7e/mt48lc16m16a2tg7e.h"
+
+//! Data bus width to use the SDRAM(s) with (16 or 32 bits; always 16 bits on
+//! UC3).
+#define SDRAM_DBW 16
+//! @}
+
+
+/*! \name USB Definitions
+ */
+//! @{
+//! Multiplexed pin used for USB_ID: AVR32_USBB_USB_ID_x_x.
+//! To be selected according to the AVR32_USBB_USB_ID_x_x_PIN and
+//! AVR32_USBB_USB_ID_x_x_FUNCTION definitions from <avr32/uc3cxxxx.h>.
+#if (defined AVR32_USBB)
+# define USB_ID AVR32_USBB_ID_0_0
+#else
+# define USB_ID AVR32_USBC_ID
+#endif
+
+//! Multiplexed pin used for USB_VBOF: AVR32_USBB_USB_VBOF_x_x.
+//! To be selected according to the AVR32_USBB_USB_VBOF_x_x_PIN and
+//! AVR32_USBB_USB_VBOF_x_x_FUNCTION definitions from <avr32/uc3cxxxx.h>.
+#if (defined AVR32_USBB)
+# define USB_VBOF AVR32_USBB_VBOF_0_0
+#else
+# define USB_VBOF AVR32_USBC_VBOF
+#endif
+
+//! Active level of the USB_VBOF output pin.
+# define USB_VBOF_ACTIVE_LEVEL LOW
+
+//! USB overcurrent detection pin.
+# define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PB7
+
+//! @}
+
+
+//! Number of LEDs.
+#define LED_COUNT 4
+
+/*! \name GPIO Connections of LEDs
+ */
+//! @{
+# define LED0_GPIO AVR32_PIN_PA08
+# define LED1_GPIO AVR32_PIN_PD23
+# define LED2_GPIO AVR32_PIN_PC13
+# define LED3_GPIO AVR32_PIN_PD22
+//! @}
+
+/*! \name PWM Channels of LEDs
+ */
+//! @{
+#define LED0_PWM (-1)
+#define LED1_PWM (-1)
+#define LED2_PWM (-1)
+#define LED3_PWM (-1)
+//! @}
+
+/*! \name PWM Functions of LEDs
+ */
+//! @{
+/* TODO: Implement PWM functionality */
+#define LED0_PWM_FUNCTION (-1)//AVR32_PWM_0_FUNCTION
+#define LED1_PWM_FUNCTION (-1)//AVR32_PWM_1_FUNCTION
+#define LED2_PWM_FUNCTION (-1)
+#define LED3_PWM_FUNCTION (-1)
+//! @}
+
+/*! \name Color Identifiers of LEDs to Use with LED Functions
+ */
+//! @{
+#define LED_MONO0_GREEN LED0
+#define LED_MONO1_GREEN LED1
+#define LED_MONO2_GREEN LED2
+#define LED_MONO3_GREEN LED3
+//! @}
+
+/*! \name GPIO Connections of Push Buttons
+ */
+//! @{
+#define GPIO_PUSH_BUTTON_0 AVR32_PIN_PA14
+#define GPIO_PUSH_BUTTON_0_PRESSED 0
+#define GPIO_PUSH_BUTTON_1 AVR32_PIN_PA29
+#define GPIO_PUSH_BUTTON_1_PRESSED 0
+//! @}
+
+/*! \name GPIO Connections of J33
+ */
+//! @{
+# define UH AVR32_PIN_PB08
+# define UL AVR32_PIN_PB09
+# define VH AVR32_PIN_PB10
+# define VL AVR32_PIN_PB11
+# define WH AVR32_PIN_PB12
+# define WL AVR32_PIN_PB13
+# define XH AVR32_PIN_PB14
+# define XL AVR32_PIN_PB15
+# define ShV AVR32_PIN_PA21
+//! @}
+
+/*! \name SPI Connections of the AT45DBX Data Flash Memory
+ */
+//! @{
+#define AT45DBX_SPI (&AVR32_SPI1)
+#define AT45DBX_SPI_NPCS 1
+#define AT45DBX_SPI_SCK_PIN AVR32_SPI1_SCK_0_1_PIN
+#define AT45DBX_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_1_FUNCTION
+#define AT45DBX_SPI_MISO_PIN AVR32_SPI1_MISO_0_1_PIN
+#define AT45DBX_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_1_FUNCTION
+#define AT45DBX_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_1_PIN
+#define AT45DBX_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_1_FUNCTION
+#define AT45DBX_SPI_NPCS0_PIN AVR32_SPI1_NPCS_1_2_PIN
+#define AT45DBX_SPI_NPCS0_FUNCTION AVR32_SPI1_NPCS_1_2_FUNCTION
+//! @}
+
+/*! \name GPIO and SPI Connections of the SD/MMC Connector
+ */
+//! @{
+#define SD_MMC_CARD_DETECT_PIN AVR32_PIN_PA28
+#define SD_MMC_WRITE_PROTECT_PIN AVR32_PIN_PD30
+#define SD_MMC_SPI (&AVR32_SPI1)
+#define SD_MMC_SPI_NPCS 3
+#define SD_MMC_SPI_SCK_PIN AVR32_SPI1_SCK_0_1_PIN
+#define SD_MMC_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_1_FUNCTION
+#define SD_MMC_SPI_MISO_PIN AVR32_SPI1_MISO_0_1_PIN
+#define SD_MMC_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_1_FUNCTION
+#define SD_MMC_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_1_PIN
+#define SD_MMC_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_1_FUNCTION
+#define SD_MMC_SPI_NPCS_PIN AVR32_SPI1_NPCS_3_2_PIN
+#define SD_MMC_SPI_NPCS_FUNCTION AVR32_SPI1_NPCS_3_2_FUNCTION
+//! @}
+
+
+//! @}
+
+/*! \name ET024006DHU TFT display
+ */
+//! @{
+
+#define ET024006DHU_TE_PIN AVR32_PIN_PD19
+#define ET024006DHU_RESET_PIN AVR32_PIN_PD16
+#define ET024006DHU_BL_PIN AVR32_TC0_B0_0_2_PIN
+#define ET024006DHU_BL_FUNCTION AVR32_TC0_B0_0_2_FUNCTION
+#define ET024006DHU_DNC_PIN AVR32_EBI_ADDR_22_PIN
+#define ET024006DHU_DNC_FUNCTION AVR32_EBI_ADDR_22_FUNCTION
+#define ET024006DHU_EBI_NCS_PIN AVR32_EBI_NCS_PIN
+#define ET024006DHU_EBI_NCS_FUNCTION AVR32_EBI_NCS_FUNCTION
+
+//! @}
+/*! \name Optional SPI connection to the TFT
+ */
+//! @{
+
+#define ET024006DHU_SPI (&AVR32_SPI1)
+#define ET024006DHU_SPI_NPCS 1
+#define ET024006DHU_SPI_SCK_PIN AVR32_SPI1_SCK_0_1_PIN
+#define ET024006DHU_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_1_FUNCTION
+#define ET024006DHU_SPI_MISO_PIN AVR32_SPI1_MISO_0_1_PIN
+#define ET024006DHU_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_1_FUNCTION
+#define ET024006DHU_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_1_PIN
+#define ET024006DHU_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_1_FUNCTION
+#define ET024006DHU_SPI_NPCS_PIN AVR32_SPI1_NPCS_2_2_PIN
+#define ET024006DHU_SPI_NPCS_FUNCTION AVR32_SPI1_NPCS_2_2_FUNCTION
+
+//! @}
+
+
+/*! \name Audio amplifier connection to the DAC
+ */
+//! @{
+
+#define TPA6130_TWI (&AVR32_TWIM0_ADDRESS)
+#define TPA6130_TWI_SCL_PIN AVR32_TWIMS0_TWCK_0_1_PIN
+#define TPA6130_TWI_SCL_FUNCTION AVR32_TWIMS0_TWCK_0_1_FUNCTION
+#define TPA6130_TWI_SDA_PIN AVR32_TWIMS0_TWD_0_0_PIN
+#define TPA6130_TWI_SDA_FUNCTION AVR32_TWIMS0_TWD_0_0_FUNCTION
+
+/*! \name USART connection to the UC3B board controller
+ */
+//! @{
+#define USART (&AVR32_USART2)
+#define USART_RXD_PIN AVR32_USART2_RXD_0_1_PIN
+#define USART_RXD_FUNCTION AVR32_USART2_RXD_0_1_FUNCTION
+#define USART_TXD_PIN AVR32_USART2_TXD_0_1_PIN
+#define USART_TXD_FUNCTION AVR32_USART2_TXD_0_1_FUNCTION
+#define USART_IRQ AVR32_USART2_IRQ
+#define USART_IRQ_GROUP AVR32_USART2_IRQ_GROUP
+#define USART_SYSCLK SYSCLK_USART2
+//! @}
+
+#define ADC_VEXT_PIN AVR32_PKGANA_ADCIN5_0_0_PIN
+#define ADC_VEXT_FUNCTION AVR32_PKGANA_ADCIN5_0_0_FUNCTION
+
+/*! \name LCD Connections of the ET024006DHU display
+ */
+//! @{
+#define ET024006DHU_SMC_USE_NCS 0
+#define ET024006DHU_SMC_COMPONENT_CS "smc_et024006dhu.h"
+
+#define ET024006DHU_EBI_DATA_0 AVR32_EBI_DATA_0
+#define ET024006DHU_EBI_DATA_1 AVR32_EBI_DATA_1
+#define ET024006DHU_EBI_DATA_2 AVR32_EBI_DATA_2
+#define ET024006DHU_EBI_DATA_3 AVR32_EBI_DATA_3
+#define ET024006DHU_EBI_DATA_4 AVR32_EBI_DATA_4
+#define ET024006DHU_EBI_DATA_5 AVR32_EBI_DATA_5
+#define ET024006DHU_EBI_DATA_6 AVR32_EBI_DATA_6
+#define ET024006DHU_EBI_DATA_7 AVR32_EBI_DATA_7
+#define ET024006DHU_EBI_DATA_8 AVR32_EBI_DATA_8
+#define ET024006DHU_EBI_DATA_9 AVR32_EBI_DATA_9
+#define ET024006DHU_EBI_DATA_10 AVR32_EBI_DATA_10
+#define ET024006DHU_EBI_DATA_11 AVR32_EBI_DATA_11
+#define ET024006DHU_EBI_DATA_12 AVR32_EBI_DATA_12
+#define ET024006DHU_EBI_DATA_13 AVR32_EBI_DATA_13
+#define ET024006DHU_EBI_DATA_14 AVR32_EBI_DATA_14
+#define ET024006DHU_EBI_DATA_15 AVR32_EBI_DATA_15
+
+#define ET024006DHU_EBI_ADDR_21 AVR32_EBI_ADDR_22
+
+#define ET024006DHU_EBI_NWE AVR32_EBI_NWE0
+#define ET024006DHU_EBI_NRD AVR32_EBI_NRD
+#define ET024006DHU_EBI_NCS AVR32_EBI_NCS_0
+//! @}
+
+#endif // _UC3C_EK_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.c
new file mode 100644
index 0000000..6af0fd8
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.c
@@ -0,0 +1,115 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CANIF driver for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CANIF module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include "compiler.h"
+#include "preprocessor.h"
+#include "canif.h"
+
+void canif_clear_all_mob(uint8_t ch,
+ uint8_t nb_mob)
+{
+ uint8_t mob_number;
+
+ for (mob_number = 0; mob_number < nb_mob; mob_number++) {
+ CANIF_clr_mob(ch,mob_number)
+ }
+}
+
+uint8_t canif_get_mob_free(uint8_t ch)
+{
+ uint8_t mob_number = CANIF_mob_get_mob_free(ch);
+
+ if ((mob_number & 0x20) == 0x20) {
+ return (NO_MOB);
+ }
+
+ return mob_number;
+}
+
+uint8_t canif_get_mob_status(uint8_t ch,
+ uint8_t mob)
+{
+ uint8_t mob_status;
+
+ // Test if MOb ENABLE or DISABLE
+ if (!(CANIF_mob_enable_status(ch, mob))) {
+ return(MOB_DISABLE);
+ }
+
+ mob_status = CANIF_mob_get_status(ch,mob);
+
+ mob_status &= ((1<<AVR32_CANIF_MOBSR_DLCW_OFFSET) |
+ (1<<AVR32_CANIF_MOBSR_TXOK_OFFSET) |
+ (1<<AVR32_CANIF_MOBSR_RXOK_OFFSET));
+
+ if ((mob_status == MOB_RX_COMPLETED) ||
+ (mob_status==MOB_TX_COMPLETED) ||
+ (mob_status==MOB_RX_COMPLETED_DLCW)) {
+ return mob_status;
+ }
+
+ // Test if last mob selected is the mob interested
+ if (CANIF_get_interrupt_lastmob_selected(ch) != mob) {
+ return MOB_NOT_COMPLETED;
+ }
+
+ // If MOb is ENABLE & NOT_COMPLETED, test if CAN is in ERROR
+ mob_status = CANIF_get_interrupt_error_status(ch);
+ if (mob_status != 0) {
+ return mob_status;
+ }
+
+ // If CANSTMOB = 0 then MOB_NOT_COMPLETED
+ return MOB_NOT_COMPLETED;
+}
+
+uint8_t canif_fixed_baudrate(uint8_t ch)
+{
+ CANIF_conf_bt(ch);
+ return 1;
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.h
new file mode 100644
index 0000000..438e62a
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/canif/canif.h
@@ -0,0 +1,331 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CANIF for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CANIF module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _CANIF_H_
+#define _CANIF_H_
+
+//_____ I N C L U D E S ________________________________________________________
+#include "avr32/io.h"
+#include "compiler.h"
+#include "preprocessor.h"
+#include "conf_can.h"
+
+//_____ D E F I N I T I O N S __________________________________________________
+
+// These defines are missing from or wrong in the toolchain header file
+#ifndef AVR32_PM_AWEN_CANIF0WEN_MASK
+// Optionnal #undef AVR32_PM_AWEN_CANIF0WEN_MASK if the define values is wrong.
+#define AVR32_PM_AWEN_CANIF0WEN_MASK 0x02
+#endif
+
+// These defines are missing from or wrong in the toolchain header file
+#ifndef AVR32_PM_AWEN_CANIF1WEN_MASK
+// Optionnal #undef AVR32_PM_AWEN_CANIF1WEN_MASK if the define values is wrong.
+#define AVR32_PM_AWEN_CANIF1WEN_MASK 0x04
+#endif
+
+typedef struct
+{
+ union{
+ struct{
+ U32 id : 32;
+ U32 id_mask : 32;
+ };
+ struct{
+ U32 : 1;
+ U32 rtr_bit : 1;
+ U32 ide_bit : 1;
+ U32 id_bit : 29;
+ U32 : 1;
+ U32 rtr_mask_bit : 1;
+ U32 ide_mask_bit : 1;
+ U32 id_mask_bit : 29;
+ };
+ };
+ Union64 data;
+} can_msg_t;
+
+
+#if (CAN_AUTOBAUD == true)
+#error 'Autobaud feature not supported'
+#else
+#define CANIF_bit_timing(ch) (canif_fixed_baudrate(ch))
+#endif
+
+
+#define BRP_MIN 1 //! Prescaler of FOSC (TQ generation)
+#define BRP_MAX 64
+#define NTQ_MIN 8 //! Number of TQ in one CAN bit
+#define NTQ_MAX 25
+#define PRS_MIN 1 //! Propagation segment
+#define PRS_MAX 8
+#define PHS1_MIN 2 //! Phase segment 1
+#define PHS1_MAX 8
+#define PHS2_MIN 2 //! Phase segment 2
+#define PHS2_MAX 8
+#define SJW_MIN 1 //! Synchro jump width
+#define SJW_MAX 4
+
+#define STATUS_CLEARED 0x00
+#define MOB_NOT_COMPLETED 0x00 //! MOB Status
+#define MOB_TX_COMPLETED (AVR32_CANIF_MOBSR_TXOK_MASK)
+#define MOB_RX_COMPLETED (AVR32_CANIF_MOBSR_RXOK_MASK)
+#define MOB_RX_COMPLETED_DLCW ((AVR32_CANIF_MOBSR_RXOK_MASK)|(AVR32_CANIF_MOBSR_DLCW_MASK))
+#define MOB_ACK_ERROR (AVR32_CANIF_AERR_MASK)
+#define MOB_FORM_ERROR (AVR32_CANIF_FERR_MASK)
+#define MOB_CRC_ERROR (AVR32_CANIF_CERR_MASK)
+#define MOB_STUFF_ERROR (AVR32_CANIF_SERR_MASK)
+#define MOB_BIT_ERROR (AVR32_CANIF_BERR_MASK)
+#define MOB_NOT_REACHED ((AVR32_CANIF_AERR_MASK)| \
+ (AVR32_CANIF_FERR_MASK)| \
+ (AVR32_CANIF_CERR_MASK)| \
+ (AVR32_CANIF_SERR_MASK)| \
+ (AVR32_CANIF_BERR_MASK))
+#define MOB_DISABLE 0xFF
+#define NO_MOB 0xff
+#define DATA 0
+#define REMOTE 1
+#define STD 0
+#define EXTD 1
+#define RTR_BIT 30
+#define IDE_BIT 29
+
+
+//_____ M A C R O S ____________________________________________________________
+
+
+
+//! CANRAMB Register Access
+#define CANIF_get_ram_add(ch) ( AVR32_CANIF.channel[ch].canramb )
+#define CANIF_set_ram_add(ch,add) { AVR32_CANIF.channel[ch].canramb = add; }
+
+//! CANCTRL Register Access
+#define CANIF_set_reset(ch) { AVR32_CANIF.channel[ch].canctrl = (1<<AVR32_CANIF_CANCTRL_INIT_OFFSET); }
+#define CANIF_clr_reset(ch) { AVR32_CANIF.channel[ch].canctrl = (0<<AVR32_CANIF_CANCTRL_INIT_OFFSET); }
+#define CANIF_enable(ch) { AVR32_CANIF.channel[ch].canctrl |= (1<<AVR32_CANIF_CANCTRL_CEN_OFFSET); }
+#define CANIF_disable(ch) { AVR32_CANIF.channel[ch].canctrl &= ~(1<<AVR32_CANIF_CANCTRL_CEN_OFFSET); }
+#define CANIF_full_abort(ch) { CANIF_disable(ch) }
+#define CANIF_send_overload(ch) { AVR32_CANIF.channel[ch].canctrl |= (1<<AVR32_CANIF_CANCTRL_OVRQ_OFFSET); }
+#define CANIF_enable_wakeup(ch) { AVR32_CANIF.channel[ch].canctrl |= (1<<AVR32_CANIF_CANCTRL_WKEN_OFFSET); }
+#define CANIF_disable_wakeup(ch) { AVR32_CANIF.channel[ch].canctrl &= ~(1<<AVR32_CANIF_CANCTRL_WKEN_OFFSET); }
+
+//! CANIFSR Register Access
+#define CANIF_channel_enable_status(ch) ( (AVR32_CANIF.channel[ch].cansr&AVR32_CANIF_CANSR_CES_MASK) >> AVR32_CANIF_CANSR_CES_OFFSET )
+#define CANIF_channel_overload_status(ch) ( (AVR32_CANIF.channel[ch].cansr&AVR32_CANIF_CANSR_OVS_MASK) >> AVR32_CANIF_CANSR_OVS_OFFSET )
+#define CANIF_channel_receive_status(ch) ( (AVR32_CANIF.channel[ch].cansr&AVR32_CANIF_CANSR_RS_MASK) >> AVR32_CANIF_CANSR_RS_OFFSET )
+#define CANIF_channel_transmit_status(ch) ( (AVR32_CANIF.channel[ch].cansr&AVR32_CANIF_CANSR_TS_MASK) >> AVR32_CANIF_CANSR_TS_OFFSET )
+
+//! CANIFCFG Register Access
+#define CANIF_CHANNEL_MODE_NORMAL 0
+#define CANIF_CHANNEL_MODE_LISTENING 1
+#define CANIF_CHANNEL_MODE_LOOPBACK 2
+#define CANIF_get_channel_mode(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_CMODE_MASK)>> AVR32_CANIF_CANCFG_CMODE_OFFSET) )
+#define CANIF_set_channel_mode(ch,mode) { AVR32_CANIF.channel[ch].cancfg &= ~(AVR32_CANIF_CANCFG_CMODE_MASK); \
+ AVR32_CANIF.channel[ch].cancfg |= (mode<<AVR32_CANIF_CANCFG_CMODE_OFFSET); }
+#define CANIF_get_overrun_mode(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_OVRM_MASK)>> AVR32_CANIF_CANCFG_OVRM_OFFSET) )
+#define CANIF_set_overrun_mode(ch) { AVR32_CANIF.channel[ch].cancfg |= (1<<AVR32_CANIF_CANCFG_OVRM_OFFSET); }
+#define CANIF_clr_overrun_mode(ch) { AVR32_CANIF.channel[ch].cancfg &= ~(1<<AVR32_CANIF_CANCFG_OVRM_OFFSET); }
+#define CANIF_get_phs1(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_PHS1_MASK)>> AVR32_CANIF_CANCFG_PHS1_OFFSET) )
+#define CANIF_set_phs1(ch,phs1) { AVR32_CANIF.channel[ch].cancfg &= ~(AVR32_CANIF_CANCFG_PHS1_MASK); \
+ AVR32_CANIF.channel[ch].cancfg |= (phs1<<AVR32_CANIF_CANCFG_PHS1_OFFSET); }
+#define CANIF_get_phs2(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_PHS2_MASK)>> AVR32_CANIF_CANCFG_PHS2_OFFSET) )
+#define CANIF_set_phs2(ch,phs2) { AVR32_CANIF.channel[ch].cancfg &= ~(AVR32_CANIF_CANCFG_PHS2_MASK); \
+ AVR32_CANIF.channel[ch].cancfg |= (phs2<<AVR32_CANIF_CANCFG_PHS2_OFFSET); }
+#define CANIF_get_pres(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_PRES_MASK)>> AVR32_CANIF_CANCFG_PRES_OFFSET) )
+#define CANIF_set_pres(ch,pres) { AVR32_CANIF.channel[ch].cancfg &= ~(AVR32_CANIF_CANCFG_PRES_MASK); \
+ AVR32_CANIF.channel[ch].cancfg |= (pres<<AVR32_CANIF_CANCFG_PRES_OFFSET); }
+#define CANIF_get_prs(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_PRS_MASK)>> AVR32_CANIF_CANCFG_PRS_OFFSET) )
+#define CANIF_set_prs(ch,prs) { AVR32_CANIF.channel[ch].cancfg &= ~(AVR32_CANIF_CANCFG_PRS_MASK); \
+ AVR32_CANIF.channel[ch].cancfg |= (prs<<AVR32_CANIF_CANCFG_PRS_OFFSET); }
+#define CANIF_get_sjw(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_SJW_MASK)>> AVR32_CANIF_CANCFG_SJW_OFFSET) )
+#define CANIF_set_sjw(ch,sjw) { AVR32_CANIF.channel[ch].cancfg &= ~(AVR32_CANIF_CANCFG_SJW_MASK); \
+ AVR32_CANIF.channel[ch].cancfg |= (sjw<<AVR32_CANIF_CANCFG_SJW_OFFSET); }
+#define CANIF_get_sm(ch) ( ((AVR32_CANIF.channel[ch].cancfg & AVR32_CANIF_CANCFG_SM_MASK)>> AVR32_CANIF_CANCFG_SM_OFFSET) )
+#define CANIF_set_sm(ch,sm) { AVR32_CANIF.channel[ch].cancfg |= (sm<<AVR32_CANIF_CANCFG_SM_OFFSET); }
+#define CANIF_conf_bt(ch) { CANIF_set_sjw(ch,BAUDRATE##_SJW); \
+ CANIF_set_prs(ch,BAUDRATE##_PRS); \
+ CANIF_set_pres(ch,BAUDRATE##_PRES); \
+ CANIF_set_phs2(ch,BAUDRATE##_PHS2); \
+ CANIF_set_phs1(ch,BAUDRATE##_PHS1); }
+
+//! CANIFFC Register Access
+#define CANIF_get_error_mode(ch) { ((AVR32_CANIF.channel[ch].canfc & AVR32_CANIF_CANFC_EMODE_MASK)>> AVR32_CANIF_CANFC_EMODE_OFFSET) }
+#define CANIF_get_tec(ch) { ((AVR32_CANIF.channel[ch].canfc & AVR32_CANIF_CANFC_TEC_MASK)>> AVR32_CANIF_CANFC_TEC_OFFSET) }
+#define CANIF_get_rec(ch) { ((AVR32_CANIF.channel[ch].canfc & AVR32_CANIF_CANFC_REC_MASK)>> AVR32_CANIF_CANFC_REC_OFFSET) }
+
+//! CANIFIER Register Access
+#define CANIF_enable_wakeup_interrupt(ch) { AVR32_CANIF.channel[ch].canier = AVR32_CANIF_CANIER_WKUPIM_MASK; }
+#define CANIF_enable_interrupt(ch) { AVR32_CANIF.channel[ch].canier = AVR32_CANIF_CANIER_TXOKIM_MASK | \
+ AVR32_CANIF_CANIER_RXOKIM_MASK | \
+ AVR32_CANIF_CANIER_CERRIM_MASK | \
+ AVR32_CANIF_CANIER_BOFFIM_MASK | \
+ AVR32_CANIF_CANIER_WKUPIM_MASK; }
+
+//! CANIFIDR Register Access
+#define CANIF_disable_wakeup_interrupt(ch) { AVR32_CANIF.channel[ch].canidr = AVR32_CANIF_CANIDR_WKUPIM_MASK; }
+#define CANIF_disable_interrupt(ch) { AVR32_CANIF.channel[ch].canidr = AVR32_CANIF_CANIDR_TXOKIM_MASK | \
+ AVR32_CANIF_CANIDR_RXOKIM_MASK | \
+ AVR32_CANIF_CANIDR_CERRIM_MASK | \
+ AVR32_CANIF_CANIDR_BOFFIM_MASK; }
+
+//! CANIFISCR Register Access
+#define CANIF_get_interrupt_status(ch) ( AVR32_CANIF.channel[ch].canisr)
+#define CANIF_get_interrupt_error_status(ch) ( AVR32_CANIF.channel[ch].canisr & 0x3F)
+#define CANIF_get_interrupt_lastmob_selected(ch)( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_LSMOB_MASK)>> AVR32_CANIF_CANISR_LSMOB_OFFSET ))
+#define CANIF_get_interrupt_wakeup_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_WKUP_MASK)>> AVR32_CANIF_CANISR_WKUP_OFFSET ))
+#define CANIF_get_interrupt_berr_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_BERR_MASK)>> AVR32_CANIF_CANISR_BERR_OFFSET ))
+#define CANIF_get_interrupt_serr_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_SERR_MASK)>> AVR32_CANIF_CANISR_SERR_OFFSET ))
+#define CANIF_get_interrupt_cerr_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_cERR_MASK)>> AVR32_CANIF_CANISR_CERR_OFFSET ))
+#define CANIF_get_interrupt_ferr_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_FERR_MASK)>> AVR32_CANIF_CANISR_FERR_OFFSET ))
+#define CANIF_get_interrupt_aerr_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_AERR_MASK)>> AVR32_CANIF_CANISR_AERR_OFFSET ))
+#define CANIF_get_interrupt_boff_status(ch) ( ((AVR32_CANIF.channel[ch].canisr & AVR32_CANIF_CANISR_BOFF_MASK)>> AVR32_CANIF_CANISR_BOFF_OFFSET ))
+#define CANIF_clr_interrupt_status(ch) { AVR32_CANIF.channel[ch].caniscr = CANIF_get_interrupt_status(ch); }
+
+//! MOBCTRL Register Access
+#define CANIF_get_mobctrl(ch,mob) (((unsigned volatile long*)&(AVR32_CANIF.channel[ch].mobctrl))[mob*3])
+#define CANIF_set_mobctrl(ch,mob,val) (((unsigned volatile long*)&(AVR32_CANIF.channel[ch].mobctrl))[mob*3]=val)
+#define CANIF_mobctrl(ch,mob) (((unsigned volatile long*)&(AVR32_CANIF.channel[ch].mobctrl))[mob*3])
+#define CANIF_mob_clr_automode(ch,mob) { CANIF_set_mobctrl(ch,mob,CANIF_get_mobctrl(ch,mob)&~(1<<AVR32_CANIF_AM_OFFSET));}
+#define CANIF_mob_set_automode(ch,mob) { CANIF_set_mobctrl(ch,mob,CANIF_get_mobctrl(ch,mob)| (1<<AVR32_CANIF_AM_OFFSET));}
+#define CANIF_mob_clr_dlc(ch,mob) { CANIF_set_mobctrl(ch,mob,CANIF_get_mobctrl(ch,mob)&~(0x0F<<AVR32_CANIF_DLC_OFFSET));}
+#define CANIF_mob_set_dlc(ch,mob,dlc) { CANIF_set_mobctrl(ch,mob,(CANIF_get_mobctrl(ch,mob)| (dlc<<AVR32_CANIF_DLC_OFFSET))); }
+#define CANIF_mob_get_dlc(ch,mob) ( (CANIF_get_mobctrl(ch,mob)&AVR32_CANIF_DLC_MASK)>>AVR32_CANIF_DLC_OFFSET )
+#define CANIF_mob_clr_dir(ch,mob) { CANIF_set_mobctrl(ch,mob,CANIF_get_mobctrl(ch,mob)&~(1<<AVR32_CANIF_DIR_OFFSET));}
+#define CANIF_mob_set_dir(ch,mob) { CANIF_set_mobctrl(ch,mob,CANIF_get_mobctrl(ch,mob)| (1<<AVR32_CANIF_DIR_OFFSET));}
+#define CANIF_mob_get_dir(ch,mob) ( (CANIF_get_mobctrl(ch,mob)&AVR32_CANIF_DIR_MASK) >> AVR32_CANIF_DIR_OFFSET )
+
+//! MOBSR Register Access
+#define CANIF_mob_get_status(ch,mob) (((unsigned volatile long*) &(AVR32_CANIF.channel[ch].mobsr))[mob*3])
+#define CANIF_mob_set_status(ch,mob,val) {((unsigned volatile long*) &(AVR32_CANIF.channel[ch].mobscr))[mob*3]=val;}
+#define CANIF_mob_clear_status(ch,mob) {CANIF_mob_set_status(ch,mob,0x0F)}
+
+//! MOBSCH Register Access
+#define CANIF_mob_get_mob_free(ch) ((AVR32_CANIF.channel[ch].mobsch&AVR32_CANIF_MOBSCH_MAV_MASK)>>AVR32_CANIF_MOBSCH_MAV_OFFSET)
+#define CANIF_mob_get_mob_rxok(ch) ((AVR32_CANIF.channel[ch].mobsch&AVR32_CANIF_MOBSCH_MRXOK_MASK)>>AVR32_CANIF_MOBSCH_MRXOK_OFFSET)
+#define CANIF_mob_get_mob_txok(ch) ((AVR32_CANIF.channel[ch].mobsch&AVR32_CANIF_MOBSCH_MTXOK_MASK)>>AVR32_CANIF_MOBSCH_MTXOK_OFFSET)
+
+//! MOBER Register Access
+#define CANIF_mob_enable(ch,mob) {AVR32_CANIF.channel[ch].mober = 1<<mob;}
+
+//! MOBDR Register Access
+#define CANIF_mob_disable(ch,mob) {AVR32_CANIF.channel[ch].mobdr = 1<<mob;}
+
+//! MOBESR Register Access
+#define CANIF_mob_enable_status(ch,mob) ((AVR32_CANIF.channel[ch].mobesr >> mob)&1)
+
+//! MOBIER Register Access
+#define CANIF_mob_enable_interrupt(ch,mob) {AVR32_CANIF.channel[ch].mobier = 1<<mob;}
+
+//! MOBIDR Register Access
+#define CANIF_mob_disable_interrupt(ch,mob) {AVR32_CANIF.channel[ch].mobidr = 1<<mob;}
+
+//! MRXISCR Register Access
+#define CANIF_mob_clear_rxok_status(ch,mob) {AVR32_CANIF.channel[ch].mrxiscr = 1<<mob;}
+
+//! MRXISR Register Access
+#define CANIF_mob_get_rxok_status(ch,mob) ((AVR32_CANIF.channel[ch].mrxisr >> mob)& 1)
+
+//! MTXISCR Register Access
+#define CANIF_mob_clear_txok_status(ch,mob) {AVR32_CANIF.channel[ch].mtxiscr = 1<<mob;}
+
+//! MTXISR Register Access
+#define CANIF_mob_get_txok_status(ch,mob) ((AVR32_CANIF.channel[ch].mtxisr >> mob)& 1)
+
+#define CANIF_SIZE_OF_CANIF_MSG (sizeof(can_msg_t))
+#define CANIF_config_tx(ch,mob) {CANIF_mob_set_dir(ch,mob) }
+#define CANIF_config_rx(ch,mob) {CANIF_mob_clr_dir(ch,mob) }
+
+#define CANIF_mob_allocate(ch) (CANIF_mob_get_mob_free(ch))
+#define CANIF_mob_free_get_addr_data(ch) (CANIF_SIZE_OF_CANIF_MSG*CANIF_mob_get_mob_free(ch)+CANIF_get_ram_add(ch))
+#define CANIF_mob_free_get_ptr_data(ch) ((can_msg_t *)(CANIF_SIZE_OF_CANIF_MSG*CANIF_mob_get_mob_free(ch)+CANIF_get_ram_add(ch)))
+#define CANIF_mob_free(ch,mob) {CANIF_mob_disable(ch,mob)}
+#define CANIF_mob_get_addr_data(ch,mob) ((CANIF_SIZE_OF_CANIF_MSG*mob+CANIF_get_ram_add(ch)))
+#define CANIF_mob_get_ptr_data(ch,mob) ((can_msg_t *)(CANIF_SIZE_OF_CANIF_MSG*mob+CANIF_get_ram_add(ch)))
+
+#define CANIF_set_idemask(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->ide_mask_bit = 1;}
+#define CANIF_clr_idemask(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->ide_mask_bit = 0);}
+#define CANIF_get_idemask(ch,mob) ((CANIF_mob_get_ptr_data(ch,mob))->ide_mask_bit)
+#define CANIF_set_rtrmask(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->rtr_mask_bit = 1;}
+#define CANIF_clr_rtrmask(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->rtr_mask_bit = 0;}
+#define CANIF_get_rtrmask(ch,mob) ((CANIF_mob_get_ptr_data(ch,mob))->rtr_mask_bit)
+#define CANIF_set_ide(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->ide_bit = 1;}
+#define CANIF_clr_ide(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->ide_bit = 0;}
+#define CANIF_get_ide(ch,mob) ((CANIF_mob_get_ptr_data(ch,mob))->ide_bit)
+#define CANIF_set_rtr(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->rtr_bit = 1;}
+#define CANIF_clr_rtr(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->rtr_bit = 0;}
+#define CANIF_get_rtr(ch,mob) ((CANIF_mob_get_ptr_data(ch,mob))->rtr_bit )
+
+#define CANIF_set_ext_id(ch,mob,_id) {(CANIF_mob_get_ptr_data(ch,mob))->id = (1<<IDE_BIT)|(_id);}
+#define CANIF_get_ext_id(ch,mob) ((CANIF_mob_get_ptr_data(ch,mob))->id & 0x1FFFFFFF )
+#define CANIF_set_std_id(ch,mob,_id) {(CANIF_mob_get_ptr_data(ch,mob))->id = (_id);}
+#define CANIF_get_std_id(ch,mob) ((CANIF_mob_get_ptr_data(ch,mob))->id & 0x000007FF )
+
+#define CANIF_set_ext_idmask(ch,mob,mask) {(CANIF_mob_get_ptr_data(ch,mob))->id_mask = mask;}
+#define CANIF_set_std_idmask(ch,mob,mask) {(CANIF_mob_get_ptr_data(ch,mob))->id_mask = mask;}
+
+#define CANIF_clr_mob(ch,mob) {(CANIF_mob_get_ptr_data(ch,mob))->id = 0; \
+ (CANIF_mob_get_ptr_data(ch,mob))->id_mask = 0; \
+ (CANIF_mob_get_ptr_data(ch,mob))->data.u64 = 0;}
+
+#define CANIF_set_data(ch,mob,_data) {(CANIF_mob_get_ptr_data(ch,mob))->data.u64 = _data;}
+
+/*! \brief Gets the mob status.
+ */
+extern uint8_t canif_get_mob_status(uint8_t ch, uint8_t mob);
+
+/*! \brief Config Baudrate with fixed baudrate
+ */
+extern uint8_t canif_fixed_baudrate(uint8_t ch);
+
+/*! \brief Clear all mob of a channel
+ */
+extern void canif_clear_all_mob(uint8_t ch,
+ uint8_t nb_mob);
+//______________________________________________________________________________
+
+#endif // _CANIF_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.c
new file mode 100644
index 0000000..1a22bc9
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.c
@@ -0,0 +1,1136 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief FLASHC driver for AVR32 UC3.
+ *
+ * AVR32 Flash Controller driver module.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a FLASHC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include <avr32/io.h>
+#include <stddef.h>
+#include "compiler.h"
+#include "flashc.h"
+
+
+/*! \name FLASHC Writable Bit-Field Registers
+ */
+//! @{
+
+typedef union
+{
+ unsigned long fcr;
+ avr32_flashc_fcr_t FCR;
+} u_avr32_flashc_fcr_t;
+
+typedef union
+{
+ unsigned long fcmd;
+ avr32_flashc_fcmd_t FCMD;
+} u_avr32_flashc_fcmd_t;
+
+//! @}
+
+
+/*! \name Flash Properties
+ */
+//! @{
+
+
+unsigned int flashc_get_flash_size(void)
+{
+#if (AVR32_FLASHC_H_VERSION >= 300)
+ static const unsigned int FLASH_SIZE[1 << AVR32_FLASHC_PR_FSZ_SIZE] =
+ {
+ 4 << 10,
+ 8 << 10,
+ 16 << 10,
+ 32 << 10,
+ 48 << 10,
+ 64 << 10,
+ 96 << 10,
+ 128 << 10,
+ 192 << 10,
+ 256 << 10,
+ 384 << 10,
+ 512 << 10,
+ 768 << 10,
+ 1024 << 10,
+ 2048 << 10
+ };
+ return FLASH_SIZE[(AVR32_FLASHC.pr & AVR32_FLASHC_PR_FSZ_MASK) >> AVR32_FLASHC_PR_FSZ_OFFSET];
+#else // in older flashc version, FSZ is located in FSR register
+ static const unsigned int FLASH_SIZE[1 << AVR32_FLASHC_FSR_FSZ_SIZE] =
+ {
+ 32 << 10,
+ 64 << 10,
+ 128 << 10,
+ 256 << 10,
+ 384 << 10,
+ 512 << 10,
+ 768 << 10,
+ 1024 << 10
+ };
+ return FLASH_SIZE[(AVR32_FLASHC.fsr & AVR32_FLASHC_FSR_FSZ_MASK) >> AVR32_FLASHC_FSR_FSZ_OFFSET];
+#endif
+}
+
+
+unsigned int flashc_get_page_count(void)
+{
+ return flashc_get_flash_size() / AVR32_FLASHC_PAGE_SIZE;
+}
+
+
+unsigned int flashc_get_page_count_per_region(void)
+{
+ return flashc_get_page_count() / AVR32_FLASHC_REGIONS;
+}
+
+
+unsigned int flashc_get_page_region(int page_number)
+{
+ return ((page_number >= 0) ? page_number : flashc_get_page_number()) / flashc_get_page_count_per_region();
+}
+
+
+unsigned int flashc_get_region_first_page_number(unsigned int region)
+{
+ return region * flashc_get_page_count_per_region();
+}
+
+
+//! @}
+
+
+/*! \name FLASHC Control
+ */
+//! @{
+
+
+unsigned int flashc_get_wait_state(void)
+{
+ return (AVR32_FLASHC.fcr & AVR32_FLASHC_FCR_FWS_MASK) >> AVR32_FLASHC_FCR_FWS_OFFSET;
+}
+
+
+void flashc_set_wait_state(unsigned int wait_state)
+{
+ u_avr32_flashc_fcr_t u_avr32_flashc_fcr = {AVR32_FLASHC.fcr};
+ u_avr32_flashc_fcr.FCR.fws = wait_state;
+ AVR32_FLASHC.fcr = u_avr32_flashc_fcr.fcr;
+}
+
+
+void flashc_set_bus_freq(unsigned int cpu_f_hz)
+{
+ if(cpu_f_hz >= AVR32_FLASHC_FWS_0_MAX_FREQ)
+ {
+ // Set 1 WS.
+ flashc_set_wait_state(1);
+ }
+ else
+ {
+ // Set 0 WS.
+ flashc_set_wait_state(0);
+ }
+}
+
+bool flashc_is_ready_int_enabled(void)
+{
+ return ((AVR32_FLASHC.fcr & AVR32_FLASHC_FCR_FRDY_MASK) != 0);
+}
+
+
+void flashc_enable_ready_int(bool enable)
+{
+ u_avr32_flashc_fcr_t u_avr32_flashc_fcr = {AVR32_FLASHC.fcr};
+ u_avr32_flashc_fcr.FCR.frdy = (enable != false);
+ AVR32_FLASHC.fcr = u_avr32_flashc_fcr.fcr;
+}
+
+
+bool flashc_is_lock_error_int_enabled(void)
+{
+ return ((AVR32_FLASHC.fcr & AVR32_FLASHC_FCR_LOCKE_MASK) != 0);
+}
+
+
+void flashc_enable_lock_error_int(bool enable)
+{
+ u_avr32_flashc_fcr_t u_avr32_flashc_fcr = {AVR32_FLASHC.fcr};
+ u_avr32_flashc_fcr.FCR.locke = (enable != false);
+ AVR32_FLASHC.fcr = u_avr32_flashc_fcr.fcr;
+}
+
+
+bool flashc_is_prog_error_int_enabled(void)
+{
+ return ((AVR32_FLASHC.fcr & AVR32_FLASHC_FCR_PROGE_MASK) != 0);
+}
+
+
+void flashc_enable_prog_error_int(bool enable)
+{
+ u_avr32_flashc_fcr_t u_avr32_flashc_fcr = {AVR32_FLASHC.fcr};
+ u_avr32_flashc_fcr.FCR.proge = (enable != false);
+ AVR32_FLASHC.fcr = u_avr32_flashc_fcr.fcr;
+}
+
+
+//! @}
+
+
+/*! \name FLASHC Status
+ */
+//! @{
+
+
+bool flashc_is_ready(void)
+{
+ return ((AVR32_FLASHC.fsr & AVR32_FLASHC_FSR_FRDY_MASK) != 0);
+}
+
+
+void flashc_default_wait_until_ready(void)
+{
+ while (!flashc_is_ready());
+}
+
+
+void (*volatile flashc_wait_until_ready)(void) = flashc_default_wait_until_ready;
+
+
+/*! \brief Gets the error status of the FLASHC.
+ *
+ * \return The error status of the FLASHC built up from
+ * \c AVR32_FLASHC_FSR_LOCKE_MASK and \c AVR32_FLASHC_FSR_PROGE_MASK.
+ *
+ * \warning This hardware error status is cleared by all functions reading the
+ * Flash Status Register (FSR). This function is therefore not part of
+ * the driver's API which instead presents \ref flashc_is_lock_error
+ * and \ref flashc_is_programming_error.
+ */
+static unsigned int flashc_get_error_status(void)
+{
+ return AVR32_FLASHC.fsr & (AVR32_FLASHC_FSR_LOCKE_MASK |
+ AVR32_FLASHC_FSR_PROGE_MASK);
+}
+
+
+//! Sticky error status of the FLASHC.
+//! This variable is updated by functions that issue FLASHC commands. It
+//! contains the cumulated FLASHC error status of all the FLASHC commands issued
+//! by a function.
+static unsigned int flashc_error_status = 0;
+
+
+bool flashc_is_lock_error(void)
+{
+ return ((flashc_error_status & AVR32_FLASHC_FSR_LOCKE_MASK) != 0);
+}
+
+
+bool flashc_is_programming_error(void)
+{
+ return ((flashc_error_status & AVR32_FLASHC_FSR_PROGE_MASK) != 0);
+}
+
+
+//! @}
+
+
+/*! \name FLASHC Command Control
+ */
+//! @{
+
+
+unsigned int flashc_get_command(void)
+{
+ return (AVR32_FLASHC.fcmd & AVR32_FLASHC_FCMD_CMD_MASK) >> AVR32_FLASHC_FCMD_CMD_OFFSET;
+}
+
+
+unsigned int flashc_get_page_number(void)
+{
+ return (AVR32_FLASHC.fcmd & AVR32_FLASHC_FCMD_PAGEN_MASK) >> AVR32_FLASHC_FCMD_PAGEN_OFFSET;
+}
+
+
+void flashc_issue_command(unsigned int command, int page_number)
+{
+ u_avr32_flashc_fcmd_t u_avr32_flashc_fcmd;
+ flashc_wait_until_ready();
+ u_avr32_flashc_fcmd.fcmd = AVR32_FLASHC.fcmd;
+ u_avr32_flashc_fcmd.FCMD.cmd = command;
+ if (page_number >= 0) u_avr32_flashc_fcmd.FCMD.pagen = page_number;
+ u_avr32_flashc_fcmd.FCMD.key = AVR32_FLASHC_FCMD_KEY_KEY;
+ AVR32_FLASHC.fcmd = u_avr32_flashc_fcmd.fcmd;
+ flashc_error_status = flashc_get_error_status();
+ flashc_wait_until_ready();
+}
+
+
+//! @}
+
+
+/*! \name FLASHC Global Commands
+ */
+//! @{
+
+
+void flashc_no_operation(void)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_NOP, -1);
+}
+
+
+void flashc_erase_all(void)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_EA, -1);
+}
+
+
+//! @}
+
+
+/*! \name FLASHC Protection Mechanisms
+ */
+//! @{
+
+
+bool flashc_is_security_bit_active(void)
+{
+ return ((AVR32_FLASHC.fsr & AVR32_FLASHC_FSR_SECURITY_MASK) != 0);
+}
+
+
+void flashc_activate_security_bit(void)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_SSB, -1);
+}
+
+
+unsigned int flashc_get_bootloader_protected_size(void)
+{
+ unsigned int bootprot = (1 << AVR32_FLASHC_FGPFRLO_BOOTPROT_SIZE) - 1 -
+ flashc_read_gp_fuse_bitfield(AVR32_FLASHC_FGPFRLO_BOOTPROT_OFFSET,
+ AVR32_FLASHC_FGPFRLO_BOOTPROT_SIZE);
+ return (bootprot) ? AVR32_FLASHC_PAGE_SIZE << bootprot : 0;
+}
+
+
+unsigned int flashc_set_bootloader_protected_size(unsigned int bootprot_size)
+{
+ flashc_set_gp_fuse_bitfield(AVR32_FLASHC_FGPFRLO_BOOTPROT_OFFSET,
+ AVR32_FLASHC_FGPFRLO_BOOTPROT_SIZE,
+ (1 << AVR32_FLASHC_FGPFRLO_BOOTPROT_SIZE) - 1 -
+ ((bootprot_size) ?
+ 32 - clz((((min(max(bootprot_size, AVR32_FLASHC_PAGE_SIZE << 1),
+ AVR32_FLASHC_PAGE_SIZE <<
+ ((1 << AVR32_FLASHC_FGPFRLO_BOOTPROT_SIZE) - 1)) +
+ AVR32_FLASHC_PAGE_SIZE - 1) /
+ AVR32_FLASHC_PAGE_SIZE) << 1) - 1) - 1 :
+ 0));
+ return flashc_get_bootloader_protected_size();
+}
+
+
+bool flashc_is_external_privileged_fetch_locked(void)
+{
+ return (!flashc_read_gp_fuse_bit(AVR32_FLASHC_FGPFRLO_EPFL_OFFSET));
+}
+
+
+void flashc_lock_external_privileged_fetch(bool lock)
+{
+ flashc_set_gp_fuse_bit(AVR32_FLASHC_FGPFRLO_EPFL_OFFSET, !lock);
+}
+
+
+bool flashc_is_page_region_locked(int page_number)
+{
+ return flashc_is_region_locked(flashc_get_page_region(page_number));
+}
+
+
+bool flashc_is_region_locked(unsigned int region)
+{
+ return ((AVR32_FLASHC.fsr & AVR32_FLASHC_FSR_LOCK0_MASK << (region & (AVR32_FLASHC_REGIONS - 1))) != 0);
+}
+
+
+void flashc_lock_page_region(int page_number, bool lock)
+{
+ flashc_issue_command((lock) ? AVR32_FLASHC_FCMD_CMD_LP : AVR32_FLASHC_FCMD_CMD_UP, page_number);
+}
+
+
+void flashc_lock_region(unsigned int region, bool lock)
+{
+ flashc_lock_page_region(flashc_get_region_first_page_number(region), lock);
+}
+
+
+void flashc_lock_all_regions(bool lock)
+{
+ unsigned int error_status = 0;
+ unsigned int region = AVR32_FLASHC_REGIONS;
+ while (region)
+ {
+ flashc_lock_region(--region, lock);
+ error_status |= flashc_error_status;
+ }
+ flashc_error_status = error_status;
+}
+
+
+//! @}
+
+
+/*! \name Access to General-Purpose Fuses
+ */
+//! @{
+
+
+bool flashc_read_gp_fuse_bit(unsigned int gp_fuse_bit)
+{
+ return ((flashc_read_all_gp_fuses() & 1ULL << (gp_fuse_bit & 0x3F)) != 0);
+}
+
+
+U64 flashc_read_gp_fuse_bitfield(unsigned int pos, unsigned int width)
+{
+ return flashc_read_all_gp_fuses() >> (pos & 0x3F) & ((1ULL << min(width, 64)) - 1);
+}
+
+
+U8 flashc_read_gp_fuse_byte(unsigned int gp_fuse_byte)
+{
+ return flashc_read_all_gp_fuses() >> ((gp_fuse_byte & 0x07) << 3);
+}
+
+
+U64 flashc_read_all_gp_fuses(void)
+{
+ return AVR32_FLASHC.fgpfrlo | (U64)AVR32_FLASHC.fgpfrhi << 32;
+}
+
+
+bool flashc_erase_gp_fuse_bit(unsigned int gp_fuse_bit, bool check)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_EGPB, gp_fuse_bit & 0x3F);
+ return (check) ? flashc_read_gp_fuse_bit(gp_fuse_bit) : true;
+}
+
+
+bool flashc_erase_gp_fuse_bitfield(unsigned int pos, unsigned int width, bool check)
+{
+ unsigned int error_status = 0;
+ unsigned int gp_fuse_bit;
+ pos &= 0x3F;
+ width = min(width, 64);
+ for (gp_fuse_bit = pos; gp_fuse_bit < pos + width; gp_fuse_bit++)
+ {
+ flashc_erase_gp_fuse_bit(gp_fuse_bit, false);
+ error_status |= flashc_error_status;
+ }
+ flashc_error_status = error_status;
+ return (check) ? (flashc_read_gp_fuse_bitfield(pos, width) == (1ULL << width) - 1) : true;
+}
+
+
+bool flashc_erase_gp_fuse_byte(unsigned int gp_fuse_byte, bool check)
+{
+ unsigned int error_status;
+ unsigned int current_gp_fuse_byte;
+ U64 value = flashc_read_all_gp_fuses();
+ flashc_erase_all_gp_fuses(false);
+ error_status = flashc_error_status;
+ for (current_gp_fuse_byte = 0; current_gp_fuse_byte < 8; current_gp_fuse_byte++, value >>= 8)
+ {
+ if (current_gp_fuse_byte != gp_fuse_byte)
+ {
+ flashc_write_gp_fuse_byte(current_gp_fuse_byte, value);
+ error_status |= flashc_error_status;
+ }
+ }
+ flashc_error_status = error_status;
+ return (check) ? (flashc_read_gp_fuse_byte(gp_fuse_byte) == 0xFF) : true;
+}
+
+
+bool flashc_erase_all_gp_fuses(bool check)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_EAGPF, -1);
+ return (check) ? (flashc_read_all_gp_fuses() == 0xFFFFFFFFFFFFFFFFULL) : true;
+}
+
+
+void flashc_write_gp_fuse_bit(unsigned int gp_fuse_bit, bool value)
+{
+ if (!value)
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_WGPB, gp_fuse_bit & 0x3F);
+}
+
+
+void flashc_write_gp_fuse_bitfield(unsigned int pos, unsigned int width, U64 value)
+{
+ unsigned int error_status = 0;
+ unsigned int gp_fuse_bit;
+ pos &= 0x3F;
+ width = min(width, 64);
+ for (gp_fuse_bit = pos; gp_fuse_bit < pos + width; gp_fuse_bit++, value >>= 1)
+ {
+ flashc_write_gp_fuse_bit(gp_fuse_bit, value & 0x01);
+ error_status |= flashc_error_status;
+ }
+ flashc_error_status = error_status;
+}
+
+
+void flashc_write_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_PGPFB, (gp_fuse_byte & 0x07) | value << 3);
+}
+
+
+void flashc_write_all_gp_fuses(U64 value)
+{
+ unsigned int error_status = 0;
+ unsigned int gp_fuse_byte;
+ for (gp_fuse_byte = 0; gp_fuse_byte < 8; gp_fuse_byte++, value >>= 8)
+ {
+ flashc_write_gp_fuse_byte(gp_fuse_byte, value);
+ error_status |= flashc_error_status;
+ }
+ flashc_error_status = error_status;
+}
+
+
+void flashc_set_gp_fuse_bit(unsigned int gp_fuse_bit, bool value)
+{
+ if (value)
+ flashc_erase_gp_fuse_bit(gp_fuse_bit, false);
+ else
+ flashc_write_gp_fuse_bit(gp_fuse_bit, false);
+}
+
+
+void flashc_set_gp_fuse_bitfield(unsigned int pos, unsigned int width, U64 value)
+{
+ unsigned int error_status = 0;
+ unsigned int gp_fuse_bit;
+ pos &= 0x3F;
+ width = min(width, 64);
+ for (gp_fuse_bit = pos; gp_fuse_bit < pos + width; gp_fuse_bit++, value >>= 1)
+ {
+ flashc_set_gp_fuse_bit(gp_fuse_bit, value & 0x01);
+ error_status |= flashc_error_status;
+ }
+ flashc_error_status = error_status;
+}
+
+
+void flashc_set_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value)
+{
+ unsigned int error_status;
+ switch (value)
+ {
+ case 0xFF:
+ flashc_erase_gp_fuse_byte(gp_fuse_byte, false);
+ break;
+ case 0x00:
+ flashc_write_gp_fuse_byte(gp_fuse_byte, 0x00);
+ break;
+ default:
+ flashc_erase_gp_fuse_byte(gp_fuse_byte, false);
+ error_status = flashc_error_status;
+ flashc_write_gp_fuse_byte(gp_fuse_byte, value);
+ flashc_error_status |= error_status;
+ }
+}
+
+
+void flashc_set_all_gp_fuses(U64 value)
+{
+ unsigned int error_status;
+ switch (value)
+ {
+ case 0xFFFFFFFFFFFFFFFFULL:
+ flashc_erase_all_gp_fuses(false);
+ break;
+ case 0x0000000000000000ULL:
+ flashc_write_all_gp_fuses(0x0000000000000000ULL);
+ break;
+ default:
+ flashc_erase_all_gp_fuses(false);
+ error_status = flashc_error_status;
+ flashc_write_all_gp_fuses(value);
+ flashc_error_status |= error_status;
+ }
+}
+
+
+//! @}
+
+
+/*! \name Access to Flash Pages
+ */
+//! @{
+
+
+void flashc_clear_page_buffer(void)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_CPB, -1);
+}
+
+
+bool flashc_is_page_erased(void)
+{
+ return ((AVR32_FLASHC.fsr & AVR32_FLASHC_FSR_QPRR_MASK) != 0);
+}
+
+
+bool flashc_quick_page_read(int page_number)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_QPR, page_number);
+ return flashc_is_page_erased();
+}
+
+
+bool flashc_erase_page(int page_number, bool check)
+{
+ bool page_erased = true;
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_EP, page_number);
+ if (check)
+ {
+ unsigned int error_status = flashc_error_status;
+ page_erased = flashc_quick_page_read(-1);
+ flashc_error_status |= error_status;
+ }
+ return page_erased;
+}
+
+
+bool flashc_erase_all_pages(bool check)
+{
+ bool all_pages_erased = true;
+ unsigned int error_status = 0;
+ unsigned int page_number = flashc_get_page_count();
+ while (page_number)
+ {
+ all_pages_erased &= flashc_erase_page(--page_number, check);
+ error_status |= flashc_error_status;
+ }
+ flashc_error_status = error_status;
+ return all_pages_erased;
+}
+
+
+void flashc_write_page(int page_number)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_WP, page_number);
+}
+
+
+bool flashc_quick_user_page_read(void)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_QPRUP, -1);
+ return flashc_is_page_erased();
+}
+
+
+bool flashc_erase_user_page(bool check)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_EUP, -1);
+ return (check) ? flashc_quick_user_page_read() : true;
+}
+
+
+void flashc_write_user_page(void)
+{
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_WUP, -1);
+}
+
+
+volatile void *flashc_memset8(volatile void *dst, U8 src, size_t nbytes, bool erase)
+{
+ return flashc_memset16(dst, src | (U16)src << 8, nbytes, erase);
+}
+
+
+volatile void *flashc_memset16(volatile void *dst, U16 src, size_t nbytes, bool erase)
+{
+ return flashc_memset32(dst, src | (U32)src << 16, nbytes, erase);
+}
+
+
+volatile void *flashc_memset32(volatile void *dst, U32 src, size_t nbytes, bool erase)
+{
+ return flashc_memset64(dst, src | (U64)src << 32, nbytes, erase);
+}
+
+
+volatile void *flashc_memset64(volatile void *dst, U64 src, size_t nbytes, bool erase)
+{
+ // Use aggregated pointers to have several alignments available for a same address.
+ UnionCVPtr flash_array_end;
+ UnionVPtr dest;
+ Union64 source = {0};
+ StructCVPtr dest_end;
+ UnionCVPtr flash_page_source_end;
+ bool incomplete_flash_page_end;
+ Union64 flash_dword;
+ UnionVPtr tmp;
+ unsigned int error_status = 0;
+ unsigned int i;
+
+ // Reformat arguments.
+ flash_array_end.u8ptr = AVR32_FLASH + flashc_get_flash_size();
+ dest.u8ptr = dst;
+ for (i = (Get_align((U32)dest.u8ptr, sizeof(U64)) - 1) & (sizeof(U64) - 1);
+ src; i = (i - 1) & (sizeof(U64) - 1))
+ {
+ source.u8[i] = src;
+ src >>= 8;
+ }
+ dest_end.u8ptr = dest.u8ptr + nbytes;
+
+ // If destination is outside flash, go to next flash page if any.
+ if (dest.u8ptr < AVR32_FLASH)
+ {
+ dest.u8ptr = AVR32_FLASH;
+ }
+ else if (flash_array_end.u8ptr <= dest.u8ptr && dest.u8ptr < AVR32_FLASHC_USER_PAGE)
+ {
+ dest.u8ptr = AVR32_FLASHC_USER_PAGE;
+ }
+
+ // If end of destination is outside flash, move it to the end of the previous flash page if any.
+ if (dest_end.u8ptr > AVR32_FLASHC_USER_PAGE + AVR32_FLASHC_USER_PAGE_SIZE)
+ {
+ dest_end.u8ptr = AVR32_FLASHC_USER_PAGE + AVR32_FLASHC_USER_PAGE_SIZE;
+ }
+ else if (AVR32_FLASHC_USER_PAGE >= dest_end.u8ptr && dest_end.u8ptr > flash_array_end.u8ptr)
+ {
+ dest_end.u8ptr = flash_array_end.u8ptr;
+ }
+
+ // Align each end of destination pointer with its natural boundary.
+ dest_end.u16ptr = (U16 *)Align_down((U32)dest_end.u8ptr, sizeof(U16));
+ dest_end.u32ptr = (U32 *)Align_down((U32)dest_end.u16ptr, sizeof(U32));
+ dest_end.u64ptr = (U64 *)Align_down((U32)dest_end.u32ptr, sizeof(U64));
+
+ // While end of destination is not reached...
+ while (dest.u8ptr < dest_end.u8ptr)
+ {
+ // Clear the page buffer in order to prepare data for a flash page write.
+ flashc_clear_page_buffer();
+ error_status |= flashc_error_status;
+
+ // Determine where the source data will end in the current flash page.
+ flash_page_source_end.u64ptr =
+ (U64 *)min((U32)dest_end.u64ptr,
+ Align_down((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE) + AVR32_FLASHC_PAGE_SIZE);
+
+ // Determine if the current destination page has an incomplete end.
+ incomplete_flash_page_end = (Align_down((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE) >=
+ Align_down((U32)dest_end.u8ptr, AVR32_FLASHC_PAGE_SIZE));
+
+ // Use a flash double-word buffer to manage unaligned accesses.
+ flash_dword.u64 = source.u64;
+
+ // If destination does not point to the beginning of the current flash page...
+ if (!Test_align((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE))
+ {
+ // Fill the beginning of the page buffer with the current flash page data.
+ // This is required by the hardware, even if page erase is not requested,
+ // in order to be able to write successfully to erased parts of flash
+ // pages that have already been written to.
+ for (tmp.u8ptr = (U8 *)Align_down((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE);
+ tmp.u64ptr < (U64 *)Align_down((U32)dest.u8ptr, sizeof(U64));
+ tmp.u64ptr++)
+ *tmp.u64ptr = *tmp.u64ptr;
+
+ // If destination is not 64-bit aligned...
+ if (!Test_align((U32)dest.u8ptr, sizeof(U64)))
+ {
+ // Fill the beginning of the flash double-word buffer with the current
+ // flash page data.
+ // This is required by the hardware, even if page erase is not
+ // requested, in order to be able to write successfully to erased parts
+ // of flash pages that have already been written to.
+ for (i = 0; i < Get_align((U32)dest.u8ptr, sizeof(U64)); i++)
+ flash_dword.u8[i] = *tmp.u8ptr++;
+
+ // Align the destination pointer with its 64-bit boundary.
+ dest.u64ptr = (U64 *)Align_down((U32)dest.u8ptr, sizeof(U64));
+
+ // If the current destination double-word is not the last one...
+ if (dest.u64ptr < dest_end.u64ptr)
+ {
+ // Write the flash double-word buffer to the page buffer and reinitialize it.
+ *dest.u64ptr++ = flash_dword.u64;
+ flash_dword.u64 = source.u64;
+ }
+ }
+ }
+
+ // Write the source data to the page buffer with 64-bit alignment.
+ for (i = flash_page_source_end.u64ptr - dest.u64ptr; i; i--)
+ *dest.u64ptr++ = source.u64;
+
+ // If the current destination page has an incomplete end...
+ if (incomplete_flash_page_end)
+ {
+ // This is required by the hardware, even if page erase is not requested,
+ // in order to be able to write successfully to erased parts of flash
+ // pages that have already been written to.
+ {
+ tmp.u8ptr = (volatile U8 *)dest_end.u8ptr;
+
+ // If end of destination is not 64-bit aligned...
+ if (!Test_align((U32)dest_end.u8ptr, sizeof(U64)))
+ {
+ // Fill the end of the flash double-word buffer with the current flash page data.
+ for (i = Get_align((U32)dest_end.u8ptr, sizeof(U64)); i < sizeof(U64); i++)
+ flash_dword.u8[i] = *tmp.u8ptr++;
+
+ // Write the flash double-word buffer to the page buffer.
+ *dest.u64ptr++ = flash_dword.u64;
+ }
+
+ // Fill the end of the page buffer with the current flash page data.
+ for (; !Test_align((U32)tmp.u64ptr, AVR32_FLASHC_PAGE_SIZE); tmp.u64ptr++)
+ *tmp.u64ptr = *tmp.u64ptr;
+ }
+ }
+
+ // If the current flash page is in the flash array...
+ if (dest.u8ptr <= AVR32_FLASHC_USER_PAGE)
+ {
+ // Erase the current page if requested and write it from the page buffer.
+ if (erase)
+ {
+ flashc_erase_page(-1, false);
+ error_status |= flashc_error_status;
+ }
+ flashc_write_page(-1);
+ error_status |= flashc_error_status;
+
+ // If the end of the flash array is reached, go to the User page.
+ if (dest.u8ptr >= flash_array_end.u8ptr)
+ dest.u8ptr = AVR32_FLASHC_USER_PAGE;
+ }
+ // If the current flash page is the User page...
+ else
+ {
+ // Erase the User page if requested and write it from the page buffer.
+ if (erase)
+ {
+ flashc_erase_user_page(false);
+ error_status |= flashc_error_status;
+ }
+ flashc_write_user_page();
+ error_status |= flashc_error_status;
+ }
+ }
+
+ // Update the FLASHC error status.
+ flashc_error_status = error_status;
+
+ // Return the initial destination pointer as the standard memset function does.
+ return dst;
+}
+
+
+volatile void *flashc_memcpy(volatile void *dst, const void *src, size_t nbytes, bool erase)
+{
+ // Use aggregated pointers to have several alignments available for a same address.
+ UnionCVPtr flash_array_end;
+ UnionVPtr dest;
+ UnionCPtr source;
+ StructCVPtr dest_end;
+ UnionCVPtr flash_page_source_end;
+ bool incomplete_flash_page_end;
+ Union64 flash_dword;
+ bool flash_dword_pending = false;
+ UnionVPtr tmp;
+ unsigned int error_status = 0;
+ unsigned int i, j;
+
+ // Reformat arguments.
+ flash_array_end.u8ptr = AVR32_FLASH + flashc_get_flash_size();
+ dest.u8ptr = dst;
+ source.u8ptr = src;
+ dest_end.u8ptr = dest.u8ptr + nbytes;
+
+ // If destination is outside flash, go to next flash page if any.
+ if (dest.u8ptr < AVR32_FLASH)
+ {
+ source.u8ptr += AVR32_FLASH - dest.u8ptr;
+ dest.u8ptr = AVR32_FLASH;
+ }
+ else if (flash_array_end.u8ptr <= dest.u8ptr && dest.u8ptr < AVR32_FLASHC_USER_PAGE)
+ {
+ source.u8ptr += AVR32_FLASHC_USER_PAGE - dest.u8ptr;
+ dest.u8ptr = AVR32_FLASHC_USER_PAGE;
+ }
+
+ // If end of destination is outside flash, move it to the end of the previous flash page if any.
+ if (dest_end.u8ptr > AVR32_FLASHC_USER_PAGE + AVR32_FLASHC_USER_PAGE_SIZE)
+ {
+ dest_end.u8ptr = AVR32_FLASHC_USER_PAGE + AVR32_FLASHC_USER_PAGE_SIZE;
+ }
+ else if (AVR32_FLASHC_USER_PAGE >= dest_end.u8ptr && dest_end.u8ptr > flash_array_end.u8ptr)
+ {
+ dest_end.u8ptr = flash_array_end.u8ptr;
+ }
+
+ // Align each end of destination pointer with its natural boundary.
+ dest_end.u16ptr = (U16 *)Align_down((U32)dest_end.u8ptr, sizeof(U16));
+ dest_end.u32ptr = (U32 *)Align_down((U32)dest_end.u16ptr, sizeof(U32));
+ dest_end.u64ptr = (U64 *)Align_down((U32)dest_end.u32ptr, sizeof(U64));
+
+ // While end of destination is not reached...
+ while (dest.u8ptr < dest_end.u8ptr)
+ {
+ // Clear the page buffer in order to prepare data for a flash page write.
+ flashc_clear_page_buffer();
+ error_status |= flashc_error_status;
+
+ // Determine where the source data will end in the current flash page.
+ flash_page_source_end.u64ptr =
+ (U64 *)min((U32)dest_end.u64ptr,
+ Align_down((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE) + AVR32_FLASHC_PAGE_SIZE);
+
+ // Determine if the current destination page has an incomplete end.
+ incomplete_flash_page_end = (Align_down((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE) >=
+ Align_down((U32)dest_end.u8ptr, AVR32_FLASHC_PAGE_SIZE));
+
+ // If destination does not point to the beginning of the current flash page...
+ if (!Test_align((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE))
+ {
+ // Fill the beginning of the page buffer with the current flash page data.
+ // This is required by the hardware, even if page erase is not requested,
+ // in order to be able to write successfully to erased parts of flash
+ // pages that have already been written to.
+ for (tmp.u8ptr = (U8 *)Align_down((U32)dest.u8ptr, AVR32_FLASHC_PAGE_SIZE);
+ tmp.u64ptr < (U64 *)Align_down((U32)dest.u8ptr, sizeof(U64));
+ tmp.u64ptr++)
+ *tmp.u64ptr = *tmp.u64ptr;
+
+ // If destination is not 64-bit aligned...
+ if (!Test_align((U32)dest.u8ptr, sizeof(U64)))
+ {
+ // Fill the beginning of the flash double-word buffer with the current
+ // flash page data.
+ // This is required by the hardware, even if page erase is not
+ // requested, in order to be able to write successfully to erased parts
+ // of flash pages that have already been written to.
+ for (i = 0; i < Get_align((U32)dest.u8ptr, sizeof(U64)); i++)
+ flash_dword.u8[i] = *tmp.u8ptr++;
+
+ // Fill the end of the flash double-word buffer with the source data.
+ for (; i < sizeof(U64); i++)
+ flash_dword.u8[i] = *source.u8ptr++;
+
+ // Align the destination pointer with its 64-bit boundary.
+ dest.u64ptr = (U64 *)Align_down((U32)dest.u8ptr, sizeof(U64));
+
+ // If the current destination double-word is not the last one...
+ if (dest.u64ptr < dest_end.u64ptr)
+ {
+ // Write the flash double-word buffer to the page buffer.
+ *dest.u64ptr++ = flash_dword.u64;
+ }
+ // If the current destination double-word is the last one, the flash
+ // double-word buffer must be kept for later.
+ else flash_dword_pending = true;
+ }
+ }
+
+ // Read the source data with the maximal possible alignment and write it to
+ // the page buffer with 64-bit alignment.
+ switch (Get_align((U32)source.u8ptr, sizeof(U32)))
+ {
+ case 0:
+ for (i = flash_page_source_end.u64ptr - dest.u64ptr; i; i--)
+ *dest.u64ptr++ = *source.u64ptr++;
+ break;
+
+ case sizeof(U16):
+ for (i = flash_page_source_end.u64ptr - dest.u64ptr; i; i--)
+ {
+ for (j = 0; j < sizeof(U64) / sizeof(U16); j++) flash_dword.u16[j] = *source.u16ptr++;
+ *dest.u64ptr++ = flash_dword.u64;
+ }
+ break;
+
+ default:
+ for (i = flash_page_source_end.u64ptr - dest.u64ptr; i; i--)
+ {
+ for (j = 0; j < sizeof(U64); j++) flash_dword.u8[j] = *source.u8ptr++;
+ *dest.u64ptr++ = flash_dword.u64;
+ }
+ }
+
+ // If the current destination page has an incomplete end...
+ if (incomplete_flash_page_end)
+ {
+ // If the flash double-word buffer is in use, do not initialize it.
+ if (flash_dword_pending) i = Get_align((U32)dest_end.u8ptr, sizeof(U64));
+ // If the flash double-word buffer is free...
+ else
+ {
+ // Fill the beginning of the flash double-word buffer with the source data.
+ for (i = 0; i < Get_align((U32)dest_end.u8ptr, sizeof(U64)); i++)
+ flash_dword.u8[i] = *source.u8ptr++;
+ }
+
+ // This is required by the hardware, even if page erase is not requested,
+ // in order to be able to write successfully to erased parts of flash
+ // pages that have already been written to.
+ {
+ tmp.u8ptr = (volatile U8 *)dest_end.u8ptr;
+
+ // If end of destination is not 64-bit aligned...
+ if (!Test_align((U32)dest_end.u8ptr, sizeof(U64)))
+ {
+ // Fill the end of the flash double-word buffer with the current flash page data.
+ for (; i < sizeof(U64); i++)
+ flash_dword.u8[i] = *tmp.u8ptr++;
+
+ // Write the flash double-word buffer to the page buffer.
+ *dest.u64ptr++ = flash_dword.u64;
+ }
+
+ // Fill the end of the page buffer with the current flash page data.
+ for (; !Test_align((U32)tmp.u64ptr, AVR32_FLASHC_PAGE_SIZE); tmp.u64ptr++)
+ *tmp.u64ptr = *tmp.u64ptr;
+ }
+ }
+
+ // If the current flash page is in the flash array...
+ if (dest.u8ptr <= AVR32_FLASHC_USER_PAGE)
+ {
+ // Erase the current page if requested and write it from the page buffer.
+ if (erase)
+ {
+ flashc_erase_page(-1, false);
+ error_status |= flashc_error_status;
+ }
+ flashc_write_page(-1);
+ error_status |= flashc_error_status;
+
+ // If the end of the flash array is reached, go to the User page.
+ if (dest.u8ptr >= flash_array_end.u8ptr)
+ {
+ source.u8ptr += AVR32_FLASHC_USER_PAGE - dest.u8ptr;
+ dest.u8ptr = AVR32_FLASHC_USER_PAGE;
+ }
+ }
+ // If the current flash page is the User page...
+ else
+ {
+ // Erase the User page if requested and write it from the page buffer.
+ if (erase)
+ {
+ flashc_erase_user_page(false);
+ error_status |= flashc_error_status;
+ }
+ flashc_write_user_page();
+ error_status |= flashc_error_status;
+ }
+ }
+
+ // Update the FLASHC error status.
+ flashc_error_status = error_status;
+
+ // Return the initial destination pointer as the standard memcpy function does.
+ return dst;
+}
+
+
+#if UC3C
+void flashc_set_flash_waitstate_and_readmode(unsigned long cpu_f_hz)
+{
+ //! Device-specific data
+ #undef AVR32_FLASHC_FWS_0_MAX_FREQ
+ #undef AVR32_FLASHC_FWS_1_MAX_FREQ
+ #undef AVR32_FLASHC_HSEN_FWS_0_MAX_FREQ
+ #undef AVR32_FLASHC_HSEN_FWS_1_MAX_FREQ
+ #define AVR32_FLASHC_FWS_0_MAX_FREQ 33000000
+ #define AVR32_FLASHC_FWS_1_MAX_FREQ 66000000
+ #define AVR32_FLASHC_HSEN_FWS_0_MAX_FREQ 33000000
+ #define AVR32_FLASHC_HSEN_FWS_1_MAX_FREQ 72000000
+ // These defines are missing from or wrong in the toolchain header files uc3cxxx.h
+ // Put a Bugzilla
+
+ if(cpu_f_hz > AVR32_FLASHC_HSEN_FWS_0_MAX_FREQ) // > 33MHz
+ {
+ // Set a wait-state
+ flashc_set_wait_state(1);
+ if(cpu_f_hz <= AVR32_FLASHC_FWS_1_MAX_FREQ) // <= 66MHz and >33Mhz
+ {
+ // Disable the high-speed read mode.
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_HSDIS, -1);
+ }
+ else // > 66Mhz
+ {
+ // Enable the high-speed read mode.
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_HSEN, -1);
+ }
+ }
+ else // <= 33 MHz
+ {
+ // Disable wait-state
+ flashc_set_wait_state(0);
+
+ // Disable the high-speed read mode.
+ flashc_issue_command(AVR32_FLASHC_FCMD_CMD_HSDIS, -1);
+
+ }
+}
+#endif // UC3C device-specific implementation
+
+//! @}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.h
new file mode 100644
index 0000000..a0da1ed
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/flashc/flashc.h
@@ -0,0 +1,1018 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief FLASHC driver for AVR32 UC3.
+ *
+ * AVR32 Flash Controller driver module.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a FLASHC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _FLASHC_H_
+#define _FLASHC_H_
+
+#include <avr32/io.h>
+#include <stddef.h>
+#include "compiler.h"
+
+//! Number of flash regions defined by the FLASHC.
+#define AVR32_FLASHC_REGIONS (AVR32_FLASHC_FLASH_SIZE /\
+ (AVR32_FLASHC_PAGES_PR_REGION * AVR32_FLASHC_PAGE_SIZE))
+
+
+/*! \name Flash Properties
+ */
+//! @{
+
+/*! \brief Gets the size of the whole flash array.
+ *
+ * \return The size of the whole flash array in bytes.
+ */
+extern unsigned int flashc_get_flash_size(void);
+
+/*! \brief Gets the total number of pages in the flash array.
+ *
+ * \return The total number of pages in the flash array.
+ */
+extern unsigned int flashc_get_page_count(void);
+
+/*! \brief Gets the number of pages in each flash region.
+ *
+ * \return The number of pages in each flash region.
+ */
+extern unsigned int flashc_get_page_count_per_region(void);
+
+/*! \brief Gets the region number of a page.
+ *
+ * \param page_number The page number:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: the current page number.
+ *
+ * \return The region number of the specified page.
+ */
+extern unsigned int flashc_get_page_region(int page_number);
+
+/*! \brief Gets the number of the first page of a region.
+ *
+ * \param region The region number: \c 0 to <tt>(AVR32_FLASHC_REGIONS - 1)</tt>.
+ *
+ * \return The number of the first page of the specified region.
+ */
+extern unsigned int flashc_get_region_first_page_number(unsigned int region);
+
+//! @}
+
+
+/*! \name FLASHC Control
+ */
+//! @{
+
+/*! \brief Gets the number of wait states of flash read accesses.
+ *
+ * \return The number of wait states of flash read accesses.
+ */
+extern unsigned int flashc_get_wait_state(void);
+
+/*! \brief Sets the number of wait states of flash read accesses.
+ *
+ * \param wait_state The number of wait states of flash read accesses: \c 0 to
+ * \c 1.
+ */
+extern void flashc_set_wait_state(unsigned int wait_state);
+
+/*! \brief Depending on the CPU frequency, set the wait states of flash read
+ * accesses.
+ *
+ * \param cpu_f_hz The CPU frequency
+ */
+extern void flashc_set_bus_freq(unsigned int cpu_f_hz);
+/*! \brief Alias on the flashc_set_bus_freq() function.
+ *
+ * \param cpu_f_hz The CPU frequency
+ */
+#define flash_set_bus_freq(cpu_f_hz) flashc_set_bus_freq(cpu_f_hz)
+
+/*! \brief Tells whether the Flash Ready interrupt is enabled.
+ *
+ * \return Whether the Flash Ready interrupt is enabled.
+ */
+extern bool flashc_is_ready_int_enabled(void);
+
+/*! \brief Enables or disables the Flash Ready interrupt.
+ *
+ * \param enable Whether to enable the Flash Ready interrupt: \c true or
+ * \c false.
+ */
+extern void flashc_enable_ready_int(bool enable);
+
+/*! \brief Tells whether the Lock Error interrupt is enabled.
+ *
+ * \return Whether the Lock Error interrupt is enabled.
+ */
+extern bool flashc_is_lock_error_int_enabled(void);
+
+/*! \brief Enables or disables the Lock Error interrupt.
+ *
+ * \param enable Whether to enable the Lock Error interrupt: \c true or
+ * \c false.
+ */
+extern void flashc_enable_lock_error_int(bool enable);
+
+/*! \brief Tells whether the Programming Error interrupt is enabled.
+ *
+ * \return Whether the Programming Error interrupt is enabled.
+ */
+extern bool flashc_is_prog_error_int_enabled(void);
+
+/*! \brief Enables or disables the Programming Error interrupt.
+ *
+ * \param enable Whether to enable the Programming Error interrupt: \c true or
+ * \c false.
+ */
+extern void flashc_enable_prog_error_int(bool enable);
+
+//! @}
+
+
+/*! \name FLASHC Status
+ */
+//! @{
+
+/*! \brief Tells whether the FLASHC is ready to run a new command.
+ *
+ * \return Whether the FLASHC is ready to run a new command.
+ */
+extern bool flashc_is_ready(void);
+
+/*! \brief Waits actively until the FLASHC is ready to run a new command.
+ *
+ * This is the default function assigned to \ref flashc_wait_until_ready.
+ */
+extern void flashc_default_wait_until_ready(void);
+
+//! Pointer to the function used by the driver when it needs to wait until the
+//! FLASHC is ready to run a new command.
+//! The default function is \ref flashc_default_wait_until_ready.
+//! The user may change this pointer to use another implementation.
+extern void (*volatile flashc_wait_until_ready)(void);
+
+/*! \brief Tells whether a Lock Error has occurred during the last function
+ * called that issued one or more FLASHC commands.
+ *
+ * \return Whether a Lock Error has occurred during the last function called
+ * that issued one or more FLASHC commands.
+ */
+extern bool flashc_is_lock_error(void);
+
+/*! \brief Tells whether a Programming Error has occurred during the last
+ * function called that issued one or more FLASHC commands.
+ *
+ * \return Whether a Programming Error has occurred during the last function
+ * called that issued one or more FLASHC commands.
+ */
+extern bool flashc_is_programming_error(void);
+
+//! @}
+
+
+/*! \name FLASHC Command Control
+ */
+//! @{
+
+/*! \brief Gets the last issued FLASHC command.
+ *
+ * \return The last issued FLASHC command.
+ */
+extern unsigned int flashc_get_command(void);
+
+/*! \brief Gets the current FLASHC page number.
+ *
+ * \return The current FLASHC page number.
+ */
+extern unsigned int flashc_get_page_number(void);
+
+/*! \brief Issues a FLASHC command.
+ *
+ * \param command The command: \c AVR32_FLASHC_FCMD_CMD_x.
+ * \param page_number The page number to apply the command to:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: use this to apply the command to the current page number
+ * or if the command does not apply to any page number;
+ * \arg this argument may have other meanings according to the command. See
+ * the FLASHC chapter of the MCU datasheet.
+ *
+ * \warning A Lock Error is issued if the command violates the protection
+ * mechanism.
+ *
+ * \warning A Programming Error is issued if the command is invalid.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_issue_command(unsigned int command, int page_number);
+
+//! @}
+
+
+/*! \name FLASHC Global Commands
+ */
+//! @{
+
+/*! \brief Issues a No Operation command to the FLASHC.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_no_operation(void);
+
+/*! \brief Issues an Erase All command to the FLASHC.
+ *
+ * This command erases all bits in the flash array, the general-purpose fuse
+ * bits and the Security bit. The User page is not erased.
+ *
+ * This command also ensures that all volatile memories, such as register file
+ * and RAMs, are erased before the Security bit is erased, i.e. deactivated.
+ *
+ * \warning A Lock Error is issued if at least one region is locked or the
+ * bootloader protection is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ */
+extern void flashc_erase_all(void);
+
+//! @}
+
+
+/*! \name FLASHC Protection Mechanisms
+ */
+//! @{
+
+/*! \brief Tells whether the Security bit is active.
+ *
+ * \return Whether the Security bit is active.
+ */
+extern bool flashc_is_security_bit_active(void);
+
+/*! \brief Activates the Security bit.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_activate_security_bit(void);
+
+/*! \brief Gets the bootloader protected size.
+ *
+ * \return The bootloader protected size in bytes.
+ */
+extern unsigned int flashc_get_bootloader_protected_size(void);
+
+/*! \brief Sets the bootloader protected size.
+ *
+ * \param bootprot_size The wanted bootloader protected size in bytes. If this
+ * size is not supported, the actual size will be the
+ * nearest greater available size or the maximal possible
+ * size if the requested size is too large.
+ *
+ * \return The actual bootloader protected size in bytes.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern unsigned int flashc_set_bootloader_protected_size(unsigned int bootprot_size);
+
+/*! \brief Tells whether external privileged fetch is locked.
+ *
+ * \return Whether external privileged fetch is locked.
+ */
+extern bool flashc_is_external_privileged_fetch_locked(void);
+
+/*! \brief Locks or unlocks external privileged fetch.
+ *
+ * \param lock Whether to lock external privileged fetch: \c true or \c false.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_lock_external_privileged_fetch(bool lock);
+
+/*! \brief Tells whether the region of a page is locked.
+ *
+ * \param page_number The page number:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: the current page number.
+ *
+ * \return Whether the region of the specified page is locked.
+ */
+extern bool flashc_is_page_region_locked(int page_number);
+
+/*! \brief Tells whether a region is locked.
+ *
+ * \param region The region number: \c 0 to <tt>(AVR32_FLASHC_REGIONS - 1)</tt>.
+ *
+ * \return Whether the specified region is locked.
+ */
+extern bool flashc_is_region_locked(unsigned int region);
+
+/*! \brief Locks or unlocks the region of a page.
+ *
+ * \param page_number The page number:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: the current page number.
+ * \param lock Whether to lock the region of the specified page: \c true or
+ * \c false.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_lock_page_region(int page_number, bool lock);
+
+/*! \brief Locks or unlocks a region.
+ *
+ * \param region The region number: \c 0 to <tt>(AVR32_FLASHC_REGIONS - 1)</tt>.
+ * \param lock Whether to lock the specified region: \c true or \c false.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_lock_region(unsigned int region, bool lock);
+
+/*! \brief Locks or unlocks all regions.
+ *
+ * \param lock Whether to lock the regions: \c true or \c false.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_lock_all_regions(bool lock);
+
+//! @}
+
+
+/*! \name Access to General-Purpose Fuses
+ */
+//! @{
+
+/*! \brief Reads a general-purpose fuse bit.
+ *
+ * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63.
+ *
+ * \return The value of the specified general-purpose fuse bit.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern bool flashc_read_gp_fuse_bit(unsigned int gp_fuse_bit);
+
+/*! \brief Reads a general-purpose fuse bit-field.
+ *
+ * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to
+ * \c 63.
+ * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to
+ * \c 64.
+ *
+ * \return The value of the specified general-purpose fuse bit-field.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern U64 flashc_read_gp_fuse_bitfield(unsigned int pos, unsigned int width);
+
+/*! \brief Reads a general-purpose fuse byte.
+ *
+ * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7.
+ *
+ * \return The value of the specified general-purpose fuse byte.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern U8 flashc_read_gp_fuse_byte(unsigned int gp_fuse_byte);
+
+/*! \brief Reads all general-purpose fuses.
+ *
+ * \return The value of all general-purpose fuses as a word.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern U64 flashc_read_all_gp_fuses(void);
+
+/*! \brief Erases a general-purpose fuse bit.
+ *
+ * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63.
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \warning A Lock Error is issued if the Security bit is active and the command
+ * is applied to BOOTPROT or EPFL fuses.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern bool flashc_erase_gp_fuse_bit(unsigned int gp_fuse_bit, bool check);
+
+/*! \brief Erases a general-purpose fuse bit-field.
+ *
+ * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to
+ * \c 63.
+ * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to
+ * \c 64.
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \warning A Lock Error is issued if the Security bit is active and the command
+ * is applied to BOOTPROT or EPFL fuses.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern bool flashc_erase_gp_fuse_bitfield(unsigned int pos, unsigned int width, bool check);
+
+/*! \brief Erases a general-purpose fuse byte.
+ *
+ * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7.
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern bool flashc_erase_gp_fuse_byte(unsigned int gp_fuse_byte, bool check);
+
+/*! \brief Erases all general-purpose fuses.
+ *
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern bool flashc_erase_all_gp_fuses(bool check);
+
+/*! \brief Writes a general-purpose fuse bit.
+ *
+ * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63.
+ * \param value The value of the specified general-purpose fuse bit.
+ *
+ * \warning A Lock Error is issued if the Security bit is active and the command
+ * is applied to BOOTPROT or EPFL fuses.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note A write operation can only clear bits; in other words, an erase operation
+ * must first be done if some bits need to be set to 1.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_write_gp_fuse_bit(unsigned int gp_fuse_bit, bool value);
+
+/*! \brief Writes a general-purpose fuse bit-field.
+ *
+ * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to
+ * \c 63.
+ * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to
+ * \c 64.
+ * \param value The value of the specified general-purpose fuse bit-field.
+ *
+ * \warning A Lock Error is issued if the Security bit is active and the command
+ * is applied to BOOTPROT or EPFL fuses.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note A write operation can only clear bits; in other words, an erase operation
+ * must first be done if some bits need to be set to 1.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_write_gp_fuse_bitfield(unsigned int pos, unsigned int width, U64 value);
+
+/*! \brief Writes a general-purpose fuse byte.
+ *
+ * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7.
+ * \param value The value of the specified general-purpose fuse byte.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note A write operation can only clear bits; in other words, an erase operation
+ * must first be done if some bits need to be set to 1.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_write_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value);
+
+/*! \brief Writes all general-purpose fuses.
+ *
+ * \param value The value of all general-purpose fuses as a word.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note A write operation can only clear bits; in other words, an erase operation
+ * must first be done if some bits need to be set to 1.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_write_all_gp_fuses(U64 value);
+
+/*! \brief Sets a general-purpose fuse bit with the appropriate erase and write
+ * operations.
+ *
+ * \param gp_fuse_bit The general-purpose fuse bit: \c 0 to \c 63.
+ * \param value The value of the specified general-purpose fuse bit.
+ *
+ * \warning A Lock Error is issued if the Security bit is active and the command
+ * is applied to BOOTPROT or EPFL fuses.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_set_gp_fuse_bit(unsigned int gp_fuse_bit, bool value);
+
+/*! \brief Sets a general-purpose fuse bit-field with the appropriate erase and
+ * write operations.
+ *
+ * \param pos The bit-position of the general-purpose fuse bit-field: \c 0 to
+ * \c 63.
+ * \param width The bit-width of the general-purpose fuse bit-field: \c 0 to
+ * \c 64.
+ * \param value The value of the specified general-purpose fuse bit-field.
+ *
+ * \warning A Lock Error is issued if the Security bit is active and the command
+ * is applied to BOOTPROT or EPFL fuses.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_set_gp_fuse_bitfield(unsigned int pos, unsigned int width, U64 value);
+
+/*! \brief Sets a general-purpose fuse byte with the appropriate erase and write
+ * operations.
+ *
+ * \param gp_fuse_byte The general-purpose fuse byte: \c 0 to \c 7.
+ * \param value The value of the specified general-purpose fuse byte.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_set_gp_fuse_byte(unsigned int gp_fuse_byte, U8 value);
+
+/*! \brief Sets all general-purpose fuses with the appropriate erase and write
+ * operations.
+ *
+ * \param value The value of all general-purpose fuses as a word.
+ *
+ * \warning A Lock Error is issued if the Security bit is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note The actual number of general-purpose fuse bits implemented by hardware
+ * is given by \c AVR32_FLASHC_GPF_NUM. The other bits among the 64 are
+ * fixed at 1 by hardware.
+ */
+extern void flashc_set_all_gp_fuses(U64 value);
+
+//! @}
+
+
+/*! \name Access to Flash Pages
+ */
+//! @{
+
+/*! \brief Clears the page buffer.
+ *
+ * This command resets all bits in the page buffer to one. Write accesses to the
+ * page buffer can only change page buffer bits from one to zero.
+ *
+ * \warning The page buffer is not automatically reset after a page write.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern void flashc_clear_page_buffer(void);
+
+/*! \brief Tells whether the page to which the last Quick Page Read or Quick
+ * Page Read User Page command was applied was erased.
+ *
+ * \return Whether the page to which the last Quick Page Read or Quick Page Read
+ * User Page command was applied was erased.
+ */
+extern bool flashc_is_page_erased(void);
+
+/*! \brief Applies the Quick Page Read command to a page.
+ *
+ * \param page_number The page number:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: the current page number.
+ *
+ * \return Whether the specified page is erased.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern bool flashc_quick_page_read(int page_number);
+
+/*! \brief Erases a page.
+ *
+ * \param page_number The page number:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: the current page number.
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \warning A Lock Error is issued if the command is applied to a page belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ */
+extern bool flashc_erase_page(int page_number, bool check);
+
+/*! \brief Erases all pages within the flash array.
+ *
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \warning A Lock Error is issued if at least one region is locked or the
+ * bootloader protection is active.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ */
+extern bool flashc_erase_all_pages(bool check);
+
+/*! \brief Writes a page from the page buffer.
+ *
+ * \param page_number The page number:
+ * \arg \c 0 to <tt>(flashc_get_page_count() - 1)</tt>: a page number within
+ * the flash array;
+ * \arg <tt>< 0</tt>: the current page number.
+ *
+ * \warning A Lock Error is issued if the command is applied to a page belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \warning The page buffer is not automatically reset after a page write.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note A write operation can only clear bits; in other words, an erase operation
+ * must first be done if some bits need to be set to 1.
+ */
+extern void flashc_write_page(int page_number);
+
+/*! \brief Issues a Quick Page Read User Page command to the FLASHC.
+ *
+ * \return Whether the User page is erased.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern bool flashc_quick_user_page_read(void);
+
+/*! \brief Erases the User page.
+ *
+ * \param check Whether to check erase: \c true or \c false.
+ *
+ * \return Whether the erase succeeded or always \c true if erase check was not
+ * requested.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note An erase operation can only set bits.
+ */
+extern bool flashc_erase_user_page(bool check);
+
+/*! \brief Writes the User page from the page buffer.
+ *
+ * \warning The page buffer is not automatically reset after a page write.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ *
+ * \note A write operation can only clear bits; in other words, an erase operation
+ * must first be done if some bits need to be set to 1.
+ */
+extern void flashc_write_user_page(void);
+
+/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
+ * from the repeated \a src source byte.
+ *
+ * The destination areas that are not within the flash array or the User page
+ * are ignored.
+ *
+ * All pointer and size alignments are supported.
+ *
+ * \param dst Pointer to flash destination.
+ * \param src Source byte.
+ * \param nbytes Number of bytes to set.
+ * \param erase Whether to erase before writing: \c true or \c false.
+ *
+ * \return The value of \a dst.
+ *
+ * \warning This function may be called with \a erase set to \c false only if
+ * the destination consists only of erased words, i.e. this function
+ * can not be used to write only one bit of a previously written word.
+ * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
+ * resulting value in flash may be different from \c 0x00000000.
+ *
+ * \warning A Lock Error is issued if the command is applied to pages belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern volatile void *flashc_memset8(volatile void *dst, U8 src, size_t nbytes, bool erase);
+
+/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
+ * from the repeated \a src big-endian source half-word.
+ *
+ * The destination areas that are not within the flash array or the User page
+ * are ignored.
+ *
+ * All pointer and size alignments are supported.
+ *
+ * \param dst Pointer to flash destination.
+ * \param src Source half-word.
+ * \param nbytes Number of bytes to set.
+ * \param erase Whether to erase before writing: \c true or \c false.
+ *
+ * \return The value of \a dst.
+ *
+ * \warning This function may be called with \a erase set to \c false only if
+ * the destination consists only of erased words, i.e. this function
+ * can not be used to write only one bit of a previously written word.
+ * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
+ * resulting value in flash may be different from \c 0x00000000.
+ *
+ * \warning A Lock Error is issued if the command is applied to pages belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern volatile void *flashc_memset16(volatile void *dst, U16 src, size_t nbytes, bool erase);
+
+/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
+ * from the repeated \a src big-endian source word.
+ *
+ * The destination areas that are not within the flash array or the User page
+ * are ignored.
+ *
+ * All pointer and size alignments are supported.
+ *
+ * \param dst Pointer to flash destination.
+ * \param src Source word.
+ * \param nbytes Number of bytes to set.
+ * \param erase Whether to erase before writing: \c true or \c false.
+ *
+ * \return The value of \a dst.
+ *
+ * \warning This function may be called with \a erase set to \c false only if
+ * the destination consists only of erased words, i.e. this function
+ * can not be used to write only one bit of a previously written word.
+ * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
+ * resulting value in flash may be different from \c 0x00000000.
+ *
+ * \warning A Lock Error is issued if the command is applied to pages belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern volatile void *flashc_memset32(volatile void *dst, U32 src, size_t nbytes, bool erase);
+
+/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
+ * from the repeated \a src big-endian source double-word.
+ *
+ * The destination areas that are not within the flash array or the User page
+ * are ignored.
+ *
+ * All pointer and size alignments are supported.
+ *
+ * \param dst Pointer to flash destination.
+ * \param src Source double-word.
+ * \param nbytes Number of bytes to set.
+ * \param erase Whether to erase before writing: \c true or \c false.
+ *
+ * \return The value of \a dst.
+ *
+ * \warning This function may be called with \a erase set to \c false only if
+ * the destination consists only of erased words, i.e. this function
+ * can not be used to write only one bit of a previously written word.
+ * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
+ * resulting value in flash may be different from \c 0x00000000.
+ *
+ * \warning A Lock Error is issued if the command is applied to pages belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern volatile void *flashc_memset64(volatile void *dst, U64 src, size_t nbytes, bool erase);
+
+/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
+ * from the repeated \a src big-endian source pattern.
+ *
+ * The destination areas that are not within the flash array or the User page
+ * are ignored.
+ *
+ * All pointer and size alignments are supported.
+ *
+ * \param dst Pointer to flash destination.
+ * \param src Source double-word.
+ * \param src_width \a src width in bits: 8, 16, 32 or 64.
+ * \param nbytes Number of bytes to set.
+ * \param erase Whether to erase before writing: \c true or \c false.
+ *
+ * \return The value of \a dst.
+ *
+ * \warning This function may be called with \a erase set to \c false only if
+ * the destination consists only of erased words, i.e. this function
+ * can not be used to write only one bit of a previously written word.
+ * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
+ * resulting value in flash may be different from \c 0x00000000.
+ *
+ * \warning A Lock Error is issued if the command is applied to pages belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+#define flashc_memset(dst, src, src_width, nbytes, erase) \
+ TPASTE2(flashc_memset, src_width)((dst), (src), (nbytes), (erase))
+
+/*! \brief Copies \a nbytes bytes to the flash destination pointed to by \a dst
+ * from the source pointed to by \a src.
+ *
+ * The destination areas that are not within the flash array or the User page
+ * are ignored.
+ *
+ * All pointer and size alignments are supported.
+ *
+ * \param dst Pointer to flash destination.
+ * \param src Pointer to source data.
+ * \param nbytes Number of bytes to copy.
+ * \param erase Whether to erase before writing: \c true or \c false.
+ *
+ * \return The value of \a dst.
+ *
+ * \warning If copying takes place between areas that overlap, the behavior is
+ * undefined.
+ *
+ * \warning This function may be called with \a erase set to \c false only if
+ * the destination consists only of erased words, i.e. this function
+ * can not be used to write only one bit of a previously written word.
+ * E.g., if \c 0x00000001 then \c 0xFFFFFFFE are written to a word, the
+ * resulting value in flash may be different from \c 0x00000000.
+ *
+ * \warning A Lock Error is issued if the command is applied to pages belonging
+ * to a locked region or to the bootloader protected area.
+ *
+ * \note The FLASHC error status returned by \ref flashc_is_lock_error and
+ * \ref flashc_is_programming_error is updated.
+ */
+extern volatile void *flashc_memcpy(volatile void *dst, const void *src, size_t nbytes, bool erase);
+
+#if UC3C
+
+/*! \brief Depednding to the CPU frequency, set the wait states of flash read
+ * accesses and enable or disable the High speed read mode.
+ *
+ * \param cpu_f_hz The CPU frequency
+ */
+void flashc_set_flash_waitstate_and_readmode(unsigned long cpu_f_hz);
+#endif // UC3C device-specific implementation
+
+//! @}
+
+
+#endif // _FLASHC_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.c
new file mode 100644
index 0000000..6b30ef0
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.c
@@ -0,0 +1,649 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief GPIO software driver interface for AVR UC3.
+ *
+ * - Compiler: GCC and IAR for AVR
+ * - Supported devices: All AVR UC3 devices with a GPIO module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2010 - 2011 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include "gpio.h"
+
+//! GPIO module instance.
+#define GPIO AVR32_GPIO
+
+
+/*! \name Peripheral Bus Interface
+ */
+//! @{
+
+
+int gpio_enable_module(const gpio_map_t gpiomap, uint32_t size)
+{
+ int status = GPIO_SUCCESS;
+ uint32_t i;
+
+ for (i = 0; i < size; i++)
+ {
+ status |= gpio_enable_module_pin(gpiomap->pin, gpiomap->function);
+ gpiomap++;
+ }
+
+ return status;
+}
+
+
+int gpio_enable_module_pin(uint32_t pin, uint32_t function)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ // Enable the correct function.
+ switch (function)
+ {
+ case 0: // A function.
+ gpio_port->pmr0c = 1 << (pin & 0x1F);
+ gpio_port->pmr1c = 1 << (pin & 0x1F);
+#if (AVR32_GPIO_H_VERSION >= 210)
+ gpio_port->pmr2c = 1 << (pin & 0x1F);
+#endif
+ break;
+
+ case 1: // B function.
+ gpio_port->pmr0s = 1 << (pin & 0x1F);
+ gpio_port->pmr1c = 1 << (pin & 0x1F);
+#if (AVR32_GPIO_H_VERSION >= 210)
+ gpio_port->pmr2c = 1 << (pin & 0x1F);
+#endif
+ break;
+
+ case 2: // C function.
+ gpio_port->pmr0c = 1 << (pin & 0x1F);
+ gpio_port->pmr1s = 1 << (pin & 0x1F);
+#if (AVR32_GPIO_H_VERSION >= 210)
+ gpio_port->pmr2c = 1 << (pin & 0x1F);
+#endif
+ break;
+
+ case 3: // D function.
+ gpio_port->pmr0s = 1 << (pin & 0x1F);
+ gpio_port->pmr1s = 1 << (pin & 0x1F);
+#if (AVR32_GPIO_H_VERSION >= 210)
+ gpio_port->pmr2c = 1 << (pin & 0x1F);
+#endif
+ break;
+
+#if (AVR32_GPIO_H_VERSION >= 210)
+ case 4: // E function.
+ gpio_port->pmr0c = 1 << (pin & 0x1F);
+ gpio_port->pmr1c = 1 << (pin & 0x1F);
+ gpio_port->pmr2s = 1 << (pin & 0x1F);
+ break;
+
+ case 5: // F function.
+ gpio_port->pmr0s = 1 << (pin & 0x1F);
+ gpio_port->pmr1c = 1 << (pin & 0x1F);
+ gpio_port->pmr2s = 1 << (pin & 0x1F);
+ break;
+
+ case 6: // G function.
+ gpio_port->pmr0c = 1 << (pin & 0x1F);
+ gpio_port->pmr1s = 1 << (pin & 0x1F);
+ gpio_port->pmr2s = 1 << (pin & 0x1F);
+ break;
+
+ case 7: // H function.
+ gpio_port->pmr0s = 1 << (pin & 0x1F);
+ gpio_port->pmr1s = 1 << (pin & 0x1F);
+ gpio_port->pmr2s = 1 << (pin & 0x1F);
+ break;
+#endif
+
+ default:
+ return GPIO_INVALID_ARGUMENT;
+ }
+
+ // Disable GPIO control.
+ gpio_port->gperc = 1 << (pin & 0x1F);
+
+ return GPIO_SUCCESS;
+}
+
+
+void gpio_enable_gpio(const gpio_map_t gpiomap, uint32_t size)
+{
+ uint32_t i;
+
+ for (i = 0; i < size; i++)
+ {
+ gpio_enable_gpio_pin(gpiomap->pin);
+ gpiomap++;
+ }
+}
+
+
+void gpio_enable_gpio_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->oderc = 1 << (pin & 0x1F);
+ gpio_port->gpers = 1 << (pin & 0x1F);
+}
+
+
+// The open-drain mode is not synthesized on the current AVR32 products.
+// If one day some AVR32 products have this feature, the corresponding part
+// numbers should be listed in the #if below.
+// Note that other functions are available in this driver to use pins with open
+// drain in GPIO mode. The advantage of the open-drain mode functions over these
+// other functions is that they can be used not only in GPIO mode but also in
+// module mode.
+#if 0
+
+
+void gpio_enable_pin_open_drain(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->odmers = 1 << (pin & 0x1F);
+}
+
+
+void gpio_disable_pin_open_drain(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->odmerc = 1 << (pin & 0x1F);
+}
+
+
+#endif
+
+
+void gpio_enable_pin_pull_up(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->puers = 1 << (pin & 0x1F);
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ gpio_port->pderc = 1 << (pin & 0x1F);
+#endif
+}
+
+
+void gpio_disable_pin_pull_up(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->puerc = 1 << (pin & 0x1F);
+}
+
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+// Added support of Pull-up Resistor, Pull-down Resistor and Buskeeper Control.
+
+/*! \brief Enables the pull-down resistor of a pin.
+ *
+ * \param pin The pin number.
+ */
+void gpio_enable_pin_pull_down(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->puerc = 1 << (pin & 0x1F);
+ gpio_port->pders = 1 << (pin & 0x1F);
+}
+
+/*! \brief Disables the pull-down resistor of a pin.
+ *
+ * \param pin The pin number.
+ */
+void gpio_disable_pin_pull_down(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->pderc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Enables the buskeeper functionality on a pin.
+ *
+ * \param pin The pin number.
+ */
+void gpio_enable_pin_buskeeper(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->puers = 1 << (pin & 0x1F);
+ gpio_port->pders = 1 << (pin & 0x1F);
+}
+
+/*! \brief Disables the buskeeper functionality on a pin.
+ *
+ * \param pin The pin number.
+ */
+void gpio_disable_pin_buskeeper(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->puerc = 1 << (pin & 0x1F);
+ gpio_port->pderc = 1 << (pin & 0x1F);
+}
+
+#endif
+
+void gpio_configure_pin(uint32_t pin, uint32_t flags)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ /* Both pull-up and pull-down set means buskeeper */
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ if (flags & GPIO_PULL_DOWN)
+ gpio_port->pders = 1 << (pin & 0x1F);
+ else
+ gpio_port->pderc = 1 << (pin & 0x1F);
+#endif
+ if (flags & GPIO_PULL_UP)
+ gpio_port->puers = 1 << (pin & 0x1F);
+ else
+ gpio_port->puerc = 1 << (pin & 0x1F);
+
+ /* Enable open-drain mode if requested */
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ if (flags & GPIO_OPEN_DRAIN)
+ gpio_port->odmers = 1 << (pin & 0x1F);
+ else
+ gpio_port->odmerc = 1 << (pin & 0x1F);
+
+ if (flags & GPIO_OPEN_DRAIN)
+ gpio_port->pders = 1 << (pin & 0x1F);
+ else
+ gpio_port->pderc = 1 << (pin & 0x1F);
+#endif
+
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ /* Select drive strength */
+ if (flags & GPIO_DRIVE_LOW)
+ gpio_port->odcr0s = 1 << (pin & 0x1F);
+ else
+ gpio_port->odcr0c = 1 << (pin & 0x1F);
+ if (flags & GPIO_DRIVE_HIGH)
+ gpio_port->odcr1s = 1 << (pin & 0x1F);
+ else
+ gpio_port->odcr1c = 1 << (pin & 0x1F);
+#endif
+
+ /* Select interrupt level for group */
+ if (flags & GPIO_INTERRUPT) {
+ if (flags & GPIO_BOTHEDGES)
+ {
+ gpio_port->imr0c = 1 << (pin & 0x1F);
+ gpio_port->imr1c = 1 << (pin & 0x1F);
+ }
+ else if (flags & GPIO_RISING)
+ {
+ gpio_port->imr0s = 1 << (pin & 0x1F);
+ gpio_port->imr1c = 1 << (pin & 0x1F);
+ }
+ else if (flags & GPIO_FALLING)
+ {
+ gpio_port->imr0c = 1 << (pin & 0x1F);
+ gpio_port->imr1s = 1 << (pin & 0x1F);
+ }
+ }
+
+ /* Select direction and initial pin state */
+ if (flags & GPIO_DIR_OUTPUT) {
+ if (flags & GPIO_INIT_HIGH)
+ gpio_port->ovrs = 1 << (pin & 0x1F);
+ else
+ gpio_port->ovrc = 1 << (pin & 0x1F);
+ gpio_port->oders = 1 << (pin & 0x1F);
+ } else {
+ gpio_port->oderc = 1 << (pin & 0x1F);
+ }
+
+ /* Enable GPIO */
+ gpio_port->gpers = 1 << (pin & 0x1F);
+}
+
+void gpio_configure_group(uint32_t port, uint32_t mask, uint32_t flags)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[port];
+
+ /* Both pull-up and pull-down set means buskeeper */
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ if (flags & GPIO_PULL_DOWN)
+ gpio_port->pders = mask;
+ else
+ gpio_port->pderc = mask;
+#endif
+ if (flags & GPIO_PULL_UP)
+ gpio_port->puers = mask;
+ else
+ gpio_port->puerc = mask;
+
+ /* Enable open-drain mode if requested */
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ if (flags & GPIO_OPEN_DRAIN)
+ gpio_port->odmers = mask;
+ else
+ gpio_port->odmerc = mask;
+
+ if (flags & GPIO_OPEN_DRAIN)
+ gpio_port->pders = mask;
+ else
+ gpio_port->pderc = mask;
+#endif
+
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+ /* Select drive strength */
+ if (flags & GPIO_DRIVE_LOW)
+ gpio_port->odcr0s = mask;
+ else
+ gpio_port->odcr0c = mask;
+ if (flags & GPIO_DRIVE_HIGH)
+ gpio_port->odcr1s = mask;
+ else
+ gpio_port->odcr1c = mask;
+#endif
+
+ /* Select interrupt level for group */
+ if (flags & GPIO_INTERRUPT) {
+ if (flags & GPIO_BOTHEDGES)
+ {
+ gpio_port->imr0c = mask;
+ gpio_port->imr1c = mask;
+ }
+ else if (flags & GPIO_RISING)
+ {
+ gpio_port->imr0s = mask;
+ gpio_port->imr1c = mask;
+ }
+ else if (flags & GPIO_FALLING)
+ {
+ gpio_port->imr0c = mask;
+ gpio_port->imr1s = mask;
+ }
+ }
+
+ /* Select direction and initial pin state */
+ if (flags & GPIO_DIR_OUTPUT) {
+ if (flags & GPIO_INIT_HIGH)
+ gpio_port->ovrs = mask;
+ else
+ gpio_port->ovrc = mask;
+ gpio_port->oders = mask;
+ } else {
+ gpio_port->oderc = mask;
+ }
+
+ /* Enable GPIO */
+ gpio_port->gpers = mask;
+}
+
+int gpio_get_pin_value(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ return (gpio_port->pvr >> (pin & 0x1F)) & 1;
+}
+
+
+int gpio_get_gpio_pin_output_value(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ return (gpio_port->ovr >> (pin & 0x1F)) & 1;
+}
+
+
+int gpio_get_gpio_open_drain_pin_output_value(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ return ((gpio_port->oder >> (pin & 0x1F)) & 1) ^ 1;
+}
+
+
+void gpio_set_gpio_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ovrs = 1 << (pin & 0x1F); // Value to be driven on the I/O line: 1.
+ gpio_port->oders = 1 << (pin & 0x1F); // The GPIO output driver is enabled for that pin.
+ gpio_port->gpers = 1 << (pin & 0x1F); // The GPIO module controls that pin.
+}
+
+void gpio_set_pin_high(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ovrs = 1 << (pin & 0x1F); // Value to be driven on the I/O line: 1.
+}
+
+void gpio_set_group_high(uint32_t port, uint32_t mask)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[port];
+ gpio_port->ovrs = mask; // Value to be driven on the I/O group: 1.
+}
+
+
+void gpio_set_pin_low(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ovrc = 1 << (pin & 0x1F); // Value to be driven on the I/O line: 0.
+}
+
+void gpio_clr_gpio_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ovrc = 1 << (pin & 0x1F); // Value to be driven on the I/O line: 0.
+ gpio_port->oders = 1 << (pin & 0x1F); // The GPIO output driver is enabled for that pin.
+ gpio_port->gpers = 1 << (pin & 0x1F); // The GPIO module controls that pin.
+}
+
+void gpio_set_group_low(uint32_t port, uint32_t mask)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[port];
+ gpio_port->ovrc = mask; // Value to be driven on the I/O group: 0.
+}
+
+void gpio_tgl_gpio_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ovrt = 1 << (pin & 0x1F); // Toggle the I/O line.
+ gpio_port->oders = 1 << (pin & 0x1F); // The GPIO output driver is enabled for that pin.
+ gpio_port->gpers = 1 << (pin & 0x1F); // The GPIO module controls that pin.
+}
+
+void gpio_toggle_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ovrt = 1 << (pin & 0x1F); // Toggle the I/O line.
+}
+
+void gpio_toggle_group(uint32_t port, uint32_t mask)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[port];
+ gpio_port->ovrt = mask; // Toggle the I/O port.
+}
+
+void gpio_set_gpio_open_drain_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ gpio_port->oderc = 1 << (pin & 0x1F); // The GPIO output driver is disabled for that pin.
+ gpio_port->gpers = 1 << (pin & 0x1F); // The GPIO module controls that pin.
+}
+
+
+void gpio_clr_gpio_open_drain_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ gpio_port->ovrc = 1 << (pin & 0x1F); // Value to be driven on the I/O line: 0.
+ gpio_port->oders = 1 << (pin & 0x1F); // The GPIO output driver is enabled for that pin.
+ gpio_port->gpers = 1 << (pin & 0x1F); // The GPIO module controls that pin.
+}
+
+
+void gpio_tgl_gpio_open_drain_pin(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ gpio_port->ovrc = 1 << (pin & 0x1F); // Value to be driven on the I/O line if the GPIO output driver is enabled: 0.
+ gpio_port->odert = 1 << (pin & 0x1F); // The GPIO output driver is toggled for that pin.
+ gpio_port->gpers = 1 << (pin & 0x1F); // The GPIO module controls that pin.
+}
+
+
+void gpio_enable_pin_glitch_filter(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->gfers = 1 << (pin & 0x1F);
+}
+
+
+void gpio_disable_pin_glitch_filter(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->gferc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Configure the edge detector of an input pin
+ *
+ * \param pin The pin number.
+ * \param mode The edge detection mode (\ref GPIO_PIN_CHANGE, \ref GPIO_RISING_EDGE
+ * or \ref GPIO_FALLING_EDGE).
+ *
+ * \return \ref GPIO_SUCCESS or \ref GPIO_INVALID_ARGUMENT.
+ */
+static int gpio_configure_edge_detector(uint32_t pin, uint32_t mode)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ // Configure the edge detector.
+ switch (mode)
+ {
+ case GPIO_PIN_CHANGE:
+ gpio_port->imr0c = 1 << (pin & 0x1F);
+ gpio_port->imr1c = 1 << (pin & 0x1F);
+ break;
+
+ case GPIO_RISING_EDGE:
+ gpio_port->imr0s = 1 << (pin & 0x1F);
+ gpio_port->imr1c = 1 << (pin & 0x1F);
+ break;
+
+ case GPIO_FALLING_EDGE:
+ gpio_port->imr0c = 1 << (pin & 0x1F);
+ gpio_port->imr1s = 1 << (pin & 0x1F);
+ break;
+
+ default:
+ return GPIO_INVALID_ARGUMENT;
+ }
+
+ return GPIO_SUCCESS;
+}
+
+
+int gpio_enable_pin_interrupt(uint32_t pin, uint32_t mode)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ // Enable the glitch filter.
+ gpio_port->gfers = 1 << (pin & 0x1F);
+
+ // Configure the edge detector.
+ if(GPIO_INVALID_ARGUMENT == gpio_configure_edge_detector(pin, mode))
+ return(GPIO_INVALID_ARGUMENT);
+
+ // Enable interrupt.
+ gpio_port->iers = 1 << (pin & 0x1F);
+
+ return GPIO_SUCCESS;
+}
+
+
+void gpio_disable_pin_interrupt(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ gpio_port->ierc = 1 << (pin & 0x1F);
+}
+
+
+int gpio_get_pin_interrupt_flag(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+ return (gpio_port->ifr >> (pin & 0x1F)) & 1;
+}
+
+
+void gpio_clear_pin_interrupt_flag(uint32_t pin)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+#if (AVR32_GPIO_H_VERSION == 211)
+ // Save interrupt enable register.
+ uint32_t const gpio_ier = gpio_port->ier;
+
+ // Disable interrupt.
+ gpio_port->ierc = 1 << (pin & 0x1F);
+
+ // Clear pin interrupt.
+ gpio_port->ifrc = 1 << (pin & 0x1F);
+
+ // Restore interrupt enable register.
+ gpio_port->ier = gpio_ier;
+#else
+ gpio_port->ifrc = 1 << (pin & 0x1F);
+#endif
+}
+
+
+//#
+//# Peripheral Event System Support.
+//#
+#if UC3L
+int gpio_configure_pin_periph_event_mode(uint32_t pin, uint32_t mode, uint32_t use_igf)
+{
+ volatile avr32_gpio_port_t *gpio_port = &GPIO.port[pin >> 5];
+
+ if(true == use_igf)
+ {
+ // Enable the glitch filter.
+ gpio_port->gfers = 1 << (pin & 0x1F);
+ }
+ else
+ {
+ // Disable the glitch filter.
+ gpio_port->gferc = 1 << (pin & 0x1F);
+ }
+
+ // Configure the edge detector.
+ return(gpio_configure_edge_detector(pin, mode));
+}
+
+#endif
+
+//! @}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.h
new file mode 100644
index 0000000..ad4ca0f
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/gpio/gpio.h
@@ -0,0 +1,680 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief GPIO software driver interface for AVR UC3.
+ *
+ * - Compiler: GCC and IAR for AVR
+ * - Supported devices: All AVR UC3 devices with a GPIO module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2010 - 2011 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _GPIO_H_
+#define _GPIO_H_
+
+#include <avr32/io.h>
+#include "compiler.h"
+
+/*! \name Return Values of the GPIO API
+ */
+//! @{
+#define GPIO_SUCCESS 0 //!< Function successfully completed.
+#define GPIO_INVALID_ARGUMENT 1 //!< Input parameters are out of range.
+//! @}
+
+
+/*! \name Interrupt Trigger Modes
+ */
+//! @{
+#define GPIO_PIN_CHANGE 0 //!< Interrupt triggered upon pin change.
+#define GPIO_RISING_EDGE 1 //!< Interrupt triggered upon rising edge.
+#define GPIO_FALLING_EDGE 2 //!< Interrupt triggered upon falling edge.
+//! @}
+
+/*! \name Common defines for GPIO_FLAGS parameter
+ */
+//! @{
+#define GPIO_DIR_INPUT (0 << 0) //!< Pin is Input
+#define GPIO_DIR_OUTPUT (1 << 0) //!< Pin is Output
+#define GPIO_INIT_LOW (0 << 1) //!< Initial Ouptput State is Low
+#define GPIO_INIT_HIGH (1 << 1) //!< Initial Ouptput State is High
+#define GPIO_PULL_UP (1 << 2) //!< Pull-Up (when input)
+#define GPIO_PULL_DOWN (2 << 2) //!< Pull-Down (when input)
+#define GPIO_BUSKEEPER (3 << 2) //!< Bus Keeper
+#define GPIO_DRIVE_MIN (0 << 4) //!< Drive Min Configuration
+#define GPIO_DRIVE_LOW (1 << 4) //!< Drive Low Configuration
+#define GPIO_DRIVE_HIGH (2 << 4) //!< Drive High Configuration
+#define GPIO_DRIVE_MAX (3 << 4) //!< Drive Max Configuration
+#define GPIO_OPEN_DRAIN (1 << 6) //!< Open-Drain (when output)
+#define GPIO_INTERRUPT (1 << 7) //!< Enable Pin/Group Interrupt
+#define GPIO_BOTHEDGES (3 << 7) //!< Sense Both Edges
+#define GPIO_RISING (5 << 7) //!< Sense Risign Edge
+#define GPIO_FALLING (7 << 7) //!< Sense Falling Edge
+//! @}
+
+//! A type definition of pins and modules connectivity.
+typedef struct
+{
+ unsigned char pin; //!< Module pin.
+ unsigned char function; //!< Module function.
+} gpio_map_t[];
+
+
+/*! \name Peripheral Bus Interface
+ *
+ * Low-speed interface with a non-deterministic number of clock cycles per
+ * access.
+ *
+ * This interface operates with lower clock frequencies (fPB <= fCPU), and its
+ * timing is not deterministic since it needs to access a shared bus which may
+ * be heavily loaded.
+ *
+ * \note This interface is immediately available without initialization.
+ */
+//! @{
+
+/*! \brief Enables specific module modes for a set of pins.
+ *
+ * \param gpiomap The pin map.
+ * \param size The number of pins in \a gpiomap.
+ *
+ * \return \ref GPIO_SUCCESS or \ref GPIO_INVALID_ARGUMENT.
+ */
+extern int gpio_enable_module(const gpio_map_t gpiomap, uint32_t size);
+
+/*! \brief Enables a specific module mode for a pin.
+ *
+ * \param pin The pin number.\n
+ * Refer to the product header file `uc3x.h' (where x is the part
+ * number; e.g. x = a0512) for module pins. E.g., to enable a PWM
+ * channel output, the pin number can be AVR32_PWM_3_PIN for PWM
+ * channel 3.
+ * \param function The pin function.\n
+ * Refer to the product header file `uc3x.h' (where x is the
+ * part number; e.g. x = a0512) for module pin functions. E.g.,
+ * to enable a PWM channel output, the pin function can be
+ * AVR32_PWM_3_FUNCTION for PWM channel 3.
+ *
+ * \return \ref GPIO_SUCCESS or \ref GPIO_INVALID_ARGUMENT.
+ */
+extern int gpio_enable_module_pin(uint32_t pin, uint32_t function);
+
+/*! \brief Enables the GPIO mode of a set of pins.
+ *
+ * \param gpiomap The pin map.
+ * \param size The number of pins in \a gpiomap.
+ */
+extern void gpio_enable_gpio(const gpio_map_t gpiomap, uint32_t size);
+
+/*! \brief Enables the GPIO mode of a pin.
+ *
+ * \param pin The pin number.\n
+ * Refer to the product header file `uc3x.h' (where x is the part
+ * number; e.g. x = a0512) for pin definitions. E.g., to enable the
+ * GPIO mode of PX21, AVR32_PIN_PX21 can be used. Module pins such as
+ * AVR32_PWM_3_PIN for PWM channel 3 can also be used to release
+ * module pins for GPIO.
+ */
+extern void gpio_enable_gpio_pin(uint32_t pin);
+
+// The open-drain mode is not synthesized on the current AVR32 products.
+// If one day some AVR32 products have this feature, the corresponding part
+// numbers should be listed in the #if below.
+// Note that other functions are available in this driver to use pins with open
+// drain in GPIO mode. The advantage of the open-drain mode functions over these
+// other functions is that they can be used not only in GPIO mode but also in
+// module mode.
+#if 0
+
+/*! \brief Enables the open-drain mode of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_enable_pin_open_drain(uint32_t pin);
+
+/*! \brief Disables the open-drain mode of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_disable_pin_open_drain(uint32_t pin);
+
+#endif
+
+/*! \brief Enables the pull-up resistor of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_enable_pin_pull_up(uint32_t pin);
+
+/*! \brief Disables the pull-up resistor of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_disable_pin_pull_up(uint32_t pin);
+
+#if defined(AVR32_GPIO_200_H_INCLUDED) || defined(AVR32_GPIO_210_H_INCLUDED) || defined(AVR32_GPIO_212_H_INCLUDED)
+// Added support of Pull-up Resistor, Pull-down Resistor and Buskeeper Control.
+
+/*! \brief Enables the pull-down resistor of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_enable_pin_pull_down(uint32_t pin);
+
+/*! \brief Disables the pull-down resistor of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_disable_pin_pull_down(uint32_t pin);
+
+/*! \brief Enables the buskeeper functionality on a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_enable_pin_buskeeper(uint32_t pin);
+
+/*! \brief Disables the buskeeper functionality on a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_disable_pin_buskeeper(uint32_t pin);
+
+#endif
+
+/*! \brief Configuration functionality on a pin.
+ *
+ * \param pin The pin number.
+ * \param flags The configuration.
+ */
+extern void gpio_configure_pin(uint32_t pin, uint32_t flags);
+
+/*! \brief Configuration functionality on a port.
+ *
+ * \param port The port number.
+ * \param mask The mask.
+ * \param flags The configuration.
+ */
+extern void gpio_configure_group(uint32_t port, uint32_t mask, uint32_t flags);
+
+/*! \brief Returns the value of a pin.
+ *
+ * \param pin The pin number.
+ *
+ * \return The pin value.
+ */
+extern int gpio_get_pin_value(uint32_t pin);
+
+/*!
+ * \brief Check if the pin is in low logical level.
+ *
+ * \param pin The pin number.
+ * \return bool 1 if the pin is in low logical level
+ * 0 if the pin is not in low logical level
+ */
+ #define gpio_pin_is_low(pin)\
+ (gpio_get_pin_value(pin)?0:1)
+
+/*!
+ * \brief Check if the pin is in high logical level.
+ *
+ * \param pin The pin number.
+ * \return bool 1 if the pin is in high logical level
+ * 0 if the pin is not in high logical level
+ */
+#define gpio_pin_is_high(pin) \
+ (gpio_get_pin_value(pin)?1:0)
+
+/*! \brief Returns the output value set for a GPIO pin.
+ *
+ * \param pin The pin number.
+ *
+ * \return The pin output value.
+ *
+ * \note This function must be used in conjunction with \ref gpio_set_gpio_pin,
+ * \ref gpio_clr_gpio_pin and \ref gpio_tgl_gpio_pin.
+ */
+extern int gpio_get_gpio_pin_output_value(uint32_t pin);
+
+/*! \brief Returns the output value set for a GPIO pin using open drain.
+ *
+ * \param pin The pin number.
+ *
+ * \return The pin output value.
+ *
+ * \note This function must be used in conjunction with
+ * \ref gpio_set_gpio_open_drain_pin, \ref gpio_clr_gpio_open_drain_pin
+ * and \ref gpio_tgl_gpio_open_drain_pin.
+ */
+extern int gpio_get_gpio_open_drain_pin_output_value(uint32_t pin);
+
+/*! \brief Drives a GPIO pin to 1.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_set_gpio_pin(uint32_t pin);
+
+/*! \brief Drives a GPIO pin to 1.
+ *
+ * \param pin The pin number.
+ *
+ * \note The function \ref gpio_configure_pin must be called before.
+ */
+extern void gpio_set_pin_high(uint32_t pin);
+
+
+/*! \brief Drives a GPIO port to 1.
+ *
+ * \param port The port number.
+ * \param mask The mask.
+ */
+extern void gpio_set_group_high(uint32_t port, uint32_t mask);
+
+/*! \brief Drives a GPIO pin to 0.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_clr_gpio_pin(uint32_t pin);
+
+/*! \brief Drives a GPIO pin to 0.
+ *
+ * \param pin The pin number.
+ *
+ * \note The function \ref gpio_configure_pin must be called before.
+ */
+extern void gpio_set_pin_low(uint32_t pin);
+
+/*! \brief Drives a GPIO port to 0.
+ *
+ * \param port The port number.
+ * \param mask The mask.
+ */
+extern void gpio_set_group_low(uint32_t port, uint32_t mask);
+
+/*! \brief Toggles a GPIO pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_tgl_gpio_pin(uint32_t pin);
+
+/*! \brief Toggles a GPIO pin.
+ *
+ * \param pin The pin number.
+ *
+ * \note The function \ref gpio_configure_pin must be called before.
+ */
+extern void gpio_toggle_pin(uint32_t pin);
+
+/*! \brief Toggles a GPIO group.
+ *
+ * \param port The port number.
+ * \param mask The mask.
+ */
+extern void gpio_toggle_group(uint32_t port, uint32_t mask);
+
+/*! \brief Drives a GPIO pin to 1 using open drain.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_set_gpio_open_drain_pin(uint32_t pin);
+
+/*! \brief Drives a GPIO pin to 0 using open drain.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_clr_gpio_open_drain_pin(uint32_t pin);
+
+/*! \brief Toggles a GPIO pin using open drain.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_tgl_gpio_open_drain_pin(uint32_t pin);
+
+/*! \brief Enables the glitch filter of a pin.
+ *
+ * When the glitch filter is enabled, a glitch with duration of less than 1
+ * clock cycle is automatically rejected, while a pulse with duration of 2 clock
+ * cycles or more is accepted. For pulse durations between 1 clock cycle and 2
+ * clock cycles, the pulse may or may not be taken into account, depending on
+ * the precise timing of its occurrence. Thus for a pulse to be guaranteed
+ * visible it must exceed 2 clock cycles, whereas for a glitch to be reliably
+ * filtered out, its duration must not exceed 1 clock cycle. The filter
+ * introduces 2 clock cycles latency.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_enable_pin_glitch_filter(uint32_t pin);
+
+/*! \brief Disables the glitch filter of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_disable_pin_glitch_filter(uint32_t pin);
+
+/*! \brief Enables the interrupt of a pin with the specified settings.
+ *
+ * \param pin The pin number.
+ * \param mode The trigger mode (\ref GPIO_PIN_CHANGE, \ref GPIO_RISING_EDGE or
+ * \ref GPIO_FALLING_EDGE).
+ *
+ * \return \ref GPIO_SUCCESS or \ref GPIO_INVALID_ARGUMENT.
+ */
+extern int gpio_enable_pin_interrupt(uint32_t pin, uint32_t mode);
+
+/*! \brief Disables the interrupt of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_disable_pin_interrupt(uint32_t pin);
+
+/*! \brief Gets the interrupt flag of a pin.
+ *
+ * \param pin The pin number.
+ *
+ * \return The pin interrupt flag.
+ */
+extern int gpio_get_pin_interrupt_flag(uint32_t pin);
+
+/*! \brief Clears the interrupt flag of a pin.
+ *
+ * \param pin The pin number.
+ */
+extern void gpio_clear_pin_interrupt_flag(uint32_t pin);
+
+//! @}
+
+
+#if (defined AVR32_GPIO_LOCAL_ADDRESS)
+/*! \name Local Bus Interface
+ *
+ * High-speed interface with only one clock cycle per access.
+ *
+ * This interface operates with high clock frequency (fCPU), and its timing is
+ * deterministic since it does not need to access a shared bus which may be
+ * heavily loaded.
+ *
+ * \warning To use this interface, the clock frequency of the peripheral bus on
+ * which the GPIO peripheral is connected must be set to the CPU clock
+ * frequency (fPB = fCPU).
+ *
+ * \note This interface has to be initialized in order to be available.
+ */
+//! @{
+
+/*! \brief Enables the local bus interface for GPIO.
+ *
+ * \note This function must have been called at least once before using other
+ * functions in this interface.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_init(void)
+{
+ Set_system_register(AVR32_CPUCR,
+ Get_system_register(AVR32_CPUCR) | AVR32_CPUCR_LOCEN_MASK);
+}
+
+/*! \brief Enables the output driver of a pin.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init must have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin.
+ * \ref gpio_enable_gpio_pin can be called for this purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_enable_pin_output_driver(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].oders = 1 << (pin & 0x1F);
+}
+
+/*! \brief Disables the output driver of a pin.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init must have been called beforehand.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_disable_pin_output_driver(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].oderc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Returns the value of a pin.
+ *
+ * \param pin The pin number.
+ *
+ * \return The pin value.
+ *
+ * \note \ref gpio_local_init must have been called beforehand.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline int gpio_local_get_pin_value(uint32_t pin)
+{
+ return (AVR32_GPIO_LOCAL.port[pin >> 5].pvr >> (pin & 0x1F)) & 1;
+}
+
+/*! \brief Drives a GPIO pin to 1.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init must have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin nor its output
+ * driver. \ref gpio_enable_gpio_pin and
+ * \ref gpio_local_enable_pin_output_driver can be called for this
+ * purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_set_gpio_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].ovrs = 1 << (pin & 0x1F);
+}
+
+/*! \brief Drives a GPIO pin to 0.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init must have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin nor its output
+ * driver. \ref gpio_enable_gpio_pin and
+ * \ref gpio_local_enable_pin_output_driver can be called for this
+ * purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_clr_gpio_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].ovrc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Toggles a GPIO pin.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init must have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin nor its output
+ * driver. \ref gpio_enable_gpio_pin and
+ * \ref gpio_local_enable_pin_output_driver can be called for this
+ * purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_tgl_gpio_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].ovrt = 1 << (pin & 0x1F);
+}
+
+/*! \brief Initializes the configuration of a GPIO pin so that it can be used
+ * with GPIO open-drain functions.
+ *
+ * \note This function must have been called at least once before using
+ * \ref gpio_local_set_gpio_open_drain_pin,
+ * \ref gpio_local_clr_gpio_open_drain_pin or
+ * \ref gpio_local_tgl_gpio_open_drain_pin.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_init_gpio_open_drain_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].ovrc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Drives a GPIO pin to 1 using open drain.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init and \ref gpio_local_init_gpio_open_drain_pin must
+ * have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin.
+ * \ref gpio_enable_gpio_pin can be called for this purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_set_gpio_open_drain_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].oderc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Drives a GPIO pin to 0 using open drain.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init and \ref gpio_local_init_gpio_open_drain_pin must
+ * have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin.
+ * \ref gpio_enable_gpio_pin can be called for this purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_clr_gpio_open_drain_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].oders = 1 << (pin & 0x1F);
+}
+
+/*! \brief Toggles a GPIO pin using open drain.
+ *
+ * \param pin The pin number.
+ *
+ * \note \ref gpio_local_init and \ref gpio_local_init_gpio_open_drain_pin must
+ * have been called beforehand.
+ *
+ * \note This function does not enable the GPIO mode of the pin.
+ * \ref gpio_enable_gpio_pin can be called for this purpose.
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_local_tgl_gpio_open_drain_pin(uint32_t pin)
+{
+ AVR32_GPIO_LOCAL.port[pin >> 5].odert = 1 << (pin & 0x1F);
+}
+
+//! @}
+#endif // AVR32_GPIO_LOCAL_ADDRESS
+
+#if UC3L
+//! @{
+/*! \name Peripheral Event System support
+ *
+ * The GPIO can be programmed to output peripheral events whenever an interrupt
+ * condition is detected, such as pin value change, or only when a rising or
+ * falling edge is detected.
+ *
+ */
+
+/*! \brief Enables the peripheral event generation of a pin.
+ *
+ * \param pin The pin number.
+ *
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_enable_pin_periph_event(uint32_t pin)
+{
+ AVR32_GPIO.port[pin >> 5].oderc = 1 << (pin & 0x1F); // The GPIO output driver is disabled for that pin.
+ AVR32_GPIO.port[pin >> 5].evers = 1 << (pin & 0x1F);
+}
+
+/*! \brief Disables the peripheral event generation of a pin.
+ *
+ * \param pin The pin number.
+ *
+ */
+#if (defined __GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void gpio_disable_pin_periph_event(uint32_t pin)
+{
+ AVR32_GPIO.port[pin >> 5].everc = 1 << (pin & 0x1F);
+}
+
+/*! \brief Configure the peripheral event trigger mode of a pin
+ *
+ * \param pin The pin number.
+ * \param mode The trigger mode (\ref GPIO_PIN_CHANGE, \ref GPIO_RISING_EDGE or
+ * \ref GPIO_FALLING_EDGE).
+ * \param use_igf use the Input Glitch Filter (true) or not (false).
+ *
+ * \return \ref GPIO_SUCCESS or \ref GPIO_INVALID_ARGUMENT.
+ */
+extern int gpio_configure_pin_periph_event_mode(uint32_t pin, uint32_t mode, uint32_t use_igf);
+
+//! @}
+#endif
+
+
+#endif // _GPIO_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/exception.S b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/exception.S
new file mode 100644
index 0000000..933002e
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/exception.S
@@ -0,0 +1,237 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Exception and interrupt vectors.
+ *
+ * This file maps all events supported by an AVR32.
+ *
+ * - Compiler: GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with an INTC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#if !__AVR32_UC__ && !__AVR32_AP__
+ #error Implementation of the AVR32 architecture not supported by the INTC driver.
+#endif
+
+
+#include <avr32/io.h>
+
+
+//! @{
+//! \verbatim
+
+
+ .section .exception, "ax", @progbits
+
+
+// Start of Exception Vector Table.
+
+ // EVBA must be aligned with a power of two strictly greater than the EVBA-
+ // relative offset of the last vector.
+ .balign 0x200
+
+ // Export symbol.
+ .global _evba
+ .type _evba, @function
+_evba:
+
+ .org 0x000
+ // Unrecoverable Exception.
+_handle_Unrecoverable_Exception:
+ rjmp $
+
+ .org 0x004
+ // TLB Multiple Hit.
+_handle_TLB_Multiple_Hit:
+ rjmp $
+
+ .org 0x008
+ // Bus Error Data Fetch.
+_handle_Bus_Error_Data_Fetch:
+ rjmp $
+
+ .org 0x00C
+ // Bus Error Instruction Fetch.
+_handle_Bus_Error_Instruction_Fetch:
+ rjmp $
+
+ .org 0x010
+ // NMI.
+_handle_NMI:
+ rjmp $
+
+ .org 0x014
+ // Instruction Address.
+_handle_Instruction_Address:
+ rjmp $
+
+ .org 0x018
+ // ITLB Protection.
+_handle_ITLB_Protection:
+ rjmp $
+
+ .org 0x01C
+ // Breakpoint.
+_handle_Breakpoint:
+ rjmp $
+
+ .org 0x020
+ // Illegal Opcode.
+_handle_Illegal_Opcode:
+ rjmp $
+
+ .org 0x024
+ // Unimplemented Instruction.
+_handle_Unimplemented_Instruction:
+ rjmp $
+
+ .org 0x028
+ // Privilege Violation.
+_handle_Privilege_Violation:
+ rjmp $
+
+ .org 0x02C
+ // Floating-Point: UNUSED IN AVR32UC and AVR32AP.
+_handle_Floating_Point:
+ rjmp $
+
+ .org 0x030
+ // Coprocessor Absent: UNUSED IN AVR32UC.
+_handle_Coprocessor_Absent:
+ rjmp $
+
+ .org 0x034
+ // Data Address (Read).
+_handle_Data_Address_Read:
+ rjmp $
+
+ .org 0x038
+ // Data Address (Write).
+_handle_Data_Address_Write:
+ rjmp $
+
+ .org 0x03C
+ // DTLB Protection (Read).
+_handle_DTLB_Protection_Read:
+ rjmp $
+
+ .org 0x040
+ // DTLB Protection (Write).
+_handle_DTLB_Protection_Write:
+ rjmp $
+
+ .org 0x044
+ // DTLB Modified: UNUSED IN AVR32UC.
+_handle_DTLB_Modified:
+ rjmp $
+
+ .org 0x050
+ // ITLB Miss.
+_handle_ITLB_Miss:
+ rjmp $
+
+ .org 0x060
+ // DTLB Miss (Read).
+_handle_DTLB_Miss_Read:
+ rjmp $
+
+ .org 0x070
+ // DTLB Miss (Write).
+_handle_DTLB_Miss_Write:
+ rjmp $
+
+ .org 0x100
+ // Supervisor Call.
+_handle_Supervisor_Call:
+ rjmp $
+
+
+// Interrupt support.
+// The interrupt controller must provide the offset address relative to EVBA.
+// Important note:
+// All interrupts call a C function named _get_interrupt_handler.
+// This function will read group and interrupt line number to then return in
+// R12 a pointer to a user-provided interrupt handler.
+
+ .balign 4
+
+ .irp priority, 0, 1, 2, 3
+_int\priority:
+#if __AVR32_UC__
+ // R8-R12, LR, PC and SR are automatically pushed onto the system stack by the
+ // CPU upon interrupt entry. No other register is saved by hardware.
+#elif __AVR32_AP__
+ // PC and SR are automatically saved in respectively RAR_INTx and RSR_INTx by
+ // the CPU upon interrupt entry. No other register is saved by hardware.
+ pushm r8-r12, lr
+#endif
+ mov r12, \priority // Pass the int_level parameter to the _get_interrupt_handler function.
+ call _get_interrupt_handler
+ cp.w r12, 0 // Get the pointer to the interrupt handler returned by the function.
+#if __AVR32_UC__
+ movne pc, r12 // If this was not a spurious interrupt (R12 != NULL), jump to the handler.
+#elif __AVR32_AP__
+ breq spint\priority // If this was a spurious interrupt (R12 == NULL), branch.
+ st.w --sp, r12 // Push the pointer to the interrupt handler onto the system stack since no register may be altered.
+ popm r8-r12, lr, pc // Restore registers and jump to the handler.
+spint\priority:
+ popm r8-r12, lr
+#endif
+ rete // If this was a spurious interrupt (R12 == NULL), return from event handler.
+ .endr
+
+
+// Constant data area.
+
+ .balign 4
+
+ // Values to store in the interrupt priority registers for the various interrupt priority levels.
+ // The interrupt priority registers contain the interrupt priority level and
+ // the EVBA-relative interrupt vector offset.
+ .global ipr_val
+ .type ipr_val, @object
+ipr_val:
+ .word (AVR32_INTC_INT0 << AVR32_INTC_IPR_INTLEVEL_OFFSET) | (_int0 - _evba),\
+ (AVR32_INTC_INT1 << AVR32_INTC_IPR_INTLEVEL_OFFSET) | (_int1 - _evba),\
+ (AVR32_INTC_INT2 << AVR32_INTC_IPR_INTLEVEL_OFFSET) | (_int2 - _evba),\
+ (AVR32_INTC_INT3 << AVR32_INTC_IPR_INTLEVEL_OFFSET) | (_int3 - _evba)
+
+
+//! \endverbatim
+//! @}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.c
new file mode 100644
index 0000000..26be0d2
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.c
@@ -0,0 +1,214 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief INTC driver for AVR32 UC3.
+ *
+ * AVR32 Interrupt Controller driver module.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with an INTC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include <avr32/io.h>
+#include "compiler.h"
+#include "preprocessor.h"
+#include "intc.h"
+
+// define _evba from exception.S
+extern void _evba;
+
+//! Values to store in the interrupt priority registers for the various interrupt priority levels.
+extern const unsigned int ipr_val[AVR32_INTC_NUM_INT_LEVELS];
+
+__int_handler _get_interrupt_handler(unsigned int int_level);
+
+//! Creates a table of interrupt line handlers per interrupt group in order to optimize RAM space.
+//! Each line handler table contains a set of pointers to interrupt handlers.
+#if (defined __GNUC__)
+#define DECL_INT_LINE_HANDLER_TABLE(GRP, unused) \
+static volatile __int_handler _int_line_handler_table_##GRP[Max(AVR32_INTC_NUM_IRQS_PER_GRP##GRP, 1)];
+#elif (defined __ICCAVR32__)
+#define DECL_INT_LINE_HANDLER_TABLE(GRP, unused) \
+static volatile __no_init __int_handler _int_line_handler_table_##GRP[Max(AVR32_INTC_NUM_IRQS_PER_GRP##GRP, 1)];
+#endif
+MREPEAT(AVR32_INTC_NUM_INT_GRPS, DECL_INT_LINE_HANDLER_TABLE, ~);
+#undef DECL_INT_LINE_HANDLER_TABLE
+
+//! Table containing for each interrupt group the number of interrupt request
+//! lines and a pointer to the table of interrupt line handlers.
+static const struct
+{
+ unsigned int num_irqs;
+ volatile __int_handler *_int_line_handler_table;
+} _int_handler_table[AVR32_INTC_NUM_INT_GRPS] =
+{
+#define INSERT_INT_LINE_HANDLER_TABLE(GRP, unused) \
+ {AVR32_INTC_NUM_IRQS_PER_GRP##GRP, _int_line_handler_table_##GRP},
+ MREPEAT(AVR32_INTC_NUM_INT_GRPS, INSERT_INT_LINE_HANDLER_TABLE, ~)
+#undef INSERT_INT_LINE_HANDLER_TABLE
+};
+
+
+/*! \brief Default interrupt handler.
+ *
+ * \note Taken and adapted from Newlib.
+ */
+#if (defined __GNUC__)
+__attribute__((__interrupt__))
+#elif (defined __ICCAVR32__)
+__interrupt
+#endif
+static void _unhandled_interrupt(void)
+{
+ // Catch unregistered interrupts.
+ while (true);
+}
+
+
+/*! \brief Gets the interrupt handler of the current event at the \a int_level
+ * interrupt priority level (called from exception.S).
+ *
+ * \param int_level Interrupt priority level to handle.
+ *
+ * \return Interrupt handler to execute.
+ *
+ * \note Taken and adapted from Newlib.
+ */
+__int_handler _get_interrupt_handler(unsigned int int_level)
+{
+ // ICR3 is mapped first, ICR0 last.
+ // Code in exception.S puts int_level in R12 which is used by AVR32-GCC to
+ // pass a single argument to a function.
+ unsigned int int_grp = AVR32_INTC.icr[AVR32_INTC_INT3 - int_level];
+ unsigned int int_req = AVR32_INTC.irr[int_grp];
+
+ // As an interrupt may disappear while it is being fetched by the CPU
+ // (spurious interrupt caused by a delayed response from an MCU peripheral to
+ // an interrupt flag clear or interrupt disable instruction), check if there
+ // are remaining interrupt lines to process.
+ // If a spurious interrupt occurs, the status register (SR) contains an
+ // execution mode and interrupt level masks corresponding to a level 0
+ // interrupt, whatever the interrupt priority level causing the spurious
+ // event. This behavior has been chosen because a spurious interrupt has not
+ // to be a priority one and because it may not cause any trouble to other
+ // interrupts.
+ // However, these spurious interrupts place the hardware in an unstable state
+ // and could give problems in other/future versions of the CPU, so the
+ // software has to be written so that they never occur. The only safe way of
+ // achieving this is to always clear or disable peripheral interrupts with the
+ // following sequence:
+ // 1: Mask the interrupt in the CPU by setting GM (or IxM) in SR.
+ // 2: Perform the bus access to the peripheral register that clears or
+ // disables the interrupt.
+ // 3: Wait until the interrupt has actually been cleared or disabled by the
+ // peripheral. This is usually performed by reading from a register in the
+ // same peripheral (it DOES NOT have to be the same register that was
+ // accessed in step 2, but it MUST be in the same peripheral), what takes
+ // bus system latencies into account, but peripheral internal latencies
+ // (generally 0 cycle) also have to be considered.
+ // 4: Unmask the interrupt in the CPU by clearing GM (or IxM) in SR.
+ // Note that steps 1 and 4 are useless inside interrupt handlers as the
+ // corresponding interrupt level is automatically masked by IxM (unless IxM is
+ // explicitly cleared by the software).
+ //
+ // Get the right IRQ handler.
+ //
+ // If several interrupt lines are active in the group, the interrupt line with
+ // the highest number is selected. This is to be coherent with the
+ // prioritization of interrupt groups performed by the hardware interrupt
+ // controller.
+ //
+ // If no handler has been registered for the pending interrupt,
+ // _unhandled_interrupt will be selected thanks to the initialization of
+ // _int_line_handler_table_x by INTC_init_interrupts.
+ //
+ // exception.S will provide the interrupt handler with a clean interrupt stack
+ // frame, with nothing more pushed onto the stack. The interrupt handler must
+ // manage the `rete' instruction, what can be done thanks to pure assembly,
+ // inline assembly or the `__attribute__((__interrupt__))' C function
+ // attribute.
+ return (int_req) ? _int_handler_table[int_grp]._int_line_handler_table[32 - clz(int_req) - 1] : NULL;
+}
+
+//! Init EVBA address. This sequence might also be done in the utils/startup/startup_uc3.S file.
+static __inline__ void INTC_init_evba(void)
+{
+ Set_system_register(AVR32_EVBA, (int)&_evba );
+}
+
+void INTC_init_interrupts(void)
+{
+ unsigned int int_grp, int_req;
+
+ INTC_init_evba();
+
+ // For all interrupt groups,
+ for (int_grp = 0; int_grp < AVR32_INTC_NUM_INT_GRPS; int_grp++)
+ {
+ // For all interrupt request lines of each group,
+ for (int_req = 0; int_req < _int_handler_table[int_grp].num_irqs; int_req++)
+ {
+ // Assign _unhandled_interrupt as default interrupt handler.
+ _int_handler_table[int_grp]._int_line_handler_table[int_req] = &_unhandled_interrupt;
+ }
+
+ // Set the interrupt group priority register to its default value.
+ // By default, all interrupt groups are linked to the interrupt priority
+ // level 0 and to the interrupt vector _int0.
+ AVR32_INTC.ipr[int_grp] = ipr_val[AVR32_INTC_INT0];
+ }
+}
+
+
+void INTC_register_interrupt(__int_handler handler, unsigned int irq, unsigned int int_level)
+{
+ // Determine the group of the IRQ.
+ unsigned int int_grp = irq / AVR32_INTC_MAX_NUM_IRQS_PER_GRP;
+
+ // Store in _int_line_handler_table_x the pointer to the interrupt handler, so
+ // that _get_interrupt_handler can retrieve it when the interrupt is vectored.
+ _int_handler_table[int_grp]._int_line_handler_table[irq % AVR32_INTC_MAX_NUM_IRQS_PER_GRP] = handler;
+
+ // Program the corresponding IPRX register to set the interrupt priority level
+ // and the interrupt vector offset that will be fetched by the core interrupt
+ // system.
+ // NOTE: The _intx functions are intermediate assembly functions between the
+ // core interrupt system and the user interrupt handler.
+ AVR32_INTC.ipr[int_grp] = ipr_val[int_level & (AVR32_INTC_IPR_INTLEVEL_MASK >> AVR32_INTC_IPR_INTLEVEL_OFFSET)];
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.h
new file mode 100644
index 0000000..1c5a7c1
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/intc/intc.h
@@ -0,0 +1,90 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief INTC driver for AVR32 UC3.
+ *
+ * AVR32 Interrupt Controller driver module.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with an INTC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _INTC_H_
+#define _INTC_H_
+
+#include "compiler.h"
+
+
+//! Maximal number of interrupt request lines per group.
+#define AVR32_INTC_MAX_NUM_IRQS_PER_GRP 32
+
+//! Number of interrupt priority levels.
+#define AVR32_INTC_NUM_INT_LEVELS (1 << AVR32_INTC_IPR_INTLEVEL_SIZE)
+
+
+#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
+
+/*! \brief Initializes the hardware interrupt controller driver.
+ *
+ * \note Taken and adapted from Newlib.
+ */
+extern void INTC_init_interrupts(void);
+
+/*! \brief Registers an interrupt handler.
+ *
+ * \param handler Interrupt handler to register.
+ * \param irq IRQ of the interrupt handler to register.
+ * \param int_level Interrupt priority level to assign to the group of this IRQ.
+ *
+ * \warning The interrupt handler must manage the `rete' instruction, what can
+ * be done thanks to pure assembly, inline assembly or the
+ * `__attribute__((__interrupt__))' C function attribute.
+ *
+ * \warning If several interrupt handlers of a same group are registered with
+ * different priority levels, only the latest priority level set will
+ * be effective.
+ *
+ * \note Taken and adapted from Newlib.
+ */
+extern void INTC_register_interrupt(__int_handler handler, unsigned int irq, unsigned int int_level);
+
+#endif // __AVR32_ABI_COMPILER__
+
+
+#endif // _INTC_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.c
new file mode 100644
index 0000000..ff6f1c0
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.c
@@ -0,0 +1,277 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Power Manager(PM) driver interface.
+ *
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 UC3C devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+#include "pm_uc3c.h"
+
+#ifndef AVR32_PM_VERSION_RESETVALUE
+ #error Cannot use this software module with the current device.
+#else
+ #if AVR32_PM_VERSION_RESETVALUE < 0x400
+ #error Cannot use this software module with the current device
+ #endif
+#endif
+
+/*! \name PM Writable Bit-Field Registers
+ */
+//! @{
+
+typedef union
+{
+ unsigned long cfdctrl;
+ avr32_pm_cfdctrl_t CFDCTRL;
+} u_avr32_pm_cfdctrl_t;
+
+typedef union
+{
+ unsigned long cpusel;
+ avr32_pm_cpusel_t CPUSEL;
+} u_avr32_pm_cpusel_t;
+
+typedef union
+{
+ unsigned long pbasel;
+ avr32_pm_pbasel_t PBASEL;
+} u_avr32_pm_pbasel_t;
+
+typedef union
+{
+ unsigned long pbbsel;
+ avr32_pm_pbbsel_t PBBSEL;
+} u_avr32_pm_pbbsel_t;
+
+typedef union
+{
+ unsigned long pbcsel;
+ avr32_pm_pbcsel_t PBCSEL;
+} u_avr32_pm_pbcsel_t;
+
+//! @}
+
+
+/**
+ ** Clock Functions
+ **/
+
+long pm_set_mclk_source(pm_clk_src_t src)
+{
+ // Unlock the write-protected MCCTRL register
+ AVR32_ENTER_CRITICAL_REGION( );
+ PM_UNLOCK(AVR32_PM_MCCTRL);
+ AVR32_PM.mcctrl = src;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long pm_config_mainclk_safety(bool cfd, bool final)
+{
+ u_avr32_pm_cfdctrl_t u_avr32_pm_cfdctrl = {AVR32_PM.cfdctrl};
+
+ // Check if the CFDCTRL register is read-only.
+ if(AVR32_PM.cfdctrl & AVR32_PM_CFDCTRL_SFV_MASK)
+ return -1;
+
+ // Unlock the write-protected CFDCTRL register
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Modify
+ u_avr32_pm_cfdctrl.CFDCTRL.cfden = cfd;
+ u_avr32_pm_cfdctrl.CFDCTRL.sfv = final;
+ // Write back
+ PM_UNLOCK(AVR32_PM_CFDCTRL);
+ AVR32_PM.cfdctrl = u_avr32_pm_cfdctrl.cfdctrl;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long pm_set_clk_domain_div(pm_clk_domain_t clock_domain, pm_divratio_t divratio)
+{
+ u_avr32_pm_cpusel_t u_avr32_pm_cpusel = {AVR32_PM.cpusel};
+
+//# Implementation note: the CPUSEL and PBASEL and PBBSEL registers all have the
+//# same structure.
+
+//# Implementation note: the ckSEL registers are contiguous and memory-mapped in
+//# that order: CPUSEL, HSBSEL, PBASEL, PBBSEL.
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check the divratio
+ if((divratio > PM_CPUSEL_DIVRATIO_MAX)||(divratio < 0))
+ return -1;
+#endif
+
+ // ckSEL must not be written while SR.CKRDY is 0.
+ if(!(AVR32_PM.sr & AVR32_PM_SR_CKRDY_MASK))
+ return -1;
+
+ // Modify
+ u_avr32_pm_cpusel.CPUSEL.cpudiv= 1;
+ u_avr32_pm_cpusel.CPUSEL.cpusel = divratio;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected ckSEL register
+ PM_UNLOCK(AVR32_PM_CPUSEL + clock_domain*sizeof(avr32_pm_cpusel_t));
+ // Update
+ *(&(AVR32_PM.cpusel) + clock_domain)= u_avr32_pm_cpusel.cpusel;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long pm_disable_clk_domain_div(pm_clk_domain_t clock_domain)
+{
+ u_avr32_pm_cpusel_t u_avr32_pm_cpusel = {AVR32_PM.cpusel};
+
+//# Implementation note: the CPUSEL and PBASEL and PBBSEL and PBCSEL registers all have the
+//# same structure.
+
+//# Implementation note: the ckSEL registers are contiguous and memory-mapped in
+//# that order: CPUSEL, HSBSEL, PBASEL, PBBSEL, PBCSEL.
+
+ // ckSEL must not be written while SR.CKRDY is 0.
+ if(!(AVR32_PM.sr & AVR32_PM_SR_CKRDY_MASK))
+ return -1;
+
+ // Modify
+ u_avr32_pm_cpusel.CPUSEL.cpudiv= DISABLE;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected ckSEL register
+ PM_UNLOCK(AVR32_PM_CPUSEL + clock_domain*sizeof(avr32_pm_cpusel_t));
+ // Update
+ *(&(AVR32_PM.cpusel) + clock_domain)= u_avr32_pm_cpusel.cpusel;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long pm_wait_for_clk_ready(void)
+{
+ unsigned int timeout = PM_POLL_TIMEOUT;
+ while (!(AVR32_PM.sr & AVR32_PM_SR_CKRDY_MASK))
+ {
+ if(--timeout == 0)
+ return -1;
+ }
+ return PASS;
+}
+
+
+
+/**
+ ** Module Functions
+ **/
+
+long pm_enable_module(unsigned long module)
+{
+ unsigned long domain = module>>5;
+//# Implementation note: the ckMASK registers are contiguous and memory-mapped
+//# in that order: CPUMASK, HSBMASK, PBAMASK, PBBMASK.
+ unsigned long *regptr = (unsigned long*)(&(AVR32_PM.cpumask) + domain);
+ unsigned long regvalue;
+
+
+ // Read
+ regvalue = *regptr;
+ // Modify
+ regvalue |= (1<<(module%32));
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected ckMASK register
+ PM_UNLOCK(AVR32_PM_CPUMASK + domain*sizeof(avr32_pm_cpumask_t));
+ // Write
+ *regptr = regvalue;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long pm_disable_module(unsigned long module)
+{
+ unsigned long domain = module>>5;
+//# Implementation note: the ckMASK registers are contiguous and memory-mapped
+//# in that order: CPUMASK, HSBMASK, PBAMASK, PBBMASK.
+ volatile unsigned long *regptr = (volatile unsigned long*)(&(AVR32_PM.cpumask) + domain);
+ unsigned long regvalue;
+
+
+ // Read
+ regvalue = *regptr;
+ // Modify
+ regvalue &= ~(1<<(module%32));
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected ckMASK register
+ PM_UNLOCK(AVR32_PM_CPUMASK + domain*sizeof(avr32_pm_cpumask_t));
+ // Write
+ *regptr = regvalue;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+
+
+/**
+ ** Sleep Functions
+ **/
+// Implemented as inline in pm_uc3c.h
+
+
+
+/**
+ ** Reset Functions
+ **/
+// Implemented as inline in pm_uc3c.h
+
+
+
+/**
+ ** Interrupt Functions
+ **/
+// Implemented as inline in pm_uc3c.h
+
+
+
+/**
+ ** Misc Functions
+ **/
+// Implemented as inline in pm_uc3c.h
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.h
new file mode 100644
index 0000000..c01d382
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/pm_uc3c.h
@@ -0,0 +1,392 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Power Manager(PM) driver interface.
+ *
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 UC3C devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+#ifndef _PM_UC3C_H_
+#define _PM_UC3C_H_
+
+#define _PM_UC3C_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <avr32/io.h>
+#include "compiler.h"
+
+// These defines are missing from or wrong in the toolchain header file ip_xxx.h or part.h
+#ifdef AVR32_PM_410_H_INCLUDED
+// Optionnal #undef AVR32_PM_UNLOCK_KEY_VALUE if the define values is wrong.
+#define AVR32_PM_UNLOCK_KEY_VALUE 0x000000AA
+#endif
+
+//! Device-specific data
+
+//! The clock sources of the power manager.
+typedef enum
+{
+ PM_CLK_SRC_SLOW = AVR32_PM_MCSEL_SLOW,
+ PM_CLK_SRC_OSC0 = AVR32_PM_MCSEL_OSC0,
+ PM_CLK_SRC_OSC1 = AVR32_PM_MCSEL_OSC1,
+ PM_CLK_SRC_PLL0 = AVR32_PM_MCSEL_PLL0,
+ PM_CLK_SRC_PLL1 = AVR32_PM_MCSEL_PLL1,
+ PM_CLK_SRC_RC8M = AVR32_PM_MCSEL_RCOSC8,
+ PM_CLK_SRC_RCRIPOSC = AVR32_PM_MCSEL_CRIPOSC,
+ PM_CLK_SRC_RC120M = AVR32_PM_MCSEL_RC120M,
+ PM_CLK_SRC_INVALID
+} pm_clk_src_t;
+
+//! The clock domains of the power manager.
+typedef enum
+{
+ PM_CLK_DOMAIN_0 = AVR32_PM_CLK_GRP_CPU,
+ PM_CLK_DOMAIN_1 = AVR32_PM_CLK_GRP_HSB,
+ PM_CLK_DOMAIN_2 = AVR32_PM_CLK_GRP_PBA,
+ PM_CLK_DOMAIN_3 = AVR32_PM_CLK_GRP_PBB,
+ PM_CLK_DOMAIN_4 = AVR32_PM_CLK_GRP_PBC,
+ PM_CLK_DOMAIN_INVALID
+} pm_clk_domain_t;
+
+
+//! The possible synchronous clock division ratio.
+typedef enum
+{
+ PM_CKSEL_DIVRATIO_2 = 0, // Divide the main clock by 2^1
+ PM_CKSEL_DIVRATIO_4, // Divide the main clock by 2^2
+ PM_CKSEL_DIVRATIO_8, // Divide the main clock by 2^3
+ PM_CKSEL_DIVRATIO_16, // Divide the main clock by 2^4
+ PM_CKSEL_DIVRATIO_32, // Divide the main clock by 2^5
+ PM_CKSEL_DIVRATIO_64, // Divide the main clock by 2^6
+ PM_CKSEL_DIVRATIO_128, // Divide the main clock by 2^7
+ PM_CKSEL_DIVRATIO_256 // Divide the main clock by 2^8
+} pm_divratio_t;
+
+//! The timeguard used for polling (expressed in ticks).
+#define PM_POLL_TIMEOUT 100000
+
+//! Define "not supported" for the power manager features.
+#define PM_NOT_SUPPORTED (-10000)
+
+
+//! Unlock PM register macro
+#define PM_UNLOCK(reg) (AVR32_PM.unlock = (unsigned long)(AVR32_PM_UNLOCK_KEY_VALUE << AVR32_PM_UNLOCK_KEY_OFFSET)|(reg))
+
+
+/*! \name Clock Functions
+ */
+//! @{
+
+/*! \brief Set the main clock.
+ *
+ * \param src The clock to use as the main clock.
+ *
+ * \warning The input clock to use as the main clock must be enabled before calling
+ * this function, otherwise a deadlock will occur.
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured when trying to set the main clock.
+ */
+extern long pm_set_mclk_source(pm_clk_src_t src);
+
+/*! \brief Configure the main clock safety mechanisms.
+ *
+ * \note Refer to the section Clock Failure Detector of the PM chapter in the datasheet
+ *
+ * \warning The Critical Path Oscillator (CRIPOSC) must be enabled before
+ * enabling the Over Clock Protection mechanism.
+ *
+ * \param cfd Enable/disable the Clock Failure Detection mechanism
+ * \param final If true, make this configuration definitive
+ *
+ * \return Status.
+ * \retval =0 Success.
+ * \retval <0 An error occured.
+ */
+extern long pm_config_mainclk_safety(bool cfd, bool final);
+
+/*! \brief Set the division ratio for a clock domain.
+ *
+ * \param clock_domain The clock domain to alter.
+ * \param divratio The division ratio to set.
+ *
+ * \warning Care should be taken that each new frequency of the synchronous clocks
+ * does not exceed the maximum frequency for each clock domain.
+ *
+ * \return Status.
+ * \retval =0 Success.
+ * \retval <0 An error occured.
+ */
+extern long pm_set_clk_domain_div(pm_clk_domain_t clock_domain, pm_divratio_t divratio);
+
+/*! \brief Disable the division ratio for a clock domain.
+ *
+ * \param clock_domain The clock domain to alter.
+ *
+ * \warning Care should be taken that each new frequency of the synchronous clocks
+ * does not exceed the maximum frequency for each clock domain.
+ *
+ * \return Status.
+ * \retval =0 Success.
+ * \retval <0 An error occured.
+ */
+extern long pm_disable_clk_domain_div(pm_clk_domain_t clock_domain);
+
+/*! \brief Wait actively for the clock settings to be effective.
+ *
+ * \note To avoid an infinite loop, this function checks the clock ready flag
+ * PM_POLL_TIMEOUT times.
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 Unable to reach a clock ready status within the polling limit.
+ */
+extern long pm_wait_for_clk_ready(void);
+
+//! @}
+
+
+/*! \name Module Functions
+ */
+//! @{
+
+/*! \brief Enable the clock of a module.
+ *
+ * \param module The module to clock (use one of the defines in the part-specific
+ * header file under "toolchain folder"/avr32/inc(lude)/avr32/; depending on the
+ * clock domain, look for the sections "CPU clocks", "HSB clocks", "PBx clocks")
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long pm_enable_module(unsigned long module);
+
+/*! \brief Disable the clock of a module.
+ *
+ * \param module The module to shut down (use one of the defines in the part-specific
+ * header file under "toolchain folder"/avr32/inc(lude)/avr32/; depending on the
+ * clock domain, look for the sections "CPU clocks", "HSB clocks", "PBx clocks")
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long pm_disable_module(unsigned long module);
+
+
+//! @}
+
+/*! \name Sleep Functions
+ */
+//! @{
+
+/*! \brief Sets the MCU in the specified sleep mode
+ *
+ * \note Precautions should be taken before entering sleep mode. Refer to the
+ * datasheet chapter 'Power Manager'.
+ *
+ * \param sleep_mode The sleep mode index
+ */
+#define SLEEP(sleep_mode) {__asm__ __volatile__ ("sleep "STRINGZ(sleep_mode));}
+
+/*! \brief Returns MCU wake cause
+ *
+ * \return The MCU wake cause which can be masked with the
+ * \c AVR32_PM_WCAUSE_x_MASK bit-masks to isolate specific causes.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long pm_get_wake_cause(void)
+{
+ return AVR32_PM.wcause;
+}
+
+/*! \brief Enable one or several asynchronous wake-up source.
+ *
+ * \param awen_mask Mask of asynchronous wake-up sources (use one of the defines
+ * AVR32_PM_AWEN_xxxxWEN_MASK in the part-specific header file under
+ * "toolchain folder"/avr32/inc(lude)/avr32/)
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void pm_asyn_wake_up_enable(unsigned long awen_mask)
+{
+ AVR32_PM.awen |= awen_mask;
+}
+
+/*! \brief Disable one or several asynchronous wake-up sources
+ *
+ * \param awen_mask Mask of asynchronous wake-up sources (use one of the defines
+ * AVR32_PM_AWEN_xxxxWEN_MASK in the part-specific header file under
+ * "toolchain folder"/avr32/inc(lude)/avr32/)
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void pm_asyn_wake_up_disable(unsigned long awen_mask)
+{
+ AVR32_PM.awen &= ~awen_mask;
+}
+
+//! @}
+
+
+
+/*! \name Reset Functions
+ */
+//! @{
+
+/*! \brief Returns MCU last reset cause
+ *
+ * \return The MCU last reset cause which can be masked with the
+ * \c AVR32_PM_RCAUSE_x_MASK bit-masks to isolate specific causes.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long pm_get_reset_cause(void)
+{
+ return AVR32_PM.rcause;
+}
+
+//! @}
+
+
+
+/*! \name Interrupt Functions
+ */
+//! @{
+
+/*! \brief Enable power manager interrupts.
+ *
+ * \param mask the interrupts to enable.
+ *
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void pm_enable_interrupts(unsigned long mask)
+{
+ AVR32_PM.ier |= mask;
+}
+
+/*! \brief Disable power manager interrupts.
+ *
+ * \param mask the interrupts to disable.
+ *
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void pm_disable_interrupts(unsigned long mask)
+{
+ AVR32_PM.idr |= mask;
+}
+
+/*! \brief Read the enabled power manager interrupts.
+ *
+ * \return mask of the enabled interrupts.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long pm_get_enabled_interrupts(void)
+{
+ return(AVR32_PM.imr);
+}
+
+/*! \brief Read the interrupts status of the power manager.
+ *
+ * \return mask of the interrupts that have been triggered.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long pm_get_interrupts_status(void)
+{
+ return(AVR32_PM.isr);
+}
+
+/*! \brief Clear raised interrupts from the power manager.
+ *
+ * \param mask The interrupts to clear.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void pm_clear_interrupt_status(unsigned long mask)
+{
+ AVR32_PM.icr |= mask;
+}
+
+//! @}
+
+
+
+/*! \name Misc Functions
+ */
+//! @{
+
+/*! \brief Get the PM status
+ *
+ * \return The content of the PM Status register.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long pm_get_status(void)
+{
+ return AVR32_PM.sr;
+}
+
+//! @}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _PM_UC3C_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.c
new file mode 100644
index 0000000..af71e60
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.c
@@ -0,0 +1,575 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief High-level library abstracting features such as oscillators/pll/dfll
+ * configuration, clock configuration, System-sensible parameters
+ * configuration, buses clocks configuration, sleep mode, reset.
+ *
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+#include "power_clocks_lib.h"
+
+
+//! Device-specific data
+#if UC3L
+static long int pcl_configure_clocks_uc3l(pcl_freq_param_t *param); // FORWARD declaration
+#endif
+
+#if UC3C
+static long int pcl_configure_clocks_uc3c(pcl_freq_param_t *param); // FORWARD declaration
+#endif
+
+long int pcl_configure_clocks(pcl_freq_param_t *param)
+{
+#ifndef AVR32_PM_VERSION_RESETVALUE
+ // Implementation for UC3A, UC3A3, UC3B parts.
+ return(pm_configure_clocks(param));
+#else
+ #if (defined AVR32_PM_410_H_INCLUDED ) || (defined AVR32_PM_412_H_INCLUDED )
+ // Implementation for UC3C parts.
+ return(pcl_configure_clocks_uc3c(param));
+ #else
+ // Implementation for UC3L parts.
+ return(pcl_configure_clocks_uc3l(param));
+ #endif
+#endif
+}
+
+
+//! Device-specific implementation
+#if UC3L
+// FORWARD declaration
+static long int pcl_configure_synchronous_clocks( pm_clk_src_t main_clk_src,
+ unsigned long main_clock_freq_hz,
+ pcl_freq_param_t *param);
+
+long int pcl_configure_clocks_rcsys(pcl_freq_param_t *param)
+{
+ // Supported main clock sources: PCL_MC_RCSYS
+
+ // Supported synchronous clocks frequencies if RCSYS is the main clock source:
+ // 115200Hz, 57600Hz, 28800Hz, 14400Hz, 7200Hz, 3600Hz, 1800Hz, 900Hz, 450Hz.
+
+ // NOTE: by default, this implementation doesn't perform thorough checks on the
+ // input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that fCPU >= fPBx
+ if((param->cpu_f < param->pba_f) || (param->cpu_f < param->pbb_f))
+ return(-1);
+#endif
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that the target frequencies are reachable.
+ if((param->cpu_f > SCIF_SLOWCLOCK_FREQ_HZ) || (param->pba_f > SCIF_SLOWCLOCK_FREQ_HZ)
+ || (param->pbb_f > SCIF_SLOWCLOCK_FREQ_HZ))
+ return(-1);
+#endif
+
+ return(pcl_configure_synchronous_clocks(PM_CLK_SRC_SLOW, SCIF_SLOWCLOCK_FREQ_HZ, param));
+}
+
+
+long int pcl_configure_clocks_rc120m(pcl_freq_param_t *param)
+{
+ // Supported main clock sources: PCL_MC_RC120M
+
+ // Supported synchronous clocks frequencies if RC120M is the main clock source:
+ // 30MHz, 15MHz, 7.5MHz, 3.75MHz, 1.875MHz, 937.5kHz, 468.75kHz.
+
+ // NOTE: by default, this implementation doesn't perform thorough checks on the
+ // input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that fCPU >= fPBx
+ if((param->cpu_f < param->pba_f) || (param->cpu_f < param->pbb_f))
+ return(-1);
+#endif
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that the target frequencies are reachable.
+ if((param->cpu_f > SCIF_RC120M_FREQ_HZ) || (param->pba_f > SCIF_RC120M_FREQ_HZ)
+ || (param->pbb_f > SCIF_RC120M_FREQ_HZ))
+ return(-1);
+#endif
+
+ // Start the 120MHz internal RCosc (RC120M) clock
+ scif_start_rc120M();
+
+ return(pcl_configure_synchronous_clocks(PM_CLK_SRC_RC120M, SCIF_RC120M_FREQ_HZ, param));
+}
+
+
+long int pcl_configure_clocks_osc0(pcl_freq_param_t *param)
+{
+ // Supported main clock sources: PCL_MC_OSC0
+
+ // Supported synchronous clocks frequencies if OSC0 is the main clock source:
+ // (these obviously depend on the OSC0 frequency; we'll take 16MHz as an example)
+ // 16MHz, 8MHz, 4MHz, 2MHz, 1MHz, 500kHz, 250kHz, 125kHz, 62.5kHz.
+
+ // NOTE: by default, this implementation doesn't perform thorough checks on the
+ // input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+
+ unsigned long main_clock_freq;
+
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that fCPU >= fPBx
+ if((param->cpu_f < param->pba_f) || (param->cpu_f < param->pbb_f))
+ return(-1);
+#endif
+
+ main_clock_freq = param->osc0_f;
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that the target frequencies are reachable.
+ if((param->cpu_f > main_clock_freq) || (param->pba_f > main_clock_freq)
+ || (param->pbb_f > main_clock_freq))
+ return(-1);
+#endif
+ // Configure OSC0 in crystal mode, external crystal with a fcrystal Hz frequency.
+ scif_configure_osc_crystalmode(SCIF_OSC0, main_clock_freq);
+ // Enable the OSC0
+ scif_enable_osc(SCIF_OSC0, param->osc0_startup, true);
+
+ return(pcl_configure_synchronous_clocks(PM_CLK_SRC_OSC0, main_clock_freq, param));
+}
+
+
+long int pcl_configure_clocks_dfll0(pcl_freq_param_t *param)
+{
+ // Supported main clock sources: PCL_MC_DFLL
+
+ // Supported synchronous clocks frequencies if DFLL is the main clock source:
+ // (these obviously depend on the DFLL target frequency; we'll take 100MHz as an example)
+ // 50MHz, 25MHz, 12.5MHz, 6.25MHz, 3.125MHz, 1562.5kHz, 781.25kHz, 390.625kHz.
+
+ // NOTE: by default, this implementation doesn't perform thorough checks on the
+ // input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+
+ unsigned long main_clock_freq;
+ scif_gclk_opt_t *pgc_dfllif_ref_opt;
+
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that fCPU >= fPBx
+ if((param->cpu_f < param->pba_f) || (param->cpu_f < param->pbb_f))
+ return(-1);
+#endif
+
+ main_clock_freq = param->dfll_f;
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that the target DFLL output frequency is in the correct range.
+ if((main_clock_freq > SCIF_DFLL_MAXFREQ_HZ) || (main_clock_freq < SCIF_DFLL_MINFREQ_HZ))
+ return(-1);
+ // Verify that the target frequencies are reachable.
+ if((param->cpu_f > main_clock_freq) || (param->pba_f > main_clock_freq)
+ || (param->pbb_f > main_clock_freq))
+ return(-1);
+#endif
+ pgc_dfllif_ref_opt = (scif_gclk_opt_t *)param->pextra_params;
+ // Implementation note: this implementation configures the DFLL in closed-loop
+ // mode (because it gives the best accuracy) which enables the generic clock CLK_DFLLIF_REF
+ // as a reference (RCSYS being used as the generic clock source, undivided).
+ scif_dfll0_closedloop_configure_and_start(pgc_dfllif_ref_opt, main_clock_freq, true);
+
+ return(pcl_configure_synchronous_clocks(PM_CLK_SRC_DFLL0, main_clock_freq, param));
+}
+
+
+static long int pcl_configure_clocks_uc3l(pcl_freq_param_t *param)
+{
+ // Supported main clock sources: PCL_MC_RCSYS, PCL_MC_OSC0, PCL_MC_DFLL0, PCL_MC_RC120M
+
+ // Supported synchronous clocks frequencies if RCSYS is the main clock source:
+ // 115200Hz, 57600Hz, 28800Hz, 14400Hz, 7200Hz, 3600Hz, 1800Hz, 900Hz, 450Hz.
+
+ // Supported synchronous clocks frequencies if RC120M is the main clock source:
+ // 30MHz, 15MHz, 7.5MHz, 3.75MHz, 1.875MHz, 937.5kHz, 468.75kHz.
+
+ // Supported synchronous clocks frequencies if OSC0 is the main clock source:
+ // (these obviously depend on the OSC0 frequency; we'll take 16MHz as an example)
+ // 16MHz, 8MHz, 4MHz, 2MHz, 1MHz, 500kHz, 250kHz, 125kHz, 62.5kHz.
+
+ // Supported synchronous clocks frequencies if DFLL is the main clock source:
+ // (these obviously depend on the DFLL target frequency; we'll take 100MHz as an example)
+ // 50MHz, 25MHz, 12.5MHz, 6.25MHz, 3.125MHz, 1562.5kHz, 781.25kHz, 390.625kHz.
+
+ // NOTE: by default, this implementation doesn't perform thorough checks on the
+ // input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Verify that fCPU >= fPBx
+ if((param->cpu_f < param->pba_f) || (param->cpu_f < param->pbb_f))
+ return(-1);
+#endif
+
+ if(PCL_MC_RCSYS == param->main_clk_src)
+ {
+ return(pcl_configure_clocks_rcsys(param));
+ }
+ else if(PCL_MC_RC120M == param->main_clk_src)
+ {
+ return(pcl_configure_clocks_rc120m(param));
+ }
+ else if(PCL_MC_OSC0 == param->main_clk_src)
+ {
+ return(pcl_configure_clocks_osc0(param));
+ }
+ else // PCL_MC_DFLL0 == param->main_clk_src
+ {
+ return(pcl_configure_clocks_dfll0(param));
+ }
+}
+
+static long int pcl_configure_synchronous_clocks(pm_clk_src_t main_clk_src, unsigned long main_clock_freq_hz, pcl_freq_param_t *param)
+{
+ //#
+ //# Set the Synchronous clock division ratio for each clock domain
+ //#
+ pm_set_all_cksel(main_clock_freq_hz, param->cpu_f, param->pba_f, param->pbb_f);
+
+ //#
+ //# Set the Flash wait state and the speed read mode (depending on the target CPU frequency).
+ //#
+#if UC3L
+ flashcdw_set_flash_waitstate_and_readmode(param->cpu_f);
+#elif UC3C
+ flashc_set_flash_waitstate_and_readmode(param->cpu_f);
+#endif
+
+
+ //#
+ //# Switch the main clock source to the selected clock.
+ //#
+ pm_set_mclk_source(main_clk_src);
+
+ return PASS;
+}
+
+#endif // UC3L device-specific implementation
+
+//! UC3C Device-specific implementation
+#if UC3C
+static long int pcl_configure_clocks_uc3c(pcl_freq_param_t *param)
+{
+ #define PM_MAX_MUL ((1 << AVR32_SCIF_PLLMUL_SIZE) - 1)
+ #define AVR32_PM_PBA_MAX_FREQ 66000000
+ #define AVR32_PM_PLL_VCO_RANGE0_MAX_FREQ 240000000
+ #define AVR32_PM_PLL_VCO_RANGE0_MIN_FREQ 160000000
+
+ // Implementation for UC3C parts.
+ // Supported frequencies:
+ // Fosc0 mul div PLL div2_en cpu_f pba_f Comment
+ // 12 15 1 192 1 12 12
+ // 12 9 3 40 1 20 20 PLL out of spec
+ // 12 15 1 192 1 24 12
+ // 12 9 1 120 1 30 15
+ // 12 9 3 40 0 40 20 PLL out of spec
+ // 12 15 1 192 1 48 12
+ // 12 15 1 192 1 48 24
+ // 12 8 1 108 1 54 27
+ // 12 9 1 120 1 60 15
+ // 12 9 1 120 1 60 30
+ // 12 10 1 132 1 66 16.5
+ //
+ unsigned long in_cpu_f = param->cpu_f;
+ unsigned long in_osc0_f = param->osc0_f;
+ unsigned long mul, div, div2_en = 0, div2_cpu = 0, div2_pba = 0;
+ unsigned long pll_freq, rest;
+ bool b_div2_pba, b_div2_cpu;
+
+ // Configure OSC0 in crystal mode, external crystal with a FOSC0 Hz frequency.
+ scif_configure_osc_crystalmode(SCIF_OSC0, in_osc0_f);
+ // Enable the OSC0
+ scif_enable_osc(SCIF_OSC0, param->osc0_startup, true);
+ // Set the main clock source as being OSC0.
+ pm_set_mclk_source(PM_CLK_SRC_OSC0);
+
+ // Start with CPU freq config
+ if (in_cpu_f == in_osc0_f)
+ {
+ param->cpu_f = in_osc0_f;
+ param->pba_f = in_osc0_f;
+ return PASS;
+ }
+ else if (in_cpu_f < in_osc0_f)
+ {
+ // TBD
+ }
+
+ rest = in_cpu_f % in_osc0_f;
+
+ for (div = 1; div < 32; div++)
+ {
+ if ((div * rest) % in_osc0_f == 0)
+ break;
+ }
+ if (div == 32)
+ return FAIL;
+
+ mul = (in_cpu_f * div) / in_osc0_f;
+
+ if (mul > PM_MAX_MUL)
+ return FAIL;
+
+ // export 2power from PLL div to div2_cpu
+ while (!(div % 2))
+ {
+ div /= 2;
+ div2_cpu++;
+ }
+
+ // Here we know the mul and div parameter of the PLL config.
+ // . Check out if the PLL has a valid in_cpu_f.
+ // . Try to have for the PLL frequency (VCO output) the highest possible value
+ // to reduce jitter.
+ while (in_osc0_f * 2 * mul / div < AVR32_PM_PLL_VCO_RANGE0_MAX_FREQ)
+ {
+ if (2 * mul > PM_MAX_MUL)
+ break;
+ mul *= 2;
+ div2_cpu++;
+ }
+
+ if (div2_cpu != 0)
+ {
+ div2_cpu--;
+ div2_en = 1;
+ }
+
+ pll_freq = in_osc0_f * mul / (div * (1 << div2_en));
+
+ // Update real CPU Frequency
+ param->cpu_f = pll_freq / (1 << div2_cpu);
+ mul--;
+
+ scif_pll_opt_t opt;
+
+ opt.osc = SCIF_OSC0, // Sel Osc0 or Osc1
+ opt.lockcount = 16, // lockcount in main clock for the PLL wait lock
+ opt.div = div, // DIV=1 in the formula
+ opt.mul = mul, // MUL=7 in the formula
+ opt.pll_div2 = div2_en, // pll_div2 Divide the PLL output frequency by 2 (this settings does not change the FVCO value)
+ opt.pll_wbwdisable = 0, //pll_wbwdisable 1 Disable the Wide-Bandith Mode (Wide-Bandwith mode allow a faster startup time and out-of-lock time). 0 to enable the Wide-Bandith Mode.
+ opt.pll_freq = (pll_freq < AVR32_PM_PLL_VCO_RANGE0_MIN_FREQ) ? 1 : 0, // Set to 1 for VCO frequency range 80-180MHz, set to 0 for VCO frequency range 160-240Mhz.
+
+
+ scif_pll_setup(SCIF_PLL0, opt); // lockcount in main clock for the PLL wait lock
+
+ /* Enable PLL0 */
+ scif_pll_enable(SCIF_PLL0);
+
+ /* Wait for PLL0 locked */
+ scif_wait_for_pll_locked(SCIF_PLL0) ;
+
+ rest = pll_freq;
+ while (rest > AVR32_PM_PBA_MAX_FREQ ||
+ rest != param->pba_f)
+ {
+ div2_pba++;
+ rest = pll_freq / (1 << div2_pba);
+ if (rest < param->pba_f)
+ break;
+ }
+
+ // Update real PBA Frequency
+ param->pba_f = pll_freq / (1 << div2_pba);
+
+
+ if (div2_cpu)
+ {
+ b_div2_cpu = true;
+ div2_cpu--;
+ }
+ else
+ b_div2_cpu = false;
+
+ if (div2_pba)
+ {
+ b_div2_pba = true;
+ div2_pba--;
+ }
+ else
+ b_div2_pba = false;
+
+ if (b_div2_cpu == true )
+ {
+ pm_set_clk_domain_div(PM_CLK_DOMAIN_0, (pm_divratio_t) div2_cpu); // CPU
+ pm_set_clk_domain_div(PM_CLK_DOMAIN_1, (pm_divratio_t) div2_cpu); // HSB
+ pm_set_clk_domain_div(PM_CLK_DOMAIN_3, (pm_divratio_t) div2_cpu); // PBB
+ }
+ if (b_div2_pba == true )
+ {
+ pm_set_clk_domain_div(PM_CLK_DOMAIN_2, (pm_divratio_t) div2_pba); // PBA
+ pm_set_clk_domain_div(PM_CLK_DOMAIN_4, (pm_divratio_t) div2_pba); // PBC
+ }
+
+ // Set Flashc Wait State
+ flashc_set_flash_waitstate_and_readmode(param->cpu_f);
+
+ // Set the main clock source as being PLL0.
+ pm_set_mclk_source(PM_CLK_SRC_PLL0);
+
+ return PASS;
+}
+#endif // UC3C device-specific implementation
+
+long int pcl_switch_to_osc(pcl_osc_t osc, unsigned int fcrystal, unsigned int startup)
+{
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Implementation for UC3A, UC3A3, UC3B parts.
+ if(PCL_OSC0 == osc)
+ {
+ // Configure OSC0 in crystal mode, external crystal with a FOSC0 Hz frequency,
+ // enable the OSC0, set the main clock source as being OSC0.
+ pm_switch_to_osc0(&AVR32_PM, fcrystal, startup);
+ }
+ else
+ {
+ return PCL_NOT_SUPPORTED;
+ }
+#else
+// Implementation for UC3C, UC3L parts.
+ #if AVR32_PM_VERSION_RESETVALUE < 0x400
+ return PCL_NOT_SUPPORTED;
+ #else
+ if(PCL_OSC0 == osc)
+ {
+ // Configure OSC0 in crystal mode, external crystal with a fcrystal Hz frequency.
+ scif_configure_osc_crystalmode(SCIF_OSC0, fcrystal);
+ // Enable the OSC0
+ scif_enable_osc(SCIF_OSC0, startup, true);
+ // Set the Flash wait state and the speed read mode (depending on the target CPU frequency).
+#if UC3L
+ flashcdw_set_flash_waitstate_and_readmode(fcrystal);
+#elif UC3C
+ flashc_set_flash_waitstate_and_readmode(fcrystal);
+#endif
+ // Set the main clock source as being OSC0.
+ pm_set_mclk_source(PM_CLK_SRC_OSC0);
+ }
+ else
+ {
+ return PCL_NOT_SUPPORTED;
+ }
+ #endif
+#endif
+ return PASS;
+}
+
+long int pcl_configure_usb_clock(void)
+{
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Implementation for UC3A, UC3A3, UC3B parts.
+ pm_configure_usb_clock();
+ return PASS;
+#else
+ #if UC3C
+ const scif_pll_opt_t opt = {
+ .osc = SCIF_OSC0, // Sel Osc0 or Osc1
+ .lockcount = 16, // lockcount in main clock for the PLL wait lock
+ .div = 1, // DIV=1 in the formula
+ .mul = 5, // MUL=7 in the formula
+ .pll_div2 = 1, // pll_div2 Divide the PLL output frequency by 2 (this settings does not change the FVCO value)
+ .pll_wbwdisable = 0, //pll_wbwdisable 1 Disable the Wide-Bandith Mode (Wide-Bandwith mode allow a faster startup time and out-of-lock time). 0 to enable the Wide-Bandith Mode.
+ .pll_freq = 1, // Set to 1 for VCO frequency range 80-180MHz, set to 0 for VCO frequency range 160-240Mhz.
+ };
+
+ /* Setup PLL1 on Osc0, mul=7 ,no divisor, lockcount=16, ie. 16Mhzx6 = 96MHz output */
+ scif_pll_setup(SCIF_PLL1, opt); // lockcount in main clock for the PLL wait lock
+
+ /* Enable PLL1 */
+ scif_pll_enable(SCIF_PLL1);
+
+ /* Wait for PLL1 locked */
+ scif_wait_for_pll_locked(SCIF_PLL1) ;
+
+ // Implementation for UC3C parts.
+ // Setup the generic clock for USB
+ scif_gc_setup(
+#if (defined AVR32_USBB)
+ AVR32_SCIF_GCLK_USB,
+#else
+ AVR32_SCIF_GCLK_USBC,
+#endif
+ SCIF_GCCTRL_PLL1,
+ AVR32_SCIF_GC_NO_DIV_CLOCK,
+ 0);
+ // Now enable the generic clock
+ scif_gc_enable(
+#if (defined AVR32_USBB)
+ AVR32_SCIF_GCLK_USB
+#else
+ AVR32_SCIF_GCLK_USBC
+#endif
+ );
+ return PASS;
+ #else
+ return PCL_NOT_SUPPORTED;
+ #endif
+#endif
+}
+
+
+#if UC3L
+#else
+void pcl_write_gplp(unsigned long gplp, unsigned long value)
+{
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Implementation for UC3A, UC3A3, UC3B parts.
+ pm_write_gplp(&AVR32_PM,gplp,value);
+#else
+ scif_write_gplp(gplp,value);
+#endif
+}
+
+unsigned long pcl_read_gplp(unsigned long gplp)
+{
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Implementation for UC3A, UC3A3, UC3B parts.
+ return pm_read_gplp(&AVR32_PM,gplp);
+#else
+ return scif_read_gplp(gplp);
+#endif
+}
+#endif
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.h
new file mode 100644
index 0000000..f661873
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/power_clocks_lib.h
@@ -0,0 +1,381 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief High-level library abstracting features such as oscillators/pll/dfll
+ * configuration, clock configuration, System-sensible parameters
+ * configuration, buses clocks configuration, sleep mode, reset.
+ *
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _POWER_CLOCKS_LIB_H_
+#define _POWER_CLOCKS_LIB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <avr32/io.h>
+#include "compiler.h"
+
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Support for UC3A, UC3A3, UC3B parts.
+ #include "pm.h"
+#else
+//! Device-specific data
+#if UC3L
+ #include "pm_uc3l.h"
+ #include "scif_uc3l.h"
+ #include "flashcdw.h"
+#elif UC3C
+ #include "pm_uc3c.h"
+ #include "scif_uc3c.h"
+ #include "flashc.h"
+#elif UC3D
+ #include "pm_uc3d.h"
+ #include "scif_uc3d.h"
+ #include "flashcdw.h"
+#endif
+ #endif
+
+/*! \name Clocks Management
+ */
+//! @{
+
+//! The different oscillators
+typedef enum
+{
+ PCL_OSC0 = 0,
+ PCL_OSC1 = 1
+} pcl_osc_t;
+
+//! The different DFLLs
+typedef enum
+{
+ PCL_DFLL0 = 0,
+ PCL_DFLL1 = 1
+} pcl_dfll_t;
+
+//! Possible Main Clock Sources
+typedef enum
+{
+ PCL_MC_RCSYS, // Default main clock source, supported by all (aka Slow Clock)
+ PCL_MC_OSC0, // Supported by all
+ PCL_MC_OSC1, // Supported by UC3C only
+ PCL_MC_OSC0_PLL0, // Supported by UC3A, UC3B, UC3A3, UC3C (the main clock source is PLL0 with OSC0 as reference)
+ PCL_MC_OSC1_PLL0, // Supported by UC3A, UC3B, UC3A3, UC3C (the main clock source is PLL0 with OSC1 as reference)
+ PCL_MC_OSC0_PLL1, // Supported by UC3C (the main clock source is PLL1 with OSC0 as reference)
+ PCL_MC_OSC1_PLL1, // Supported by UC3C (the main clock source is PLL1 with OSC1 as reference)
+ PCL_MC_DFLL0, // Supported by UC3L
+ PCL_MC_DFLL1, // Not supported yet
+ PCL_MC_RC120M, // Supported by UC3L, UC3C
+ PCL_MC_RC8M, // Supported by UC3C
+ PCL_MC_CRIPOSC // Supported by UC3C
+} pcl_mainclk_t;
+
+//! Input and output parameters to configure clocks with pcl_configure_clocks().
+// NOTE: regarding the frequency settings, always abide by the datasheet rules and min & max supported frequencies.
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Support for UC3A, UC3A3, UC3B parts.
+#define pcl_freq_param_t pm_freq_param_t // See pm.h
+#else
+// Support for UC3C, UC3L parts.
+typedef struct
+{
+ //! Main clock source selection (input argument).
+ pcl_mainclk_t main_clk_src;
+
+ //! Target CPU frequency (input/output argument).
+ unsigned long cpu_f;
+
+ //! Target PBA frequency (input/output argument).
+ unsigned long pba_f;
+
+ //! Target PBB frequency (input/output argument).
+ unsigned long pbb_f;
+
+ //! Target PBC frequency (input/output argument).
+ unsigned long pbc_f;
+
+ //! Oscillator 0's external crystal(or external clock) frequency (board dependant) (input argument).
+ unsigned long osc0_f;
+
+ //! Oscillator 0's external crystal(or external clock) startup time: AVR32_PM_OSCCTRL0_STARTUP_x_RCOSC (input argument).
+ unsigned long osc0_startup;
+
+ //! DFLL target frequency (input/output argument) (NOTE: the bigger, the most stable the frequency)
+ unsigned long dfll_f;
+
+ //! Other parameters that might be necessary depending on the device (implementation-dependent).
+ // For the UC3L DFLL setup, this parameter should be pointing to a structure of
+ // type (scif_gclk_opt_t *).
+ void *pextra_params;
+} pcl_freq_param_t;
+#endif
+
+//! Define "not supported" for the lib.
+#define PCL_NOT_SUPPORTED (-10000)
+
+/*! \brief Automatically configure the CPU, PBA, PBB, and HSB clocks
+ *
+ * This function needs some parameters stored in a pcl_freq_param_t structure:
+ * - main_clk_src is the id of the main clock source to use,
+ * - cpu_f and pba_f and pbb_f are the wanted frequencies,
+ * - osc0_f is the oscillator 0's external crystal (or external clock) on-board frequency (e.g. FOSC0),
+ * - osc0_startup is the oscillator 0's external crystal (or external clock) startup time (e.g. OSC0_STARTUP).
+ * - dfll_f is the target DFLL frequency to set-up if main_clk_src is the dfll.
+ *
+ * The CPU, HSB and PBA frequencies programmed after configuration are stored back into cpu_f and pba_f.
+ *
+ * \note: since it is dynamically computing the appropriate field values of the
+ * configuration registers from the parameters structure, this function is not
+ * optimal in terms of code size. For a code size optimal solution, it is better
+ * to create a new function from pcl_configure_clocks() and modify it to use
+ * preprocessor computation from pre-defined target frequencies.
+ *
+ * \param param pointer on the configuration structure.
+ *
+ * \retval 0 Success.
+ * \retval <0 The configuration cannot be performed.
+ */
+extern long int pcl_configure_clocks(pcl_freq_param_t *param);
+
+/*! \brief Automatically configure the CPU, PBA, PBB, and HSB clocks using the RCSYS osc as main source clock.
+ *
+ * This function needs some parameters stored in a pcl_freq_param_t structure:
+ * - cpu_f and pba_f and pbb_f are the wanted frequencies
+ *
+ * Supported main clock sources: PCL_MC_RCSYS
+ *
+ * Supported synchronous clocks frequencies:
+ * 115200Hz, 57600Hz, 28800Hz, 14400Hz, 7200Hz, 3600Hz, 1800Hz, 900Hz, 450Hz.
+ *
+ * \note: by default, this implementation doesn't perform thorough checks on the
+ * input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+ *
+ * \note: since it is dynamically computing the appropriate field values of the
+ * configuration registers from the parameters structure, this function is not
+ * optimal in terms of code size. For a code size optimal solution, it is better
+ * to create a new function from pcl_configure_clocks_rcsys() and modify it to use
+ * preprocessor computation from pre-defined target frequencies.
+ *
+ * \param param pointer on the configuration structure.
+ *
+ * \retval 0 Success.
+ * \retval <0 The configuration cannot be performed.
+ */
+extern long int pcl_configure_clocks_rcsys(pcl_freq_param_t *param);
+
+/*! \brief Automatically configure the CPU, PBA, PBB, and HSB clocks using the RC120M osc as main source clock.
+ *
+ * This function needs some parameters stored in a pcl_freq_param_t structure:
+ * - cpu_f and pba_f and pbb_f are the wanted frequencies
+ *
+ * Supported main clock sources: PCL_MC_RC120M
+ *
+ * Supported synchronous clocks frequencies:
+ * 30MHz, 15MHz, 7.5MHz, 3.75MHz, 1.875MHz, 937.5kHz, 468.75kHz.
+ *
+ * \note: by default, this implementation doesn't perform thorough checks on the
+ * input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+ *
+ * \note: since it is dynamically computing the appropriate field values of the
+ * configuration registers from the parameters structure, this function is not
+ * optimal in terms of code size. For a code size optimal solution, it is better
+ * to create a new function from pcl_configure_clocks_rc120m() and modify it to
+ * use preprocessor computation from pre-defined target frequencies.
+ *
+ * \param param pointer on the configuration structure.
+ *
+ * \retval 0 Success.
+ * \retval <0 The configuration cannot be performed.
+ */
+extern long int pcl_configure_clocks_rc120m(pcl_freq_param_t *param);
+
+/*! \brief Automatically configure the CPU, PBA, PBB, and HSB clocks using the OSC0 osc as main source clock
+ *
+ * This function needs some parameters stored in a pcl_freq_param_t structure:
+ * - cpu_f and pba_f and pbb_f are the wanted frequencies,
+ * - osc0_f is the oscillator 0's external crystal (or external clock) on-board frequency (e.g. FOSC0),
+ * - osc0_startup is the oscillator 0's external crystal (or external clock) startup time (e.g. OSC0_STARTUP).
+ *
+ * Supported main clock sources: PCL_MC_OSC0
+ *
+ * Supported synchronous clocks frequencies:
+ * (these obviously depend on the OSC0 frequency; we'll take 16MHz as an example)
+ * 16MHz, 8MHz, 4MHz, 2MHz, 1MHz, 500kHz, 250kHz, 125kHz, 62.5kHz.
+ *
+ * \note: by default, this implementation doesn't perform thorough checks on the
+ * input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+ *
+ * \note: since it is dynamically computing the appropriate field values of the
+ * configuration registers from the parameters structure, this function is not
+ * optimal in terms of code size. For a code size optimal solution, it is better
+ * to create a new function from pcl_configure_clocks_osc0() and modify it to use
+ * preprocessor computation from pre-defined target frequencies.
+ *
+ * \param param pointer on the configuration structure.
+ *
+ * \retval 0 Success.
+ * \retval <0 The configuration cannot be performed.
+ */
+extern long int pcl_configure_clocks_osc0(pcl_freq_param_t *param);
+
+/*! \brief Automatically configure the CPU, PBA, PBB, and HSB clocks using the DFLL0 as main source clock
+ *
+ * This function needs some parameters stored in a pcl_freq_param_t structure:
+ * - cpu_f and pba_f and pbb_f are the wanted frequencies,
+ * - dfll_f is the target DFLL frequency to set-up
+ *
+ * \note: when the DFLL0 is to be used as main source clock for the synchronous clocks,
+ * the target frequency of the DFLL should be chosen to be as high as possible
+ * within the specification range (for stability reasons); the target cpu and pbx
+ * frequencies will then be reached by appropriate division ratio.
+ *
+ * Supported main clock sources: PCL_MC_DFLL0
+ *
+ * Supported synchronous clocks frequencies:
+ * (these obviously depend on the DFLL target frequency; we'll take 100MHz as an example)
+ * 50MHz, 25MHz, 12.5MHz, 6.25MHz, 3.125MHz, 1562.5kHz, 781.25kHz, 390.625kHz.
+ *
+ * \note: by default, this implementation doesn't perform thorough checks on the
+ * input parameters. To enable the checks, define AVR32SFW_INPUT_CHECK.
+ *
+ * \note: since it is dynamically computing the appropriate field values of the
+ * configuration registers from the parameters structure, this function is not
+ * optimal in terms of code size. For a code size optimal solution, it is better
+ * to create a new function from pcl_configure_clocks_dfll0() and modify it to
+ * use preprocessor computation from pre-defined target frequencies.
+ *
+ * \param param pointer on the configuration structure.
+ *
+ * \retval 0 Success.
+ * \retval <0 The configuration cannot be performed.
+ */
+extern long int pcl_configure_clocks_dfll0(pcl_freq_param_t *param);
+
+/*! \brief Switch the main clock source to Osc0 configured in crystal mode
+ *
+ * \param osc The oscillator to enable and switch to.
+ * \param fcrystal Oscillator external crystal frequency (Hz)
+ * \param startup Oscillator startup time.
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long int pcl_switch_to_osc(pcl_osc_t osc, unsigned int fcrystal, unsigned int startup);
+
+/*! \brief Enable the clock of a module.
+ *
+ * \param module The module to clock (use one of the defines in the part-specific
+ * header file under "toolchain folder"/avr32/inc(lude)/avr32/; depending on the
+ * clock domain, look for the sections "CPU clocks", "HSB clocks", "PBx clocks"
+ * or look in the module section).
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Implementation for UC3A, UC3A3, UC3B parts.
+#define pcl_enable_module(module) pm_enable_module(&AVR32_PM, module)
+#else
+// Implementation for UC3C, UC3L parts.
+#define pcl_enable_module(module) pm_enable_module(module)
+#endif
+
+/*! \brief Disable the clock of a module.
+ *
+ * \param module The module to shut down (use one of the defines in the part-specific
+ * header file under "toolchain folder"/avr32/inc(lude)/avr32/; depending on the
+ * clock domain, look for the sections "CPU clocks", "HSB clocks", "PBx clocks"
+ * or look in the module section).
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+#ifndef AVR32_PM_VERSION_RESETVALUE
+// Implementation for UC3A, UC3A3, UC3B parts.
+#define pcl_disable_module(module) pm_disable_module(&AVR32_PM, module)
+#else
+// Implementation for UC3C, UC3L parts.
+#define pcl_disable_module(module) pm_disable_module(module)
+#endif
+
+/*! \brief Configure the USB Clock
+ *
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long int pcl_configure_usb_clock(void);
+
+//! @}
+
+/*! \name Power Management
+ */
+//! @{
+/*!
+ * \brief Read the content of the GPLP registers
+ * \param gplp GPLP register index (0,1,... depending on the number of GPLP registers for a given part)
+ *
+ * \return The content of the chosen GPLP register.
+ */
+extern unsigned long pcl_read_gplp(unsigned long gplp);
+
+
+/*!
+ * \brief Write into the GPLP registers
+ * \param gplp GPLP register index (0,1,... depending on the number of GPLP registers for a given part)
+ * \param value Value to write
+ */
+extern void pcl_write_gplp(unsigned long gplp, unsigned long value);
+
+//! @}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _POWER_CLOCKS_LIB_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/sleep.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/sleep.h
new file mode 100644
index 0000000..7be961c
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/pm/sleep.h
@@ -0,0 +1,149 @@
+/**
+ * \file
+ *
+ * \brief Sleep mode access
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef SLEEP_H
+#define SLEEP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <compiler.h>
+
+#ifndef AVR32_PM_SMODE_GMCLEAR_MASK
+#define AVR32_PM_SMODE_GMCLEAR_MASK 0x80
+#else
+#warning Define already present in the system toolchain header files!
+#endif
+
+/**
+ * \defgroup sleep_group Power Manager (PM)
+ *
+ * This is a stub on the AVR UC3 Power Manager(PM) for the sleepmgr service.
+ *
+ * \note To minimize the code overhead, these functions do not feature
+ * interrupt-protected access since they are likely to be called inside
+ * interrupt handlers or in applications where such protection is not
+ * necessary. If such protection is needed, it must be ensured by the calling
+ * code.
+ *
+ * @{
+ */
+
+#if defined(__DOXYGEN__)
+/**
+ * \brief Sets the MCU in the specified sleep mode
+ * \param sleep_mode Sleep mode to set.
+ */
+#endif
+
+#if (UC3A || UC3B) // For AVR UC3 A0/A1, UC3 B, UC3 A3 series
+
+# ifndef AVR32_PM_SMODE_DEEPSTOP
+# define AVR32_PM_SMODE_DEEPSTOP 0x00000004
+# endif
+# include "pm.h"
+#elif UC3C // For AVR UC3 C series
+# include "pm_uc3c.h"
+#elif UC3D // For AVR UC3 D series
+# include "pm_uc3d.h"
+#elif UC3L // For AVR UC3 L series
+# include "pm_uc3l.h"
+#else
+# error Unsupported AVR UC3 series.
+#endif
+
+static inline void pm_sleep(int sleep_mode)
+{
+ switch (sleep_mode) {
+ case AVR32_PM_SMODE_IDLE:
+ SLEEP(AVR32_PM_SMODE_IDLE);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_IDLE:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_IDLE);
+ break;
+ case AVR32_PM_SMODE_FROZEN:
+ SLEEP(AVR32_PM_SMODE_FROZEN);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_FROZEN:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_FROZEN);
+ break;
+ case AVR32_PM_SMODE_STANDBY:
+ SLEEP(AVR32_PM_SMODE_STANDBY);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_STANDBY:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_STANDBY);
+ break;
+ case AVR32_PM_SMODE_STOP:
+ SLEEP(AVR32_PM_SMODE_STOP);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_STOP:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_STOP);
+ break;
+ case AVR32_PM_SMODE_DEEPSTOP:
+ SLEEP(AVR32_PM_SMODE_DEEPSTOP);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_DEEPSTOP:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_DEEPSTOP);
+ break;
+ case AVR32_PM_SMODE_STATIC:
+ SLEEP(AVR32_PM_SMODE_STATIC);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_STATIC:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_STATIC);
+ break;
+#if UC3L
+ case AVR32_PM_SMODE_SHUTDOWN:
+ SLEEP(AVR32_PM_SMODE_SHUTDOWN);
+ break;
+ case AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_SHUTDOWN:
+ SLEEP(AVR32_PM_SMODE_GMCLEAR_MASK | AVR32_PM_SMODE_SHUTDOWN);
+ break;
+#endif
+ default:
+ break;
+ }
+}
+
+
+//! @}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SLEEP_H */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.c
new file mode 100644
index 0000000..d43719d
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.c
@@ -0,0 +1,784 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief System Control InterFace(SCIF) driver.
+ *
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 UC3C devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include "compiler.h"
+#include "scif_uc3c.h"
+
+
+/*! \name SCIF Writable Bit-Field Registers
+ */
+//! @{
+
+typedef union
+{
+ unsigned long oscctrl[2];
+ avr32_scif_oscctrl_t OSCCTRL[2];
+} u_avr32_scif_oscctrl_t;
+
+typedef union
+{
+ unsigned long pll[2];
+ avr32_scif_pll_t PLL[2];
+} u_avr32_scif_pll_t;
+
+typedef union
+{
+ unsigned long oscctrl32;
+ avr32_scif_oscctrl32_t OSCCTRL32;
+} u_avr32_scif_oscctrl32_t;
+
+
+
+//! @}
+
+
+//----- PRIVATE FUNCTIONS
+
+/*! \brief Wait for a status high in the Power and Clocks status register.
+ *
+ * \param statusMask Mask field of the status to poll [INPUT]
+ *
+ * \return Status.
+ * \retval 0 Status is high.
+ * \retval <0 SCIF_POLL_TIMEOUT Timeout expired before the status was high.
+ */
+static long int scif_pclksr_statushigh_wait(unsigned long statusMask)
+{
+ unsigned int timeout = SCIF_POLL_TIMEOUT;
+
+ while(!(AVR32_SCIF.pclksr & statusMask))
+ {
+ if(--timeout == 0)
+ return -1;
+ }
+ return PASS;
+}
+
+unsigned long scif_read_gplp(unsigned long gplp)
+{
+ return AVR32_SCIF.gplp[gplp];
+}
+
+
+void scif_write_gplp(int gplp, unsigned long value)
+{
+ SCIF_UNLOCK(AVR32_SCIF_GPLP + 4*gplp);
+ AVR32_SCIF.gplp[gplp] = value;
+}
+
+/**
+ ** Interrupt Functions
+ **/
+// Implemented as inline in scif_uc3x.h
+
+
+/**
+ ** Power and Clocks Status Functions
+ **/
+// Implemented as inline in scif_uc3x.h
+
+
+/**
+ ** OSC0/OSC1 Functions
+ **/
+
+long int scif_start_osc(scif_osc_t osc, const scif_osc_opt_t *opt, bool wait_for_ready)
+{
+ u_avr32_scif_oscctrl_t u_avr32_scif_oscctrl;
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check that the input frequency is in the supported frequency range.
+ if( (opt->freq_hz < SCIF_EXT_CRYSTAL_MIN_FREQ_HZ)
+ || (opt->freq_hz > SCIF_EXT_CRYSTAL_MAX_FREQ_HZ))
+ {
+ return -1;
+ }
+ // Check : for OSC0/OSC1, only 2 modes are supported
+ if( (opt->mode != SCIF_OSC_MODE_EXT_CLK)
+ && (opt->mode != SCIF_OSC_MODE_2PIN_CRYSTAL))
+ {
+ return -1;
+ }
+
+ if (osc == SCIF_OSC0)
+ {
+ // Check that the startup value is in the supported range.
+ if(opt->startup > (unsigned char)AVR32_SCIF_OSCCTRL0_STARTUP_16384_RCOSC)
+ {
+ return -1;
+ }
+ // Check that the gain value is in the supported range.
+ if(opt->gain > AVR32_SCIF_OSCCTRL0_GAIN_G3)
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ // Check that the startup value is in the supported range.
+ if(opt->startup > (unsigned char)AVR32_SCIF_OSCCTRL1_STARTUP_16384_RCOSC)
+ {
+ return -1;
+ }
+ // Check that the gain value is in the supported range.
+ if(opt->gain > AVR32_SCIF_OSCCTRL1_GAIN_G3)
+ {
+ return -1;
+ }
+ }
+#endif // AVR32SFW_INPUT_CHECK
+ // Read Register
+ u_avr32_scif_oscctrl.OSCCTRL[osc] = AVR32_SCIF.OSCCTRL[osc] ;
+ // Modify: Configure & start OSC0.
+ u_avr32_scif_oscctrl.OSCCTRL[osc].mode = opt->mode;
+ u_avr32_scif_oscctrl.OSCCTRL[osc].gain = opt->gain;
+ u_avr32_scif_oscctrl.OSCCTRL[osc].startup = opt->startup;
+ u_avr32_scif_oscctrl.OSCCTRL[osc].oscen = ENABLE;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL0 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL + 4*osc);
+ // Write Back
+ AVR32_SCIF.OSCCTRL[osc] = u_avr32_scif_oscctrl.OSCCTRL[osc];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ if(true == wait_for_ready)
+ {
+ // Wait until OSC0 is stable and ready to be used.
+ if(scif_pclksr_statushigh_wait(AVR32_SCIF_PCLKSR_OSC0RDY_MASK))
+ return -1;
+ }
+ return PASS;
+}
+
+
+bool scif_is_osc_ready(scif_osc_t osc)
+{
+ if (osc == SCIF_OSC0)
+ {
+ return((AVR32_SCIF.pclksr & AVR32_SCIF_PCLKSR_OSC0RDY_MASK)>>AVR32_SCIF_PCLKSR_OSC0RDY_OFFSET);
+ }
+ else
+ {
+ return((AVR32_SCIF.pclksr & AVR32_SCIF_PCLKSR_OSC1RDY_MASK)>>AVR32_SCIF_PCLKSR_OSC1RDY_OFFSET);
+ }
+}
+
+
+long int scif_stop_osc(scif_osc_t osc)
+{
+
+ unsigned long temp;
+
+ temp = AVR32_SCIF.oscctrl[osc];
+ temp &= ~AVR32_SCIF_OSCCTRL_OSCEN_MASK;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL0 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL + 4*osc);
+ // Stop OSC0.
+ AVR32_SCIF.oscctrl[osc] = temp;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+
+long int scif_configure_osc_crystalmode(scif_osc_t osc, unsigned int fcrystal)
+{
+ u_avr32_scif_oscctrl_t u_avr32_scif_oscctrl;
+
+ if (osc == SCIF_OSC0)
+ {
+ // Read Register
+ u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC0] = AVR32_SCIF.OSCCTRL[SCIF_OSC0] ;
+ // Modify : Configure the oscillator mode to crystal and set the gain according to the
+ // cyrstal frequency.
+ u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC0].mode = SCIF_OSC_MODE_2PIN_CRYSTAL;
+ u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC0].gain = (fcrystal < 900000) ? AVR32_SCIF_OSCCTRL0_GAIN_G0 :
+ (fcrystal < 3000000) ? AVR32_SCIF_OSCCTRL0_GAIN_G1 :
+ (fcrystal < 8000000) ? AVR32_SCIF_OSCCTRL0_GAIN_G2 :
+ AVR32_SCIF_OSCCTRL0_GAIN_G3;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL0 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL);
+ // Write Back
+ AVR32_SCIF.OSCCTRL[SCIF_OSC0] = u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC0];
+ AVR32_LEAVE_CRITICAL_REGION( );
+ }
+ else
+ {
+ // Read Register
+ u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC1] = AVR32_SCIF.OSCCTRL[SCIF_OSC1] ;
+ // Modify : Configure the oscillator mode to crystal and set the gain according to the
+ // cyrstal frequency.
+ u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC1].mode = SCIF_OSC_MODE_2PIN_CRYSTAL;
+ u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC1].gain = (fcrystal < 900000) ? AVR32_SCIF_OSCCTRL1_GAIN_G0 :
+ (fcrystal < 3000000) ? AVR32_SCIF_OSCCTRL1_GAIN_G1 :
+ (fcrystal < 8000000) ? AVR32_SCIF_OSCCTRL1_GAIN_G2 :
+ AVR32_SCIF_OSCCTRL1_GAIN_G3;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL1 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL + 4);
+ // Write Back
+ AVR32_SCIF.OSCCTRL[SCIF_OSC1] = u_avr32_scif_oscctrl.OSCCTRL[SCIF_OSC1];
+ AVR32_LEAVE_CRITICAL_REGION( );
+ }
+
+ return PASS;
+}
+
+long int scif_configure_osc_extmode(scif_osc_t osc)
+{
+ u_avr32_scif_oscctrl_t u_avr32_scif_oscctrl;
+
+ // Read Register
+ u_avr32_scif_oscctrl.OSCCTRL[osc] = AVR32_SCIF.OSCCTRL[osc] ;
+ // Modify : Configure the oscillator mode to crystal and set the gain according to the
+ // cyrstal frequency.
+ u_avr32_scif_oscctrl.OSCCTRL[osc].mode = SCIF_OSC_MODE_EXT_CLK;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL0 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL + 4*osc);
+ // Write Back
+ AVR32_SCIF.OSCCTRL[osc] = u_avr32_scif_oscctrl.OSCCTRL[osc];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long int scif_enable_osc(scif_osc_t osc, unsigned int startup, bool wait_for_ready)
+{
+
+ u_avr32_scif_oscctrl_t u_avr32_scif_oscctrl;
+
+ // Read Register
+ u_avr32_scif_oscctrl.OSCCTRL[osc] = AVR32_SCIF.OSCCTRL[osc] ;
+ // Modify: Configure the oscillator startup and enable the osc.
+ u_avr32_scif_oscctrl.OSCCTRL[osc].startup = startup;
+ u_avr32_scif_oscctrl.OSCCTRL[osc].oscen = ENABLE;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL0 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL + 4*osc);
+ // Write Back
+ AVR32_SCIF.OSCCTRL[osc] = u_avr32_scif_oscctrl.OSCCTRL[osc];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ if(true == wait_for_ready)
+ {
+ // Wait until OSC0 is stable and ready to be used.
+ if(scif_pclksr_statushigh_wait(AVR32_SCIF_PCLKSR_OSC0RDY_MASK))
+ return -1;
+ }
+
+ return PASS;
+}
+
+long int scif_enable_extosc(scif_osc_t osc)
+{
+
+ u_avr32_scif_oscctrl_t u_avr32_scif_oscctrl;
+
+ // Read Register
+ u_avr32_scif_oscctrl.OSCCTRL[osc] = AVR32_SCIF.OSCCTRL[osc] ;
+ // Modify : Enable the osc.
+ u_avr32_scif_oscctrl.OSCCTRL[osc].oscen = ENABLE;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL0 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL + 4*osc);
+ // Write Back
+ AVR32_SCIF.OSCCTRL[osc] = u_avr32_scif_oscctrl.OSCCTRL[osc];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+/**
+ ** PLL0/PLL1 Functions
+ **/
+long int scif_pll_setup(scif_pll_t pll, const scif_pll_opt_t opt)
+{
+
+ u_avr32_scif_pll_t u_avr32_scif_pll;
+
+ // Read Register
+ u_avr32_scif_pll.PLL[pll] = AVR32_SCIF.PLL[pll] ;
+ // Modify Configuration
+ u_avr32_scif_pll.PLL[pll].pllosc = opt.osc;
+ u_avr32_scif_pll.PLL[pll].pllopt = opt.pll_freq | (opt.pll_div2 << 1) | (opt.pll_wbwdisable << 2);
+ u_avr32_scif_pll.PLL[pll].plldiv = opt.div;
+ u_avr32_scif_pll.PLL[pll].pllmul = opt.mul;
+ u_avr32_scif_pll.PLL[pll].pllcount= opt.lockcount;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected PLL0 register
+ SCIF_UNLOCK(AVR32_SCIF_PLL + 4*pll);
+ // Write Back
+ AVR32_SCIF.PLL[pll] = u_avr32_scif_pll.PLL[pll];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long int scif_pll_enable(scif_pll_t pll)
+{
+
+ u_avr32_scif_pll_t u_avr32_scif_pll;
+
+ // Read Register
+ u_avr32_scif_pll.PLL[pll] = AVR32_SCIF.PLL[pll] ;
+ // Modify Configuration
+ u_avr32_scif_pll.PLL[pll].pllen = ENABLE;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected PLL0 register
+ SCIF_UNLOCK(AVR32_SCIF_PLL + 4*pll);
+ // Write Back
+ AVR32_SCIF.PLL[pll] = u_avr32_scif_pll.PLL[pll];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long int scif_pll_disable(scif_pll_t pll)
+{
+
+ u_avr32_scif_pll_t u_avr32_scif_pll;
+
+ // Read Register
+ u_avr32_scif_pll.PLL[pll] = AVR32_SCIF.PLL[pll] ;
+ // Modify Configuration
+ u_avr32_scif_pll.PLL[pll].pllen = DISABLE;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected PLL0 register
+ SCIF_UNLOCK(AVR32_SCIF_PLL + 4*pll);
+ // Write Back
+ AVR32_SCIF.PLL[pll] = u_avr32_scif_pll.PLL[pll];
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+long int scif_wait_for_pll_locked(scif_pll_t pll)
+{
+
+ if (pll == SCIF_PLL0)
+ {
+ // Wait until PLL0 is stable and ready to be used.
+ while(!(AVR32_SCIF.pclksr & AVR32_SCIF_PCLKSR_PLL0_LOCK_MASK));
+ }
+ else
+ {
+ // Wait until PLL1 is stable and ready to be used.
+ while(!(AVR32_SCIF.pclksr & AVR32_SCIF_PCLKSR_PLL1_LOCK_MASK));
+ }
+
+ return PASS;
+}
+
+/**
+ ** OSC32 Functions
+ **/
+
+long int scif_start_osc32(const scif_osc32_opt_t *opt, bool wait_for_ready)
+{
+ u_avr32_scif_oscctrl32_t u_avr32_scif_oscctrl32;
+
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check that the input frequency is in the supported frequency range.
+ if( (opt->freq_hz < SCIF_EXT_CRYSTAL_MIN_FREQ_HZ)
+ || (opt->freq_hz > SCIF_EXT_CRYSTAL_MAX_FREQ_HZ))
+ {
+ return -1;
+ }
+ // Check : for OSC0/OSC1, only 2 modes are supported
+ if( (opt->mode < SCIF_OSC_MODE_EXT_CLK)
+ || (opt->mode > SCIF_OSC_MODE_2PIN_CRYSTAL)
+ || (opt->mode == SCIF_OSC_MODE_NOT_SUPPORTED_1)
+ || (opt->mode == SCIF_OSC_MODE_NOT_SUPPORTED_2) )
+ {
+ return -1;
+ }
+ // Check that the startup value is in the supported range.
+ if(opt->startup > (unsigned char)AVR32_SCIF_OSCCTRL32_STARTUP_524288_RCOSC)
+ {
+ return -1;
+ }
+#endif // AVR32SFW_INPUT_CHECK
+
+ // Read Register
+ u_avr32_scif_oscctrl32.oscctrl32 = AVR32_SCIF.oscctrl32 ;
+
+ // Modify : Configure & start OSC32.
+ u_avr32_scif_oscctrl32.OSCCTRL32.mode = opt->mode;
+ u_avr32_scif_oscctrl32.OSCCTRL32.startup = opt->startup;
+ u_avr32_scif_oscctrl32.OSCCTRL32.osc32en = ENABLE;
+
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL32 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL32);
+
+ // Write Back
+ AVR32_SCIF.oscctrl32 = u_avr32_scif_oscctrl32.oscctrl32;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ if(true == wait_for_ready)
+ {
+ // Wait until OSC32 is stable and ready to be used.
+ if(scif_pclksr_statushigh_wait(AVR32_SCIF_PCLKSR_OSC32RDY_MASK))
+ return -1;
+ }
+
+ return PASS;
+}
+
+
+long scif_stop_osc32()
+{
+ unsigned long temp = AVR32_SCIF.oscctrl32;
+ temp &= ~AVR32_SCIF_OSCCTRL32_OSC32EN_MASK;
+
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected OSCCTRL32 register
+ SCIF_UNLOCK(AVR32_SCIF_OSCCTRL32);
+
+ // Stop OSC32.
+ AVR32_SCIF.oscctrl32 = temp;
+ AVR32_LEAVE_CRITICAL_REGION( );
+
+ return PASS;
+}
+
+
+/**
+ ** Calibration Functions
+ **/
+
+
+/**
+ ** Critical Path Oscillator Functions
+ **/
+
+/**
+ ** 8MHz RCosc Functions
+ **/
+
+void scif_start_rc8M(void)
+{
+ unsigned int* calibration_bits = (unsigned int*)0x80800200;
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected RC8MCR register
+ SCIF_UNLOCK(AVR32_SCIF_RCCR8);
+ AVR32_SCIF.rccr8 = AVR32_SCIF_RCCR8_RCOSC8_EN_MASK | ((*calibration_bits)&AVR32_SCIF_RCCR8_CALIB_MASK);
+ AVR32_LEAVE_CRITICAL_REGION( );
+}
+
+void scif_stop_rc8M(void)
+{
+ unsigned long temp = AVR32_SCIF.rccr8;
+
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected RC8MCR register
+ SCIF_UNLOCK(AVR32_SCIF_RCCR8);
+ temp &= ~AVR32_SCIF_RCCR8_RCOSC8_EN_MASK;
+ AVR32_SCIF.rccr8 = temp;
+ AVR32_LEAVE_CRITICAL_REGION( );
+}
+
+/**
+ ** 120MHz RCosc Functions
+ **/
+
+void scif_start_rc120M(void)
+{
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected RC120MCR register
+ SCIF_UNLOCK(AVR32_SCIF_RC120MCR);
+ AVR32_SCIF.rc120mcr = AVR32_SCIF_RC120MCR_EN_MASK;
+ AVR32_LEAVE_CRITICAL_REGION( );
+}
+
+void scif_stop_rc120M(void)
+{
+ unsigned long temp = AVR32_SCIF.rc120mcr;
+
+ AVR32_ENTER_CRITICAL_REGION( );
+ // Unlock the write-protected RC120MCR register
+ SCIF_UNLOCK(AVR32_SCIF_RC120MCR);
+ temp &= ~AVR32_SCIF_RC120MCR_EN_MASK;
+ AVR32_SCIF.rc120mcr = temp;
+ AVR32_LEAVE_CRITICAL_REGION( );
+}
+
+
+
+/**
+ ** Generic Clock Functions
+ **/
+
+long int scif_start_gclk(unsigned int gclk, const scif_gclk_opt_t *opt)
+{
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check that the generic clock number is correct
+ if( gclk > AVR32_SCIF_GCLK_NUM )
+ {
+ return -1;
+ }
+ // Check that the clock source for the generic clock is correct.
+ if(( opt->clock_source >= SCIF_GCCTRL_OSCSEL_INVALID ) || ( opt->clock_source < 0 ))
+ {
+ return -1;
+ }
+#endif // AVR32SFW_INPUT_CHECK
+
+ // If the generic clock is already enabled, return an error.
+ if(AVR32_SCIF.gcctrl[gclk] & AVR32_SCIF_GCCTRL_CEN_MASK)
+ return -1;
+
+ // Configure & start the generic clock.
+ AVR32_SCIF.gcctrl[gclk] = ((opt->divider << AVR32_SCIF_GCCTRL_DIV_OFFSET)&AVR32_SCIF_GCCTRL_DIV_MASK)
+ |((opt->diven << AVR32_SCIF_GCCTRL_DIVEN_OFFSET)&AVR32_SCIF_GCCTRL_DIVEN_MASK)
+ |((opt->clock_source << AVR32_SCIF_GCCTRL_OSCSEL_OFFSET)&AVR32_SCIF_GCCTRL_OSCSEL_MASK)
+ |(AVR32_SCIF_GCCTRL_CEN_MASK);
+
+ return PASS;
+}
+
+
+long int scif_stop_gclk(unsigned int gclk)
+{
+ unsigned int timeout = SCIF_POLL_TIMEOUT;
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check that the generic clock number is correct
+ if( gclk > AVR32_SCIF_GCLK_NUM )
+ {
+ return -1;
+ }
+#endif // AVR32SFW_INPUT_CHECK
+
+ // Stop the generic clock.
+ AVR32_SCIF.gcctrl[gclk] &= ~AVR32_SCIF_GCCTRL_CEN_MASK;
+
+ // Wait until the generic clock is actually stopped.
+ while(AVR32_SCIF.gcctrl[gclk] & AVR32_SCIF_GCCTRL_CEN_MASK)
+ {
+ if(--timeout == 0)
+ return -1;
+ }
+
+ return PASS;
+}
+
+
+long int scif_gc_setup(unsigned int gclk, scif_gcctrl_oscsel_t clk_src, unsigned int diven, unsigned int divfactor)
+{
+ int restart_gc = false;
+
+
+ // Change the division factor to conform to the equation: fgclk = fsrc/divfactor = fsrc/(2*(div+1))
+ divfactor = (divfactor>>1) -1;
+
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check that the generic clock number is correct
+ if( gclk > AVR32_SCIF_GCLK_NUM )
+ {
+ return -1;
+ }
+ // Check that the clock source for the generic clock is correct.
+ if(( clk_src >= SCIF_GCCTRL_OSCSEL_INVALID ) || ( clk_src < 0 ))
+ {
+ return -1;
+ }
+ // Check that the required division factor is correct.
+ if(diven)
+ {
+ if(divfactor >= (1<<AVR32_SCIF_GCCTRL_DIV_SIZE))
+ return -1;
+ }
+#endif // AVR32SFW_INPUT_CHECK
+
+ // If the generic clock is already enabled, disable it before changing its setup.
+ if(AVR32_SCIF.gcctrl[gclk] & AVR32_SCIF_GCCTRL_CEN_MASK)
+ {
+ restart_gc = true;
+ if(scif_stop_gclk(gclk) < 0)
+ return -1; // Could not stop the generic clock.
+ }
+
+ // Setup the generic clock.
+ AVR32_SCIF.gcctrl[gclk] = ((divfactor << AVR32_SCIF_GCCTRL_DIV_OFFSET)&AVR32_SCIF_GCCTRL_DIV_MASK)
+ |((diven << AVR32_SCIF_GCCTRL_DIVEN_OFFSET)&AVR32_SCIF_GCCTRL_DIVEN_MASK)
+ |((clk_src << AVR32_SCIF_GCCTRL_OSCSEL_OFFSET)&AVR32_SCIF_GCCTRL_OSCSEL_MASK);
+
+ // Restart the gc if it previously was enabled.
+ if(true == restart_gc)
+ AVR32_SCIF.gcctrl[gclk] |= AVR32_SCIF_GCCTRL_CEN_MASK ;
+
+ return PASS;
+}
+
+
+long int scif_gc_enable(unsigned int gclk)
+{
+#ifdef AVR32SFW_INPUT_CHECK
+ // Check that the generic clock number is correct
+ if( gclk > AVR32_SCIF_GCLK_NUM )
+ {
+ return -1;
+ }
+#endif // AVR32SFW_INPUT_CHECK
+
+ // If the generic clock is already enabled, do nothing.
+ if(!(AVR32_SCIF.gcctrl[gclk] & AVR32_SCIF_GCCTRL_CEN_MASK))
+ AVR32_SCIF.gcctrl[gclk] |= AVR32_SCIF_GCCTRL_CEN_MASK;
+
+ return PASS;
+
+}
+
+void scif_bod18_enable_irq(void)
+{
+ AVR32_SCIF.ier = AVR32_SCIF_IER_BODDET_MASK ;
+}
+
+void scif_bod18_disable_irq(void)
+{
+ bool global_interrupt_enabled = Is_global_interrupt_enabled();
+
+ if (global_interrupt_enabled) Disable_global_interrupt();
+ AVR32_SCIF.idr = AVR32_SCIF_IDR_BODDET_MASK;
+ AVR32_SCIF.isr;
+ if (global_interrupt_enabled) Enable_global_interrupt();
+}
+
+void scif_bod18_clear_irq(void)
+{
+ AVR32_SCIF.icr = AVR32_SCIF_ICR_BODDET_MASK;
+}
+
+unsigned long scif_bod18_get_irq_status(void)
+{
+ return ((AVR32_SCIF.isr & AVR32_SCIF_ISR_BODDET_MASK) != 0);
+}
+
+unsigned long scif_bod18_get_irq_enable_bit(void)
+{
+ return ((AVR32_SCIF.imr & AVR32_SCIF_IMR_BODDET_MASK) != 0);
+}
+
+unsigned long scif_bod18_get_level(void)
+{
+ return (AVR32_SCIF.bod & AVR32_SCIF_BOD_LEVEL_MASK) >> AVR32_SCIF_BOD_LEVEL_OFFSET;
+}
+
+void scif_bod33_enable_irq(void)
+{
+ AVR32_SCIF.ier = AVR32_SCIF_IER_BOD33DET_MASK ;
+}
+
+void scif_bod33_disable_irq(void)
+{
+ bool global_interrupt_enabled = Is_global_interrupt_enabled();
+
+ if (global_interrupt_enabled) Disable_global_interrupt();
+ AVR32_SCIF.idr = AVR32_SCIF_IDR_BOD33DET_MASK;
+ AVR32_SCIF.isr;
+ if (global_interrupt_enabled) Enable_global_interrupt();
+}
+
+void scif_bod33_clear_irq(void)
+{
+ AVR32_SCIF.icr = AVR32_SCIF_ICR_BOD33DET_MASK;
+}
+
+unsigned long scif_bod33_get_irq_status(void)
+{
+ return ((AVR32_SCIF.isr & AVR32_SCIF_ISR_BOD33DET_MASK) != 0);
+}
+
+unsigned long scif_bod33_get_irq_enable_bit(void)
+{
+ return ((AVR32_SCIF.imr & AVR32_SCIF_IMR_BOD33DET_MASK) != 0);
+}
+
+unsigned long scif_bod33_get_level(void)
+{
+ return (AVR32_SCIF.bod33 & AVR32_SCIF_BOD33_LEVEL_MASK) >> AVR32_SCIF_BOD33_LEVEL_OFFSET;
+}
+
+void scif_bod50_enable_irq(void)
+{
+ AVR32_SCIF.ier = AVR32_SCIF_IER_BOD50DET_MASK ;
+}
+
+void scif_bod50_disable_irq(void)
+{
+ bool global_interrupt_enabled = Is_global_interrupt_enabled();
+
+ if (global_interrupt_enabled) Disable_global_interrupt();
+ AVR32_SCIF.idr = AVR32_SCIF_IDR_BOD50DET_MASK;
+ AVR32_SCIF.isr;
+ if (global_interrupt_enabled) Enable_global_interrupt();
+}
+
+void scif_bod50_clear_irq(void)
+{
+ AVR32_SCIF.icr = AVR32_SCIF_ICR_BOD50DET_MASK;
+}
+
+unsigned long scif_bod50_get_irq_status(void)
+{
+ return ((AVR32_SCIF.isr & AVR32_SCIF_ISR_BOD50DET_MASK) != 0);
+}
+
+unsigned long scif_bod50_get_irq_enable_bit(void)
+{
+ return ((AVR32_SCIF.imr & AVR32_SCIF_IMR_BOD50DET_MASK) != 0);
+}
+
+unsigned long scif_bod50_get_level(void)
+{
+ return (AVR32_SCIF.bod50 & AVR32_SCIF_BOD50_LEVEL_MASK) >> AVR32_SCIF_BOD50_LEVEL_OFFSET;
+}
+
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.h
new file mode 100644
index 0000000..74c3a2c
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/scif/scif_uc3c.h
@@ -0,0 +1,761 @@
+/*This file has been prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief System Control InterFace(SCIF) driver interface.
+ *
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 UC3C devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ *****************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+#ifndef _SCIF_UC3C_H_
+#define _SCIF_UC3C_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "compiler.h"
+
+
+// These defines are missing from or wrong in the toolchain header file ip_xxx.h or part.h
+#ifdef AVR32_SCIF_101_H_INCLUDED
+#define AVR32_SCIF_OSCCTRL0_STARTUP_0_RCOSC 0x00000000
+#define AVR32_SCIF_OSCCTRL0_STARTUP_128_RCOSC 0x00000002
+#define AVR32_SCIF_OSCCTRL0_STARTUP_16384_RCOSC 0x00000006
+#define AVR32_SCIF_OSCCTRL0_STARTUP_2048_RCOSC 0x00000003
+#define AVR32_SCIF_OSCCTRL0_STARTUP_4096_RCOSC 0x00000004
+#define AVR32_SCIF_OSCCTRL0_STARTUP_64_RCOSC 0x00000001
+#define AVR32_SCIF_OSCCTRL0_STARTUP_8192_RCOSC 0x00000005
+#define AVR32_SCIF_OSCCTRL1_STARTUP_0_RCOSC 0x00000000
+#define AVR32_SCIF_OSCCTRL1_STARTUP_128_RCOSC 0x00000002
+#define AVR32_SCIF_OSCCTRL1_STARTUP_16384_RCOSC 0x00000006
+#define AVR32_SCIF_OSCCTRL1_STARTUP_2048_RCOSC 0x00000003
+#define AVR32_SCIF_OSCCTRL1_STARTUP_4096_RCOSC 0x00000004
+#define AVR32_SCIF_OSCCTRL1_STARTUP_64_RCOSC 0x00000001
+#define AVR32_SCIF_OSCCTRL1_STARTUP_8192_RCOSC 0x00000005
+#define AVR32_SCIF_OSCCTRL32_STARTUP_0_RCOSC 0x00000000
+#define AVR32_SCIF_OSCCTRL32_STARTUP_128_RCOSC 0x00000001
+#define AVR32_SCIF_OSCCTRL32_STARTUP_131072_RCOSC 0x00000005
+#define AVR32_SCIF_OSCCTRL32_STARTUP_16384_RCOSC 0x00000003
+#define AVR32_SCIF_OSCCTRL32_STARTUP_262144_RCOSC 0x00000006
+#define AVR32_SCIF_OSCCTRL32_STARTUP_524288_RCOSC 0x00000007
+#define AVR32_SCIF_OSCCTRL32_STARTUP_65536_RCOSC 0x00000004
+#define AVR32_SCIF_OSCCTRL32_STARTUP_8192_RCOSC 0x00000002
+#define AVR32_SCIF_OSCCTRL0_MODE_CRYSTAL 0x00000001
+#define AVR32_SCIF_OSCCTRL0_MODE_EXTCLK 0x00000000
+#define AVR32_SCIF_OSCCTRL0_GAIN_G0 0x00000000
+#define AVR32_SCIF_OSCCTRL0_GAIN_G1 0x00000001
+#define AVR32_SCIF_OSCCTRL0_GAIN_G2 0x00000002
+#define AVR32_SCIF_OSCCTRL0_GAIN_G3 0x00000003
+#define AVR32_SCIF_OSCCTRL1_GAIN_G0 0x00000000
+#define AVR32_SCIF_OSCCTRL1_GAIN_G1 0x00000001
+#define AVR32_SCIF_OSCCTRL1_GAIN_G2 0x00000002
+#define AVR32_SCIF_OSCCTRL1_GAIN_G3 0x00000003
+#define AVR32_SCIF_UNLOCK_KEY_VALUE 0x000000AA
+#define AVR32_SCIF_OSCCTRL_OSCEN_ENABLE 0x00000001
+#define AVR32_SCIF_OSCCTRL_OSCEN_DISABLE 0x00000000
+#define AVR32_SCIF_OSCCTRL32_OSC32EN_ENABLE 0x00000001
+#define AVR32_SCIF_OSCCTRL32_OSC32EN_DISABLE 0x00000000
+#endif
+
+
+//! Device-specific data
+
+//!< External crystal/clock min frequency (in Herz)
+#define SCIF_EXT_CRYSTAL_MIN_FREQ_HZ 4000000
+//!< External crystal/clock max frequency (in Herz)
+#define SCIF_EXT_CRYSTAL_MAX_FREQ_HZ 20000000
+
+//! The different clock source for the generic clocks
+typedef enum
+{
+ SCIF_GCCTRL_SLOWCLOCK = AVR32_SCIF_GC_USES_CLK_SLOW,
+ SCIF_GCCTRL_OSC32K = AVR32_SCIF_GC_USES_CLK_32,
+ SCIF_GCCTRL_OSC0 = AVR32_SCIF_GC_USES_OSC0,
+ SCIF_GCCTRL_OSC1 = AVR32_SCIF_GC_USES_OSC1,
+ SCIF_GCCTRL_PLL0 = AVR32_SCIF_GC_USES_PLL0,
+ SCIF_GCCTRL_PLL1 = AVR32_SCIF_GC_USES_PLL1,
+ SCIF_GCCTRL_RC8M = AVR32_SCIF_GC_USES_RCOSC8,
+ SCIF_GCCTRL_CPUCLOCK = AVR32_SCIF_GC_USES_CLK_CPU,
+ SCIF_GCCTRL_HSBCLOCK = AVR32_SCIF_GC_USES_CLK_HSB,
+ SCIF_GCCTRL_PBACLOCK = AVR32_SCIF_GC_USES_CLK_PBA,
+ SCIF_GCCTRL_PBBCLOCK = AVR32_SCIF_GC_USES_CLK_PBB,
+ SCIF_GCCTRL_OSCSEL_INVALID
+} scif_gcctrl_oscsel_t;
+
+
+
+//! The timeguard used for polling in ticks.
+#define SCIF_POLL_TIMEOUT 100000
+
+//! Define "not supported" for the chosen implementation.
+#define SCIF_NOT_SUPPORTED (-10000)
+
+
+//! The different oscillators
+typedef enum
+{
+ SCIF_OSC0 = 0,
+ SCIF_OSC1 = 1
+} scif_osc_t;
+
+//! The different plls
+typedef enum
+{
+ SCIF_PLL0 = 0,
+ SCIF_PLL1 = 1
+} scif_pll_t;
+
+//! The different oscillator modes
+typedef enum
+{
+ SCIF_OSC_MODE_EXT_CLK = 0, // For both OSC0 & OSC32
+ SCIF_OSC_MODE_2PIN_CRYSTAL = 1, // For both OSC0 & OSC32
+ SCIF_OSC_MODE_2PIN_CRYSTAL_HICUR = 2, // For OSC32 only
+} scif_osc_mode_t;
+
+//! OSC0/OSC1 startup options.
+typedef struct
+{
+ //! The input frequency (from the external clock or the crystal).
+ unsigned long freq_hz;
+ //! Set the oscillator mode.
+ scif_osc_mode_t mode;
+ //! Specify the oscillator startup time.
+ unsigned char startup;
+ //! Gain for the oscillator
+ unsigned char gain;
+} scif_osc_opt_t;
+
+//! PLL0/PLL1 startup options.
+typedef struct
+{
+ //! Set to 1 for VCO frequency range 80-180MHz, set to 0 for VCO frequency range 160-240Mhz.
+ unsigned char pll_freq;
+ //! 1 Disable the Wide-Bandith Mode (Wide-Bandwith mode allow a faster startup time and out-of-lock time). 0 to enable the Wide-Bandith Mode.
+ unsigned char pll_wbwdisable;
+ //! Divide the PLL output frequency by 2. (this settings does not change the FVCO value)
+ unsigned char pll_div2;
+ //! PLL MUL in the PLL formula
+ unsigned int mul;
+ //! PLL DIV in the PLL formula
+ unsigned int div;
+ //! PLL lockount
+ unsigned int lockcount;
+ //! Specify the scillator input.
+ unsigned char osc;
+} scif_pll_opt_t;
+
+//! OSC32 startup options.
+typedef struct
+{
+ //! The input frequency (from the external clock or the crystal).
+ unsigned long freq_hz;
+ //! Set the oscillator mode.
+ scif_osc_mode_t mode;
+ //! Specify the oscillator startup time.
+ unsigned char startup;
+} scif_osc32_opt_t;
+
+
+//! Generic clock generation settings.
+typedef struct
+{
+ //! The input clock source to use for the generic clock
+ scif_gcctrl_oscsel_t clock_source;
+ //! The division factor to apply to the clock src.
+ unsigned int divider;
+ //! Enable/disable the generic clock divisor
+ unsigned int diven;
+} scif_gclk_opt_t;
+
+
+//! Unlock SCIF register macro
+#define SCIF_UNLOCK(reg) (AVR32_SCIF.unlock = (AVR32_SCIF_UNLOCK_KEY_VALUE << AVR32_SCIF_UNLOCK_KEY_OFFSET)|(reg))
+
+/*! \name Interrupt Functions
+ */
+//! @{
+
+/*! \brief Enable SCIF interrupts.
+ *
+ * \param mask the interrupts to enable.
+ */
+ #if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void scif_enable_interrupts(unsigned long mask)
+{
+ AVR32_SCIF.ier = mask;
+}
+
+/*! \brief Disable SCIF interrupts.
+ *
+ * \param mask the interrupts to disable.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void scif_disable_interrupts(unsigned long mask)
+{
+ AVR32_SCIF.idr = mask;
+}
+
+/*! \brief Read the SCIF currently enabled interrupts.
+ *
+ * \return The enabled interrupts.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long scif_get_enabled_interrupts(void)
+{
+ return(AVR32_SCIF.imr);
+}
+
+/*! \brief Read the interrupt status of the SCIF.
+ *
+ * \return The interrupts which have been triggered.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long scif_get_interrupts_status(void)
+{
+ return(AVR32_SCIF.isr);
+}
+
+/*! \brief Clear raised interrupts from the SCIF.
+ *
+ * \param mask The interrupts to clear.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void scif_clear_interrupts_status(unsigned long mask)
+{
+ AVR32_SCIF.icr = mask;
+}
+
+//! @}
+
+
+/*! \name Power and Clocks Status Functions
+ */
+//! @{
+
+/*! \brief Read the Power and Clocks Status of the SCIF.
+ *
+ * \return The content of the PCLKSR register
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline unsigned long scif_get_pclk_status(void)
+{
+ return(AVR32_SCIF.pclksr);
+}
+
+//! @}
+
+
+/*! \name OSC0/OSC1 Functions
+ */
+//! @{
+
+/*! \brief Configure and start an OSC0/OSC1 oscillator.
+ *
+ * \param osc The oscillator to start [INPUT]
+ * \param opt The configuration of the oscillator [INPUT]
+ * \param wait_for_ready Wait for the oscillator to be stable before return [INPUT]
+ *
+ * \note To avoid an infinite loop, this function checks the osc0 ready flag
+ * SCIF_POLL_TIMEOUT times.
+ *
+ * \return Status.
+ * \retval 0 Oscillator start successfull.
+ * \retval <0 Error starting the oscillator.
+ */
+extern long int scif_start_osc(scif_osc_t osc, const scif_osc_opt_t *opt, bool wait_for_ready);
+
+/*! \brief Is an oscillator stable and ready to be used as clock source?
+ *
+ * \param osc The oscillator [INPUT]
+ *
+ * \return Status.
+ * \retval true oscillator stable and ready
+ * \retval false oscillator not enabled or not ready.
+ */
+extern bool scif_is_osc_ready(scif_osc_t osc);
+
+/*! \brief Stop an oscillator.
+ *
+ * \param osc The oscillator to stop
+ *
+ * \return Status.
+ * \retval 0 Oscillator successfully stopped.
+ * \retval <0 An error occured when stopping the oscillator.
+ */
+extern long int scif_stop_osc(scif_osc_t osc);
+
+/*! \brief Configure an oscillator in crystal mode
+ *
+ * \param osc The oscillator to configure [INPUT]
+ * \param fcrystal Crystal frequency (Hz) [INPUT]
+ *
+ * \return Status.
+ * \retval 0 Oscillator successfully configured.
+ * \retval <0 Error configuring the oscillator.
+ */
+extern long int scif_configure_osc_crystalmode(scif_osc_t osc, unsigned int fcrystal);
+
+/*! \brief Configure an external clock as input clock
+ *
+ * \param osc The external clock to configure [INPUT]
+ *
+ * \return Status.
+ * \retval 0 External clock successfully configured.
+ * \retval <0 Error configuring the external clock.
+ */
+extern long int scif_configure_osc_extmode(scif_osc_t osc);
+
+/*! \brief Enable an oscillator with a given startup time.
+ *
+ * \param osc The oscillator to configure [INPUT]
+ * \param startup Oscillator startup time (one of AVR32_SCIF_OSCCTRLx_STARTUP_x_RCOSC) [INPUT]
+ * \param wait_for_ready Wait for the oscillator to be stable before return [INPUT]
+ *
+ * \return Status.
+ * \retval 0 Oscillator successfully started
+ * \retval <0 Error starting the oscillator.
+ */
+extern long int scif_enable_osc(scif_osc_t osc, unsigned int startup, bool wait_for_ready);
+
+/*! \brief Enable external clock.
+ *
+ * \param osc The oscillator to configure [INPUT]
+ *
+ * \return Status.
+ * \retval 0 Oscillator successfully started
+ * \retval <0 Error starting the oscillator.
+ */
+extern long int scif_enable_extosc(scif_osc_t osc);
+
+//! @}
+
+
+/*! \name PLL0/PLL1 Functions
+ */
+//! @{
+
+/*!
+ * \brief This function will setup a PLL.
+ * \param pll The PLL to configure [INPUT]
+ * \param opt The configuration of the PLL [INPUT]
+ * \return Status.
+ * \retval 0 PLL successfully started
+ * \retval <0 Error starting the PLL.
+ */
+extern long int scif_pll_setup(scif_pll_t pll, const scif_pll_opt_t opt);
+
+/*!
+ * \brief This function will enable a PLL.
+ * \param pll The PLL to configure [INPUT]
+ * \return Status.
+ * \retval 0 PLL successfully started
+ * \retval <0 Error starting the PLL.
+ */
+extern long int scif_pll_enable(scif_pll_t pll);
+
+
+/*!
+ * \brief This function will disable a PLL.
+ * \param pll The PLL to configure [INPUT]
+ * \return Status.
+ * \retval 0 PLL successfully started
+ * \retval <0 Error starting the PLL.
+ */
+extern long int scif_pll_disable(scif_pll_t pll);
+
+
+/*!
+ * \brief This function will wait for PLL locked
+ * \param pll The PLL to configure [INPUT]
+ * \return Status.
+ * \retval 0 PLL successfully started
+ * \retval <0 Error starting the PLL.
+ */
+extern long int scif_wait_for_pll_locked(scif_pll_t pll);
+
+//! @}
+
+/*! \name OSC32 Functions
+ */
+//! @{
+
+/*! \brief Configure and start the OSC32 oscillator.
+ *
+ * \param opt The configuration of the oscillator [INPUT]
+ * \param wait_for_ready Wait for the oscillator to be stable before return [INPUT]
+ *
+ * \note To avoid an infinite loop, this function checks the osc32 ready flag
+ * SCIF_POLL_TIMEOUT times.
+ *
+ * \return Status.
+ * \retval 0 Oscillator start successfull.
+ * \retval <0 Error starting the oscillator.
+ */
+extern long int scif_start_osc32(const scif_osc32_opt_t *opt, bool wait_for_ready);
+
+/*! \brief Is OSC32 stable and ready to be used as clock source?
+ *
+ * \return Status.
+ * \retval true oscillator stable and ready
+ * \retval false oscillator not enabled or not ready.
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline bool scif_is_osc32_ready(void)
+{
+ return((AVR32_SCIF.pclksr & AVR32_SCIF_PCLKSR_OSC32RDY_MASK)>>AVR32_SCIF_PCLKSR_OSC32RDY_OFFSET);
+}
+
+
+/*! \brief Stop the OSC32 oscillator.
+ *
+ * \return Status.
+ * \retval 0 Oscillator successfully stopped.
+ * \retval <0 An error occured when stopping the oscillator.
+ */
+extern long int scif_stop_osc32(void);
+
+//! @}
+
+
+/*! \name Calibration Functions
+ */
+//! @{
+
+/*! \brief Enables the 1.8V Brown-Out Detector interrupt.
+ *
+ */
+extern void scif_bod18_enable_irq(void);
+
+
+/*! \brief Disables the 1.8V Brown-Out Detector interrupt.
+ *
+ */
+extern void scif_bod18_disable_irq(void);
+
+
+/*! \brief Clears the 1.8V Brown-Out Detector interrupt flag.
+ *
+ */
+extern void scif_bod18_clear_irq(void);
+
+
+/*! \brief Gets the 1.8V Brown-Out Detector interrupt flag.
+ *
+ *
+ * \retval 0 No BOD interrupt.
+ * \retval 1 BOD interrupt pending.
+ */
+extern unsigned long scif_bod18_get_irq_status(void);
+
+
+/*! \brief Gets the 1.8V Brown-Out Detector interrupt enable status.
+ *
+ *
+ * \retval 0 BOD interrupt disabled.
+ * \retval 1 BOD interrupt enabled.
+ */
+extern unsigned long scif_bod18_get_irq_enable_bit(void);
+
+
+/*! \brief Gets the triggering threshold of the 1.8V Brown-Out Detector.
+ *
+ */
+extern unsigned long scif_bod18_get_level(void);
+
+
+/*! \brief Enables the 3.3V Brown-Out Detector interrupt.
+ *
+ */
+extern void scif_bod33_enable_irq(void);
+
+
+/*! \brief Disables the 3.3V Brown-Out Detector interrupt.
+ *
+ */
+extern void scif_bod33_disable_irq(void);
+
+
+/*! \brief Clears the 3.3V Brown-Out Detector interrupt flag.
+ *
+ */
+extern void scif_bod33_clear_irq(void);
+
+
+/*! \brief Gets the 3.3V Brown-Out Detector interrupt flag.
+ *
+ *
+ * \retval 0 No BOD interrupt.
+ * \retval 1 BOD interrupt pending.
+ */
+extern unsigned long scif_bod33_get_irq_status(void);
+
+
+/*! \brief Gets the 3.3V Brown-Out Detector interrupt enable status.
+ *
+ *
+ * \retval 0 BOD interrupt disabled.
+ * \retval 1 BOD interrupt enabled.
+ */
+extern unsigned long scif_bod33_get_irq_enable_bit(void);
+
+
+/*! \brief Gets the triggering threshold of the 3.3V Brown-Out Detector.
+ *
+ */
+extern unsigned long scif_bod33_get_level(void);
+
+/*! \brief Enables the 5.0V Brown-Out Detector interrupt.
+ *
+ */
+extern void scif_bod50_enable_irq(void);
+
+
+/*! \brief Disables the 5.0V Brown-Out Detector interrupt.
+ *
+ */
+extern void scif_bod50_disable_irq(void);
+
+
+/*! \brief Clears the 5.0V Brown-Out Detector interrupt flag.
+ *
+ */
+extern void scif_bod50_clear_irq(void);
+
+
+/*! \brief Gets the 5.0V Brown-Out Detector interrupt flag.
+ *
+ *
+ * \retval 0 No BOD interrupt.
+ * \retval 1 BOD interrupt pending.
+ */
+extern unsigned long scif_bod50_get_irq_status(void);
+
+
+/*! \brief Gets the 5.0V Brown-Out Detector interrupt enable status.
+ *
+ *
+ * \retval 0 BOD interrupt disabled.
+ * \retval 1 BOD interrupt enabled.
+ */
+extern unsigned long scif_bod50_get_irq_enable_bit(void);
+
+
+/*! \brief Gets the triggering threshold of the 5.0V Brown-Out Detector.
+ *
+ */
+extern unsigned long scif_bod50_get_level(void);
+
+//! @}
+
+
+/*! \name Critical Path Oscillator Functions
+ */
+//! @{
+
+
+//! @}
+
+/*! \name 8MHz RCosc Functions
+ */
+//! @{
+
+/*! \brief Start the 8MHz internal RCosc (RC8M) clock
+ */
+extern void scif_start_rc8M(void);
+
+/*! \brief Stop the 8MHz internal RCosc (RC8M) clock
+ */
+extern void scif_stop_rc8M(void);
+
+
+/*! \name 120MHz RCosc Functions
+ */
+//! @{
+
+/*! \brief Start the 120MHz internal RCosc (RC120M) clock
+ */
+extern void scif_start_rc120M(void);
+
+/*! \brief Stop the 120MHz internal RCosc (RC120M) clock
+ */
+extern void scif_stop_rc120M(void);
+
+//! @}
+
+
+/*! \name Generic Clock Functions
+ */
+//! @{
+
+/*! \brief Setup and start a generic clock.
+ *
+ * \param gclk The generic clock number to setup and start (cf. datasheet)
+ * \param opt The settings for the generic clock.
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long int scif_start_gclk(unsigned int gclk, const scif_gclk_opt_t *opt);
+
+/*! \brief Stop a generic clock.
+ *
+ * \param gclk The generic clock number to stop.
+ *
+ * \note To avoid an infinite loop, this function checks the Clock enable flag
+ * SCIF_POLL_TIMEOUT times.
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 Unable to stop generic clock.
+ */
+extern long int scif_stop_gclk(unsigned int gclk);
+
+/*! \brief Setup a generic clock.
+ *
+ * \param gclk generic clock number (0 for gc0...)
+ * \param clk_src The input clock source to use for the generic clock
+ * \param diven Generic clock divisor enable
+ * \param divfactor Generic clock divisor
+ *
+ * \note If the generic clock is already enabled, this function will disable it,
+ * apply the configuration then restart the generic clock.
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long int scif_gc_setup(unsigned int gclk, scif_gcctrl_oscsel_t clk_src, unsigned int diven, unsigned int divfactor);
+
+/*! \brief Enable a generic clock.
+ *
+ * \param gclk generic clock number (0 for gc0...)
+ *
+ * \return Status.
+ * \retval 0 Success.
+ * \retval <0 An error occured.
+ */
+extern long int scif_gc_enable(unsigned int gclk);
+
+//! @}
+
+
+/*! \name Backup Registers Functions
+ */
+//! @{
+/*!
+ * \brief Read the content of the SCIF GPLP registers
+ * \param gplp GPLP register index (0,1,... depending on the number of GPLP registers for a given part)
+ *
+ * \return The content of the chosen GPLP register.
+ */
+extern unsigned long scif_read_gplp(unsigned long gplp);
+
+
+/*!
+ * \brief Write into the SCIF GPLP registers
+ * \param gplp GPLP register index (0,1,... depending on the number of GPLP registers for a given part)
+ * \param value Value to write
+ */
+extern void scif_write_gplp(int gplp, unsigned long value);
+
+//! @}
+
+
+/*! \name Temperature Sensor Management Functions
+ */
+//! @{
+
+
+/*! \brief Enable the temperature sensor
+ *
+ * \note Due to register unlock process, this function needs to be atomic. So if
+ * there's risk that call is split by any interrupts, disable them first.
+ *
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void scif_temperature_sensor_enable(void)
+{
+ // Unlock the write-protected TSENS register
+ SCIF_UNLOCK(AVR32_SCIF_TSENS);
+ AVR32_SCIF.tsens = AVR32_SCIF_TSENS_EN_MASK;
+}
+
+/*! \brief Disable the temperature sensor.
+ *
+ * \note Due to register unlock process, this function needs to be atomic so if
+ * there's risk that call is split by an interrupt, disable them first.
+ *
+ */
+#if defined (__GNUC__)
+__attribute__((__always_inline__))
+#endif
+static inline void scif_temperature_sensor_disable(void)
+{
+ // Unlock the write-protected TSENS register
+ SCIF_UNLOCK(AVR32_SCIF_TSENS);
+ AVR32_SCIF.tsens = ~AVR32_SCIF_TSENS_EN_MASK;
+}
+
+//! @}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _SCIF_UC3C_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.c
new file mode 100644
index 0000000..0be1e77
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.c
@@ -0,0 +1,312 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief TC driver for AVR32 UC3.
+ *
+ * AVR32 Timer/Counter driver module.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a TC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include <avr32/io.h>
+#include "compiler.h"
+#include "tc.h"
+
+
+int tc_get_interrupt_settings(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ return tc->channel[channel].imr;
+}
+
+
+int tc_configure_interrupts(volatile avr32_tc_t *tc, unsigned int channel, const tc_interrupt_t *bitfield)
+{
+ bool global_interrupt_enabled = Is_global_interrupt_enabled();
+
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // Enable the appropriate interrupts.
+ tc->channel[channel].ier = bitfield->etrgs << AVR32_TC_ETRGS_OFFSET |
+ bitfield->ldrbs << AVR32_TC_LDRBS_OFFSET |
+ bitfield->ldras << AVR32_TC_LDRAS_OFFSET |
+ bitfield->cpcs << AVR32_TC_CPCS_OFFSET |
+ bitfield->cpbs << AVR32_TC_CPBS_OFFSET |
+ bitfield->cpas << AVR32_TC_CPAS_OFFSET |
+ bitfield->lovrs << AVR32_TC_LOVRS_OFFSET |
+ bitfield->covfs << AVR32_TC_COVFS_OFFSET;
+
+ // Disable the appropriate interrupts.
+ if (global_interrupt_enabled) Disable_global_interrupt();
+ tc->channel[channel].idr = (~bitfield->etrgs & 1) << AVR32_TC_ETRGS_OFFSET |
+ (~bitfield->ldrbs & 1) << AVR32_TC_LDRBS_OFFSET |
+ (~bitfield->ldras & 1) << AVR32_TC_LDRAS_OFFSET |
+ (~bitfield->cpcs & 1) << AVR32_TC_CPCS_OFFSET |
+ (~bitfield->cpbs & 1) << AVR32_TC_CPBS_OFFSET |
+ (~bitfield->cpas & 1) << AVR32_TC_CPAS_OFFSET |
+ (~bitfield->lovrs & 1) << AVR32_TC_LOVRS_OFFSET |
+ (~bitfield->covfs & 1) << AVR32_TC_COVFS_OFFSET;
+ tc->channel[channel].sr;
+ if (global_interrupt_enabled) Enable_global_interrupt();
+
+ return 0;
+}
+
+
+int tc_select_external_clock(volatile avr32_tc_t *tc, unsigned int channel, unsigned int ext_clk_sig_src)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS || ext_clk_sig_src >= 1 << AVR32_TC_BMR_TC0XC0S_SIZE)
+ return TC_INVALID_ARGUMENT;
+
+ // Clear bit-field and set the correct behavior.
+ tc->bmr = (tc->bmr & ~(AVR32_TC_BMR_TC0XC0S_MASK << (channel * AVR32_TC_BMR_TC0XC0S_SIZE))) |
+ (ext_clk_sig_src << (channel * AVR32_TC_BMR_TC0XC0S_SIZE));
+
+ return 0;
+}
+
+
+int tc_init_capture(volatile avr32_tc_t *tc, const tc_capture_opt_t *opt)
+{
+ // Check for valid input.
+ if (opt->channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // MEASURE SIGNALS: Capture operating mode.
+ tc->channel[opt->channel].cmr = opt->ldrb << AVR32_TC_LDRB_OFFSET |
+ opt->ldra << AVR32_TC_LDRA_OFFSET |
+ 0 << AVR32_TC_WAVE_OFFSET |
+ opt->cpctrg << AVR32_TC_CPCTRG_OFFSET |
+ opt->abetrg << AVR32_TC_ABETRG_OFFSET |
+ opt->etrgedg << AVR32_TC_ETRGEDG_OFFSET|
+ opt->ldbdis << AVR32_TC_LDBDIS_OFFSET |
+ opt->ldbstop << AVR32_TC_LDBSTOP_OFFSET |
+ opt->burst << AVR32_TC_BURST_OFFSET |
+ opt->clki << AVR32_TC_CLKI_OFFSET |
+ opt->tcclks << AVR32_TC_TCCLKS_OFFSET;
+
+ return 0;
+}
+
+
+int tc_init_waveform(volatile avr32_tc_t *tc, const tc_waveform_opt_t *opt)
+{
+ // Check for valid input.
+ if (opt->channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // GENERATE SIGNALS: Waveform operating mode.
+ tc->channel[opt->channel].cmr = opt->bswtrg << AVR32_TC_BSWTRG_OFFSET |
+ opt->beevt << AVR32_TC_BEEVT_OFFSET |
+ opt->bcpc << AVR32_TC_BCPC_OFFSET |
+ opt->bcpb << AVR32_TC_BCPB_OFFSET |
+ opt->aswtrg << AVR32_TC_ASWTRG_OFFSET |
+ opt->aeevt << AVR32_TC_AEEVT_OFFSET |
+ opt->acpc << AVR32_TC_ACPC_OFFSET |
+ opt->acpa << AVR32_TC_ACPA_OFFSET |
+ 1 << AVR32_TC_WAVE_OFFSET |
+ opt->wavsel << AVR32_TC_WAVSEL_OFFSET |
+ opt->enetrg << AVR32_TC_ENETRG_OFFSET |
+ opt->eevt << AVR32_TC_EEVT_OFFSET |
+ opt->eevtedg << AVR32_TC_EEVTEDG_OFFSET |
+ opt->cpcdis << AVR32_TC_CPCDIS_OFFSET |
+ opt->cpcstop << AVR32_TC_CPCSTOP_OFFSET |
+ opt->burst << AVR32_TC_BURST_OFFSET |
+ opt->clki << AVR32_TC_CLKI_OFFSET |
+ opt->tcclks << AVR32_TC_TCCLKS_OFFSET;
+
+ return 0;
+}
+
+
+int tc_start(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // Enable, reset and start the selected timer/counter channel.
+ tc->channel[channel].ccr = AVR32_TC_SWTRG_MASK | AVR32_TC_CLKEN_MASK;
+
+ return 0;
+}
+
+
+int tc_stop(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // Disable the selected timer/counter channel.
+ tc->channel[channel].ccr = AVR32_TC_CLKDIS_MASK;
+
+ return 0;
+}
+
+
+int tc_software_trigger(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // Reset the selected timer/counter channel.
+ tc->channel[channel].ccr = AVR32_TC_SWTRG_MASK;
+
+ return 0;
+}
+
+
+void tc_sync_trigger(volatile avr32_tc_t *tc)
+{
+ // Reset all channels of the selected timer/counter.
+ tc->bcr = AVR32_TC_BCR_SYNC_MASK;
+}
+
+
+void tc_sync_start(volatile avr32_tc_t *tc)
+{
+ unsigned int i;
+ // Enable the clock for each channel.
+ for(i=0; i<TC_NUMBER_OF_CHANNELS;i++)
+ tc->channel[i].ccr = AVR32_TC_CLKEN_MASK;
+
+ // Reset all channels of the selected timer/counter.
+ tc->bcr = AVR32_TC_BCR_SYNC_MASK;
+}
+
+
+int tc_read_sr(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ return tc->channel[channel].sr;
+}
+
+
+int tc_read_tc(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ return Rd_bitfield(tc->channel[channel].cv, AVR32_TC_CV_MASK);
+}
+
+
+int tc_read_ra(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ return Rd_bitfield(tc->channel[channel].ra, AVR32_TC_RA_MASK);
+}
+
+
+int tc_read_rb(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ return Rd_bitfield(tc->channel[channel].rb, AVR32_TC_RB_MASK);
+}
+
+
+int tc_read_rc(volatile avr32_tc_t *tc, unsigned int channel)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ return Rd_bitfield(tc->channel[channel].rc, AVR32_TC_RC_MASK);
+}
+
+
+int tc_write_ra(volatile avr32_tc_t *tc, unsigned int channel, unsigned short value)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // This function is only available in WAVEFORM mode.
+ if (Tst_bits(tc->channel[channel].cmr, AVR32_TC_WAVE_MASK))
+ Wr_bitfield(tc->channel[channel].ra, AVR32_TC_RA_MASK, value);
+
+ return value;
+}
+
+
+int tc_write_rb(volatile avr32_tc_t *tc, unsigned int channel, unsigned short value)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // This function is only available in WAVEFORM mode.
+ if (Tst_bits(tc->channel[channel].cmr, AVR32_TC_WAVE_MASK))
+ Wr_bitfield(tc->channel[channel].rb, AVR32_TC_RB_MASK, value);
+
+ return value;
+}
+
+
+int tc_write_rc(volatile avr32_tc_t *tc, unsigned int channel, unsigned short value)
+{
+ // Check for valid input.
+ if (channel >= TC_NUMBER_OF_CHANNELS)
+ return TC_INVALID_ARGUMENT;
+
+ // This function is only available in WAVEFORM mode.
+ if (Tst_bits(tc->channel[channel].cmr, AVR32_TC_WAVE_MASK))
+ Wr_bitfield(tc->channel[channel].rc, AVR32_TC_RC_MASK, value);
+
+ return value;
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.h
new file mode 100644
index 0000000..0b4027d
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/tc/tc.h
@@ -0,0 +1,589 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Timer/Counter driver for AVR32 UC3.
+ *
+ * AVR32 Timer/Counter driver module.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a TC module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _TC_H_
+#define _TC_H_
+
+#include <avr32/io.h>
+
+
+//! TC driver functions return value in case of invalid argument(s).
+#define TC_INVALID_ARGUMENT (-1)
+
+//! Number of timer/counter channels.
+#define TC_NUMBER_OF_CHANNELS (sizeof(((avr32_tc_t *)0)->channel) / sizeof(avr32_tc_channel_t))
+
+/*! \name External Clock Signal 0 Selection
+ */
+//! @{
+#define TC_CH0_EXT_CLK0_SRC_TCLK0 AVR32_TC_TC0XC0S_TCLK0
+#define TC_CH0_EXT_CLK0_SRC_NO_CLK AVR32_TC_TC0XC0S_NO_CLK
+#define TC_CH0_EXT_CLK0_SRC_TIOA1 AVR32_TC_TC0XC0S_TIOA1
+#define TC_CH0_EXT_CLK0_SRC_TIOA2 AVR32_TC_TC0XC0S_TIOA2
+//! @}
+
+/*! \name External Clock Signal 1 Selection
+ */
+//! @{
+#define TC_CH1_EXT_CLK1_SRC_TCLK1 AVR32_TC_TC1XC1S_TCLK1
+#define TC_CH1_EXT_CLK1_SRC_NO_CLK AVR32_TC_TC1XC1S_NO_CLK
+#define TC_CH1_EXT_CLK1_SRC_TIOA0 AVR32_TC_TC1XC1S_TIOA0
+#define TC_CH1_EXT_CLK1_SRC_TIOA2 AVR32_TC_TC1XC1S_TIOA2
+//! @}
+
+/*! \name External Clock Signal 2 Selection
+ */
+//! @{
+#define TC_CH2_EXT_CLK2_SRC_TCLK2 AVR32_TC_TC2XC2S_TCLK2
+#define TC_CH2_EXT_CLK2_SRC_NO_CLK AVR32_TC_TC2XC2S_NO_CLK
+#define TC_CH2_EXT_CLK2_SRC_TIOA0 AVR32_TC_TC2XC2S_TIOA0
+#define TC_CH2_EXT_CLK2_SRC_TIOA1 AVR32_TC_TC2XC2S_TIOA1
+//! @}
+
+/*! \name Event/Trigger Actions on Output
+ */
+//! @{
+#define TC_EVT_EFFECT_NOOP AVR32_TC_NONE
+#define TC_EVT_EFFECT_SET AVR32_TC_SET
+#define TC_EVT_EFFECT_CLEAR AVR32_TC_CLEAR
+#define TC_EVT_EFFECT_TOGGLE AVR32_TC_TOGGLE
+//! @}
+
+/*! \name RC Compare Trigger Enable
+ */
+//! @{
+#define TC_NO_TRIGGER_COMPARE_RC 0
+#define TC_TRIGGER_COMPARE_RC 1
+//! @}
+
+/*! \name Waveform Selection
+ */
+//! @{
+#define TC_WAVEFORM_SEL_UP_MODE AVR32_TC_WAVSEL_UP_NO_AUTO
+#define TC_WAVEFORM_SEL_UP_MODE_RC_TRIGGER AVR32_TC_WAVSEL_UP_AUTO
+#define TC_WAVEFORM_SEL_UPDOWN_MODE AVR32_TC_WAVSEL_UPDOWN_NO_AUTO
+#define TC_WAVEFORM_SEL_UPDOWN_MODE_RC_TRIGGER AVR32_TC_WAVSEL_UPDOWN_AUTO
+//! @}
+
+/*! \name TIOA or TIOB External Trigger Selection
+ */
+//! @{
+#define TC_EXT_TRIG_SEL_TIOA 1
+#define TC_EXT_TRIG_SEL_TIOB 0
+//! @}
+
+/*! \name External Event Selection
+ */
+//! @{
+#define TC_EXT_EVENT_SEL_TIOB_INPUT AVR32_TC_EEVT_TIOB_INPUT
+#define TC_EXT_EVENT_SEL_XC0_OUTPUT AVR32_TC_EEVT_XC0_OUTPUT
+#define TC_EXT_EVENT_SEL_XC1_OUTPUT AVR32_TC_EEVT_XC1_OUTPUT
+#define TC_EXT_EVENT_SEL_XC2_OUTPUT AVR32_TC_EEVT_XC2_OUTPUT
+//! @}
+
+/*! \name Edge Selection
+ */
+//! @{
+#define TC_SEL_NO_EDGE AVR32_TC_EEVTEDG_NO_EDGE
+#define TC_SEL_RISING_EDGE AVR32_TC_EEVTEDG_POS_EDGE
+#define TC_SEL_FALLING_EDGE AVR32_TC_EEVTEDG_NEG_EDGE
+#define TC_SEL_EACH_EDGE AVR32_TC_EEVTEDG_BOTH_EDGES
+//! @}
+
+/*! \name Burst Signal Selection
+ */
+//! @{
+#define TC_BURST_NOT_GATED AVR32_TC_BURST_NOT_GATED
+#define TC_BURST_CLK_AND_XC0 AVR32_TC_BURST_CLK_AND_XC0
+#define TC_BURST_CLK_AND_XC1 AVR32_TC_BURST_CLK_AND_XC1
+#define TC_BURST_CLK_AND_XC2 AVR32_TC_BURST_CLK_AND_XC2
+//! @}
+
+/*! \name Clock Invert
+ */
+//! @{
+#define TC_CLOCK_RISING_EDGE 0
+#define TC_CLOCK_FALLING_EDGE 1
+//! @}
+
+/*! \name Clock Selection
+ */
+//! @{
+#define TC_CLOCK_SOURCE_TC1 AVR32_TC_TCCLKS_TIMER_CLOCK1
+#define TC_CLOCK_SOURCE_TC2 AVR32_TC_TCCLKS_TIMER_CLOCK2
+#define TC_CLOCK_SOURCE_TC3 AVR32_TC_TCCLKS_TIMER_CLOCK3
+#define TC_CLOCK_SOURCE_TC4 AVR32_TC_TCCLKS_TIMER_CLOCK4
+#define TC_CLOCK_SOURCE_TC5 AVR32_TC_TCCLKS_TIMER_CLOCK5
+#define TC_CLOCK_SOURCE_XC0 AVR32_TC_TCCLKS_XC0
+#define TC_CLOCK_SOURCE_XC1 AVR32_TC_TCCLKS_XC1
+#define TC_CLOCK_SOURCE_XC2 AVR32_TC_TCCLKS_XC2
+//! @}
+
+
+//! Timer/counter interrupts.
+typedef struct
+{
+ unsigned int :24;
+
+ //! External trigger interrupt.
+ unsigned int etrgs : 1;
+
+ //! RB load interrupt.
+ unsigned int ldrbs : 1;
+
+ //! RA load interrupt.
+ unsigned int ldras : 1;
+
+ //! RC compare interrupt.
+ unsigned int cpcs : 1;
+
+ //! RB compare interrupt.
+ unsigned int cpbs : 1;
+
+ //! RA compare interrupt.
+ unsigned int cpas : 1;
+
+ //! Load overrun interrupt.
+ unsigned int lovrs : 1;
+
+ //! Counter overflow interrupt.
+ unsigned int covfs : 1;
+} tc_interrupt_t;
+
+//! Parameters when initializing a timer/counter in capture mode.
+typedef struct
+{
+ //! Channel to initialize.
+ unsigned int channel ;
+
+ unsigned int :12;
+
+ //! RB loading selection:\n
+ //! - \ref TC_SEL_NO_EDGE;\n
+ //! - \ref TC_SEL_RISING_EDGE;\n
+ //! - \ref TC_SEL_FALLING_EDGE;\n
+ //! - \ref TC_SEL_EACH_EDGE.
+ unsigned int ldrb : 2;
+
+ //! RA loading selection:\n
+ //! - \ref TC_SEL_NO_EDGE;\n
+ //! - \ref TC_SEL_RISING_EDGE;\n
+ //! - \ref TC_SEL_FALLING_EDGE;\n
+ //! - \ref TC_SEL_EACH_EDGE.
+ unsigned int ldra : 2;
+
+ unsigned int : 1;
+
+ //! RC compare trigger enable:\n
+ //! - \ref TC_NO_TRIGGER_COMPARE_RC;\n
+ //! - \ref TC_TRIGGER_COMPARE_RC.
+ unsigned int cpctrg : 1;
+
+ unsigned int : 3;
+
+ //! TIOA or TIOB external trigger selection:\n
+ //! - \ref TC_EXT_TRIG_SEL_TIOA;\n
+ //! - \ref TC_EXT_TRIG_SEL_TIOB.
+ unsigned int abetrg : 1;
+
+ //! External trigger edge selection:\n
+ //! - \ref TC_SEL_NO_EDGE;\n
+ //! - \ref TC_SEL_RISING_EDGE;\n
+ //! - \ref TC_SEL_FALLING_EDGE;\n
+ //! - \ref TC_SEL_EACH_EDGE.
+ unsigned int etrgedg : 2;
+
+ //! Counter clock disable with RB loading:\n
+ //! - \c false;\n
+ //! - \c true.
+ unsigned int ldbdis : 1;
+
+ //! Counter clock stopped with RB loading:\n
+ //! - \c false;\n
+ //! - \c true.
+ unsigned int ldbstop : 1;
+
+ //! Burst signal selection:\n
+ //! - \ref TC_BURST_NOT_GATED;\n
+ //! - \ref TC_BURST_CLK_AND_XC0;\n
+ //! - \ref TC_BURST_CLK_AND_XC1;\n
+ //! - \ref TC_BURST_CLK_AND_XC2.
+ unsigned int burst : 2;
+
+ //! Clock invert:\n
+ //! - \ref TC_CLOCK_RISING_EDGE;\n
+ //! - \ref TC_CLOCK_FALLING_EDGE.
+ unsigned int clki : 1;
+
+ //! Clock selection:\n
+ //! - \ref TC_CLOCK_SOURCE_TC1;\n
+ //! - \ref TC_CLOCK_SOURCE_TC2;\n
+ //! - \ref TC_CLOCK_SOURCE_TC3;\n
+ //! - \ref TC_CLOCK_SOURCE_TC4;\n
+ //! - \ref TC_CLOCK_SOURCE_TC5;\n
+ //! - \ref TC_CLOCK_SOURCE_XC0;\n
+ //! - \ref TC_CLOCK_SOURCE_XC1;\n
+ //! - \ref TC_CLOCK_SOURCE_XC2.
+ unsigned int tcclks : 3;
+} tc_capture_opt_t;
+
+//! Parameters when initializing a timer/counter in waveform mode.
+typedef struct
+{
+ //! Channel to initialize.
+ unsigned int channel ;
+
+ //! Software trigger effect on TIOB:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int bswtrg : 2;
+
+ //! External event effect on TIOB:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int beevt : 2;
+
+ //! RC compare effect on TIOB:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int bcpc : 2;
+
+ //! RB compare effect on TIOB:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int bcpb : 2;
+
+ //! Software trigger effect on TIOA:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int aswtrg : 2;
+
+ //! External event effect on TIOA:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int aeevt : 2;
+
+ //! RC compare effect on TIOA:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int acpc : 2;
+
+ //! RA compare effect on TIOA:\n
+ //! - \ref TC_EVT_EFFECT_NOOP;\n
+ //! - \ref TC_EVT_EFFECT_SET;\n
+ //! - \ref TC_EVT_EFFECT_CLEAR;\n
+ //! - \ref TC_EVT_EFFECT_TOGGLE.
+ unsigned int acpa : 2;
+
+ unsigned int : 1;
+
+ //! Waveform selection:\n
+ //! - \ref TC_WAVEFORM_SEL_UP_MODE;\n
+ //! - \ref TC_WAVEFORM_SEL_UP_MODE_RC_TRIGGER;\n
+ //! - \ref TC_WAVEFORM_SEL_UPDOWN_MODE;\n
+ //! - \ref TC_WAVEFORM_SEL_UPDOWN_MODE_RC_TRIGGER.
+ unsigned int wavsel : 2;
+
+ //! External event trigger enable:\n
+ //! - \c false;\n
+ //! - \c true.
+ unsigned int enetrg : 1;
+
+ //! External event selection:\n
+ //! - \ref TC_EXT_EVENT_SEL_TIOB_INPUT;\n
+ //! - \ref TC_EXT_EVENT_SEL_XC0_OUTPUT;\n
+ //! - \ref TC_EXT_EVENT_SEL_XC1_OUTPUT;\n
+ //! - \ref TC_EXT_EVENT_SEL_XC2_OUTPUT.
+ unsigned int eevt : 2;
+
+ //! External event edge selection:\n
+ //! - \ref TC_SEL_NO_EDGE;\n
+ //! - \ref TC_SEL_RISING_EDGE;\n
+ //! - \ref TC_SEL_FALLING_EDGE;\n
+ //! - \ref TC_SEL_EACH_EDGE.
+ unsigned int eevtedg : 2;
+
+ //! Counter clock disable with RC compare:\n
+ //! - \c false;\n
+ //! - \c true.
+ unsigned int cpcdis : 1;
+
+ //! Counter clock stopped with RC compare:\n
+ //! - \c false;\n
+ //! - \c true.
+ unsigned int cpcstop : 1;
+
+ //! Burst signal selection:\n
+ //! - \ref TC_BURST_NOT_GATED;\n
+ //! - \ref TC_BURST_CLK_AND_XC0;\n
+ //! - \ref TC_BURST_CLK_AND_XC1;\n
+ //! - \ref TC_BURST_CLK_AND_XC2.
+ unsigned int burst : 2;
+
+ //! Clock invert:\n
+ //! - \ref TC_CLOCK_RISING_EDGE;\n
+ //! - \ref TC_CLOCK_FALLING_EDGE.
+ unsigned int clki : 1;
+
+ //! Clock selection:\n
+ //! - \ref TC_CLOCK_SOURCE_TC1;\n
+ //! - \ref TC_CLOCK_SOURCE_TC2;\n
+ //! - \ref TC_CLOCK_SOURCE_TC3;\n
+ //! - \ref TC_CLOCK_SOURCE_TC4;\n
+ //! - \ref TC_CLOCK_SOURCE_TC5;\n
+ //! - \ref TC_CLOCK_SOURCE_XC0;\n
+ //! - \ref TC_CLOCK_SOURCE_XC1;\n
+ //! - \ref TC_CLOCK_SOURCE_XC2.
+ unsigned int tcclks : 3;
+} tc_waveform_opt_t;
+
+
+/*! \brief Reads timer/counter interrupt settings.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval >=0 The interrupt enable configuration organized according to \ref tc_interrupt_t.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_get_interrupt_settings(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Enables various timer/counter interrupts.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ * \param bitfield The interrupt enable configuration.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_configure_interrupts(volatile avr32_tc_t *tc, unsigned int channel, const tc_interrupt_t *bitfield);
+
+/*! \brief Selects which external clock to use and how to configure it.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ * \param ext_clk_sig_src External clock signal selection:
+ * \arg \c TC_CH0_EXT_CLK0_SRC_TCLK0;
+ * \arg \c TC_CH0_EXT_CLK0_SRC_NO_CLK;
+ * \arg \c TC_CH0_EXT_CLK0_SRC_TIOA1;
+ * \arg \c TC_CH0_EXT_CLK0_SRC_TIOA2;
+ * \arg \c TC_CH1_EXT_CLK1_SRC_TCLK1;
+ * \arg \c TC_CH1_EXT_CLK1_SRC_NO_CLK;
+ * \arg \c TC_CH1_EXT_CLK1_SRC_TIOA0;
+ * \arg \c TC_CH1_EXT_CLK1_SRC_TIOA2;
+ * \arg \c TC_CH2_EXT_CLK2_SRC_TCLK2;
+ * \arg \c TC_CH2_EXT_CLK2_SRC_NO_CLK;
+ * \arg \c TC_CH2_EXT_CLK2_SRC_TIOA0;
+ * \arg \c TC_CH2_EXT_CLK2_SRC_TIOA1.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_select_external_clock(volatile avr32_tc_t *tc, unsigned int channel, unsigned int ext_clk_sig_src);
+
+/*! \brief Sets options for timer/counter capture initialization.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param opt Options for capture mode.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_init_capture(volatile avr32_tc_t *tc, const tc_capture_opt_t *opt);
+
+/*! \brief Sets options for timer/counter waveform initialization.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param opt Options for waveform generation.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_init_waveform(volatile avr32_tc_t *tc, const tc_waveform_opt_t *opt);
+
+/*! \brief Starts a timer/counter.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_start(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Stops a timer/counter.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_stop(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Performs a software trigger: the counter is reset and the clock is started.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval 0 Success.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_software_trigger(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Asserts a SYNC signal to generate a software trigger and reset all channels.
+ *
+ * \param tc Pointer to the TC instance to access.
+ */
+extern void tc_sync_trigger(volatile avr32_tc_t *tc);
+
+/*! \brief Start all TC channels simultaneously.
+ *
+ * \param tc Pointer to the TC instance to access.
+ */
+extern void tc_sync_start(volatile avr32_tc_t *tc);
+
+/*! \brief Reads the status register.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval >=0 Status register value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_read_sr(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Reads the channel's TC counter and returns the value.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval >=0 TC counter value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_read_tc(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Reads the channel's RA register and returns the value.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval >=0 RA register value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_read_ra(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Reads the channel's RB register and returns the value.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval >=0 RB register value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_read_rb(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Reads the channel's RC register and returns the value.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ *
+ * \retval >=0 RC register value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_read_rc(volatile avr32_tc_t *tc, unsigned int channel);
+
+/*! \brief Writes a value to the channel's RA register.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ * \param value Value to write to the RA register.
+ *
+ * \retval >=0 Written value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_write_ra(volatile avr32_tc_t *tc, unsigned int channel, unsigned short value);
+
+/*! \brief Writes a value to the channel's RB register.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ * \param value Value to write to the RB register.
+ *
+ * \retval >=0 Written value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_write_rb(volatile avr32_tc_t *tc, unsigned int channel, unsigned short value);
+
+/*! \brief Writes a value to the channel's RC register.
+ *
+ * \param tc Pointer to the TC instance to access.
+ * \param channel The TC instance channel to access.
+ * \param value Value to write to the RC register.
+ *
+ * \retval >=0 Written value.
+ * \retval TC_INVALID_ARGUMENT Invalid argument(s).
+ */
+extern int tc_write_rc(volatile avr32_tc_t *tc, unsigned int channel, unsigned short value);
+
+
+#endif // _TC_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt.h
new file mode 100644
index 0000000..06e0334
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt.h
@@ -0,0 +1,140 @@
+ /**
+ * \file
+ *
+ * \brief WDT driver for WDT module from revision 4.0.0 for AVR32 UC3.
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef _WDT_H_
+#define _WDT_H_
+
+// These defines are missing from or wrong in the toolchain header file ip_xxx.h or part.h
+#if !defined(AVR32_SCIF_OSC32_FREQUENCY)
+#define AVR32_SCIF_OSC32_FREQUENCY 32768
+#else
+#warning "Duplicate define(s) to remove from the ASF"
+#endif
+// These defines are missing from or wrong in the toolchain header file ip_xxx.h or part.h
+#if (defined AVR32_WDT_401_H_INCLUDED ) || (defined AVR32_WDT_410_H_INCLUDED )
+#define AVR32_WDT_KEY_VALUE 0x00000055
+#endif
+
+//! WDT Clock Source Select RCOSC
+#define WDT_CLOCK_SOURCE_SELECT_RCSYS 0x0
+
+//! WDT Clock Source Select 32K Oscillator
+#define WDT_CLOCK_SOURCE_SELECT_OSC32K 0x1
+
+//! WDT Basic Mode
+#define WDT_BASIC_MODE 0x0
+
+//! WDT Window Mode
+#define WDT_WINDOW_MODE 0x1
+
+//! WDT startup options.
+typedef struct
+{
+ //! Prescaler value for the timeout.
+ uint64_t us_timeout_period;
+#if AVR32_WDT_H_VERSION >= 400
+ //! Prescaler value for the timeban.
+ uint64_t us_timeban_period;
+ //! Clock Source Select.
+ uint8_t cssel;
+ //! Flash Calibration Done.
+ uint8_t fcd;
+ //! Store final Value.
+ uint8_t sfv;
+ //! Mode selection for the WDT
+ uint8_t mode;
+ //! Disable WDT after reset
+ uint8_t dar;
+#endif
+} wdt_opt_t;
+
+/**
+ * \brief Gets the time-out period of the WatchDog Timer in microseconds.
+ *
+ * \param opt Structure for settings of WDT.
+ *
+ * \retval <0 The WatchDog Timer is disabled.
+ * \retval >=0 Active time-out period of the WatchDog Timer in microseconds.
+ */
+int64_t wdt_get_us_timeout_period(wdt_opt_t *opt);
+
+// Only available for WDT versions above 400
+#if AVR32_WDT_H_VERSION >= 400
+/**
+ * \brief Gets the timeban period of the WatchDog Timer in microseconds.
+ *
+ * \param opt Structure for settings of WDT.
+ *
+ * \retval <0 The WatchDog Timer is disabled.
+ * \retval >=0 Active timeban period of the WatchDog Timer in microseconds.
+ */
+int64_t wdt_get_us_timeban_period(wdt_opt_t *opt);
+#endif
+
+/**
+ * \brief Disables the WatchDog Timer.
+ */
+void wdt_disable(void);
+
+/**
+ * \brief Enables the WatchDog Timer with the \a us_timeout_period time-out
+ * period saturated to the supported range and rounded up to the nearest
+ * supported greater time-out period.
+ *
+ * \param opt Structure for settings of WDT.
+ *
+ * \return Actually configured time-out period in microseconds.
+ */
+uint64_t wdt_enable(wdt_opt_t *opt);
+
+/**
+ * \brief Re-enables the WatchDog Timer with the last time-out period
+ * configured.
+ */
+void wdt_reenable(void);
+
+/**
+ * \brief Clears the WatchDog Timer.
+ */
+void wdt_clear(void);
+
+/**
+ * \brief Resets the MCU with the WatchDog Timer as fast as possible.
+ */
+void wdt_reset_mcu(void);
+
+#endif // _WDT_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt4.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt4.c
new file mode 100644
index 0000000..fcd6ce4
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/drivers/wdt/wdt4.c
@@ -0,0 +1,165 @@
+/**
+ * \file
+ *
+ * \brief WDT driver for WDT module from revision 4.0.0 for AVR32 UC3.
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#include <avr32/io.h>
+#include "compiler.h"
+#include "board.h"
+#include "wdt.h"
+
+#define MIN_US_TIMEOUT_PERIOD_RCSYS (((1ULL << 1 ) * 1000000 + AVR32_SCIF_RCOSC_FREQUENCY / 2) / AVR32_SCIF_RCOSC_FREQUENCY)
+#define MAX_US_TIMEOUT_PERIOD_RCSYS (((1ULL << (1 << AVR32_WDT_CTRL_PSEL_SIZE)) * 1000000 + AVR32_SCIF_RCOSC_FREQUENCY / 2) / AVR32_SCIF_RCOSC_FREQUENCY)
+#define MIN_US_TIMEOUT_PERIOD_OSC32K (((1ULL << 1 ) * 1000000 + AVR32_SCIF_OSC32_FREQUENCY / 2) / AVR32_SCIF_OSC32_FREQUENCY)
+#define MAX_US_TIMEOUT_PERIOD_OSC32K (((1ULL << (1 << AVR32_WDT_CTRL_PSEL_SIZE)) * 1000000 + AVR32_SCIF_OSC32_FREQUENCY / 2) / AVR32_SCIF_OSC32_FREQUENCY)
+
+#define MIN_US_TIMEBAN_PERIOD_RCSYS (((1ULL << 1 ) * 1000000 + AVR32_SCIF_RCOSC_FREQUENCY / 2) / AVR32_SCIF_RCOSC_FREQUENCY)
+#define MAX_US_TIMEBAN_PERIOD_RCSYS (((1ULL << (1 << AVR32_WDT_CTRL_TBAN_SIZE)) * 1000000 + AVR32_SCIF_RCOSC_FREQUENCY / 2) / AVR32_SCIF_RCOSC_FREQUENCY)
+#define MIN_US_TIMEBAN_PERIOD_OSC32K (((1ULL << 1 ) * 1000000 + AVR32_SCIF_OSC32_FREQUENCY / 2) / AVR32_SCIF_OSC32_FREQUENCY)
+#define MAX_US_TIMEBAN_PERIOD_OSC32K (((1ULL << (1 << AVR32_WDT_CTRL_TBAN_SIZE)) * 1000000 + AVR32_SCIF_OSC32_FREQUENCY / 2) / AVR32_SCIF_OSC32_FREQUENCY)
+
+/**
+ * \brief Sets the WatchDog Timer Control register to the \a ctrl value thanks
+ * to the WatchDog Timer key.
+ *
+ * \param ctrl Value to set the WatchDog Timer Control register to.
+ *
+ * \note The KEY bit-field of \a ctrl is assumed to be zero.
+ */
+static void wdt_set_ctrl(uint32_t ctrl)
+{
+ AVR32_WDT.ctrl = ctrl | (AVR32_WDT_KEY_VALUE << AVR32_WDT_CTRL_KEY_OFFSET);
+ AVR32_WDT.ctrl = ctrl | ((uint32_t) (~AVR32_WDT_KEY_VALUE << AVR32_WDT_CTRL_KEY_OFFSET) & AVR32_WDT_CTRL_KEY_MASK);
+}
+
+int64_t wdt_get_us_timeout_period(wdt_opt_t *opt)
+{
+ // RCOSC
+ if (opt->cssel == WDT_CLOCK_SOURCE_SELECT_RCSYS) {
+ // Read CTRL.PSEL and translate it into us.
+ return (AVR32_WDT.ctrl & AVR32_WDT_CTRL_EN_MASK) ?
+ ((1ULL << (((AVR32_WDT.ctrl & AVR32_WDT_CTRL_PSEL_MASK) >> AVR32_WDT_CTRL_PSEL_OFFSET) + 1)) *
+ 1000000 + AVR32_SCIF_RCOSC_FREQUENCY / 2) / AVR32_SCIF_RCOSC_FREQUENCY :
+ -1ULL;
+ } else {
+ // Read CTRL.PSEL and translate it into us.
+ return (AVR32_WDT.ctrl & AVR32_WDT_CTRL_EN_MASK) ?
+ ((1ULL << (((AVR32_WDT.ctrl & AVR32_WDT_CTRL_PSEL_MASK) >> AVR32_WDT_CTRL_PSEL_OFFSET) + 1)) *
+ 1000000 + AVR32_SCIF_OSC32_FREQUENCY / 2) / AVR32_SCIF_OSC32_FREQUENCY :
+ -1ULL;
+ }
+}
+
+int64_t wdt_get_us_timeban_period(wdt_opt_t *opt)
+{
+ // RCOSC
+ if (opt->cssel == WDT_CLOCK_SOURCE_SELECT_RCSYS) {
+ // Read CTRL.PSEL and translate it into us.
+ return (AVR32_WDT.ctrl & AVR32_WDT_CTRL_EN_MASK) ?
+ ((1ULL << (((AVR32_WDT.ctrl & AVR32_WDT_CTRL_TBAN_MASK) >> AVR32_WDT_CTRL_TBAN_OFFSET) + 1)) *
+ 1000000 + AVR32_SCIF_RCOSC_FREQUENCY / 2) / AVR32_SCIF_RCOSC_FREQUENCY :
+ -1ULL;
+ } else {
+ // Read CTRL.PSEL and translate it into us.
+ return (AVR32_WDT.ctrl & AVR32_WDT_CTRL_EN_MASK) ?
+ ((1ULL << (((AVR32_WDT.ctrl & AVR32_WDT_CTRL_TBAN_MASK) >> AVR32_WDT_CTRL_TBAN_OFFSET) + 1)) *
+ 1000000 + AVR32_SCIF_OSC32_FREQUENCY / 2) / AVR32_SCIF_OSC32_FREQUENCY :
+ -1ULL;
+ }
+}
+
+void wdt_disable(void)
+{
+ wdt_set_ctrl(AVR32_WDT.ctrl & ~AVR32_WDT_CTRL_EN_MASK);
+}
+
+uint64_t wdt_enable(wdt_opt_t *opt)
+{
+ // RCOSC
+ if (opt->cssel == WDT_CLOCK_SOURCE_SELECT_RCSYS) {
+ // Set the CTRL.EN bit
+ // Translate the us timeout to fit in CTRL.PSEL using the formula Twdt = 2pow(PSEL+1) / fRCosc
+ // Translate the us timeban to fit in CTRL.PSEL using the formula Twdt = 2pow(PSEL+1) / fRCosc
+ wdt_set_ctrl(AVR32_WDT_CTRL_EN_MASK | AVR32_WDT_CTRL_CEN_MASK |
+ (opt->dar << AVR32_WDT_CTRL_DAR_OFFSET) |
+ (opt->mode << AVR32_WDT_CTRL_MODE_OFFSET) |
+ (opt->sfv << AVR32_WDT_CTRL_SFV_OFFSET) |
+ (opt->fcd << AVR32_WDT_CTRL_FCD_OFFSET) |
+ (opt->cssel << AVR32_WDT_CTRL_CSSEL_OFFSET) |
+ ((32 - clz(((((Min(Max(opt->us_timeout_period, MIN_US_TIMEOUT_PERIOD_RCSYS), MAX_US_TIMEOUT_PERIOD_RCSYS) *
+ AVR32_SCIF_RCOSC_FREQUENCY + 500000) / 1000000) << 1) - 1) >> 1) - 1) << AVR32_WDT_CTRL_PSEL_OFFSET) |
+ ((32 - clz(((((Min(Max(opt->us_timeban_period, MIN_US_TIMEBAN_PERIOD_RCSYS), MAX_US_TIMEBAN_PERIOD_RCSYS) *
+ AVR32_SCIF_RCOSC_FREQUENCY + 500000) / 1000000) << 1) - 1) >> 1) - 1) << AVR32_WDT_CTRL_TBAN_OFFSET));
+ } else {
+ // Set the CTRL.EN bit
+ // Translate the us timeout to fit in CTRL.PSEL using the formula Twdt = 2pow(PSEL+1) / fROSC32K
+ // Translate the us timeban to fit in CTRL.PSEL using the formula Twdt = 2pow(PSEL+1) / fROSC32K
+ wdt_set_ctrl(AVR32_WDT_CTRL_EN_MASK | AVR32_WDT_CTRL_CEN_MASK |
+ (opt->dar << AVR32_WDT_CTRL_DAR_OFFSET) |
+ (opt->mode << AVR32_WDT_CTRL_MODE_OFFSET) |
+ (opt->sfv << AVR32_WDT_CTRL_SFV_OFFSET) |
+ (opt->fcd << AVR32_WDT_CTRL_FCD_OFFSET) |
+ (opt->cssel << AVR32_WDT_CTRL_CSSEL_OFFSET) |
+ ((32 - clz(((((Min(Max(opt->us_timeout_period, MIN_US_TIMEOUT_PERIOD_OSC32K), MAX_US_TIMEOUT_PERIOD_OSC32K) *
+ AVR32_SCIF_OSC32_FREQUENCY + 500000) / 1000000) << 1) - 1) >> 1) - 1) << AVR32_WDT_CTRL_PSEL_OFFSET) |
+ ((32 - clz(((((Min(Max(opt->us_timeout_period, MIN_US_TIMEBAN_PERIOD_OSC32K), MAX_US_TIMEBAN_PERIOD_OSC32K) *
+ AVR32_SCIF_OSC32_FREQUENCY + 500000) / 1000000) << 1) - 1) >> 1) - 1) << AVR32_WDT_CTRL_TBAN_OFFSET));
+ }
+ // Return the actual wdt period in us.
+ return wdt_get_us_timeout_period(opt);
+}
+
+void wdt_reenable(void)
+{
+ wdt_set_ctrl(AVR32_WDT.ctrl | AVR32_WDT_CTRL_EN_MASK | AVR32_WDT_CTRL_CEN_MASK );
+}
+
+void wdt_clear(void)
+{
+ while (!(AVR32_WDT.sr & AVR32_WDT_CLR_WDTCLR_MASK));
+ AVR32_WDT.clr = ( (AVR32_WDT_KEY_VALUE << AVR32_WDT_KEY_OFFSET) | AVR32_WDT_CLR_WDTCLR_MASK );
+ AVR32_WDT.clr = ( (~AVR32_WDT_KEY_VALUE << AVR32_WDT_KEY_OFFSET) | AVR32_WDT_CLR_WDTCLR_MASK );
+}
+
+void wdt_reset_mcu(void)
+{
+ Disable_global_interrupt();
+ // Enable the WDT with a 0s period (fastest way to get a Watchdog reset).
+ wdt_opt_t opt = {
+ .us_timeout_period = 0
+ };
+ wdt_enable(&opt);
+ while (1);
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.c
new file mode 100644
index 0000000..0e014da
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.c
@@ -0,0 +1,464 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CAN Software Stack for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CANIF module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+//_____ I N C L U D E S ________________________________________________________
+#include "avr32/io.h"
+#include "can.h"
+#include "compiler.h"
+#include "preprocessor.h"
+#include "intc.h"
+#include "canif.h"
+#include "CAN1c1.h"
+//_____ D E F I N I T I O N S __________________________________________________
+
+//_____ F U N C T I O N S ______________________________________________________
+
+//! Dynamic Mob Allocation State Vector for Channel 0
+U32 can_mob_alloc_vector0 = 0;
+
+//! Dynamic Mob Allocation State Vector for Channel 1
+U32 can_mob_alloc_vector1 = 0;
+
+//! Output parameters.
+static struct
+{
+ void (*can_msg_callback_channel0) (U8,U8,U8);
+ void (*can_msg_callback_channel1) (U8,U8,U8);
+} can_lib_params =
+{
+ .can_msg_callback_channel0 = NULL,
+ .can_msg_callback_channel1 = NULL
+};
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can0_int_tx_handler(void)
+{
+ U8 handle;
+ handle = CANIF_mob_get_mob_txok(0);
+ if (handle != 0x20)
+ {
+ CANIF_mob_clear_txok_status(0,handle);
+ CANIF_mob_clear_status(0,handle); // and reset MOb status
+ }
+ can_lib_params.can_msg_callback_channel0(handle,CAN_STATUS_COMPLETED,CAN__nenMbMode_Tx);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can0_int_rx_handler(void)
+{
+ U8 handle;
+ handle = CANIF_mob_get_mob_rxok(0) ;
+ if (handle != 0x20)
+ {
+ CANIF_mob_clear_rxok_status(0,handle);
+ CANIF_mob_clear_status(0,handle); // and reset MOb status
+ }
+ can_lib_params.can_msg_callback_channel0(handle,CAN_STATUS_COMPLETED,CAN__nenMbMode_Rx);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can0_int_busoff_handler(void)
+{
+ CANIF_clr_interrupt_status(0);
+ can_lib_params.can_msg_callback_channel0(0xFF,CAN_STATUS_BUSOFF,CAN_STATUS_BUSOFF);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can0_int_cerr_handler(void)
+{
+ CANIF_clr_interrupt_status(0);
+ can_lib_params.can_msg_callback_channel0(0xFF,CAN_STATUS_ERROR,CAN_STATUS_ERROR);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can0_int_wakeup_handler(void)
+{
+ CANIF_clr_interrupt_status(0);
+ can_lib_params.can_msg_callback_channel0(0xFF,CAN_STATUS_WAKEUP,CAN_STATUS_WAKEUP);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can1_int_tx_handler(void)
+{
+ U8 handle;
+ handle = CANIF_mob_get_mob_txok(1) ;
+ if (handle != 0x20)
+ {
+ CANIF_mob_clear_txok_status(1,handle);
+ CANIF_mob_clear_status(1,handle); // and reset MOb status
+ }
+ can_lib_params.can_msg_callback_channel1(handle,CAN_STATUS_COMPLETED,CAN__nenMbMode_Tx);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can1_int_rx_handler(void)
+{
+ U8 handle;
+ handle = CANIF_mob_get_mob_rxok(1) ;
+ if (handle != 0x20)
+ {
+ CANIF_mob_clear_rxok_status(1,handle);
+ CANIF_mob_clear_status(1,handle); // and reset MOb status
+ }
+ can_lib_params.can_msg_callback_channel1(handle,CAN_STATUS_COMPLETED,CAN__nenMbMode_Rx);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can1_int_busoff_handler(void)
+{
+ CANIF_clr_interrupt_status(1);
+ can_lib_params.can_msg_callback_channel1(0xFF,CAN_STATUS_BUSOFF,CAN_STATUS_BUSOFF);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can1_int_cerr_handler(void)
+{
+ CANIF_clr_interrupt_status(1);
+ can_lib_params.can_msg_callback_channel1(0xFF,CAN_STATUS_ERROR,CAN_STATUS_ERROR);
+}
+
+#if defined (__GNUC__)
+__attribute__((__interrupt__))
+#elif defined (__ICCAVR32__)
+__interrupt
+#endif
+static void can1_int_wakeup_handler(void)
+{
+ CANIF_clr_interrupt_status(1);
+ can_lib_params.can_msg_callback_channel1(0xFF,CAN_STATUS_WAKEUP,CAN_STATUS_WAKEUP);
+}
+
+U8 can_enable_interrupt(U8 ch)
+{
+ if ((ch > 1))
+ return CAN_CMD_REFUSED;
+
+ if (ch==0)
+ {
+ INTC_register_interrupt(&can0_int_tx_handler, AVR32_CANIF_TXOK_IRQ_0, CAN0_INT_TX_LEVEL);
+ INTC_register_interrupt(&can0_int_rx_handler, AVR32_CANIF_RXOK_IRQ_0, CAN0_INT_RX_LEVEL);
+ INTC_register_interrupt(&can0_int_busoff_handler, AVR32_CANIF_BUS_OFF_IRQ_0, CAN0_INT_BOFF_LEVEL);
+ INTC_register_interrupt(&can0_int_cerr_handler, AVR32_CANIF_ERROR_IRQ_0, CAN0_INT_ERR_LEVEL);
+ INTC_register_interrupt(&can0_int_wakeup_handler, AVR32_CANIF_WAKE_UP_IRQ_0, CAN0_INT_WAKE_UP_LEVEL);
+ CANIF_enable_interrupt(ch);
+ }
+ else if (ch == 1)
+ {
+ INTC_register_interrupt(&can1_int_tx_handler, AVR32_CANIF_TXOK_IRQ_1, CAN1_INT_TX_LEVEL);
+ INTC_register_interrupt(&can1_int_rx_handler, AVR32_CANIF_RXOK_IRQ_1, CAN1_INT_RX_LEVEL);
+ INTC_register_interrupt(&can1_int_busoff_handler, AVR32_CANIF_BUS_OFF_IRQ_1, CAN1_INT_BOFF_LEVEL);
+ INTC_register_interrupt(&can1_int_cerr_handler, AVR32_CANIF_ERROR_IRQ_1, CAN1_INT_ERR_LEVEL);
+ INTC_register_interrupt(&can1_int_wakeup_handler, AVR32_CANIF_WAKE_UP_IRQ_1, CAN1_INT_WAKE_UP_LEVEL);
+ CANIF_enable_interrupt(ch);
+ }
+
+ return CAN_CMD_ACCEPTED;
+}
+
+U8 can_init(U8 ch,
+ U32 can_msg_ram_add,
+ U8 operating_mode,
+ void (*can_msg_callback_channel) (U8 handle, U8 event, U8 dir))
+{
+ if ( ch > 1)
+ return CAN_CMD_REFUSED;
+
+ // Initialize CAN channel
+ CANIF_set_reset(ch);
+ while(CANIF_channel_enable_status(ch));
+ CANIF_clr_reset(ch);
+
+ CANIF_set_ram_add(ch,(unsigned long) can_msg_ram_add);
+ if ((CANIF_bit_timing(ch))==0) return (0);
+ switch(operating_mode)
+ {
+ case CANIF_CHANNEL_MODE_NORMAL:
+ CANIF_set_channel_mode(ch,0);
+ CANIF_clr_overrun_mode(ch);
+ break;
+ case CANIF_CHANNEL_MODE_LISTENING:
+ CANIF_set_channel_mode(ch,1);
+ CANIF_set_overrun_mode(ch);
+ break;
+ case CANIF_CHANNEL_MODE_LOOPBACK:
+ CANIF_set_channel_mode(ch,2);
+ CANIF_clr_overrun_mode(ch);
+ break;
+ }
+ canif_clear_all_mob(ch,NB_MOB_CHANNEL);
+ //CANIF_enable(ch);
+ //while(!CANIF_channel_enable_status(ch));
+
+#ifdef CAN_LIB_UNDER_INTERRUPT
+ switch(ch)
+ {
+ case 0:
+ can_lib_params.can_msg_callback_channel0 = can_msg_callback_channel;
+ break;
+ case 1:
+ can_lib_params.can_msg_callback_channel1 = can_msg_callback_channel;
+ break;
+ }
+ can_enable_interrupt(ch);
+#endif
+
+ return CAN_CMD_ACCEPTED;
+}
+
+
+U8 can_mob_alloc(U8 ch)
+{
+ if ((ch > 1))
+ return CAN_CMD_REFUSED;
+
+ if(ch==0)
+ {
+ int i;
+ for (i=0;i<NB_MOB_CHANNEL;i++)
+ {
+ if (!((can_mob_alloc_vector0>>i)&0x01))
+ {
+ can_mob_alloc_vector0|=(1<<i);
+ CANIF_clr_mob(0,i);
+ return i;
+ }
+ }
+ return CAN_CMD_REFUSED;
+ }
+ else{
+ int i;
+ for (i=0;i<NB_MOB_CHANNEL;i++)
+ {
+ if (!((can_mob_alloc_vector1>>i)&0x01))
+ {
+ can_mob_alloc_vector1|=(1<<i);
+ CANIF_clr_mob(1,i);
+ return i;
+ }
+ }
+ return CAN_CMD_REFUSED;
+ }
+}
+
+U8 can_mob_free(U8 ch, U8 handle)
+{
+ if ((ch > 1)||
+ (handle > (NB_MOB_CHANNEL-1)))
+ return CAN_CMD_REFUSED;
+ switch(ch)
+ {
+ case 0:
+ can_mob_alloc_vector0 &= (~(1<<handle));
+ break;
+ case 1:
+ can_mob_alloc_vector1 &= (~(1<<handle));
+ break;
+ }
+ return CAN_CMD_ACCEPTED;
+}
+
+U8 can_tx( U8 ch,
+ U8 handle,
+ U8 dlc,
+ U8 req_type,
+ const can_msg_t *can_msg)
+{
+ if ((ch > 1) ||
+ (handle > (NB_MOB_CHANNEL-1)) ||
+ (dlc > 8))
+ return CAN_CMD_REFUSED;
+
+ if (can_msg->ide_bit){
+ CANIF_set_ext_id(ch,
+ handle,
+ can_msg->id);
+
+ CANIF_set_ext_idmask(ch,
+ handle,
+ can_msg->id_mask);
+ }
+ else {
+ CANIF_set_std_id(ch,
+ handle,
+ can_msg->id);
+ CANIF_set_std_idmask(ch,
+ handle,
+ can_msg->id_mask);
+ }
+ CANIF_mob_set_dlc(ch,handle,dlc);
+ if (req_type == CAN_REMOTE_FRAME){
+ CANIF_set_rtr(ch,handle);
+ CANIF_set_rtrmask(ch,handle);
+ CANIF_mob_set_automode(ch,handle);
+ }
+ CANIF_set_data(ch,handle,((can_msg_t *)can_msg)->data.u64);
+ CANIF_config_tx(ch,handle);
+ CANIF_mob_enable(ch,handle);
+#ifdef CAN_LIB_UNDER_INTERRUPT
+ CANIF_mob_enable_interrupt(ch,handle);
+#endif
+ return CAN_CMD_ACCEPTED;
+}
+
+U8 can_rx( U8 ch,
+ U8 handle,
+ U8 req_type,
+ const can_msg_t *can_msg)
+{
+ if ((ch > 1) ||
+ (handle > (NB_MOB_CHANNEL-1)))
+ return CAN_CMD_REFUSED;
+ if (can_msg->ide_bit){
+ CANIF_set_ext_id(ch,
+ handle,
+ can_msg->id);
+ CANIF_set_ext_idmask(ch,
+ handle,
+ can_msg->id_mask);
+ }
+ else {
+ CANIF_set_std_id(ch,
+ handle,
+ can_msg->id);
+ CANIF_set_std_idmask(ch,
+ handle,
+ can_msg->id_mask);
+ }
+ if (req_type == CAN_REMOTE_FRAME){
+ CANIF_set_rtr(ch,handle);
+ CANIF_set_rtrmask(ch,handle);
+ CANIF_mob_set_automode(ch,handle);
+ CANIF_set_data(ch,handle,((can_msg_t *)can_msg)->data.u64);
+ }
+ CANIF_config_rx(ch,handle);
+ CANIF_mob_enable(ch,handle);
+#ifdef CAN_LIB_UNDER_INTERRUPT
+ CANIF_mob_enable_interrupt(ch,handle);
+#endif
+ return CAN_CMD_ACCEPTED;
+}
+
+Union64 can_get_mob_data( U8 ch ,
+ U8 handle)
+{
+ return ((CANIF_mob_get_ptr_data(ch,handle)->data));
+}
+
+U8 can_get_mob_dlc( U8 ch ,
+ U8 handle)
+{
+ return (CANIF_mob_get_dlc(ch,handle));
+}
+
+U32 can_get_mob_id( U8 ch ,
+ U8 handle)
+{
+ return (CANIF_get_ext_id(ch,handle));
+}
+
+U8 can_mob_get_status( U8 ch,
+ U8 handle)
+{
+ U8 status;
+ if ((ch > 1)||
+ (handle > (NB_MOB_CHANNEL-1)) )
+ return CAN_CMD_REFUSED;
+
+ status = CANIF_get_interrupt_error_status(ch);
+ if (status!=0)
+ return CAN_STATUS_ERROR;
+
+ status = CANIF_mob_get_status(ch,handle);
+ if ( (status & MOB_RX_COMPLETED) ||
+ (status & MOB_TX_COMPLETED) ||
+ (status & MOB_RX_COMPLETED_DLCW) )
+ return CAN_STATUS_COMPLETED;
+
+ return CAN_STATUS_NOT_COMPLETED;
+}
+
+void can_clear_status (U8 ch,
+ U8 mob)
+{
+ CANIF_mob_clear_status(ch,mob);
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.h
new file mode 100644
index 0000000..f160a5f
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/services/network/can/can.h
@@ -0,0 +1,183 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CAN Software Stack for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CANIF module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+#ifndef _CAN_H_
+#define _CAN_H_
+
+//_____ I N C L U D E S ________________________________________________________
+#include "conf_can.h"
+#include "canif.h"
+#include "compiler.h"
+#include "preprocessor.h"
+//_____ D E F I N I T I O N S __________________________________________________
+
+// ----------
+//! This constant is used as return value for "can_cmd" function.
+#define CAN_CMD_REFUSED 0xFF
+// ----------
+//!This constant is used as return value for "can_cmd" function.
+#define CAN_CMD_ACCEPTED 0x00
+// ----------
+//! This constant is used as return value for "can_get_status" function.
+#define CAN_STATUS_COMPLETED 0x00
+// ----------
+//! This constant is used as return value for "can_get_status" function.
+#define CAN_STATUS_NOT_COMPLETED 0x01
+// ----------
+//! This constant is used as return value for "can_get_status" function.
+#define CAN_STATUS_ERROR 0x02
+// ----------
+//! This constant is used as return value for "can_get_status" function.
+#define CAN_STATUS_WAKEUP 0x03
+// ----------
+//! This constant is used as return value for "can_get_status" function.
+#define CAN_STATUS_BUSOFF 0x04
+// ----------
+//! This constant is used for MOB Allocation status
+#define CAN_MOB_NOT_ALLOCATED 0xFF
+// ----------
+//! This constant is used for MOB Initialization request
+#define CAN_DATA_FRAME 0
+//! This constant is used for MOB Initialization request
+#define CAN_REMOTE_FRAME 1
+
+typedef struct{
+ U8 handle;
+ can_msg_t *can_msg;
+ U8 dlc;
+ U8 req_type;
+ U8 status;
+}can_mob_t;
+//_____ D E C L A R A T I O N S ________________________________________________
+
+
+/*! \brief Initialize CAN channel
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param can_msg_ram_add Adress of the location of MOB Ram Buffer
+ * \param operating_mode Selection between CAN_CHANNEL_MODE_NORMAL or CAN_CHANNEL_MODE_LISTENING or CAN_CHANNEL_MODE_LOOPBACK
+ * \param can_msg_callback Callback for hardware interrupt
+ * \return U8 CAN_CMD_REFUSED or CAN_CMD_ACCEPTED
+ */
+extern U8 can_init( U8 ch,
+ U32 can_msg_ram_add,
+ U8 operating_mode,
+ void (*can_msg_callback) (U8,U8,U8));
+
+/*! \brief Allocate one MOB in a specific CAN Channel
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \return U8 CAN_CMD_REFUSED or the number of the MOB selected
+ */
+extern U8 can_mob_alloc(U8 ch);
+
+/*! \brief Free one specific MOB in a specific CAN Channel
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \return U8 CAN_CMD_REFUSED or CAN_CMD_ACCEPTED
+ */
+extern U8 can_mob_free(U8 ch,U8 handle);
+
+/*! \brief Start Transmission
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \param dlc Datalength
+ * \param req_type CAN_DATA_FRAME or CAN_REMOTE_FRAME
+ * \param can_msg CAN Message
+ * \return U8 CAN_CMD_REFUSED or CAN_CMD_ACCEPTED
+ */
+extern U8 can_tx( U8 ch,
+ U8 handle,
+ U8 dlc,
+ U8 req_type,
+ const can_msg_t *can_msg);
+
+/*! \brief Start Reception
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \param req_type CAN_DATA_FRAME or CAN_REMOTE_FRAME
+ * \param can_msg CAN Message
+ * \return U8 CAN_CMD_REFUSED or CAN_CMD_ACCEPTED
+ */
+extern U8 can_rx( U8 ch,
+ U8 handle,
+ U8 req_type,
+ const can_msg_t *can_msg);
+
+
+/*! \brief Get Mob data from a selected MOB
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \return Union64 See compiler.h file for type return definition
+ */
+extern Union64 can_get_mob_data( U8 ch ,
+ U8 handle);
+
+/*! \brief Get Mob dlc from a selected MOB
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \return U8 Return the DLC
+ */
+extern U8 can_get_mob_dlc( U8 ch ,
+ U8 handle);
+
+/*! \brief Get Mob ID from a selected MOB
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \return U32 Return the ID
+ */
+extern U32 can_get_mob_id( U8 ch ,
+ U8 handle);
+
+/*! \brief Get Mob status from a selected MOB
+ * \param ch CAN channel selected 0 (CAN Channel 0) 1 (CAN Channel 1)
+ * \param handle CAN MOB number
+ * \return U8 CAN_CMD_REFUSED or CAN_STATUS_ERROR or CAN_STATUS_COMPLETED or CAN_STATUS_NOT_COMPLETED
+ */
+extern U8 can_mob_get_status( U8 ch,
+ U8 handle);
+//______________________________________________________________________________
+
+#endif // _CAN_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/compiler.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/compiler.h
new file mode 100644
index 0000000..2639c7a
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/compiler.h
@@ -0,0 +1,1233 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Compiler file for AVR32.
+ *
+ * This file defines commonly used types and macros.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _COMPILER_AVR32_H_
+#define _COMPILER_AVR32_H_
+
+#if (defined __ICCAVR32__)
+# include <intrinsics.h>
+#endif
+#include "preprocessor.h"
+
+#include "parts.h"
+
+
+//_____ D E C L A R A T I O N S ____________________________________________
+
+#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+
+#if (defined __ICCAVR32__)
+
+/*! \name Compiler Keywords
+ *
+ * Port of some keywords from GNU GCC for AVR32 to IAR Embedded Workbench for Atmel AVR32.
+ */
+//! @{
+#define __asm__ asm
+#define __inline__ inline
+#define __volatile__
+//! @}
+
+#endif
+
+/**
+ * \def barrier
+ * \brief Memory barrier
+ */
+#if defined(__GNUC__)
+# define barrier() asm volatile("" ::: "memory")
+#elif defined(__ICCAVR32__)
+# define barrier() __asm__ __volatile__ ("")
+#endif
+
+/**
+ * \brief Emit the compiler pragma \a arg.
+ *
+ * \param arg The pragma directive as it would appear after \e \#pragma
+ * (i.e. not stringified).
+ */
+#define COMPILER_PRAGMA(arg) _Pragma(#arg)
+
+/**
+ * \def COMPILER_PACK_SET(alignment)
+ * \brief Set maximum alignment for subsequent struct and union
+ * definitions to \a alignment.
+ */
+#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment))
+
+/**
+ * \def COMPILER_PACK_RESET()
+ * \brief Set default alignment for subsequent struct and union
+ * definitions.
+ */
+#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())
+
+
+/**
+ * \brief Set aligned boundary.
+ */
+#if (defined __GNUC__)
+#define COMPILER_ALIGNED(a) __attribute__((__aligned__(a)))
+#elif (defined __ICCAVR32__)
+#define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a)
+#endif
+
+/**
+ * \brief Set word-aligned boundary.
+ */
+#if (defined __GNUC__)
+#define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4)))
+#elif (defined __ICCAVR32__)
+#define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4)
+#endif
+
+/**
+ * \name System Register Access
+ * @{
+ */
+#if defined(__GNUC__) || defined(__DOXYGEN__)
+/**
+ * \brief Get value of system register
+ *
+ * \param reg Address of the system register of which to get the value.
+ *
+ * \return Value of system register \a reg.
+ */
+# define sysreg_read(reg) __builtin_mfsr(reg)
+
+/**
+ * \name Tag functions as deprecated
+ *
+ * Tagging a function as deprecated will produce a warning when and only
+ * when the function is called.
+ *
+ * Usage is to add the __DEPRECATED__ symbol before the function definition.
+ * E.g.:
+ * __DEPRECATED__ uint8_t some_deprecated_function (void)
+ * {
+ * ...
+ * }
+ *
+ * \note Only supported by GCC 3.1 and above, no IAR support
+ * @{
+ */
+#if ((defined __GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >=1)))
+#define __DEPRECATED__ __attribute__((__deprecated__))
+#else
+#define __DEPRECATED__
+#endif
+//! @}
+
+/**
+ * \brief Set value of system register
+ *
+ * \param reg Address of the system register of which to set the value.
+ * \param val Value to set the system register \a reg to.
+ */
+# define sysreg_write(reg, val) __builtin_mtsr(reg, val)
+
+#elif defined(__ICCAVR32__)
+# define sysreg_read(reg) __get_system_register(reg)
+# define sysreg_write(reg, val) __set_system_register(reg, val)
+#endif
+
+// Deprecated definitions
+#define Get_system_register(reg) sysreg_read(reg)
+#define Set_system_register(reg, val) sysreg_write(reg, val)
+//! @}
+
+#include "interrupt.h"
+
+/*! \name Usual Types
+ */
+//! @{
+typedef unsigned char Bool; //!< Boolean.
+#ifndef __cplusplus
+#if !defined(__bool_true_false_are_defined)
+typedef unsigned char bool; //!< Boolean.
+#endif
+#endif
+typedef int8_t S8 ; //!< 8-bit signed integer.
+typedef uint8_t U8 ; //!< 8-bit unsigned integer.
+typedef int16_t S16; //!< 16-bit signed integer.
+typedef uint16_t U16; //!< 16-bit unsigned integer.
+typedef uint16_t le16_t;
+typedef uint16_t be16_t;
+typedef int32_t S32; //!< 32-bit signed integer.
+typedef uint32_t U32; //!< 32-bit unsigned integer.
+typedef uint32_t le32_t;
+typedef uint32_t be32_t;
+typedef signed long long int S64; //!< 64-bit signed integer.
+typedef unsigned long long int U64; //!< 64-bit unsigned integer.
+typedef float F32; //!< 32-bit floating-point number.
+typedef double F64; //!< 64-bit floating-point number.
+typedef uint32_t iram_size_t;
+//! @}
+
+
+/*! \name Status Types
+ */
+//! @{
+typedef bool Status_bool_t; //!< Boolean status.
+typedef U8 Status_t; //!< 8-bit-coded status.
+//! @}
+
+
+/*! \name Aliasing Aggregate Types
+ */
+//! @{
+
+//! 16-bit union.
+typedef union
+{
+ S16 s16 ;
+ U16 u16 ;
+ S8 s8 [2];
+ U8 u8 [2];
+} Union16;
+
+//! 32-bit union.
+typedef union
+{
+ S32 s32 ;
+ U32 u32 ;
+ S16 s16[2];
+ U16 u16[2];
+ S8 s8 [4];
+ U8 u8 [4];
+} Union32;
+
+//! 64-bit union.
+typedef union
+{
+ S64 s64 ;
+ U64 u64 ;
+ S32 s32[2];
+ U32 u32[2];
+ S16 s16[4];
+ U16 u16[4];
+ S8 s8 [8];
+ U8 u8 [8];
+} Union64;
+
+//! Union of pointers to 64-, 32-, 16- and 8-bit unsigned integers.
+typedef union
+{
+ S64 *s64ptr;
+ U64 *u64ptr;
+ S32 *s32ptr;
+ U32 *u32ptr;
+ S16 *s16ptr;
+ U16 *u16ptr;
+ S8 *s8ptr ;
+ U8 *u8ptr ;
+} UnionPtr;
+
+//! Union of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers.
+typedef union
+{
+ volatile S64 *s64ptr;
+ volatile U64 *u64ptr;
+ volatile S32 *s32ptr;
+ volatile U32 *u32ptr;
+ volatile S16 *s16ptr;
+ volatile U16 *u16ptr;
+ volatile S8 *s8ptr ;
+ volatile U8 *u8ptr ;
+} UnionVPtr;
+
+//! Union of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers.
+typedef union
+{
+ const S64 *s64ptr;
+ const U64 *u64ptr;
+ const S32 *s32ptr;
+ const U32 *u32ptr;
+ const S16 *s16ptr;
+ const U16 *u16ptr;
+ const S8 *s8ptr ;
+ const U8 *u8ptr ;
+} UnionCPtr;
+
+//! Union of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers.
+typedef union
+{
+ const volatile S64 *s64ptr;
+ const volatile U64 *u64ptr;
+ const volatile S32 *s32ptr;
+ const volatile U32 *u32ptr;
+ const volatile S16 *s16ptr;
+ const volatile U16 *u16ptr;
+ const volatile S8 *s8ptr ;
+ const volatile U8 *u8ptr ;
+} UnionCVPtr;
+
+//! Structure of pointers to 64-, 32-, 16- and 8-bit unsigned integers.
+typedef struct
+{
+ S64 *s64ptr;
+ U64 *u64ptr;
+ S32 *s32ptr;
+ U32 *u32ptr;
+ S16 *s16ptr;
+ U16 *u16ptr;
+ S8 *s8ptr ;
+ U8 *u8ptr ;
+} StructPtr;
+
+//! Structure of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers.
+typedef struct
+{
+ volatile S64 *s64ptr;
+ volatile U64 *u64ptr;
+ volatile S32 *s32ptr;
+ volatile U32 *u32ptr;
+ volatile S16 *s16ptr;
+ volatile U16 *u16ptr;
+ volatile S8 *s8ptr ;
+ volatile U8 *u8ptr ;
+} StructVPtr;
+
+//! Structure of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers.
+typedef struct
+{
+ const S64 *s64ptr;
+ const U64 *u64ptr;
+ const S32 *s32ptr;
+ const U32 *u32ptr;
+ const S16 *s16ptr;
+ const U16 *u16ptr;
+ const S8 *s8ptr ;
+ const U8 *u8ptr ;
+} StructCPtr;
+
+//! Structure of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers.
+typedef struct
+{
+ const volatile S64 *s64ptr;
+ const volatile U64 *u64ptr;
+ const volatile S32 *s32ptr;
+ const volatile U32 *u32ptr;
+ const volatile S16 *s16ptr;
+ const volatile U16 *u16ptr;
+ const volatile S8 *s8ptr ;
+ const volatile U8 *u8ptr ;
+} StructCVPtr;
+
+//! @}
+
+#endif // __AVR32_ABI_COMPILER__
+
+
+//_____ M A C R O S ________________________________________________________
+
+/*! \name Usual Constants
+ */
+//! @{
+#define DISABLE 0
+#define ENABLE 1
+#ifndef __cplusplus
+#if !defined(__bool_true_false_are_defined)
+#define false 0
+#define true 1
+#endif
+#endif
+#define PASS 0
+#define FAIL 1
+#define LOW 0
+#define HIGH 1
+//! @}
+
+
+#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
+
+//! \name Optimization Control
+//@{
+
+/**
+ * \def likely(exp)
+ * \brief The expression \a exp is likely to be true
+ */
+#ifndef likely
+# define likely(exp) (exp)
+#endif
+
+/**
+ * \def unlikely(exp)
+ * \brief The expression \a exp is unlikely to be true
+ */
+#ifndef unlikely
+# define unlikely(exp) (exp)
+#endif
+
+/**
+ * \def is_constant(exp)
+ * \brief Determine if an expression evaluates to a constant value.
+ *
+ * \param exp Any expression
+ *
+ * \return true if \a exp is constant, false otherwise.
+ */
+#ifdef __GNUC__
+# define is_constant(exp) __builtin_constant_p(exp)
+#else
+# define is_constant(exp) (0)
+#endif
+
+//! @}
+
+/*! \name Bit-Field Handling
+ */
+//! @{
+
+/*! \brief Reads the bits of a value specified by a given bit-mask.
+ *
+ * \param value Value to read bits from.
+ * \param mask Bit-mask indicating bits to read.
+ *
+ * \return Read bits.
+ */
+#define Rd_bits( value, mask) ((value) & (mask))
+
+/*! \brief Writes the bits of a C lvalue specified by a given bit-mask.
+ *
+ * \param lvalue C lvalue to write bits to.
+ * \param mask Bit-mask indicating bits to write.
+ * \param bits Bits to write.
+ *
+ * \return Resulting value with written bits.
+ */
+#define Wr_bits(lvalue, mask, bits) ((lvalue) = ((lvalue) & ~(mask)) |\
+ ((bits ) & (mask)))
+
+/*! \brief Tests the bits of a value specified by a given bit-mask.
+ *
+ * \param value Value of which to test bits.
+ * \param mask Bit-mask indicating bits to test.
+ *
+ * \return \c 1 if at least one of the tested bits is set, else \c 0.
+ */
+#define Tst_bits( value, mask) (Rd_bits(value, mask) != 0)
+
+/*! \brief Clears the bits of a C lvalue specified by a given bit-mask.
+ *
+ * \param lvalue C lvalue of which to clear bits.
+ * \param mask Bit-mask indicating bits to clear.
+ *
+ * \return Resulting value with cleared bits.
+ */
+#define Clr_bits(lvalue, mask) ((lvalue) &= ~(mask))
+
+/*! \brief Sets the bits of a C lvalue specified by a given bit-mask.
+ *
+ * \param lvalue C lvalue of which to set bits.
+ * \param mask Bit-mask indicating bits to set.
+ *
+ * \return Resulting value with set bits.
+ */
+#define Set_bits(lvalue, mask) ((lvalue) |= (mask))
+
+/*! \brief Toggles the bits of a C lvalue specified by a given bit-mask.
+ *
+ * \param lvalue C lvalue of which to toggle bits.
+ * \param mask Bit-mask indicating bits to toggle.
+ *
+ * \return Resulting value with toggled bits.
+ */
+#define Tgl_bits(lvalue, mask) ((lvalue) ^= (mask))
+
+/*! \brief Reads the bit-field of a value specified by a given bit-mask.
+ *
+ * \param value Value to read a bit-field from.
+ * \param mask Bit-mask indicating the bit-field to read.
+ *
+ * \return Read bit-field.
+ */
+#define Rd_bitfield( value, mask) (Rd_bits( value, mask) >> ctz(mask))
+
+/*! \brief Writes the bit-field of a C lvalue specified by a given bit-mask.
+ *
+ * \param lvalue C lvalue to write a bit-field to.
+ * \param mask Bit-mask indicating the bit-field to write.
+ * \param bitfield Bit-field to write.
+ *
+ * \return Resulting value with written bit-field.
+ */
+#define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (U32)(bitfield) << ctz(mask)))
+
+//! @}
+
+
+/*! \brief This macro makes the CPU take a small break for a few cycles. This should
+ * be used when waiting for an event. It will reduce the internal bus load.
+ *
+ * "sub pc, pc, -4" (or "sub pc, -2") forces the IF stage to wait until the result
+ * of the calculation before it can fetch the next instruction. This makes sure
+ * there are nothing stuck in the LS pipe when you start a new iteration and guarante
+ * to flush the pipeline without having any other effect.
+ * (A nop doesn't have any effect on the IF stage.)
+ */
+#if (defined __GNUC__)
+# define cpu_relax() __asm__ __volatile__("sub pc, pc, -4" ::: "memory", "cc")
+#elif (defined __ICCAVR32__)
+# define cpu_relax() __asm__ __volatile__("sub pc, pc, -4")
+#endif
+
+
+/*! \brief This macro is used to test fatal errors.
+ *
+ * The macro tests if the expression is false. If it is, a fatal error is
+ * detected and the application hangs up.
+ *
+ * \param expr Expression to evaluate and supposed to be nonzero.
+ */
+#ifdef _ASSERT_ENABLE_
+ #define Assert(expr) \
+ {\
+ if (!(expr)) while (true);\
+ }
+#else
+ #define Assert(expr) ((void) 0)
+#endif
+
+
+/*! \name Zero-Bit Counting
+ *
+ * Under AVR32-GCC, __builtin_clz and __builtin_ctz behave like macros when
+ * applied to constant expressions (values known at compile time), so they are
+ * more optimized than the use of the corresponding assembly instructions and
+ * they can be used as constant expressions e.g. to initialize objects having
+ * static storage duration, and like the corresponding assembly instructions
+ * when applied to non-constant expressions (values unknown at compile time), so
+ * they are more optimized than an assembly periphrasis. Hence, clz and ctz
+ * ensure a possible and optimized behavior for both constant and non-constant
+ * expressions.
+ */
+//! @{
+
+/*! \brief Counts the leading zero bits of the given value considered as a 32-bit integer.
+ *
+ * \param u Value of which to count the leading zero bits.
+ *
+ * \return The count of leading zero bits in \a u.
+ */
+#if (defined __GNUC__)
+ #define clz(u) __builtin_clz(u)
+#elif (defined __ICCAVR32__)
+ #if (__VER__ == 330) && (__SUBVERSION__ <= 1)
+ // __count_leading_zeros is broken and returns a value which is offset by
+ // -32 when called with a constant parameter.
+ #define clz(v) (0 == v ? 32 : (31 & __count_leading_zeros(v)))
+ #else
+ #define clz(v) __count_leading_zeros(v)
+ #endif
+#endif
+
+/*! \brief Counts the trailing zero bits of the given value considered as a 32-bit integer.
+ *
+ * \param u Value of which to count the trailing zero bits.
+ *
+ * \return The count of trailing zero bits in \a u.
+ */
+#if (defined __GNUC__)
+ #define ctz(u) __builtin_ctz(u)
+#elif (defined __ICCAVR32__)
+ #define ctz(u) __count_trailing_zeros(u)
+#endif
+
+//! @}
+
+//! \name Logarithmic functions
+//! @{
+
+/**
+ * \internal
+ * Undefined function. Will cause a link failure if ilog2() is called
+ * with an invalid constant value.
+ */
+int_fast8_t ilog2_undefined(void);
+
+/**
+ * \brief Calculate the base-2 logarithm of a number rounded down to
+ * the nearest integer.
+ *
+ * \param x A 32-bit value
+ * \return The base-2 logarithm of \a x, or -1 if \a x is 0.
+ */
+static inline int_fast8_t ilog2(uint32_t x)
+{
+ if (is_constant(x))
+ return ((x) & (1ULL << 31) ? 31 :
+ (x) & (1ULL << 30) ? 30 :
+ (x) & (1ULL << 29) ? 29 :
+ (x) & (1ULL << 28) ? 28 :
+ (x) & (1ULL << 27) ? 27 :
+ (x) & (1ULL << 26) ? 26 :
+ (x) & (1ULL << 25) ? 25 :
+ (x) & (1ULL << 24) ? 24 :
+ (x) & (1ULL << 23) ? 23 :
+ (x) & (1ULL << 22) ? 22 :
+ (x) & (1ULL << 21) ? 21 :
+ (x) & (1ULL << 20) ? 20 :
+ (x) & (1ULL << 19) ? 19 :
+ (x) & (1ULL << 18) ? 18 :
+ (x) & (1ULL << 17) ? 17 :
+ (x) & (1ULL << 16) ? 16 :
+ (x) & (1ULL << 15) ? 15 :
+ (x) & (1ULL << 14) ? 14 :
+ (x) & (1ULL << 13) ? 13 :
+ (x) & (1ULL << 12) ? 12 :
+ (x) & (1ULL << 11) ? 11 :
+ (x) & (1ULL << 10) ? 10 :
+ (x) & (1ULL << 9) ? 9 :
+ (x) & (1ULL << 8) ? 8 :
+ (x) & (1ULL << 7) ? 7 :
+ (x) & (1ULL << 6) ? 6 :
+ (x) & (1ULL << 5) ? 5 :
+ (x) & (1ULL << 4) ? 4 :
+ (x) & (1ULL << 3) ? 3 :
+ (x) & (1ULL << 2) ? 2 :
+ (x) & (1ULL << 1) ? 1 :
+ (x) & (1ULL << 0) ? 0 :
+ ilog2_undefined());
+
+ return 31 - clz(x);
+}
+
+//! @}
+
+/*! \name Bit Reversing
+ */
+//! @{
+
+/*! \brief Reverses the bits of \a u8.
+ *
+ * \param u8 U8 of which to reverse the bits.
+ *
+ * \return Value resulting from \a u8 with reversed bits.
+ */
+#define bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24))
+
+/*! \brief Reverses the bits of \a u16.
+ *
+ * \param u16 U16 of which to reverse the bits.
+ *
+ * \return Value resulting from \a u16 with reversed bits.
+ */
+#define bit_reverse16(u16) ((U16)(bit_reverse32((U16)(u16)) >> 16))
+
+/*! \brief Reverses the bits of \a u32.
+ *
+ * \param u32 U32 of which to reverse the bits.
+ *
+ * \return Value resulting from \a u32 with reversed bits.
+ */
+#if (defined __GNUC__)
+ #define bit_reverse32(u32) \
+ (\
+ {\
+ unsigned int __value = (U32)(u32);\
+ __asm__ ("brev\t%0" : "+r" (__value) : : "cc");\
+ (U32)__value;\
+ }\
+ )
+#elif (defined __ICCAVR32__)
+ #define bit_reverse32(u32) ((U32)__bit_reverse((U32)(u32)))
+#endif
+
+/*! \brief Reverses the bits of \a u64.
+ *
+ * \param u64 U64 of which to reverse the bits.
+ *
+ * \return Value resulting from \a u64 with reversed bits.
+ */
+#define bit_reverse64(u64) ((U64)(((U64)bit_reverse32((U64)(u64) >> 32)) |\
+ ((U64)bit_reverse32((U64)(u64)) << 32)))
+
+//! @}
+
+
+/*! \name Alignment
+ */
+//! @{
+
+/*! \brief Tests alignment of the number \a val with the \a n boundary.
+ *
+ * \param val Input value.
+ * \param n Boundary.
+ *
+ * \return \c 1 if the number \a val is aligned with the \a n boundary, else \c 0.
+ */
+#define Test_align(val, n ) (!Tst_bits( val, (n) - 1 ) )
+
+/*! \brief Gets alignment of the number \a val with respect to the \a n boundary.
+ *
+ * \param val Input value.
+ * \param n Boundary.
+ *
+ * \return Alignment of the number \a val with respect to the \a n boundary.
+ */
+#define Get_align( val, n ) ( Rd_bits( val, (n) - 1 ) )
+
+/*! \brief Sets alignment of the lvalue number \a lval to \a alg with respect to the \a n boundary.
+ *
+ * \param lval Input/output lvalue.
+ * \param n Boundary.
+ * \param alg Alignment.
+ *
+ * \return New value of \a lval resulting from its alignment set to \a alg with respect to the \a n boundary.
+ */
+#define Set_align(lval, n, alg) ( Wr_bits(lval, (n) - 1, alg) )
+
+/*! \brief Aligns the number \a val with the upper \a n boundary.
+ *
+ * \param val Input value.
+ * \param n Boundary.
+ *
+ * \return Value resulting from the number \a val aligned with the upper \a n boundary.
+ */
+#define Align_up( val, n ) (((val) + ((n) - 1)) & ~((n) - 1))
+
+/*! \brief Aligns the number \a val with the lower \a n boundary.
+ *
+ * \param val Input value.
+ * \param n Boundary.
+ *
+ * \return Value resulting from the number \a val aligned with the lower \a n boundary.
+ */
+#define Align_down(val, n ) ( (val) & ~((n) - 1))
+
+//! @}
+
+
+/*! \name Mathematics
+ *
+ * The same considerations as for clz and ctz apply here but AVR32-GCC does not
+ * provide built-in functions to access the assembly instructions abs, min and
+ * max and it does not produce them by itself in most cases, so two sets of
+ * macros are defined here:
+ * - Abs, Min and Max to apply to constant expressions (values known at
+ * compile time);
+ * - abs, min and max to apply to non-constant expressions (values unknown at
+ * compile time).
+ */
+//! @{
+
+/*! \brief Takes the absolute value of \a a.
+ *
+ * \param a Input value.
+ *
+ * \return Absolute value of \a a.
+ *
+ * \note More optimized if only used with values known at compile time.
+ */
+#define Abs(a) (((a) < 0 ) ? -(a) : (a))
+
+/*! \brief Takes the minimal value of \a a and \a b.
+ *
+ * \param a Input value.
+ * \param b Input value.
+ *
+ * \return Minimal value of \a a and \a b.
+ *
+ * \note More optimized if only used with values known at compile time.
+ */
+#define Min(a, b) (((a) < (b)) ? (a) : (b))
+
+/*! \brief Takes the maximal value of \a a and \a b.
+ *
+ * \param a Input value.
+ * \param b Input value.
+ *
+ * \return Maximal value of \a a and \a b.
+ *
+ * \note More optimized if only used with values known at compile time.
+ */
+#define Max(a, b) (((a) > (b)) ? (a) : (b))
+
+/*! \brief Takes the absolute value of \a a.
+ *
+ * \param a Input value.
+ *
+ * \return Absolute value of \a a.
+ *
+ * \note More optimized if only used with values unknown at compile time.
+ */
+#if (defined __GNUC__)
+ #define abs(a) \
+ (\
+ {\
+ int __value = (a);\
+ __asm__ ("abs\t%0" : "+r" (__value) : : "cc");\
+ __value;\
+ }\
+ )
+#elif (defined __ICCAVR32__)
+ #define abs(a) Abs(a)
+#endif
+
+/*! \brief Takes the minimal value of \a a and \a b.
+ *
+ * \param a Input value.
+ * \param b Input value.
+ *
+ * \return Minimal value of \a a and \a b.
+ *
+ * \note More optimized if only used with values unknown at compile time.
+ */
+#if (defined __GNUC__)
+ #define min(a, b) \
+ (\
+ {\
+ int __value, __arg_a = (a), __arg_b = (b);\
+ __asm__ ("min\t%0, %1, %2" : "=r" (__value) : "r" (__arg_a), "r" (__arg_b));\
+ __value;\
+ }\
+ )
+#elif (defined __ICCAVR32__)
+ #define min(a, b) __min(a, b)
+#endif
+
+/*! \brief Takes the maximal value of \a a and \a b.
+ *
+ * \param a Input value.
+ * \param b Input value.
+ *
+ * \return Maximal value of \a a and \a b.
+ *
+ * \note More optimized if only used with values unknown at compile time.
+ */
+#if (defined __GNUC__)
+ #define max(a, b) \
+ (\
+ {\
+ int __value, __arg_a = (a), __arg_b = (b);\
+ __asm__ ("max\t%0, %1, %2" : "=r" (__value) : "r" (__arg_a), "r" (__arg_b));\
+ __value;\
+ }\
+ )
+#elif (defined __ICCAVR32__)
+ #define max(a, b) __max(a, b)
+#endif
+
+//! @}
+
+
+/*! \brief Calls the routine at address \a addr.
+ *
+ * It generates a long call opcode.
+ *
+ * For example, `Long_call(0x80000000)' generates a software reset on a UC3 if
+ * it is invoked from the CPU supervisor mode.
+ *
+ * \param addr Address of the routine to call.
+ *
+ * \note It may be used as a long jump opcode in some special cases.
+ */
+#define Long_call(addr) ((*(void (*)(void))(addr))())
+
+/*! \brief Resets the CPU by software.
+ *
+ * \warning It shall not be called from the CPU application mode.
+ */
+#if (defined __GNUC__)
+ #define Reset_CPU() \
+ (\
+ {\
+ __asm__ __volatile__ (\
+ "lddpc r9, 3f\n\t"\
+ "mfsr r8, %[SR]\n\t"\
+ "bfextu r8, r8, %[SR_M_OFFSET], %[SR_M_SIZE]\n\t"\
+ "cp.w r8, 0b001\n\t"\
+ "breq 0f\n\t"\
+ "sub r8, pc, $ - 1f\n\t"\
+ "pushm r8-r9\n\t"\
+ "rete\n"\
+ "0:\n\t"\
+ "mtsr %[SR], r9\n"\
+ "1:\n\t"\
+ "mov r0, 0\n\t"\
+ "mov r1, 0\n\t"\
+ "mov r2, 0\n\t"\
+ "mov r3, 0\n\t"\
+ "mov r4, 0\n\t"\
+ "mov r5, 0\n\t"\
+ "mov r6, 0\n\t"\
+ "mov r7, 0\n\t"\
+ "mov r8, 0\n\t"\
+ "mov r9, 0\n\t"\
+ "mov r10, 0\n\t"\
+ "mov r11, 0\n\t"\
+ "mov r12, 0\n\t"\
+ "mov sp, 0\n\t"\
+ "stdsp sp[0], sp\n\t"\
+ "ldmts sp, sp\n\t"\
+ "mov lr, 0\n\t"\
+ "lddpc pc, 2f\n\t"\
+ ".balign 4\n"\
+ "2:\n\t"\
+ ".word _start\n"\
+ "3:\n\t"\
+ ".word %[RESET_SR]"\
+ :\
+ : [SR] "i" (AVR32_SR),\
+ [SR_M_OFFSET] "i" (AVR32_SR_M_OFFSET),\
+ [SR_M_SIZE] "i" (AVR32_SR_M_SIZE),\
+ [RESET_SR] "i" (AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | (AVR32_SR_M_SUP << AVR32_SR_M_OFFSET))\
+ );\
+ }\
+ )
+#elif (defined __ICCAVR32__)
+ #define Reset_CPU() \
+ {\
+ extern void *volatile __program_start;\
+ __asm__ __volatile__ (\
+ "mov r7, LWRD(__program_start)\n\t"\
+ "orh r7, HWRD(__program_start)\n\t"\
+ "mov r9, LWRD("ASTRINGZ(AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | (AVR32_SR_M_SUP << AVR32_SR_M_OFFSET))")\n\t"\
+ "orh r9, HWRD("ASTRINGZ(AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | (AVR32_SR_M_SUP << AVR32_SR_M_OFFSET))")\n\t"\
+ "mfsr r8, "ASTRINGZ(AVR32_SR)"\n\t"\
+ "bfextu r8, r8, "ASTRINGZ(AVR32_SR_M_OFFSET)", "ASTRINGZ(AVR32_SR_M_SIZE)"\n\t"\
+ "cp.w r8, 001b\n\t"\
+ "breq $ + 10\n\t"\
+ "sub r8, pc, -12\n\t"\
+ "pushm r8-r9\n\t"\
+ "rete\n\t"\
+ "mtsr "ASTRINGZ(AVR32_SR)", r9\n\t"\
+ "mov r0, 0\n\t"\
+ "mov r1, 0\n\t"\
+ "mov r2, 0\n\t"\
+ "mov r3, 0\n\t"\
+ "mov r4, 0\n\t"\
+ "mov r5, 0\n\t"\
+ "mov r6, 0\n\t"\
+ "st.w r0[4], r7\n\t"\
+ "mov r7, 0\n\t"\
+ "mov r8, 0\n\t"\
+ "mov r9, 0\n\t"\
+ "mov r10, 0\n\t"\
+ "mov r11, 0\n\t"\
+ "mov r12, 0\n\t"\
+ "mov sp, 0\n\t"\
+ "stdsp sp[0], sp\n\t"\
+ "ldmts sp, sp\n\t"\
+ "mov lr, 0\n\t"\
+ "ld.w pc, lr[4]"\
+ );\
+ __program_start;\
+ }
+#endif
+
+
+
+/*! \name CPU Status Register Access
+ */
+//! @{
+
+/*! \brief Tells whether exceptions are globally enabled.
+ *
+ * \return \c 1 if exceptions are globally enabled, else \c 0.
+ */
+#define Is_global_exception_enabled() (!Tst_bits(Get_system_register(AVR32_SR), AVR32_SR_EM_MASK))
+
+/*! \brief Disables exceptions globally.
+ */
+#if (defined __GNUC__)
+ #define Disable_global_exception() ({__asm__ __volatile__ ("ssrf\t%0" : : "i" (AVR32_SR_EM_OFFSET));})
+#elif (defined __ICCAVR32__)
+ #define Disable_global_exception() (__set_status_flag(AVR32_SR_EM_OFFSET))
+#endif
+
+/*! \brief Enables exceptions globally.
+ */
+#if (defined __GNUC__)
+ #define Enable_global_exception() ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_EM_OFFSET));})
+#elif (defined __ICCAVR32__)
+ #define Enable_global_exception() (__clear_status_flag(AVR32_SR_EM_OFFSET))
+#endif
+
+//! @}
+
+
+/*! \name Debug Register Access
+ */
+//! @{
+
+/*! \brief Gets the value of the \a dbgreg debug register.
+ *
+ * \param dbgreg Address of the debug register of which to get the value.
+ *
+ * \return Value of the \a dbgreg debug register.
+ */
+#if (defined __GNUC__)
+ #define Get_debug_register(dbgreg) __builtin_mfdr(dbgreg)
+#elif (defined __ICCAVR32__)
+ #define Get_debug_register(dbgreg) __get_debug_register(dbgreg)
+#endif
+
+/*! \brief Sets the value of the \a dbgreg debug register to \a value.
+ *
+ * \param dbgreg Address of the debug register of which to set the value.
+ * \param value Value to set the \a dbgreg debug register to.
+ */
+#if (defined __GNUC__)
+ #define Set_debug_register(dbgreg, value) __builtin_mtdr(dbgreg, value)
+#elif (defined __ICCAVR32__)
+ #define Set_debug_register(dbgreg, value) __set_debug_register(dbgreg, value)
+#endif
+
+//! @}
+
+
+/*! \name Force Assembly Inline Code Section
+ */
+//! @{
+#if (defined __GNUC__)
+#define __always_inline __attribute__((__always_inline__))
+#elif (defined __ICCAVR32__)
+#define __always_inline _Pragma("inline=forced")
+#endif
+//! @}
+
+/*! \name MCU Endianism Handling
+ * AVR32 is MCU big endianism.
+ */
+//! @{
+#define MSB(u16) (((U8 *)&(u16))[0]) //!< Most significant byte of \a u16.
+#define LSB(u16) (((U8 *)&(u16))[1]) //!< Least significant byte of \a u16.
+
+#define MSH(u32) (((U16 *)&(u32))[0]) //!< Most significant half-word of \a u32.
+#define LSH(u32) (((U16 *)&(u32))[1]) //!< Least significant half-word of \a u32.
+#define MSB0W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 1st rank of \a u32.
+#define MSB1W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 2nd rank of \a u32.
+#define MSB2W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 3rd rank of \a u32.
+#define MSB3W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 4th rank of \a u32.
+#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32.
+#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32.
+#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32.
+#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32.
+
+#define MSW(u64) (((U32 *)&(u64))[0]) //!< Most significant word of \a u64.
+#define LSW(u64) (((U32 *)&(u64))[1]) //!< Least significant word of \a u64.
+#define MSH0(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 1st rank of \a u64.
+#define MSH1(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 2nd rank of \a u64.
+#define MSH2(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 3rd rank of \a u64.
+#define MSH3(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 4th rank of \a u64.
+#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64.
+#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64.
+#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64.
+#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64.
+#define MSB0D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 1st rank of \a u64.
+#define MSB1D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 2nd rank of \a u64.
+#define MSB2D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 3rd rank of \a u64.
+#define MSB3D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 4th rank of \a u64.
+#define MSB4D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 5th rank of \a u64.
+#define MSB5D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 6th rank of \a u64.
+#define MSB6D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 7th rank of \a u64.
+#define MSB7D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 8th rank of \a u64.
+#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64.
+#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64.
+#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64.
+#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64.
+#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64.
+#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64.
+#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64.
+#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64.
+
+#define LE16(x) Swap16(x)
+#define le16_to_cpu(x) swap16(x)
+#define cpu_to_le16(x) swap16(x)
+#define LE16_TO_CPU(x) Swap16(x)
+#define CPU_TO_LE16(x) Swap16(x)
+
+#define be16_to_cpu(x) (x)
+#define cpu_to_be16(x) (x)
+#define BE16_TO_CPU(x) (x)
+#define CPU_TO_BE16(x) (x)
+
+#define le32_to_cpu(x) swap32(x)
+#define cpu_to_le32(x) swap32(x)
+#define LE32_TO_CPU(x) Swap32(x)
+#define CPU_TO_LE32(x) Swap32(x)
+
+#define be32_to_cpu(x) (x)
+#define cpu_to_be32(x) (x)
+#define BE32_TO_CPU(x) (x)
+#define CPU_TO_BE32(x) (x)
+//! @}
+
+
+/*! \name Endianism Conversion
+ *
+ * The same considerations as for clz and ctz apply here but AVR32-GCC's
+ * __builtin_bswap_16 and __builtin_bswap_32 do not behave like macros when
+ * applied to constant expressions, so two sets of macros are defined here:
+ * - Swap16, Swap32 and Swap64 to apply to constant expressions (values known
+ * at compile time);
+ * - swap16, swap32 and swap64 to apply to non-constant expressions (values
+ * unknown at compile time).
+ */
+//! @{
+
+/*! \brief Toggles the endianism of \a u16 (by swapping its bytes).
+ *
+ * \param u16 U16 of which to toggle the endianism.
+ *
+ * \return Value resulting from \a u16 with toggled endianism.
+ *
+ * \note More optimized if only used with values known at compile time.
+ */
+#define Swap16(u16) ((U16)(((U16)(u16) >> 8) |\
+ ((U16)(u16) << 8)))
+
+/*! \brief Toggles the endianism of \a u32 (by swapping its bytes).
+ *
+ * \param u32 U32 of which to toggle the endianism.
+ *
+ * \return Value resulting from \a u32 with toggled endianism.
+ *
+ * \note More optimized if only used with values known at compile time.
+ */
+#define Swap32(u32) ((U32)(((U32)Swap16((U32)(u32) >> 16)) |\
+ ((U32)Swap16((U32)(u32)) << 16)))
+
+/*! \brief Toggles the endianism of \a u64 (by swapping its bytes).
+ *
+ * \param u64 U64 of which to toggle the endianism.
+ *
+ * \return Value resulting from \a u64 with toggled endianism.
+ *
+ * \note More optimized if only used with values known at compile time.
+ */
+#define Swap64(u64) ((U64)(((U64)Swap32((U64)(u64) >> 32)) |\
+ ((U64)Swap32((U64)(u64)) << 32)))
+
+/*! \brief Toggles the endianism of \a u16 (by swapping its bytes).
+ *
+ * \param u16 U16 of which to toggle the endianism.
+ *
+ * \return Value resulting from \a u16 with toggled endianism.
+ *
+ * \note More optimized if only used with values unknown at compile time.
+ */
+#if (defined __GNUC__)
+# if (!defined __OPTIMIZE_SIZE__) || !__OPTIMIZE_SIZE__
+ #define swap16(u16) ((U16)__builtin_bswap_16((U16)(u16)))
+# else
+ // swap_16 must be not used when GCC's -Os command option is used
+ #define swap16(u16) Swap16(u16)
+# endif
+#elif (defined __ICCAVR32__)
+ #define swap16(u16) ((U16)__swap_bytes_in_halfwords((U16)(u16)))
+#endif
+
+/*! \brief Toggles the endianism of \a u32 (by swapping its bytes).
+ *
+ * \param u32 U32 of which to toggle the endianism.
+ *
+ * \return Value resulting from \a u32 with toggled endianism.
+ *
+ * \note More optimized if only used with values unknown at compile time.
+ */
+#if (defined __GNUC__)
+ #define swap32(u32) ((U32)__builtin_bswap_32((U32)(u32)))
+#elif (defined __ICCAVR32__)
+ #define swap32(u32) ((U32)__swap_bytes((U32)(u32)))
+#endif
+
+/*! \brief Toggles the endianism of \a u64 (by swapping its bytes).
+ *
+ * \param u64 U64 of which to toggle the endianism.
+ *
+ * \return Value resulting from \a u64 with toggled endianism.
+ *
+ * \note More optimized if only used with values unknown at compile time.
+ */
+#define swap64(u64) ((U64)(((U64)swap32((U64)(u64) >> 32)) |\
+ ((U64)swap32((U64)(u64)) << 32)))
+
+//! @}
+
+
+/*! \name Target Abstraction
+ */
+//! @{
+
+#define _GLOBEXT_ extern //!< extern storage-class specifier.
+#define _CONST_TYPE_ const //!< const type qualifier.
+#define _MEM_TYPE_SLOW_ //!< Slow memory type.
+#define _MEM_TYPE_MEDFAST_ //!< Fairly fast memory type.
+#define _MEM_TYPE_FAST_ //!< Fast memory type.
+
+typedef U8 Byte; //!< 8-bit unsigned integer.
+
+#define memcmp_ram2ram memcmp //!< Target-specific memcmp of RAM to RAM.
+#define memcmp_code2ram memcmp //!< Target-specific memcmp of RAM to NVRAM.
+#define memcpy_ram2ram memcpy //!< Target-specific memcpy from RAM to RAM.
+#define memcpy_code2ram memcpy //!< Target-specific memcpy from NVRAM to RAM.
+
+#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32.
+#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32.
+#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32.
+#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32.
+#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32.
+#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32.
+#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32.
+#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32.
+
+//! @}
+
+#endif // __AVR32_ABI_COMPILER__
+
+
+#endif // _COMPILER_AVR32_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds
new file mode 100644
index 0000000..a3c3cc8
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/linker_scripts/at32uc3c/0512c/gcc/link_uc3c0512c.lds
@@ -0,0 +1,288 @@
+/******************************************************************************
+ * AVR32 AT32UC3C0512C GNU LD script file.
+ *
+ * - Compiler: GNU GCC for AVR32
+ * - Supported devices: AVR32 AT32UC3C0512C
+ *
+ * - author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
+
+OUTPUT_ARCH(avr32:uc)
+
+ENTRY(_start)
+
+MEMORY
+{
+ FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00080000
+ INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x0000FFFC
+ HRAM0 (wxa!ri) : ORIGIN = 0xA0000000, LENGTH = 0x00001000
+ USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
+}
+
+PHDRS
+{
+ FLASH PT_LOAD;
+ INTRAM_ALIGN PT_NULL;
+ INTRAM_AT_FLASH PT_LOAD;
+ INTRAM PT_NULL;
+ HRAM0_AT_FLASH PT_LOAD;
+ HRAM0 PT_NULL;
+ USERPAGE PT_LOAD;
+}
+
+SECTIONS
+{
+ /* If this heap size is selected, all the INTRAM space from the end of the
+ data area to the beginning of the stack will be allocated for the heap. */
+ __max_heap_size__ = -1;
+
+ /* Use a default heap size if heap size was not defined. */
+ __heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
+
+ /* Use a default stack size if stack size was not defined. */
+ __stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
+
+ /* Read-only sections, merged into text segment: */
+ PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
+ .interp : { *(.interp) } >FLASH AT>FLASH :FLASH
+ .reset : { *(.reset) } >FLASH AT>FLASH :FLASH
+ .hash : { *(.hash) } >FLASH AT>FLASH :FLASH
+ .dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
+ .dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
+ .gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
+ .gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
+ .gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
+ .rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
+ .rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
+ .rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
+ .rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
+ .rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
+ .rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
+ .rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
+ .rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
+ .rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
+ .rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
+ .rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
+ .rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
+ .rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
+ .rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
+ .init :
+ {
+ KEEP (*(.init))
+ } >FLASH AT>FLASH :FLASH =0xd703d703
+ .plt : { *(.plt) } >FLASH AT>FLASH :FLASH
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ KEEP (*(.text.*personality*))
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } >FLASH AT>FLASH :FLASH =0xd703d703
+ .fini :
+ {
+ KEEP (*(.fini))
+ } >FLASH AT>FLASH :FLASH =0xd703d703
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
+ .rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
+ .eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
+ .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
+ .lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
+ . = ORIGIN(INTRAM);
+ .dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM_ALIGN
+ /* Exception handling */
+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ /* Ensure the __preinit_array_start label is properly aligned. We
+ could instead move the label definition inside the section, but
+ the linker would then create the section even if it turns out to
+ be empty, which isn't pretty. */
+ PROVIDE (__preinit_array_start = ALIGN(32 / 8));
+ .preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ PROVIDE (__preinit_array_end = .);
+ PROVIDE (__init_array_start = .);
+ .init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ PROVIDE (__init_array_end = .);
+ PROVIDE (__fini_array_start = .);
+ .fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ PROVIDE (__fini_array_end = .);
+ .ctors :
+ {
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+ KEEP (*crtbegin*.o(.ctors))
+ /* We don't want to include the .ctor section from
+ from the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .dtors :
+ {
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .dynamic : { *(.dynamic) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .ramtext : { *(.ramtext .ramtext.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .ddalign : { . = ALIGN(8); } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ KEEP (*(.gnu.linkonce.d.*personality*))
+ SORT(CONSTRUCTORS)
+ } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .data1 : { *(.data1) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ .balign : { . = ALIGN(8); PROVIDE(_edata = .); } >INTRAM AT>FLASH :INTRAM_AT_FLASH
+ PROVIDE (edata = .);
+ __bss_start = .;
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections. */
+ . = ALIGN(8);
+ } >INTRAM AT>INTRAM :INTRAM
+ . = ALIGN(8);
+ _end = .;
+ PROVIDE (end = .);
+ __heap_start__ = ALIGN(8);
+ .heap :
+ {
+ *(.heap)
+ . = (__heap_size__ == __max_heap_size__) ?
+ ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
+ __heap_size__;
+ } >INTRAM AT>INTRAM :INTRAM
+ __heap_end__ = .;
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ .stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
+ {
+ _stack = .;
+ *(.stack)
+ . = __stack_size__;
+ _estack = .;
+ } >INTRAM AT>INTRAM :INTRAM
+
+ . = ORIGIN(HRAM0);
+ .data_hram0 ORIGIN(HRAM0) : AT ( LOADADDR(.balign) + SIZEOF (.balign) )
+ {
+ PROVIDE(_data_hram0 = .);
+ *(.data_hram0)
+ . = ALIGN(8);
+ PROVIDE(_edata_hram0 = .);
+ } >HRAM0 :HRAM0_AT_FLASH
+
+ PROVIDE(_data_hram0_lma = ABSOLUTE(LOADADDR(.data_hram0)));
+
+ . = ALIGN(8);
+ .bss_hram0 :
+ {
+ PROVIDE(__bss_hram0_start = .);
+ *(.bss_hram0)
+ PROVIDE(_bss_hram0_end = .);
+ } >HRAM0 AT>HRAM0 :HRAM0
+ .userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
+ /DISCARD/ : { *(.note.GNU-stack) }
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/parts.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/parts.h
new file mode 100644
index 0000000..91994b4
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/parts.h
@@ -0,0 +1,253 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Arch file for AVR32.
+ *
+ * This file defines common AVR32 UC3 series.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _ARCH_H_
+#define _ARCH_H_
+
+// UC3 A Series
+#define UC3A0 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3A0128__) || \
+ defined (__AVR32_UC3A0256__) || \
+ defined (__AVR32_UC3A0512__) || \
+ defined (__AVR32_UC3A0512ES__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3A0128__) || \
+ defined (__AT32UC3A0256__) || \
+ defined (__AT32UC3A0512__) || \
+ defined (__AT32UC3A0512ES__))))
+
+#define UC3A1 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3A1128__) || \
+ defined (__AVR32_UC3A1256__) || \
+ defined (__AVR32_UC3A1512__) || \
+ defined (__AVR32_UC3A1512ES__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3A1128__) || \
+ defined (__AT32UC3A1256__) || \
+ defined (__AT32UC3A1512__) || \
+ defined (__AT32UC3A1512ES__))))
+
+#define UC3A3 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3A364__) || \
+ defined (__AVR32_UC3A364S__) || \
+ defined (__AVR32_UC3A3128__) || \
+ defined (__AVR32_UC3A3128S__) || \
+ defined (__AVR32_UC3A3256__) || \
+ defined (__AVR32_UC3A3256S__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3A364__) || \
+ defined (__AT32UC3A364S__) || \
+ defined (__AT32UC3A3128__) || \
+ defined (__AT32UC3A3128S__) || \
+ defined (__AT32UC3A3256__) || \
+ defined (__AT32UC3A3256S__))))
+
+#define UC3A4 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3A464__) || \
+ defined (__AVR32_UC3A464S__) || \
+ defined (__AVR32_UC3A4128__) || \
+ defined (__AVR32_UC3A4128S__) || \
+ defined (__AVR32_UC3A4256__) || \
+ defined (__AVR32_UC3A4256S__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3A464__) || \
+ defined (__AT32UC3A464S__) || \
+ defined (__AT32UC3A4128__) || \
+ defined (__AT32UC3A4128S__) || \
+ defined (__AT32UC3A4256__) || \
+ defined (__AT32UC3A4256S__))))
+
+#define UC3A (UC3A0 || UC3A1 || UC3A3 || UC3A4)
+
+// UC3 B Series
+#define UC3B0 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3B064__) || \
+ defined (__AVR32_UC3B0128__) || \
+ defined (__AVR32_UC3B0256__) || \
+ defined (__AVR32_UC3B0256ES__) || \
+ defined (__AVR32_UC3B0512__) || \
+ defined (__AVR32_UC3B0512REVC_))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3B064__) || \
+ defined (__AT32UC3B0128__) || \
+ defined (__AT32UC3B0256__) || \
+ defined (__AT32UC3B0256ES__) || \
+ defined (__AT32UC3B0512__) || \
+ defined (__AT32UC3B0512REVC__))))
+
+#define UC3B1 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3B164__) || \
+ defined (__AVR32_UC3B1128__) || \
+ defined (__AVR32_UC3B1256__) || \
+ defined (__AVR32_UC3B1256ES__) || \
+ defined (__AVR32_UC3B1512__) || \
+ defined (__AVR32_UC3B1512ES__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3B164__) || \
+ defined (__AT32UC3B1128__) || \
+ defined (__AT32UC3B1256__) || \
+ defined (__AT32UC3B1256ES__) || \
+ defined (__AT32UC3B1512__) || \
+ defined (__AT32UC3B1512REVC__))))
+
+#define UC3B (UC3B0 || UC3B1 )
+
+// UC3 C Series
+#define UC3C0_REVC (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3C064CREVC__) || \
+ defined (__AVR32_UC3C0128CREVC__) || \
+ defined (__AVR32_UC3C0256CREVC__) || \
+ defined (__AVR32_UC3C0512CREVC__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3C064CREVC__) || \
+ defined (__AT32UC3C0128CREVC__) || \
+ defined (__AT32UC3C0256CREVC__) || \
+ defined (__AT32UC3C0512CREVC__))))
+
+#define UC3C0 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3C064C__) || \
+ defined (__AVR32_UC3C0128C__) || \
+ defined (__AVR32_UC3C0256C__) || \
+ defined (__AVR32_UC3C0512C__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3C064C__) || \
+ defined (__AT32UC3C0128C__) || \
+ defined (__AT32UC3C0256C__) || \
+ defined (__AT32UC3C0512C__))))
+
+#define UC3C1_REVC (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3C164CREVC__) || \
+ defined (__AVR32_UC3C1128CREVC__) || \
+ defined (__AVR32_UC3C1256CREVC__) || \
+ defined (__AVR32_UC3C1512CREVC__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3C164CREVC__) || \
+ defined (__AT32UC3C1128CREVC__) || \
+ defined (__AT32UC3C1256CREVC__) || \
+ defined (__AT32UC3C1512CREVC__))))
+
+#define UC3C1 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3C164C__) || \
+ defined (__AVR32_UC3C1128C__) || \
+ defined (__AVR32_UC3C1256C__) || \
+ defined (__AVR32_UC3C1512C__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3C164C__) || \
+ defined (__AT32UC3C1128C__) || \
+ defined (__AT32UC3C1256C__) || \
+ defined (__AT32UC3C1512C__))))
+
+#define UC3C2_REVC (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3C264CREVC__) || \
+ defined (__AVR32_UC3C2128CREVC__) || \
+ defined (__AVR32_UC3C2256CREVC__) || \
+ defined (__AVR32_UC3C2512CREVC__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3C264CREVC__) || \
+ defined (__AT32UC3C2128CREVC__) || \
+ defined (__AT32UC3C2256CREVC__) || \
+ defined (__AT32UC3C2512CREVC__))))
+
+#define UC3C2 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3C264C__) || \
+ defined (__AVR32_UC3C2128C__) || \
+ defined (__AVR32_UC3C2256C__) || \
+ defined (__AVR32_UC3C2512C__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3C264C__) || \
+ defined (__AT32UC3C2128C__) || \
+ defined (__AT32UC3C2256C__) || \
+ defined (__AT32UC3C2512C__))))
+
+#define UC3C_REVC (UC3C0_REVC || UC3C1_REVC || UC3C2_REVC)
+#define UC3C (UC3C0 || UC3C0_REVC || UC3C1 || UC3C1_REVC || UC3C2 || UC3C2_REVC)
+
+// UC3 L Device series
+#define UC3L0 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3L016__) || \
+ defined (__AVR32_UC3L032__) || \
+ defined (__AVR32_UC3L064__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3L016__) || \
+ defined (__AT32UC3L032__) || \
+ defined (__AT32UC3L064__))))
+
+#define UC3L0128 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3L0128__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3L0128__))))
+
+#define UC3L0256 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC3L0256__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__AT32UC3L0256__))))
+
+#define UC3L ( UC3L0 || UC3L0128 || UC3L0256 )
+
+// UC3 D Device series
+#define UC3D3 (( defined (__GNUC__) && \
+ ( defined (__AVR32_UC128D3__) || \
+ defined (__AVR32_UC64D3__))) \
+ ||((defined(__ICCAVR32__) || defined(__AAVR32__)) && \
+ ( defined (__ATUC128D3__) || \
+ defined (__ATUC64D3__) )))
+
+#define UC3D (UC3D3)
+
+#if (UC3D)
+#include "header_files/uc3d_defines_fix.h"
+#endif
+
+#define UC3 (UC3A || UC3B || UC3C || UC3D || UC3L)
+
+#if ((defined __GNUC__) && (defined __AVR32__)) || (defined __ICCAVR32__ || defined __AAVR32__)
+# if (UC3)
+# include <avr32/io.h>
+# endif
+#endif
+
+#endif // _ARCH_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/mrepeat.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/mrepeat.h
new file mode 100644
index 0000000..92b81ae
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/mrepeat.h
@@ -0,0 +1,326 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Preprocessor macro repeating utils.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices can be used.
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _MREPEAT_H_
+#define _MREPEAT_H_
+
+#include "preprocessor.h"
+
+
+//! Maximal number of repetitions supported by MREPEAT.
+#define MREPEAT_LIMIT 256
+
+/*! \brief Macro repeat.
+ *
+ * This macro represents a horizontal repetition construct.
+ *
+ * \param count The number of repetitious calls to macro. Valid values range from 0 to MREPEAT_LIMIT.
+ * \param macro A binary operation of the form macro(n, data). This macro is expanded by MREPEAT with
+ * the current repetition number and the auxiliary data argument.
+ * \param data Auxiliary data passed to macro.
+ *
+ * \return <tt>macro(0, data) macro(1, data) ... macro(count - 1, data)</tt>
+ */
+#define MREPEAT(count, macro, data) TPASTE2(MREPEAT, count)(macro, data)
+
+#define MREPEAT0( macro, data)
+#define MREPEAT1( macro, data) MREPEAT0( macro, data) macro( 0, data)
+#define MREPEAT2( macro, data) MREPEAT1( macro, data) macro( 1, data)
+#define MREPEAT3( macro, data) MREPEAT2( macro, data) macro( 2, data)
+#define MREPEAT4( macro, data) MREPEAT3( macro, data) macro( 3, data)
+#define MREPEAT5( macro, data) MREPEAT4( macro, data) macro( 4, data)
+#define MREPEAT6( macro, data) MREPEAT5( macro, data) macro( 5, data)
+#define MREPEAT7( macro, data) MREPEAT6( macro, data) macro( 6, data)
+#define MREPEAT8( macro, data) MREPEAT7( macro, data) macro( 7, data)
+#define MREPEAT9( macro, data) MREPEAT8( macro, data) macro( 8, data)
+#define MREPEAT10( macro, data) MREPEAT9( macro, data) macro( 9, data)
+#define MREPEAT11( macro, data) MREPEAT10( macro, data) macro( 10, data)
+#define MREPEAT12( macro, data) MREPEAT11( macro, data) macro( 11, data)
+#define MREPEAT13( macro, data) MREPEAT12( macro, data) macro( 12, data)
+#define MREPEAT14( macro, data) MREPEAT13( macro, data) macro( 13, data)
+#define MREPEAT15( macro, data) MREPEAT14( macro, data) macro( 14, data)
+#define MREPEAT16( macro, data) MREPEAT15( macro, data) macro( 15, data)
+#define MREPEAT17( macro, data) MREPEAT16( macro, data) macro( 16, data)
+#define MREPEAT18( macro, data) MREPEAT17( macro, data) macro( 17, data)
+#define MREPEAT19( macro, data) MREPEAT18( macro, data) macro( 18, data)
+#define MREPEAT20( macro, data) MREPEAT19( macro, data) macro( 19, data)
+#define MREPEAT21( macro, data) MREPEAT20( macro, data) macro( 20, data)
+#define MREPEAT22( macro, data) MREPEAT21( macro, data) macro( 21, data)
+#define MREPEAT23( macro, data) MREPEAT22( macro, data) macro( 22, data)
+#define MREPEAT24( macro, data) MREPEAT23( macro, data) macro( 23, data)
+#define MREPEAT25( macro, data) MREPEAT24( macro, data) macro( 24, data)
+#define MREPEAT26( macro, data) MREPEAT25( macro, data) macro( 25, data)
+#define MREPEAT27( macro, data) MREPEAT26( macro, data) macro( 26, data)
+#define MREPEAT28( macro, data) MREPEAT27( macro, data) macro( 27, data)
+#define MREPEAT29( macro, data) MREPEAT28( macro, data) macro( 28, data)
+#define MREPEAT30( macro, data) MREPEAT29( macro, data) macro( 29, data)
+#define MREPEAT31( macro, data) MREPEAT30( macro, data) macro( 30, data)
+#define MREPEAT32( macro, data) MREPEAT31( macro, data) macro( 31, data)
+#define MREPEAT33( macro, data) MREPEAT32( macro, data) macro( 32, data)
+#define MREPEAT34( macro, data) MREPEAT33( macro, data) macro( 33, data)
+#define MREPEAT35( macro, data) MREPEAT34( macro, data) macro( 34, data)
+#define MREPEAT36( macro, data) MREPEAT35( macro, data) macro( 35, data)
+#define MREPEAT37( macro, data) MREPEAT36( macro, data) macro( 36, data)
+#define MREPEAT38( macro, data) MREPEAT37( macro, data) macro( 37, data)
+#define MREPEAT39( macro, data) MREPEAT38( macro, data) macro( 38, data)
+#define MREPEAT40( macro, data) MREPEAT39( macro, data) macro( 39, data)
+#define MREPEAT41( macro, data) MREPEAT40( macro, data) macro( 40, data)
+#define MREPEAT42( macro, data) MREPEAT41( macro, data) macro( 41, data)
+#define MREPEAT43( macro, data) MREPEAT42( macro, data) macro( 42, data)
+#define MREPEAT44( macro, data) MREPEAT43( macro, data) macro( 43, data)
+#define MREPEAT45( macro, data) MREPEAT44( macro, data) macro( 44, data)
+#define MREPEAT46( macro, data) MREPEAT45( macro, data) macro( 45, data)
+#define MREPEAT47( macro, data) MREPEAT46( macro, data) macro( 46, data)
+#define MREPEAT48( macro, data) MREPEAT47( macro, data) macro( 47, data)
+#define MREPEAT49( macro, data) MREPEAT48( macro, data) macro( 48, data)
+#define MREPEAT50( macro, data) MREPEAT49( macro, data) macro( 49, data)
+#define MREPEAT51( macro, data) MREPEAT50( macro, data) macro( 50, data)
+#define MREPEAT52( macro, data) MREPEAT51( macro, data) macro( 51, data)
+#define MREPEAT53( macro, data) MREPEAT52( macro, data) macro( 52, data)
+#define MREPEAT54( macro, data) MREPEAT53( macro, data) macro( 53, data)
+#define MREPEAT55( macro, data) MREPEAT54( macro, data) macro( 54, data)
+#define MREPEAT56( macro, data) MREPEAT55( macro, data) macro( 55, data)
+#define MREPEAT57( macro, data) MREPEAT56( macro, data) macro( 56, data)
+#define MREPEAT58( macro, data) MREPEAT57( macro, data) macro( 57, data)
+#define MREPEAT59( macro, data) MREPEAT58( macro, data) macro( 58, data)
+#define MREPEAT60( macro, data) MREPEAT59( macro, data) macro( 59, data)
+#define MREPEAT61( macro, data) MREPEAT60( macro, data) macro( 60, data)
+#define MREPEAT62( macro, data) MREPEAT61( macro, data) macro( 61, data)
+#define MREPEAT63( macro, data) MREPEAT62( macro, data) macro( 62, data)
+#define MREPEAT64( macro, data) MREPEAT63( macro, data) macro( 63, data)
+#define MREPEAT65( macro, data) MREPEAT64( macro, data) macro( 64, data)
+#define MREPEAT66( macro, data) MREPEAT65( macro, data) macro( 65, data)
+#define MREPEAT67( macro, data) MREPEAT66( macro, data) macro( 66, data)
+#define MREPEAT68( macro, data) MREPEAT67( macro, data) macro( 67, data)
+#define MREPEAT69( macro, data) MREPEAT68( macro, data) macro( 68, data)
+#define MREPEAT70( macro, data) MREPEAT69( macro, data) macro( 69, data)
+#define MREPEAT71( macro, data) MREPEAT70( macro, data) macro( 70, data)
+#define MREPEAT72( macro, data) MREPEAT71( macro, data) macro( 71, data)
+#define MREPEAT73( macro, data) MREPEAT72( macro, data) macro( 72, data)
+#define MREPEAT74( macro, data) MREPEAT73( macro, data) macro( 73, data)
+#define MREPEAT75( macro, data) MREPEAT74( macro, data) macro( 74, data)
+#define MREPEAT76( macro, data) MREPEAT75( macro, data) macro( 75, data)
+#define MREPEAT77( macro, data) MREPEAT76( macro, data) macro( 76, data)
+#define MREPEAT78( macro, data) MREPEAT77( macro, data) macro( 77, data)
+#define MREPEAT79( macro, data) MREPEAT78( macro, data) macro( 78, data)
+#define MREPEAT80( macro, data) MREPEAT79( macro, data) macro( 79, data)
+#define MREPEAT81( macro, data) MREPEAT80( macro, data) macro( 80, data)
+#define MREPEAT82( macro, data) MREPEAT81( macro, data) macro( 81, data)
+#define MREPEAT83( macro, data) MREPEAT82( macro, data) macro( 82, data)
+#define MREPEAT84( macro, data) MREPEAT83( macro, data) macro( 83, data)
+#define MREPEAT85( macro, data) MREPEAT84( macro, data) macro( 84, data)
+#define MREPEAT86( macro, data) MREPEAT85( macro, data) macro( 85, data)
+#define MREPEAT87( macro, data) MREPEAT86( macro, data) macro( 86, data)
+#define MREPEAT88( macro, data) MREPEAT87( macro, data) macro( 87, data)
+#define MREPEAT89( macro, data) MREPEAT88( macro, data) macro( 88, data)
+#define MREPEAT90( macro, data) MREPEAT89( macro, data) macro( 89, data)
+#define MREPEAT91( macro, data) MREPEAT90( macro, data) macro( 90, data)
+#define MREPEAT92( macro, data) MREPEAT91( macro, data) macro( 91, data)
+#define MREPEAT93( macro, data) MREPEAT92( macro, data) macro( 92, data)
+#define MREPEAT94( macro, data) MREPEAT93( macro, data) macro( 93, data)
+#define MREPEAT95( macro, data) MREPEAT94( macro, data) macro( 94, data)
+#define MREPEAT96( macro, data) MREPEAT95( macro, data) macro( 95, data)
+#define MREPEAT97( macro, data) MREPEAT96( macro, data) macro( 96, data)
+#define MREPEAT98( macro, data) MREPEAT97( macro, data) macro( 97, data)
+#define MREPEAT99( macro, data) MREPEAT98( macro, data) macro( 98, data)
+#define MREPEAT100(macro, data) MREPEAT99( macro, data) macro( 99, data)
+#define MREPEAT101(macro, data) MREPEAT100(macro, data) macro(100, data)
+#define MREPEAT102(macro, data) MREPEAT101(macro, data) macro(101, data)
+#define MREPEAT103(macro, data) MREPEAT102(macro, data) macro(102, data)
+#define MREPEAT104(macro, data) MREPEAT103(macro, data) macro(103, data)
+#define MREPEAT105(macro, data) MREPEAT104(macro, data) macro(104, data)
+#define MREPEAT106(macro, data) MREPEAT105(macro, data) macro(105, data)
+#define MREPEAT107(macro, data) MREPEAT106(macro, data) macro(106, data)
+#define MREPEAT108(macro, data) MREPEAT107(macro, data) macro(107, data)
+#define MREPEAT109(macro, data) MREPEAT108(macro, data) macro(108, data)
+#define MREPEAT110(macro, data) MREPEAT109(macro, data) macro(109, data)
+#define MREPEAT111(macro, data) MREPEAT110(macro, data) macro(110, data)
+#define MREPEAT112(macro, data) MREPEAT111(macro, data) macro(111, data)
+#define MREPEAT113(macro, data) MREPEAT112(macro, data) macro(112, data)
+#define MREPEAT114(macro, data) MREPEAT113(macro, data) macro(113, data)
+#define MREPEAT115(macro, data) MREPEAT114(macro, data) macro(114, data)
+#define MREPEAT116(macro, data) MREPEAT115(macro, data) macro(115, data)
+#define MREPEAT117(macro, data) MREPEAT116(macro, data) macro(116, data)
+#define MREPEAT118(macro, data) MREPEAT117(macro, data) macro(117, data)
+#define MREPEAT119(macro, data) MREPEAT118(macro, data) macro(118, data)
+#define MREPEAT120(macro, data) MREPEAT119(macro, data) macro(119, data)
+#define MREPEAT121(macro, data) MREPEAT120(macro, data) macro(120, data)
+#define MREPEAT122(macro, data) MREPEAT121(macro, data) macro(121, data)
+#define MREPEAT123(macro, data) MREPEAT122(macro, data) macro(122, data)
+#define MREPEAT124(macro, data) MREPEAT123(macro, data) macro(123, data)
+#define MREPEAT125(macro, data) MREPEAT124(macro, data) macro(124, data)
+#define MREPEAT126(macro, data) MREPEAT125(macro, data) macro(125, data)
+#define MREPEAT127(macro, data) MREPEAT126(macro, data) macro(126, data)
+#define MREPEAT128(macro, data) MREPEAT127(macro, data) macro(127, data)
+#define MREPEAT129(macro, data) MREPEAT128(macro, data) macro(128, data)
+#define MREPEAT130(macro, data) MREPEAT129(macro, data) macro(129, data)
+#define MREPEAT131(macro, data) MREPEAT130(macro, data) macro(130, data)
+#define MREPEAT132(macro, data) MREPEAT131(macro, data) macro(131, data)
+#define MREPEAT133(macro, data) MREPEAT132(macro, data) macro(132, data)
+#define MREPEAT134(macro, data) MREPEAT133(macro, data) macro(133, data)
+#define MREPEAT135(macro, data) MREPEAT134(macro, data) macro(134, data)
+#define MREPEAT136(macro, data) MREPEAT135(macro, data) macro(135, data)
+#define MREPEAT137(macro, data) MREPEAT136(macro, data) macro(136, data)
+#define MREPEAT138(macro, data) MREPEAT137(macro, data) macro(137, data)
+#define MREPEAT139(macro, data) MREPEAT138(macro, data) macro(138, data)
+#define MREPEAT140(macro, data) MREPEAT139(macro, data) macro(139, data)
+#define MREPEAT141(macro, data) MREPEAT140(macro, data) macro(140, data)
+#define MREPEAT142(macro, data) MREPEAT141(macro, data) macro(141, data)
+#define MREPEAT143(macro, data) MREPEAT142(macro, data) macro(142, data)
+#define MREPEAT144(macro, data) MREPEAT143(macro, data) macro(143, data)
+#define MREPEAT145(macro, data) MREPEAT144(macro, data) macro(144, data)
+#define MREPEAT146(macro, data) MREPEAT145(macro, data) macro(145, data)
+#define MREPEAT147(macro, data) MREPEAT146(macro, data) macro(146, data)
+#define MREPEAT148(macro, data) MREPEAT147(macro, data) macro(147, data)
+#define MREPEAT149(macro, data) MREPEAT148(macro, data) macro(148, data)
+#define MREPEAT150(macro, data) MREPEAT149(macro, data) macro(149, data)
+#define MREPEAT151(macro, data) MREPEAT150(macro, data) macro(150, data)
+#define MREPEAT152(macro, data) MREPEAT151(macro, data) macro(151, data)
+#define MREPEAT153(macro, data) MREPEAT152(macro, data) macro(152, data)
+#define MREPEAT154(macro, data) MREPEAT153(macro, data) macro(153, data)
+#define MREPEAT155(macro, data) MREPEAT154(macro, data) macro(154, data)
+#define MREPEAT156(macro, data) MREPEAT155(macro, data) macro(155, data)
+#define MREPEAT157(macro, data) MREPEAT156(macro, data) macro(156, data)
+#define MREPEAT158(macro, data) MREPEAT157(macro, data) macro(157, data)
+#define MREPEAT159(macro, data) MREPEAT158(macro, data) macro(158, data)
+#define MREPEAT160(macro, data) MREPEAT159(macro, data) macro(159, data)
+#define MREPEAT161(macro, data) MREPEAT160(macro, data) macro(160, data)
+#define MREPEAT162(macro, data) MREPEAT161(macro, data) macro(161, data)
+#define MREPEAT163(macro, data) MREPEAT162(macro, data) macro(162, data)
+#define MREPEAT164(macro, data) MREPEAT163(macro, data) macro(163, data)
+#define MREPEAT165(macro, data) MREPEAT164(macro, data) macro(164, data)
+#define MREPEAT166(macro, data) MREPEAT165(macro, data) macro(165, data)
+#define MREPEAT167(macro, data) MREPEAT166(macro, data) macro(166, data)
+#define MREPEAT168(macro, data) MREPEAT167(macro, data) macro(167, data)
+#define MREPEAT169(macro, data) MREPEAT168(macro, data) macro(168, data)
+#define MREPEAT170(macro, data) MREPEAT169(macro, data) macro(169, data)
+#define MREPEAT171(macro, data) MREPEAT170(macro, data) macro(170, data)
+#define MREPEAT172(macro, data) MREPEAT171(macro, data) macro(171, data)
+#define MREPEAT173(macro, data) MREPEAT172(macro, data) macro(172, data)
+#define MREPEAT174(macro, data) MREPEAT173(macro, data) macro(173, data)
+#define MREPEAT175(macro, data) MREPEAT174(macro, data) macro(174, data)
+#define MREPEAT176(macro, data) MREPEAT175(macro, data) macro(175, data)
+#define MREPEAT177(macro, data) MREPEAT176(macro, data) macro(176, data)
+#define MREPEAT178(macro, data) MREPEAT177(macro, data) macro(177, data)
+#define MREPEAT179(macro, data) MREPEAT178(macro, data) macro(178, data)
+#define MREPEAT180(macro, data) MREPEAT179(macro, data) macro(179, data)
+#define MREPEAT181(macro, data) MREPEAT180(macro, data) macro(180, data)
+#define MREPEAT182(macro, data) MREPEAT181(macro, data) macro(181, data)
+#define MREPEAT183(macro, data) MREPEAT182(macro, data) macro(182, data)
+#define MREPEAT184(macro, data) MREPEAT183(macro, data) macro(183, data)
+#define MREPEAT185(macro, data) MREPEAT184(macro, data) macro(184, data)
+#define MREPEAT186(macro, data) MREPEAT185(macro, data) macro(185, data)
+#define MREPEAT187(macro, data) MREPEAT186(macro, data) macro(186, data)
+#define MREPEAT188(macro, data) MREPEAT187(macro, data) macro(187, data)
+#define MREPEAT189(macro, data) MREPEAT188(macro, data) macro(188, data)
+#define MREPEAT190(macro, data) MREPEAT189(macro, data) macro(189, data)
+#define MREPEAT191(macro, data) MREPEAT190(macro, data) macro(190, data)
+#define MREPEAT192(macro, data) MREPEAT191(macro, data) macro(191, data)
+#define MREPEAT193(macro, data) MREPEAT192(macro, data) macro(192, data)
+#define MREPEAT194(macro, data) MREPEAT193(macro, data) macro(193, data)
+#define MREPEAT195(macro, data) MREPEAT194(macro, data) macro(194, data)
+#define MREPEAT196(macro, data) MREPEAT195(macro, data) macro(195, data)
+#define MREPEAT197(macro, data) MREPEAT196(macro, data) macro(196, data)
+#define MREPEAT198(macro, data) MREPEAT197(macro, data) macro(197, data)
+#define MREPEAT199(macro, data) MREPEAT198(macro, data) macro(198, data)
+#define MREPEAT200(macro, data) MREPEAT199(macro, data) macro(199, data)
+#define MREPEAT201(macro, data) MREPEAT200(macro, data) macro(200, data)
+#define MREPEAT202(macro, data) MREPEAT201(macro, data) macro(201, data)
+#define MREPEAT203(macro, data) MREPEAT202(macro, data) macro(202, data)
+#define MREPEAT204(macro, data) MREPEAT203(macro, data) macro(203, data)
+#define MREPEAT205(macro, data) MREPEAT204(macro, data) macro(204, data)
+#define MREPEAT206(macro, data) MREPEAT205(macro, data) macro(205, data)
+#define MREPEAT207(macro, data) MREPEAT206(macro, data) macro(206, data)
+#define MREPEAT208(macro, data) MREPEAT207(macro, data) macro(207, data)
+#define MREPEAT209(macro, data) MREPEAT208(macro, data) macro(208, data)
+#define MREPEAT210(macro, data) MREPEAT209(macro, data) macro(209, data)
+#define MREPEAT211(macro, data) MREPEAT210(macro, data) macro(210, data)
+#define MREPEAT212(macro, data) MREPEAT211(macro, data) macro(211, data)
+#define MREPEAT213(macro, data) MREPEAT212(macro, data) macro(212, data)
+#define MREPEAT214(macro, data) MREPEAT213(macro, data) macro(213, data)
+#define MREPEAT215(macro, data) MREPEAT214(macro, data) macro(214, data)
+#define MREPEAT216(macro, data) MREPEAT215(macro, data) macro(215, data)
+#define MREPEAT217(macro, data) MREPEAT216(macro, data) macro(216, data)
+#define MREPEAT218(macro, data) MREPEAT217(macro, data) macro(217, data)
+#define MREPEAT219(macro, data) MREPEAT218(macro, data) macro(218, data)
+#define MREPEAT220(macro, data) MREPEAT219(macro, data) macro(219, data)
+#define MREPEAT221(macro, data) MREPEAT220(macro, data) macro(220, data)
+#define MREPEAT222(macro, data) MREPEAT221(macro, data) macro(221, data)
+#define MREPEAT223(macro, data) MREPEAT222(macro, data) macro(222, data)
+#define MREPEAT224(macro, data) MREPEAT223(macro, data) macro(223, data)
+#define MREPEAT225(macro, data) MREPEAT224(macro, data) macro(224, data)
+#define MREPEAT226(macro, data) MREPEAT225(macro, data) macro(225, data)
+#define MREPEAT227(macro, data) MREPEAT226(macro, data) macro(226, data)
+#define MREPEAT228(macro, data) MREPEAT227(macro, data) macro(227, data)
+#define MREPEAT229(macro, data) MREPEAT228(macro, data) macro(228, data)
+#define MREPEAT230(macro, data) MREPEAT229(macro, data) macro(229, data)
+#define MREPEAT231(macro, data) MREPEAT230(macro, data) macro(230, data)
+#define MREPEAT232(macro, data) MREPEAT231(macro, data) macro(231, data)
+#define MREPEAT233(macro, data) MREPEAT232(macro, data) macro(232, data)
+#define MREPEAT234(macro, data) MREPEAT233(macro, data) macro(233, data)
+#define MREPEAT235(macro, data) MREPEAT234(macro, data) macro(234, data)
+#define MREPEAT236(macro, data) MREPEAT235(macro, data) macro(235, data)
+#define MREPEAT237(macro, data) MREPEAT236(macro, data) macro(236, data)
+#define MREPEAT238(macro, data) MREPEAT237(macro, data) macro(237, data)
+#define MREPEAT239(macro, data) MREPEAT238(macro, data) macro(238, data)
+#define MREPEAT240(macro, data) MREPEAT239(macro, data) macro(239, data)
+#define MREPEAT241(macro, data) MREPEAT240(macro, data) macro(240, data)
+#define MREPEAT242(macro, data) MREPEAT241(macro, data) macro(241, data)
+#define MREPEAT243(macro, data) MREPEAT242(macro, data) macro(242, data)
+#define MREPEAT244(macro, data) MREPEAT243(macro, data) macro(243, data)
+#define MREPEAT245(macro, data) MREPEAT244(macro, data) macro(244, data)
+#define MREPEAT246(macro, data) MREPEAT245(macro, data) macro(245, data)
+#define MREPEAT247(macro, data) MREPEAT246(macro, data) macro(246, data)
+#define MREPEAT248(macro, data) MREPEAT247(macro, data) macro(247, data)
+#define MREPEAT249(macro, data) MREPEAT248(macro, data) macro(248, data)
+#define MREPEAT250(macro, data) MREPEAT249(macro, data) macro(249, data)
+#define MREPEAT251(macro, data) MREPEAT250(macro, data) macro(250, data)
+#define MREPEAT252(macro, data) MREPEAT251(macro, data) macro(251, data)
+#define MREPEAT253(macro, data) MREPEAT252(macro, data) macro(252, data)
+#define MREPEAT254(macro, data) MREPEAT253(macro, data) macro(253, data)
+#define MREPEAT255(macro, data) MREPEAT254(macro, data) macro(254, data)
+#define MREPEAT256(macro, data) MREPEAT255(macro, data) macro(255, data)
+
+
+#endif // _MREPEAT_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/preprocessor.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/preprocessor.h
new file mode 100644
index 0000000..32677c9
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/preprocessor.h
@@ -0,0 +1,53 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Preprocessor utils.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices can be used.
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _PREPROCESSOR_H_
+#define _PREPROCESSOR_H_
+
+#include "tpaste.h"
+#include "stringz.h"
+#include "mrepeat.h"
+
+
+#endif // _PREPROCESSOR_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/stringz.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/stringz.h
new file mode 100644
index 0000000..4773d07
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/stringz.h
@@ -0,0 +1,73 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Preprocessor stringizing utils.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices can be used.
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _STRINGZ_H_
+#define _STRINGZ_H_
+
+
+/*! \brief Stringize.
+ *
+ * Stringize a preprocessing token, this token being allowed to be \#defined.
+ *
+ * May be used only within macros with the token passed as an argument if the token is \#defined.
+ *
+ * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN)
+ * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to
+ * writing "A0".
+ */
+#define STRINGZ(x) #x
+
+/*! \brief Absolute stringize.
+ *
+ * Stringize a preprocessing token, this token being allowed to be \#defined.
+ *
+ * No restriction of use if the token is \#defined.
+ *
+ * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is
+ * equivalent to writing "A0".
+ */
+#define ASTRINGZ(x) STRINGZ(x)
+
+
+#endif // _STRINGZ_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/tpaste.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/tpaste.h
new file mode 100644
index 0000000..26a7d95
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/preprocessor/tpaste.h
@@ -0,0 +1,93 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Preprocessor token pasting utils.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices can be used.
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _TPASTE_H_
+#define _TPASTE_H_
+
+
+/*! \name Token Paste
+ *
+ * Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
+ *
+ * May be used only within macros with the tokens passed as arguments if the tokens are \#defined.
+ *
+ * For example, writing TPASTE2(U, WIDTH) within a macro \#defined by
+ * UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is
+ * equivalent to writing U32.
+ */
+//! @{
+#define TPASTE2( a, b) a##b
+#define TPASTE3( a, b, c) a##b##c
+#define TPASTE4( a, b, c, d) a##b##c##d
+#define TPASTE5( a, b, c, d, e) a##b##c##d##e
+#define TPASTE6( a, b, c, d, e, f) a##b##c##d##e##f
+#define TPASTE7( a, b, c, d, e, f, g) a##b##c##d##e##f##g
+#define TPASTE8( a, b, c, d, e, f, g, h) a##b##c##d##e##f##g##h
+#define TPASTE9( a, b, c, d, e, f, g, h, i) a##b##c##d##e##f##g##h##i
+#define TPASTE10(a, b, c, d, e, f, g, h, i, j) a##b##c##d##e##f##g##h##i##j
+//! @}
+
+/*! \name Absolute Token Paste
+ *
+ * Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
+ *
+ * No restriction of use if the tokens are \#defined.
+ *
+ * For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined
+ * as 32 is equivalent to writing U32.
+ */
+//! @{
+#define ATPASTE2( a, b) TPASTE2( a, b)
+#define ATPASTE3( a, b, c) TPASTE3( a, b, c)
+#define ATPASTE4( a, b, c, d) TPASTE4( a, b, c, d)
+#define ATPASTE5( a, b, c, d, e) TPASTE5( a, b, c, d, e)
+#define ATPASTE6( a, b, c, d, e, f) TPASTE6( a, b, c, d, e, f)
+#define ATPASTE7( a, b, c, d, e, f, g) TPASTE7( a, b, c, d, e, f, g)
+#define ATPASTE8( a, b, c, d, e, f, g, h) TPASTE8( a, b, c, d, e, f, g, h)
+#define ATPASTE9( a, b, c, d, e, f, g, h, i) TPASTE9( a, b, c, d, e, f, g, h, i)
+#define ATPASTE10(a, b, c, d, e, f, g, h, i, j) TPASTE10(a, b, c, d, e, f, g, h, i, j)
+//! @}
+
+
+#endif // _TPASTE_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/startup_uc3.S b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/startup_uc3.S
new file mode 100644
index 0000000..0b94189
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/startup_uc3.S
@@ -0,0 +1,118 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief AVR32UC C runtime startup file.
+ *
+ *
+ * - Compiler: GNU GCC for AVR32
+ * - Supported devices: All AVR32UC devices can be used.
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include <avr32/io.h>
+
+
+//! @{
+//! \verbatim
+
+
+ // This must be linked @ 0x80000000 if it is to be run upon reset.
+ .section .reset, "ax", @progbits
+
+
+ .global _start
+ .type _start, @function
+_start:
+ // Jump to the C runtime startup routine.
+ lda.w pc, _stext
+
+
+ // _stext is placed outside the .reset section so that the program entry point
+ // can be changed without affecting the C runtime startup.
+ .section .text._stext, "ax", @progbits
+
+
+ .global _stext
+ .type _stext, @function
+_stext:
+ // Set initial stack pointer.
+ lda.w sp, _estack
+
+ // Set up EVBA so interrupts can be enabled.
+ lda.w r0, _evba
+ mtsr AVR32_EVBA, r0
+
+ // Enable the exception processing.
+ csrf AVR32_SR_EM_OFFSET
+
+ // Load initialized data having a global lifetime from the data LMA.
+ lda.w r0, _data
+ lda.w r1, _edata
+ cp r0, r1
+ brhs idata_load_loop_end
+ lda.w r2, _data_lma
+idata_load_loop:
+ ld.d r4, r2++
+ st.d r0++, r4
+ cp r0, r1
+ brlo idata_load_loop
+idata_load_loop_end:
+
+ // Clear uninitialized data having a global lifetime in the blank static storage section.
+ lda.w r0, __bss_start
+ lda.w r1, _end
+ cp r0, r1
+ brhs udata_clear_loop_end
+ mov r2, 0
+ mov r3, 0
+udata_clear_loop:
+ st.d r0++, r2
+ cp r0, r1
+ brlo udata_clear_loop
+udata_clear_loop_end:
+
+#ifdef CONFIG_FRAME_POINTER
+ // Safety: Set the default "return" @ to the exit routine address.
+ lda.w lr, exit
+#endif
+
+ // Start the show.
+ lda.w pc, main
+
+
+//! \endverbatim
+//! @}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.S b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.S
new file mode 100644
index 0000000..7ccd36b
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.S
@@ -0,0 +1,75 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief AVR32 UC3 ISP trampoline.
+ *
+ * In order to be able to program a project with both BatchISP and JTAGICE mkII
+ * without having to take the general-purpose fuses into consideration, add this
+ * file to the project and change the program entry point to _trampoline.
+ *
+ * The pre-programmed ISP will be erased if JTAGICE mkII is used.
+ *
+ * - Compiler: GNU GCC for AVR32
+ * - Supported devices: All AVR32UC devices can be used.
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#include "trampoline_uc3.h"
+
+
+//! @{
+//! \verbatim
+
+
+ // This must be linked @ 0x80000000 if it is to be run upon reset.
+ .section .reset, "ax", @progbits
+
+
+ .global _trampoline
+ .type _trampoline, @function
+_trampoline:
+ // Jump to program start.
+ rjmp program_start
+
+ .org PROGRAM_START_OFFSET
+program_start:
+ // Jump to the C runtime startup routine.
+ lda.w pc, _stext
+
+
+//! \endverbatim
+//! @}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.h
new file mode 100644
index 0000000..575815d
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/startup/trampoline_uc3.h
@@ -0,0 +1,52 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file ******************************************************************
+ *
+ * \brief UC3 trampoline definitions (default size is 8KB)
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR UC3 devices.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ***************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _TRAMPOLINE_UC3_H_
+#define _TRAMPOLINE_UC3_H_
+
+#define PROGRAM_START_ADDRESS (AVR32_FLASH_ADDRESS + PROGRAM_START_OFFSET)
+#define PROGRAM_START_OFFSET 0x00002000
+
+#endif // _TRAMPOLINE_UC3_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/status_codes.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/status_codes.h
new file mode 100644
index 0000000..b4ddac5
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/avr32/utils/status_codes.h
@@ -0,0 +1,81 @@
+/**
+ * \file
+ *
+ * \brief Status code definitions.
+ *
+ * This file defines various status codes returned by functions,
+ * indicating success or failure as well as what kind of failure.
+ *
+ * Copyright (C) 2009 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef STATUS_CODES_H_INCLUDED
+#define STATUS_CODES_H_INCLUDED
+
+/**
+ * Status code that may be returned by shell commands and protocol
+ * implementations.
+ *
+ * \note Any change to these status codes and the corresponding
+ * message strings is strictly forbidden. New codes can be added,
+ * however, but make sure that any message string tables are updated
+ * at the same time.
+ */
+enum status_code {
+ STATUS_OK = 0, //!< Success
+ ERR_IO_ERROR = -1, //!< I/O error
+ ERR_FLUSHED = -2, //!< Request flushed from queue
+ ERR_TIMEOUT = -3, //!< Operation timed out
+ ERR_BAD_DATA = -4, //!< Data integrity check failed
+ ERR_PROTOCOL = -5, //!< Protocol error
+ ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device
+ ERR_NO_MEMORY = -7, //!< Insufficient memory
+ ERR_INVALID_ARG = -8, //!< Invalid argument
+ ERR_BAD_ADDRESS = -9, //!< Bad address
+ ERR_BUSY = -10, //!< Resource is busy
+ ERR_BAD_FORMAT = -11, //!< Data format not recognized
+
+ /**
+ * \brief Operation in progress
+ *
+ * This status code is for driver-internal use when an operation
+ * is currently being performed.
+ *
+ * \note Drivers should never return this status code to any
+ * callers. It is strictly for internal use.
+ */
+ OPERATION_IN_PROGRESS = -128,
+};
+
+typedef enum status_code status_code_t;
+
+#endif /* STATUS_CODES_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/boards/board.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/boards/board.h
new file mode 100644
index 0000000..5f80777
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/boards/board.h
@@ -0,0 +1,196 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief Standard board header file.
+ *
+ * This file includes the appropriate board header file according to the
+ * defined board (parameter BOARD).
+ *
+ * - Compiler: IAR EWAVR/IAR EWAVR32 and GNU GCC for AVR or AVR32
+ * - Supported devices: All AVR devices can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+#ifndef _BOARD_H_
+#define _BOARD_H_
+
+#include "compiler.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*! \name Base Boards
+ */
+//! @{
+#define EVK1100 1 //!< AT32UC3A EVK1100 board.
+#define EVK1101 2 //!< AT32UC3B EVK1101 board.
+#define UC3C_EK 3 //!< AT32UC3C UC3C_EK board.
+#define EVK1104 4 //!< AT32UC3A3 EVK1104 board.
+#define EVK1105 5 //!< AT32UC3A EVK1105 board.
+#define STK600_RCUC3L0 6 //!< STK600 RCUC3L0 board.
+#define UC3L_EK 7 //!< AT32UC3L-EK board.
+#define XPLAIN 8 //!< ATxmega128A1 Xplain board.
+#define STK600_RC064X 10 //!< ATxmega256A3 STK600 board.
+#define STK600_RC100X 11 //!< ATxmega128A1 STK600 board.
+#define UC3_A3_XPLAINED 13 //!< ATUC3A3 UC3-A3 Xplained board.
+#define UC3_L0_XPLAINED 15 //!< ATUC3L0 UC3-L0 Xplained board.
+#define STK600_RCUC3D 16 //!< STK600 RCUC3D board.
+#define STK600_RCUC3C0 17 //!< STK600 RCUC3C board.
+#define XMEGA_A1_XPLAINED 19 //!< ATxmega128A1 Xplain-A1 board.
+#define UC3_L0_XPLAINED_BC 22 //!< ATUC3L0 UC3-L0 Xplained board controller board
+#define MEGA1284P_XPLAINED_BC 23 //!< ATmega1284P-Xplained board controller board
+#define STK600_RC044X 24 //!< STK600 with RC044X routing card board.
+#define STK600_RCUC3B 25 //!< STK600 RCUC3B board.
+#define UC3_L0_QT600 26 //!< QT600 UC3L0 MCU board.
+#define SIMULATOR_XMEGA_A1 97 //!< Simulator for XMEGA A1 devices
+#define AVR_SIMULATOR_UC3 98 //!< AVR SIMULATOR for AVR UC3 device family.
+#define USER_BOARD 99 //!< User-reserved board (if any).
+#define DUMMY_BOARD 100 //!< Dummy board to support board-independent applications (e.g. bootloader)
+//! @}
+
+/*! \name Extension Boards
+ */
+//! @{
+#define EXT1102 1 //!< AT32UC3B EXT1102 board
+#define MC300 2 //!< AT32UC3 MC300 board
+#define SENSORS_XPLAINED_INERTIAL_1 3 //!< Xplained inertial sensor board 1
+#define SENSORS_XPLAINED_INERTIAL_2 4 //!< Xplained inertial sensor board 2
+#define SENSORS_XPLAINED_PRESSURE_1 5 //!< Xplained pressure sensor board
+#define SENSORS_XPLAINED_LIGHT_1 6 //!< Xplained light & proximity sensor board
+#define SENSORS_XPLAINED_INERTIAL_A1 7 //!< Xplained inertial sensor board "A"
+
+#define USER_EXT_BOARD 99 //!< User-reserved extension board (if any).
+//! @}
+
+#if BOARD == EVK1100
+ #include "evk1100/evk1100.h"
+#elif BOARD == EVK1101
+ #include "evk1101/evk1101.h"
+#elif BOARD == UC3C_EK
+ #include "uc3c_ek/uc3c_ek.h"
+#elif BOARD == EVK1104
+ #include "evk1104/evk1104.h"
+#elif BOARD == EVK1105
+ #include "evk1105/evk1105.h"
+#elif BOARD == STK600_RCUC3L0
+ #include "stk600/rcuc3l0/stk600_rcuc3l0.h"
+#elif BOARD == UC3L_EK
+ #include "uc3l_ek/uc3l_ek.h"
+#elif BOARD == XPLAIN
+ #include "xplain/xplain.h"
+#elif BOARD == STK600_RC044X
+ #include "stk600/rc044x/stk600_rc044x.h"
+#elif BOARD == STK600_RC064X
+ #include "stk600/rc064x/stk600_rc064x.h"
+#elif BOARD == STK600_RC100X
+ #include "stk600/rc100x/stk600_rc100x.h"
+#elif BOARD == UC3_A3_XPLAINED
+ #include "uc3_a3_xplained/uc3_a3_xplained.h"
+#elif BOARD == UC3_L0_XPLAINED
+ #include "uc3_l0_xplained/uc3_l0_xplained.h"
+#elif BOARD == STK600_RCUC3B
+ #include "stk600/rcuc3b/stk600_rcuc3b.h"
+#elif BOARD == STK600_RCUC3D
+ #include "stk600/rcuc3d/stk600_rcuc3d.h"
+#elif BOARD == STK600_RCUC3C0
+ #include "stk600/rcuc3c0/stk600_rcuc3c0.h"
+#elif BOARD == XMEGA_A1_XPLAINED
+ #include "xmega_a1_xplained/xmega_a1_xplained.h"
+#elif BOARD == UC3_L0_XPLAINED_BC
+ #include "uc3_l0_xplained_bc/uc3_l0_xplained_bc.h"
+#elif BOARD == MEGA1284P_XPLAINED_BC
+ #include "mega1284p_xplained_bc/mega1284p_xplained_bc.h"
+#elif BOARD == UC3_L0_QT600
+ #include "uc3_l0_qt600/uc3_l0_qt600.h"
+#elif BOARD == SIMULATOR_XMEGA_A1
+ #include "simulator/xmega_a1/simulator_xmega_a1.h"
+#elif BOARD == AVR_SIMULATOR_UC3
+ #include "avr_simulator_uc3/avr_simulator_uc3.h"
+#elif BOARD == USER_BOARD
+ // User-reserved area: #include the header file of your board here (if any).
+ #include "user_board.h"
+#elif BOARD == DUMMY_BOARD
+ #include "dummy/dummy_board.h"
+#else
+ #error No known AVR board defined
+#endif
+
+#if (defined EXT_BOARD)
+ #if EXT_BOARD == MC300
+ #include "mc300/mc300.h"
+ #elif (EXT_BOARD == SENSORS_XPLAINED_INERTIAL_1) || \
+ (EXT_BOARD == SENSORS_XPLAINED_INERTIAL_2) || \
+ (EXT_BOARD == SENSORS_XPLAINED_INERTIAL_A1) || \
+ (EXT_BOARD == SENSORS_XPLAINED_PRESSURE_1) || \
+ (EXT_BOARD == SENSORS_XPLAINED_LIGHT_1)
+ #include "sensors_xplained/sensors_xplained.h"
+ #elif EXT_BOARD == USER_EXT_BOARD
+ // User-reserved area: #include the header file of your extension board here
+ // (if any).
+ #endif
+#endif
+
+
+#if (defined(__GNUC__) && defined(__AVR32__)) || (defined(__ICCAVR32__) || defined(__AAVR32__))
+#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
+
+/*! \brief This function initializes the board target resources
+ *
+ * This function should be called to ensure proper initialization of the target
+ * board hardware connected to the part.
+ */
+extern void board_init(void);
+
+#endif // #ifdef __AVR32_ABI_COMPILER__
+#else
+/*! \brief This function initializes the board target resources
+ *
+ * This function should be called to ensure proper initialization of the target
+ * board hardware connected to the part.
+ */
+extern void board_init(void);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _BOARD_H_
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/genclk.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/genclk.h
new file mode 100644
index 0000000..f9b145a
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/genclk.h
@@ -0,0 +1,136 @@
+/**
+ * \file
+ *
+ * \brief Generic clock management
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CLK_GENCLK_H_INCLUDED
+#define CLK_GENCLK_H_INCLUDED
+
+#include <parts.h>
+
+#if (UC3A0 || UC3A1)
+# include "uc3a0_a1/genclk.h"
+#elif UC3A3
+# include "uc3a3_a4/genclk.h"
+#elif UC3B
+# include "uc3b0_b1/genclk.h"
+#elif UC3C
+# include "uc3c/genclk.h"
+#elif UC3D
+# include "uc3d/genclk.h"
+#elif UC3L
+# include "uc3l/genclk.h"
+#else
+# error Unsupported chip type
+#endif
+
+/**
+ * \ingroup clk_group
+ * \defgroup genclk_group Generic Clock Management
+ *
+ * Generic clocks are configurable clocks which run outside the system
+ * clock domain. They are often connected to peripherals which have an
+ * asynchronous component running independently of the bus clock, e.g.
+ * USB controllers, low-power timers and RTCs, etc.
+ *
+ * Note that not all platforms have support for generic clocks; on such
+ * platforms, this API will not be available.
+ *
+ * @{
+ */
+
+/**
+ * \def GENCLK_DIV_MAX
+ * \brief Maximum divider supported by the generic clock implementation
+ */
+/**
+ * \enum genclk_source
+ * \brief Generic clock source ID
+ *
+ * Each generic clock may be generated from a different clock source.
+ * These are the available alternatives provided by the chip.
+ */
+
+//! \name Generic clock configuration
+//@{
+/**
+ * \struct genclk_config
+ * \brief Hardware representation of a set of generic clock parameters
+ */
+/**
+ * \fn void genclk_config_defaults(struct genclk_config *cfg,
+ * unsigned int id)
+ * \brief Initialize \a cfg to the default configuration for the clock
+ * identified by \a id.
+ */
+/**
+ * \fn void genclk_config_read(struct genclk_config *cfg, unsigned int id)
+ * \brief Read the currently active configuration of the clock
+ * identified by \a id into \a cfg.
+ */
+/**
+ * \fn void genclk_config_write(const struct genclk_config *cfg,
+ * unsigned int id)
+ * \brief Activate the configuration \a cfg on the clock identified by
+ * \a id.
+ */
+/**
+ * \fn void genclk_config_set_source(struct genclk_config *cfg,
+ * enum genclk_source src)
+ * \brief Select a new source clock \a src in configuration \a cfg.
+ */
+/**
+ * \fn void genclk_config_set_divider(struct genclk_config *cfg,
+ * unsigned int divider)
+ * \brief Set a new \a divider in configuration \a cfg.
+ */
+//@}
+
+//! \name Enabling and disabling Generic Clocks
+//@{
+/**
+ * \fn void genclk_enable(const struct genclk_config *cfg, unsigned int id)
+ * \brief Activate the configuration \a cfg on the clock identified by
+ * \a id and enable it.
+ */
+/**
+ * \fn void genclk_disable(unsigned int id)
+ * \brief Disable the generic clock identified by \a id.
+ */
+//@}
+
+//! @}
+
+#endif /* CLK_GENCLK_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/osc.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/osc.h
new file mode 100644
index 0000000..4e96100
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/osc.h
@@ -0,0 +1,145 @@
+/**
+ * \file
+ *
+ * \brief Oscillator management
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef OSC_H_INCLUDED
+#define OSC_H_INCLUDED
+
+#include <parts.h>
+#include "conf_clock.h"
+
+#if (UC3A0 || UC3A1)
+# include "uc3a0_a1/osc.h"
+#elif UC3A3
+# include "uc3a3_a4/osc.h"
+#elif UC3B
+# include "uc3b0_b1/osc.h"
+#elif UC3C
+# include "uc3c/osc.h"
+#elif UC3D
+# include "uc3d/osc.h"
+#elif UC3L
+# include "uc3l/osc.h"
+#elif XMEGA
+# include "xmega/osc.h"
+#else
+# error Unsupported chip type
+#endif
+
+/**
+ * \ingroup clk_group
+ * \defgroup osc_group Oscillator Management
+ *
+ * This group contains functions and definitions related to configuring
+ * and enabling/disabling on-chip oscillators. Internal RC-oscillators,
+ * external crystal oscillators and external clock generators are
+ * supported by this module. What all of these have in common is that
+ * they swing at a fixed, nominal frequency which is normally not
+ * adjustable.
+ *
+ * \par Example: Enabling an oscillator
+ *
+ * The following example demonstrates how to enable the external
+ * oscillator on XMEGA A and wait for it to be ready to use. The
+ * oscillator identifiers are platform-specific, so while the same
+ * procedure is used on all platforms, the parameter to osc_enable()
+ * will be different from device to device.
+ * \code
+ osc_enable(OSC_ID_XOSC);
+ osc_wait_ready(OSC_ID_XOSC); \endcode
+ *
+ * \section osc_group_board Board-specific Definitions
+ * If external oscillators are used, the board code must provide the
+ * following definitions for each of those:
+ * - \b BOARD_<osc name>_HZ: The nominal frequency of the oscillator.
+ * - \b BOARD_<osc name>_STARTUP_US: The startup time of the
+ * oscillator in microseconds.
+ * - \b BOARD_<osc name>_TYPE: The type of oscillator connected, i.e.
+ * whether it's a crystal or external clock, and sometimes what kind
+ * of crystal it is. The meaning of this value is platform-specific.
+ *
+ * @{
+ */
+
+//! \name Oscillator Management
+//@{
+/**
+ * \fn void osc_enable(uint8_t id)
+ * \brief Enable oscillator \a id
+ *
+ * The startup time and mode value is automatically determined based on
+ * definitions in the board code.
+ */
+/**
+ * \fn void osc_disable(uint8_t id)
+ * \brief Disable oscillator \a id
+ */
+/**
+ * \fn osc_is_ready(uint8_t id)
+ * \brief Determine whether oscillator \a id is ready.
+ * \retval true Oscillator \a id is running and ready to use as a clock
+ * source.
+ * \retval false Oscillator \a id is not running.
+ */
+/**
+ * \fn uint32_t osc_get_rate(uint8_t id)
+ * \brief Return the frequency of oscillator \a id in Hz
+ */
+
+#ifndef __ASSEMBLY__
+
+/**
+ * \brief Wait until the oscillator identified by \a id is ready
+ *
+ * This function will busy-wait for the oscillator identified by \a id
+ * to become stable and ready to use as a clock source.
+ *
+ * \param id A number identifying the oscillator to wait for.
+ */
+static inline void osc_wait_ready(uint8_t id)
+{
+ while (!osc_is_ready(id)) {
+ /* Do nothing */
+ }
+}
+
+#endif /* __ASSEMBLY__ */
+
+//@}
+
+//! @}
+
+#endif /* OSC_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/pll.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/pll.h
new file mode 100644
index 0000000..b507264
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/pll.h
@@ -0,0 +1,279 @@
+/**
+ * \file
+ *
+ * \brief PLL management
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CLK_PLL_H_INCLUDED
+#define CLK_PLL_H_INCLUDED
+
+#include <parts.h>
+#include "conf_clock.h"
+
+#if (UC3A0 || UC3A1)
+# include "uc3a0_a1/pll.h"
+#elif UC3A3
+# include "uc3a3_a4/pll.h"
+#elif UC3B
+# include "uc3b0_b1/pll.h"
+#elif UC3C
+# include "uc3c/pll.h"
+#elif UC3D
+# include "uc3d/pll.h"
+#elif (UC3L0128 || UC3L0256)
+# include "uc3l/pll.h"
+#elif XMEGA
+# include "xmega/pll.h"
+#else
+# error Unsupported chip type
+#endif
+
+/**
+ * \ingroup clk_group
+ * \defgroup pll_group PLL Management
+ *
+ * This group contains functions and definitions related to configuring
+ * and enabling/disabling on-chip PLLs. A PLL will take an input signal
+ * (the \em source), optionally divide the frequency by a configurable
+ * \em divider, and then multiply the frequency by a configurable \em
+ * multiplier.
+ *
+ * Some devices don't support input dividers; specifying any other
+ * divisor than 1 on these devices will result in an assertion failure.
+ * Other devices may have various restrictions to the frequency range of
+ * the input and output signals.
+ *
+ * \par Example: Setting up PLL0 with default parameters
+ *
+ * The following example shows how to configure and enable PLL0 using
+ * the default parameters specified using the configuration symbols
+ * listed above, and with Wide Bandwidth Mode disabled (a UC3A3-specific
+ * PLL option.)
+ * \code
+ struct pll_config pllcfg;
+
+ pll_config_defaults(&pllcfg, 0);
+ pll_config_set_option(&pllcfg, PLL_OPT_WBM_DISABLE);
+ pll_enable(&pllcfg, 0);
+ pll_wait_for_lock(0); \endcode
+ *
+ * When the last function call returns, PLL0 is ready to be used as the
+ * main system clock source.
+ *
+ * \section pll_group_config Configuration Symbols
+ *
+ * Each PLL has a set of default parameters determined by the following
+ * configuration symbols in the application's configuration file:
+ * - \b CONFIG_PLLn_SOURCE: The default clock source connected to the
+ * input of PLL \a n. Must be one of the values defined by the
+ * #pll_source enum.
+ * - \b CONFIG_PLLn_MUL: The default multiplier (loop divider) of PLL
+ * \a n.
+ * - \b CONFIG_PLLn_DIV: The default input divider of PLL \a n.
+ *
+ * These configuration symbols determine the result of calling
+ * pll_config_defaults() and pll_get_default_rate().
+ *
+ * @{
+ */
+
+//! \name Chip-specific PLL characteristics
+//@{
+/**
+ * \def PLL_MAX_STARTUP_CYCLES
+ * \brief Maximum PLL startup time in number of slow clock cycles
+ */
+/**
+ * \def NR_PLLS
+ * \brief Number of on-chip PLLs
+ */
+
+/**
+ * \def PLL_MIN_HZ
+ * \brief Minimum frequency that the PLL can generate
+ */
+/**
+ * \def PLL_MAX_HZ
+ * \brief Maximum frequency that the PLL can generate
+ */
+/**
+ * \def PLL_NR_OPTIONS
+ * \brief Number of PLL option bits
+ */
+//@}
+
+/**
+ * \enum pll_source
+ * \brief PLL clock source
+ */
+
+//! \name PLL configuration
+//@{
+
+/**
+ * \struct pll_config
+ * \brief Hardware-specific representation of PLL configuration.
+ *
+ * This structure contains one or more device-specific values
+ * representing the current PLL configuration. The contents of this
+ * structure is typically different from platform to platform, and the
+ * user should not access any fields except through the PLL
+ * configuration API.
+ */
+
+/**
+ * \fn void pll_config_init(struct pll_config *cfg,
+ * enum pll_source src, unsigned int div, unsigned int mul)
+ * \brief Initialize PLL configuration from standard parameters.
+ *
+ * \note This function may be defined inline because it is assumed to be
+ * called very few times, and usually with constant parameters. Inlining
+ * it will in such cases reduce the code size significantly.
+ *
+ * \param cfg The PLL configuration to be initialized.
+ * \param src The oscillator to be used as input to the PLL.
+ * \param div PLL input divider.
+ * \param mul PLL loop divider (i.e. multiplier).
+ *
+ * \return A configuration which will make the PLL run at
+ * (\a mul / \a div) times the frequency of \a src
+ */
+/**
+ * \def pll_config_defaults(cfg, pll_id)
+ * \brief Initialize PLL configuration using default parameters.
+ *
+ * After this function returns, \a cfg will contain a configuration
+ * which will make the PLL run at (CONFIG_PLLx_MUL / CONFIG_PLLx_DIV)
+ * times the frequency of CONFIG_PLLx_SOURCE.
+ *
+ * \param cfg The PLL configuration to be initialized.
+ * \param pll_id Use defaults for this PLL.
+ */
+/**
+ * \def pll_get_default_rate(pll_id)
+ * \brief Get the default rate in Hz of \a pll_id
+ */
+/**
+ * \fn void pll_config_set_option(struct pll_config *cfg,
+ * unsigned int option)
+ * \brief Set the PLL option bit \a option in the configuration \a cfg.
+ *
+ * \param cfg The PLL configuration to be changed.
+ * \param option The PLL option bit to be set.
+ */
+/**
+ * \fn void pll_config_clear_option(struct pll_config *cfg,
+ * unsigned int option)
+ * \brief Clear the PLL option bit \a option in the configuration \a cfg.
+ *
+ * \param cfg The PLL configuration to be changed.
+ * \param option The PLL option bit to be cleared.
+ */
+/**
+ * \fn void pll_config_read(struct pll_config *cfg, unsigned int pll_id)
+ * \brief Read the currently active configuration of \a pll_id.
+ *
+ * \param cfg The configuration object into which to store the currently
+ * active configuration.
+ * \param pll_id The ID of the PLL to be accessed.
+ */
+/**
+ * \fn void pll_config_write(const struct pll_config *cfg,
+ * unsigned int pll_id)
+ * \brief Activate the configuration \a cfg on \a pll_id
+ *
+ * \param cfg The configuration object representing the PLL
+ * configuration to be activated.
+ * \param pll_id The ID of the PLL to be updated.
+ */
+
+//@}
+
+//! \name Interaction with the PLL hardware
+//@{
+/**
+ * \fn void pll_enable(const struct pll_config *cfg,
+ * unsigned int pll_id)
+ * \brief Activate the configuration \a cfg and enable PLL \a pll_id.
+ *
+ * \param cfg The PLL configuration to be activated.
+ * \param pll_id The ID of the PLL to be enabled.
+ */
+/**
+ * \fn void pll_disable(unsigned int pll_id)
+ * \brief Disable the PLL identified by \a pll_id.
+ *
+ * After this function is called, the PLL identified by \a pll_id will
+ * be disabled. The PLL configuration stored in hardware may be affected
+ * by this, so if the caller needs to restore the same configuration
+ * later, it should either do a pll_config_read() before disabling the
+ * PLL, or remember the last configuration written to the PLL.
+ *
+ * \param pll_id The ID of the PLL to be disabled.
+ */
+/**
+ * \fn bool pll_is_locked(unsigned int pll_id)
+ * \brief Determine whether the PLL is locked or not.
+ *
+ * \param pll_id The ID of the PLL to check.
+ *
+ * \retval true The PLL is locked and ready to use as a clock source
+ * \retval false The PLL is not yet locked, or has not been enabled.
+ */
+
+/**
+ * \brief Wait for PLL \a pll_id to become locked
+ *
+ * \todo Use a timeout to avoid waiting forever and hanging the system
+ *
+ * \param pll_id The ID of the PLL to wait for.
+ *
+ * \retval STATUS_OK The PLL is now locked.
+ * \retval ERR_TIMEOUT Timed out waiting for PLL to become locked.
+ */
+static inline int pll_wait_for_lock(unsigned int pll_id)
+{
+ Assert(pll_id < NR_PLLS);
+
+ while (!pll_is_locked(pll_id)) {
+ /* Do nothing */
+ }
+
+ return 0;
+}
+
+//@}
+//! @}
+
+#endif /* CLK_PLL_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/sysclk.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/sysclk.h
new file mode 100644
index 0000000..fd617f2
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/sysclk.h
@@ -0,0 +1,150 @@
+/**
+ * \file
+ *
+ * \brief System clock management
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef SYSCLK_H_INCLUDED
+#define SYSCLK_H_INCLUDED
+
+#include <parts.h>
+#include "conf_clock.h"
+
+#if (UC3A0 || UC3A1)
+# include "uc3a0_a1/sysclk.h"
+#elif UC3A3
+# include "uc3a3_a4/sysclk.h"
+#elif UC3B
+# include "uc3b0_b1/sysclk.h"
+#elif UC3C
+# include "uc3c/sysclk.h"
+#elif UC3D
+# include "uc3d/sysclk.h"
+#elif UC3L
+# include "uc3l/sysclk.h"
+#elif XMEGA
+# include "xmega/sysclk.h"
+#else
+# error Unsupported chip type
+#endif
+
+/**
+ * \defgroup clk_group Clock Management
+ */
+
+/**
+ * \ingroup clk_group
+ * \defgroup sysclk_group System Clock Management
+ *
+ * The <em>sysclk</em> API covers the <em>system clock</em> and all
+ * clocks derived from it. The system clock is a chip-internal clock on
+ * which all <em>synchronous clocks</em>, i.e. CPU and bus/peripheral
+ * clocks, are based. The system clock is typically generated from one
+ * of a variety of sources, which may include crystal and RC oscillators
+ * as well as PLLs. The clocks derived from the system clock are
+ * sometimes also known as <em>synchronous clocks</em>, since they
+ * always run synchronously with respect to each other, as opposed to
+ * <em>generic clocks</em> which may run from different oscillators or
+ * PLLs.
+ *
+ * Most applications should simply call sysclk_init() to initialize
+ * everything related to the system clock and its source (oscillator,
+ * PLL or DFLL), and leave it at that. More advanced applications, and
+ * platform-specific drivers, may require additional services from the
+ * clock system, some of which may be platform-specific.
+ *
+ * \section sysclk_group_platform Platform Dependencies
+ *
+ * The sysclk API is partially chip- or platform-specific. While all
+ * platforms provide mostly the same functionality, there are some
+ * variations around how different bus types and clock tree structures
+ * are handled.
+ *
+ * The following functions are available on all platforms with the same
+ * parameters and functionality. These functions may be called freely by
+ * portable applications, drivers and services:
+ * - sysclk_init()
+ * - sysclk_set_source()
+ * - sysclk_get_main_hz()
+ * - sysclk_get_cpu_hz()
+ * - sysclk_get_peripheral_bus_hz()
+ *
+ * The following functions are available on all platforms, but there may
+ * be variations in the function signature (i.e. parameters) and
+ * behaviour. These functions are typically called by platform-specific
+ * parts of drivers, and applications that aren't intended to be
+ * portable:
+ * - sysclk_enable_peripheral_clock()
+ * - sysclk_disable_peripheral_clock()
+ * - sysclk_enable_module()
+ * - sysclk_disable_module()
+ * - sysclk_module_is_enabled()
+ * - sysclk_set_prescalers()
+ *
+ * All other functions should be considered platform-specific.
+ * Enabling/disabling clocks to specific peripherals as well as
+ * determining the speed of these clocks should be done by calling
+ * functions provided by the driver for that peripheral.
+ *
+ * @{
+ */
+
+//! \name System Clock Initialization
+//@{
+/**
+ * \fn void sysclk_init(void)
+ * \brief Initialize the synchronous clock system.
+ *
+ * This function will initialize the system clock and its source. This
+ * includes:
+ * - Mask all synchronous clocks except for any clocks which are
+ * essential for normal operation (for example internal memory
+ * clocks).
+ * - Set up the system clock prescalers as specified by the
+ * application's configuration file.
+ * - Enable the clock source specified by the application's
+ * configuration file (oscillator or PLL) and wait for it to become
+ * stable.
+ * - Set the main system clock source to the clock specified by the
+ * application's configuration file.
+ *
+ * Since all non-essential peripheral clocks are initially disabled, it
+ * is the responsibility of the peripheral driver to re-enable any
+ * clocks that are needed for normal operation.
+ */
+//@}
+
+//! @}
+
+#endif /* SYSCLK_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/genclk.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/genclk.h
new file mode 100644
index 0000000..9a3b2b8
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/genclk.h
@@ -0,0 +1,132 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific generic clock management
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CHIP_GENCLK_H_INCLUDED
+#define CHIP_GENCLK_H_INCLUDED
+
+/**
+ * \weakgroup genclk_group
+ * @{
+ */
+
+//! \name Chip-specific generic clock definitions
+//@{
+
+#define GENCLK_DIV_MAX 256
+
+#ifndef __ASSEMBLY__
+
+#include <stdint.h>
+#include <avr32/io.h>
+
+enum genclk_source {
+ GENCLK_SRC_RCSYS = 0, //!< System RC oscillator
+ GENCLK_SRC_OSC32K = 1, //!< 32 kHz oscillator
+ GENCLK_SRC_RC8M = 2, //!< 8 MHz RC oscillator
+ GENCLK_SRC_OSC0 = 3, //!< Oscillator 0
+ GENCLK_SRC_OSC1 = 4, //!< Oscillator 1
+ GENCLK_SRC_PLL0 = 5, //!< PLL 0
+ GENCLK_SRC_PLL1 = 6, //!< PLL 1
+ GENCLK_SRC_CLK_CPU = 7, //!< CPU clock
+ GENCLK_SRC_CLK_HSB = 8, //!< High Speed Bus clock
+ GENCLK_SRC_CLK_PBA = 9, //!< Peripheral Bus A clock
+ GENCLK_SRC_CLK_PBB = 10, //!< Peripheral Bus B clock
+ GENCLK_SRC_CLK_PBC = 11, //!< Peripheral Bus C clock
+};
+
+//@}
+
+struct genclk_config {
+ uint32_t ctrl;
+};
+
+static inline void genclk_config_defaults(struct genclk_config *cfg,
+ unsigned int id)
+{
+ cfg->ctrl = 0;
+}
+
+static inline void genclk_config_read(struct genclk_config *cfg,
+ unsigned int id)
+{
+ cfg->ctrl = AVR32_SCIF.gcctrl[id];
+}
+
+static inline void genclk_config_write(const struct genclk_config *cfg,
+ unsigned int id)
+{
+ AVR32_SCIF.gcctrl[id] = cfg->ctrl;
+}
+
+static inline void genclk_config_set_source(struct genclk_config *cfg,
+ enum genclk_source src)
+{
+ cfg->ctrl = (cfg->ctrl & ~AVR32_SCIF_GCCTRL_OSCSEL_MASK)
+ | (src << AVR32_SCIF_GCCTRL_OSCSEL);
+}
+
+static inline void genclk_config_set_divider(struct genclk_config *cfg,
+ unsigned int divider)
+{
+ Assert(divider > 0 && divider <= GENCLK_DIV_MAX);
+
+ /* Clear all the bits we're about to modify */
+ cfg->ctrl &= ~(AVR32_SCIF_GCCTRL_DIVEN_MASK
+ | AVR32_SCIF_GCCTRL_DIV_MASK);
+
+ if (divider > 1) {
+ cfg->ctrl |= 1U << AVR32_SCIF_GCCTRL_DIVEN;
+ cfg->ctrl |= (((divider + 1) / 2) - 1) << AVR32_SCIF_GCCTRL_DIV;
+ }
+}
+
+static inline void genclk_enable(const struct genclk_config *cfg,
+ unsigned int id)
+{
+ AVR32_SCIF.gcctrl[id] = cfg->ctrl | (1U << AVR32_SCIF_GCCTRL_CEN);
+}
+
+static inline void genclk_disable(unsigned int id)
+{
+ AVR32_SCIF.gcctrl[id] = 0;
+}
+
+#endif /* __ASSEMBLY__ */
+
+//! @}
+
+#endif /* CHIP_GENCLK_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.c
new file mode 100644
index 0000000..032146f
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.c
@@ -0,0 +1,169 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific oscillator management functions
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#include <osc.h>
+
+#ifdef BOARD_OSC0_HZ
+void osc_priv_enable_osc0(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_OSCCTRL;
+ AVR32_SCIF.oscctrl[0] =
+ (OSC0_STARTUP_VALUE << AVR32_SCIF_OSCCTRL_STARTUP)
+ | (OSC0_GAIN_VALUE << AVR32_SCIF_OSCCTRL_GAIN)
+ | (OSC0_MODE_VALUE << AVR32_SCIF_OSCCTRL_MODE)
+ | (1U << AVR32_SCIF_OSCCTRL_OSCEN);
+ cpu_irq_restore(flags);
+}
+
+void osc_priv_disable_osc0(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_OSCCTRL;
+ AVR32_SCIF.oscctrl[0] = 0;
+ cpu_irq_restore(flags);
+}
+#endif /* BOARD_OSC0_HZ */
+
+#ifdef BOARD_OSC1_HZ
+void osc_priv_enable_osc1(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_OSCCTRL;
+ AVR32_SCIF.oscctrl[1] =
+ (OSC0_STARTUP_VALUE << AVR32_SCIF_OSCCTRL_STARTUP)
+ | (OSC0_GAIN_VALUE << AVR32_SCIF_OSCCTRL_GAIN)
+ | (OSC0_MODE_VALUE << AVR32_SCIF_OSCCTRL_MODE)
+ | (1U << AVR32_SCIF_OSCCTRL_OSCEN);
+ cpu_irq_restore(flags);
+}
+
+void osc_priv_disable_osc1(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_OSCCTRL;
+ AVR32_SCIF.oscctrl[1] = 0;
+ cpu_irq_restore(flags);
+}
+#endif /* BOARD_OSC0_HZ */
+
+#ifdef BOARD_OSC32_HZ
+void osc_priv_enable_osc32(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_OSCCTRL32;
+ AVR32_SCIF.oscctrl32 =
+ (OSC32_STARTUP_VALUE << AVR32_SCIF_OSCCTRL32_STARTUP)
+ | (OSC32_MODE_VALUE << AVR32_SCIF_OSCCTRL32_MODE)
+ | (1U << AVR32_SCIF_OSCCTRL32_OSC32EN);
+ cpu_irq_restore(flags);
+}
+
+void osc_priv_disable_osc32(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_OSCCTRL32;
+ AVR32_SCIF.oscctrl32 = 0;
+ cpu_irq_restore(flags);
+}
+#endif /* BOARD_OSC0_HZ */
+
+void osc_priv_enable_rc8m(void)
+{
+ irqflags_t flags;
+ uint32_t rccr8;
+ uint32_t* calibration_bits = (uint32_t*)0x80800200;
+ /* Wait for the CALIB field to be updated from fuses after reset */
+ while (!(AVR32_SCIF.rccr8 & AVR32_SCIF_RCCR8_FCD_MASK)) {
+ /* Do nothing */
+ }
+
+ /* Enable the oscillator without touching the CALIB and FCD fields */
+ flags = cpu_irq_save();
+ rccr8 = AVR32_SCIF.rccr8;
+ rccr8 &= AVR32_SCIF_RCCR8_FCD_MASK | ((*calibration_bits)&AVR32_SCIF_RCCR8_CALIB_MASK);
+ rccr8 |= 1U << AVR32_SCIF_RCOSC8_EN;
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_RCCR8;
+ AVR32_SCIF.rccr8 = rccr8;
+ cpu_irq_restore(flags);
+}
+
+void osc_priv_disable_rc8m(void)
+{
+ irqflags_t flags;
+ uint32_t rccr8;
+
+ /* Disable the oscillator without touching the CALIB and FCD fields */
+ flags = cpu_irq_save();
+ rccr8 = AVR32_SCIF.rccr8;
+ rccr8 &= AVR32_SCIF_RCCR8_FCD_MASK | AVR32_SCIF_RCCR8_CALIB_MASK;
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_RCCR8;
+ AVR32_SCIF.rccr8 = rccr8;
+ cpu_irq_restore(flags);
+}
+
+void osc_priv_enable_rc120m(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_RC120MCR;
+ AVR32_SCIF.rc120mcr = 1U << AVR32_SCIF_RC120MCR_EN;
+ cpu_irq_restore(flags);
+}
+
+void osc_priv_disable_rc120m(void)
+{
+ irqflags_t flags;
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | AVR32_SCIF_RC120MCR;
+ AVR32_SCIF.rc120mcr = 0;
+ cpu_irq_restore(flags);
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.h
new file mode 100644
index 0000000..0f235e2
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/osc.h
@@ -0,0 +1,600 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific oscillator management functions
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CHIP_OSC_H_INCLUDED
+#define CHIP_OSC_H_INCLUDED
+
+#include <board.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Bugzilla #11803
+#ifdef AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_AGC
+#undef AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_AGC
+#endif
+#define AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_AGC AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_ACG
+#ifdef AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_NO_AGC
+#undef AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_NO_AGC
+#endif
+#define AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_NO_AGC AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_NO_ACG
+
+/**
+ * \weakgroup osc_group
+ * @{
+ */
+
+//! \name Oscillator identifiers
+//@{
+#define OSC_ID_OSC0 0 //!< External Oscillator 0
+#define OSC_ID_OSC1 1 //!< External Oscillator 1
+#define OSC_ID_RC8M 2 //!< Internal 8 MHz RC oscillator
+#define OSC_ID_OSC32 3 //!< External 32 kHz oscillator
+#define OSC_ID_RC120M 4 //!< Internal 120 MHz RC oscillator
+#define OSC_ID_RCSYS 5 //!< Internal System RC oscillator
+//@}
+
+//! \name OSC0/OSC1 mode values
+//@{
+//! External clock connected to XIN
+#define OSC_MODE_EXTERNAL AVR32_SCIF_OSCCTRL_MODE_EXT_CLOCK
+//! Crystal connected to XIN/XOUT
+#define OSC_MODE_XTAL AVR32_SCIF_OSCCTRL_MODE_CRYSTAL
+//@}
+
+//! \name OSC32 mode values
+//@{
+//! External clock connected to XIN32
+#define OSC32_MODE_EXTERNAL AVR32_SCIF_OSCCTRL32_MODE_EXT_CLOCK
+//! Crystal connected to XIN32/XOUT32
+#define OSC32_MODE_XTAL AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_AGC
+//! Crystal connected to XIN32/XOUT32 in high current mode
+#define OSC32_MODE_XTAL_HC AVR32_SCIF_OSCCTRL32_MODE_CRYSTAL_NO_AGC
+//@}
+
+//! \name OSC0/OSC1 startup values
+//@{
+//! 0 cycles
+#define OSC_STARTUP_0 AVR32_SCIF_OSCCTRL0_STARTUP_0_RCOSC
+//! 4 cycles (35 us)
+#define OSC_STARTUP_4 AVR32_SCIF_OSCCTRL0_STARTUP_4_RCOSC
+//! 8 cycles (70 us)
+#define OSC_STARTUP_8 AVR32_SCIF_OSCCTRL0_STARTUP_8_RCOSC
+//! 16 cycles (140 us)
+#define OSC_STARTUP_16 AVR32_SCIF_OSCCTRL0_STARTUP_16_RCOSC
+//! 32 cycles (280 us)
+#define OSC_STARTUP_32 AVR32_SCIF_OSCCTRL0_STARTUP_32_RCOSC
+//! 64 cycles (560 us)
+#define OSC_STARTUP_64 AVR32_SCIF_OSCCTRL0_STARTUP_64_RCOSC
+//! 128 cycles (1.1 ms)
+#define OSC_STARTUP_128 AVR32_SCIF_OSCCTRL0_STARTUP_128_RCOSC
+//! 256 cycles (2.2 ms)
+#define OSC_STARTUP_256 AVR32_SCIF_OSCCTRL0_STARTUP_256_RCOSC
+//! 512 cycles (4.5 ms)
+#define OSC_STARTUP_512 AVR32_SCIF_OSCCTRL0_STARTUP_512_RCOSC
+//! 1024 cycles (9.0 ms)
+#define OSC_STARTUP_1024 AVR32_SCIF_OSCCTRL0_STARTUP_1024_RCOSC
+//! 2048 cycles (18 ms)
+#define OSC_STARTUP_2048 AVR32_SCIF_OSCCTRL0_STARTUP_2048_RCOSC
+//! 4096 cycles (36 ms)
+#define OSC_STARTUP_4096 AVR32_SCIF_OSCCTRL0_STARTUP_4096_RCOSC
+//! 8192 cycles (71 ms)
+#define OSC_STARTUP_8192 AVR32_SCIF_OSCCTRL0_STARTUP_8192_RCOSC
+//! 16384 cycles (142 ms)
+#define OSC_STARTUP_16384 AVR32_SCIF_OSCCTRL0_STARTUP_16384_RCOSC
+//@}
+
+//! \name OSC32 startup values
+//@{
+//! 0 cycles
+#define OSC32_STARTUP_0 AVR32_SCIF_OSCCTRL32_STARTUP_0_RCOSC
+//! 128 cycles (1.1 ms)
+#define OSC32_STARTUP_128 AVR32_SCIF_OSCCTRL32_STARTUP_128_RCOSC
+//! 8192 cycles (72.3 ms)
+#define OSC32_STARTUP_8192 AVR32_SCIF_OSCCTRL32_STARTUP_8192_RCOSC
+//! 16384 cycles (143 ms)
+#define OSC32_STARTUP_16384 AVR32_SCIF_OSCCTRL32_STARTUP_16384_RCOSC
+//! 65536 cycles (570 ms)
+#define OSC32_STARTUP_65536 AVR32_SCIF_OSCCTRL32_STARTUP_65536_RCOSC
+//! 131072 cycles (1.1 s)
+#define OSC32_STARTUP_131072 AVR32_SCIF_OSCCTRL32_STARTUP_131072_RCOSC
+//! 262144 cycles (2.3 s)
+#define OSC32_STARTUP_262144 AVR32_SCIF_OSCCTRL32_STARTUP_262144_RCOSC
+//! 524288 cycles (4.6 s)
+#define OSC32_STARTUP_524288 AVR32_SCIF_OSCCTRL32_STARTUP_524288_RCOSC
+//@}
+
+/**
+ * \def OSC0_STARTUP_TIMEOUT
+ * \brief Number of slow clock cycles to wait for OSC0 to start
+ *
+ * This is the number of slow clock cycles corresponding to
+ * OSC0_STARTUP_VALUE with an additional 25% safety margin. If the
+ * oscillator isn't running when this timeout has expired, it is assumed
+ * to have failed to start.
+ */
+/**
+ * \def OSC0_MODE_VALUE
+ * \brief Board-dependent value written to the MODE bitfield of
+ * PM_OSCCTRL(0)
+ */
+/**
+ * \def OSC0_STARTUP_VALUE
+ * \brief Board-dependent value written to the STARTUP bitfield of
+ * PM_OSCCTRL(0)
+ */
+/**
+ * \def OSC1_STARTUP_TIMEOUT
+ * \brief Number of slow clock cycles to wait for OSC1 to start
+ *
+ * This is the number of slow clock cycles corresponding to
+ * OSC1_STARTUP_VALUE with an additional 25% safety margin. If the
+ * oscillator isn't running when this timeout has expired, it is assumed
+ * to have failed to start.
+ */
+/**
+ * \def OSC1_MODE_VALUE
+ * \brief Board-dependent value written to the MODE bitfield of
+ * PM_OSCCTRL(1)
+ */
+/**
+ * \def OSC1_STARTUP_VALUE
+ * \brief Board-dependent value written to the STARTUP bitfield of
+ * PM_OSCCTRL(1)
+ */
+
+#if defined(BOARD_OSC0_STARTUP_US)
+# if BOARD_OSC0_STARTUP_US == 0
+# define OSC0_STARTUP_VALUE OSC_STARTUP_0
+# define OSC0_STARTUP_TIMEOUT 1
+# elif BOARD_OSC0_STARTUP_US <= 35
+# define OSC0_STARTUP_VALUE OSC_STARTUP_4
+# define OSC0_STARTUP_TIMEOUT 5
+# elif BOARD_OSC0_STARTUP_US <= 70
+# define OSC0_STARTUP_VALUE OSC_STARTUP_8
+# define OSC0_STARTUP_TIMEOUT 10
+# elif BOARD_OSC0_STARTUP_US <= 140
+# define OSC0_STARTUP_VALUE OSC_STARTUP_16
+# define OSC0_STARTUP_TIMEOUT 20
+# elif BOARD_OSC0_STARTUP_US <= 280
+# define OSC0_STARTUP_VALUE OSC_STARTUP_32
+# define OSC0_STARTUP_TIMEOUT 40
+# elif BOARD_OSC0_STARTUP_US <= 560
+# define OSC0_STARTUP_VALUE OSC_STARTUP_64
+# define OSC0_STARTUP_TIMEOUT 80
+# elif BOARD_OSC0_STARTUP_US <= 1100
+# define OSC0_STARTUP_VALUE OSC_STARTUP_128
+# define OSC0_STARTUP_TIMEOUT 160
+# elif BOARD_OSC0_STARTUP_US <= 2200
+# define OSC0_STARTUP_VALUE OSC_STARTUP_256
+# define OSC0_STARTUP_TIMEOUT 320
+# elif BOARD_OSC0_STARTUP_US <= 4500
+# define OSC0_STARTUP_VALUE OSC_STARTUP_512
+# define OSC0_STARTUP_TIMEOUT 640
+# elif BOARD_OSC0_STARTUP_US <= 9000
+# define OSC0_STARTUP_VALUE OSC_STARTUP_1024
+# define OSC0_STARTUP_TIMEOUT 1280
+# elif BOARD_OSC0_STARTUP_US <= 18000
+# define OSC0_STARTUP_VALUE OSC_STARTUP_2048
+# define OSC0_STARTUP_TIMEOUT 2560
+# elif BOARD_OSC0_STARTUP_US <= 36000
+# define OSC0_STARTUP_VALUE OSC_STARTUP_4096
+# define OSC0_STARTUP_TIMEOUT 5120
+# elif BOARD_OSC0_STARTUP_US <= 71000
+# define OSC0_STARTUP_VALUE OSC_STARTUP_8192
+# define OSC0_STARTUP_TIMEOUT 10240
+# elif BOARD_OSC0_STARTUP_US <= 142000
+# define OSC0_STARTUP_VALUE OSC_STARTUP_16384
+# define OSC0_STARTUP_TIMEOUT 20480
+# else
+# error BOARD_OSC0_STARTUP_US is too high
+# endif
+# if BOARD_OSC0_IS_XTAL == true
+# define OSC0_MODE_VALUE OSC_MODE_XTAL
+# if BOARD_OSC0_HZ < 900000
+# define OSC0_GAIN_VALUE AVR32_SCIF_OSCCTRL0_GAIN_G0
+# elif BOARD_OSC0_HZ < 3000000
+# define OSC0_GAIN_VALUE AVR32_SCIF_OSCCTRL0_GAIN_G1
+# elif BOARD_OSC0_HZ < 8000000
+# define OSC0_GAIN_VALUE AVR32_SCIF_OSCCTRL0_GAIN_G2
+# else
+# define OSC0_GAIN_VALUE AVR32_SCIF_OSCCTRL0_GAIN_G3
+# endif
+# else
+# define OSC0_MODE_VALUE OSC_MODE_EXTERNAL
+# endif
+#else
+# if defined(BOARD_OSC0_HZ)
+# error BOARD_OSC0_STARTUP_US must be defined by the board code
+# endif
+# ifdef __DOXYGEN__
+# define OSC0_STARTUP_VALUE UNDEFINED
+# define OSC0_STARTUP_TIMEOUT UNDEFINED
+# define OSC0_MODE_VALUE UNDEFINED
+# endif
+#endif
+#if defined(BOARD_OSC1_STARTUP_US)
+# if BOARD_OSC1_STARTUP_US == 0
+# define OSC1_STARTUP_VALUE OSC_STARTUP_0
+# define OSC1_STARTUP_TIMEOUT 1
+# elif BOARD_OSC1_STARTUP_US <= 35
+# define OSC1_STARTUP_VALUE OSC_STARTUP_4
+# define OSC1_STARTUP_TIMEOUT 5
+# elif BOARD_OSC1_STARTUP_US <= 70
+# define OSC1_STARTUP_VALUE OSC_STARTUP_8
+# define OSC1_STARTUP_TIMEOUT 10
+# elif BOARD_OSC1_STARTUP_US <= 140
+# define OSC1_STARTUP_VALUE OSC_STARTUP_16
+# define OSC1_STARTUP_TIMEOUT 20
+# elif BOARD_OSC1_STARTUP_US <= 280
+# define OSC1_STARTUP_VALUE OSC_STARTUP_32
+# define OSC1_STARTUP_TIMEOUT 40
+# elif BOARD_OSC1_STARTUP_US <= 560
+# define OSC1_STARTUP_VALUE OSC_STARTUP_64
+# define OSC1_STARTUP_TIMEOUT 80
+# elif BOARD_OSC1_STARTUP_US <= 1100
+# define OSC1_STARTUP_VALUE OSC_STARTUP_128
+# define OSC1_STARTUP_TIMEOUT 160
+# elif BOARD_OSC1_STARTUP_US <= 2200
+# define OSC1_STARTUP_VALUE OSC_STARTUP_256
+# define OSC1_STARTUP_TIMEOUT 320
+# elif BOARD_OSC1_STARTUP_US <= 4500
+# define OSC1_STARTUP_VALUE OSC_STARTUP_512
+# define OSC1_STARTUP_TIMEOUT 640
+# elif BOARD_OSC1_STARTUP_US <= 9000
+# define OSC1_STARTUP_VALUE OSC_STARTUP_1024
+# define OSC1_STARTUP_TIMEOUT 1280
+# elif BOARD_OSC1_STARTUP_US <= 18000
+# define OSC1_STARTUP_VALUE OSC_STARTUP_2048
+# define OSC1_STARTUP_TIMEOUT 2560
+# elif BOARD_OSC1_STARTUP_US <= 36000
+# define OSC1_STARTUP_VALUE OSC_STARTUP_4096
+# define OSC1_STARTUP_TIMEOUT 5120
+# elif BOARD_OSC1_STARTUP_US <= 71000
+# define OSC1_STARTUP_VALUE OSC_STARTUP_8192
+# define OSC1_STARTUP_TIMEOUT 10240
+# elif BOARD_OSC1_STARTUP_US <= 142000
+# define OSC1_STARTUP_VALUE OSC_STARTUP_16384
+# define OSC1_STARTUP_TIMEOUT 20480
+# else
+# error BOARD_OSC1_STARTUP_US is too high
+# endif
+# if BOARD_OSC1_IS_XTAL == true
+# define OSC1_MODE_VALUE OSC_MODE_XTAL
+# if BOARD_OSC1_HZ < 900000
+# define OSC1_GAIN_VALUE AVR32_SCIF_OSCCTRL1_GAIN_G0
+# elif BOARD_OSC1_HZ < 3000000
+# define OSC1_GAIN_VALUE AVR32_SCIF_OSCCTRL1_GAIN_G1
+# elif BOARD_OSC1_HZ < 8000000
+# define OSC1_GAIN_VALUE AVR32_SCIF_OSCCTRL1_GAIN_G2
+# else
+# define OSC1_GAIN_VALUE AVR32_SCIF_OSCCTRL1_GAIN_G3
+# endif
+# else
+# define OSC1_MODE_VALUE OSC_MODE_EXTERNAL
+# endif
+#else
+# if defined(BOARD_OSC1_HZ)
+# error BOARD_OSC1_STARTUP_US must be defined by the board code
+# endif
+# ifdef __DOXYGEN__
+# define OSC1_STARTUP_VALUE UNDEFINED
+# define OSC1_STARTUP_TIMEOUT UNDEFINED
+# define OSC1_MODE_VALUE UNDEFINED
+# endif
+#endif
+
+#if defined(BOARD_OSC32_STARTUP_US)
+# if BOARD_OSC32_STARTUP_US == 0
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_0
+# elif BOARD_OSC32_STARTUP_US <= 1100
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_128
+# elif BOARD_OSC32_STARTUP_US <= 72300
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_8192
+# elif BOARD_OSC32_STARTUP_US <= 143000
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_16384
+# elif BOARD_OSC32_STARTUP_US <= 570000
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_65536
+# elif BOARD_OSC32_STARTUP_US <= 1100000
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_131072
+# elif BOARD_OSC32_STARTUP_US <= 2300000
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_262144
+# elif BOARD_OSC32_STARTUP_US <= 4600000
+# define OSC32_STARTUP_VALUE OSC32_STARTUP_524288
+# else
+# error BOARD_OSC32_STARTUP_US is too high
+# endif
+# if BOARD_OSC32_IS_XTAL == true
+# define OSC32_MODE_VALUE OSC32_MODE_XTAL
+# else
+# define OSC32_MODE_VALUE OSC32_MODE_EXTERNAL
+# endif
+#else
+# if defined(BOARD_OSC32_HZ)
+# error BOARD_OSC32_STARTUP_US must be defined by the board code
+# endif
+# ifdef __DOXYGEN__
+# define OSC32_STARTUP_VALUE UNDEFINED
+# define OSC32_STARTUP_TIMEOUT UNDEFINED
+# define OSC32_MODE_VALUE UNDEFINED
+# endif
+#endif
+
+/**
+ * \name Board-specific configuration parameters
+ * The following definitions must be provided by the board code for all
+ * working oscillators on the board.
+ */
+//@{
+/**
+ * \def BOARD_OSC0_HZ
+ * \brief Clock frequency of OSC0 in Hz
+ */
+/**
+ * \def BOARD_OSC0_STARTUP_US
+ * \brief Startup time of OSC0 in microseconds
+ */
+/**
+ * \def BOARD_OSC0_IS_XTAL
+ * \brief OSC0 uses a crystal, not an external clock
+ */
+/**
+ * \def BOARD_OSC1_HZ
+ * \brief Clock frequency of OSC1 in Hz
+ */
+/**
+ * \def BOARD_OSC1_STARTUP_US
+ * \brief Startup time of OSC1 in microseconds
+ */
+/**
+ * \def BOARD_OSC1_IS_XTAL
+ * \brief OSC1 uses a crystal, not an external clock
+ */
+/**
+ * \def BOARD_OSC32_HZ
+ * \brief Clock frequency of OSC32 in Hz
+ */
+/**
+ * \def BOARD_OSC32_STARTUP_US
+ * \brief Startup time of OSC32 in microseconds
+ */
+/**
+ * \def BOARD_OSC32_IS_XTAL
+ * \brief OSC32 uses a crystal, not an external clock
+ */
+
+/**
+ * \name RC oscillator frequency limits
+ * The frequency of the internal RC oscillators may drift a bit as a
+ * result of temperature changes. These definitions provide upper and
+ * lower limits which may be used to calculate upper and lower limits of
+ * timeouts, derived clock frequencies, etc.
+ */
+//@{
+//! Nominal frequency of RCSYS in Hz
+#define OSC_RCSYS_NOMINAL_HZ 115000
+//! Minimum frequency of RCSYS in Hz
+#define OSC_RCSYS_MIN_HZ 100000
+//! Maximum frequency of RCSYS in Hz
+#define OSC_RCSYS_MAX_HZ 120000
+//! Nominal frequency of RC8M in Hz
+#define OSC_RC8M_NOMINAL_HZ 8000000
+//! Nominal frequency of RC120M in Hz
+#define OSC_RC120M_NOMINAL_HZ 120000000
+//@}
+
+#ifndef __ASSEMBLY__
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <avr32/io.h>
+
+extern void osc_priv_enable_osc0(void);
+extern void osc_priv_disable_osc0(void);
+extern bool osc_priv_osc0_is_ready(void);
+extern void osc_priv_enable_osc1(void);
+extern void osc_priv_disable_osc1(void);
+extern bool osc_priv_osc1_is_ready(void);
+extern void osc_priv_enable_osc32(void);
+extern void osc_priv_disable_osc32(void);
+extern bool osc_priv_osc32_is_ready(void);
+extern void osc_priv_enable_rc8m(void);
+extern void osc_priv_disable_rc8m(void);
+extern bool osc_priv_rc8m_is_ready(void);
+extern void osc_priv_enable_rc120m(void);
+extern void osc_priv_disable_rc120m(void);
+extern bool osc_priv_rc120m_is_ready(void);
+
+static inline void osc_enable(uint8_t id)
+{
+ switch (id) {
+#ifdef BOARD_OSC0_HZ
+ case OSC_ID_OSC0:
+ osc_priv_enable_osc0();
+ break;
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case OSC_ID_OSC1:
+ osc_priv_enable_osc1();
+ break;
+#endif
+
+#ifdef BOARD_OSC32_HZ
+ case OSC_ID_OSC32:
+ osc_priv_enable_osc32();
+ break;
+#endif
+
+ case OSC_ID_RC8M:
+ osc_priv_enable_rc8m();
+ break;
+
+ case OSC_ID_RC120M:
+ osc_priv_enable_rc120m();
+ break;
+
+ case OSC_ID_RCSYS:
+ /* RCSYS is always running */
+ break;
+
+ default:
+ /* unhandled_case(id); */
+ break;
+ }
+}
+
+static inline void osc_disable(uint8_t id)
+{
+ switch (id) {
+#ifdef BOARD_OSC0_HZ
+ case OSC_ID_OSC0:
+ osc_priv_disable_osc0();
+ break;
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case OSC_ID_OSC1:
+ osc_priv_disable_osc1();
+ break;
+#endif
+
+#ifdef BOARD_OSC32_HZ
+ case OSC_ID_OSC32:
+ osc_priv_disable_osc32();
+ break;
+#endif
+
+ case OSC_ID_RC8M:
+ osc_priv_disable_rc8m();
+ break;
+
+ case OSC_ID_RC120M:
+ osc_priv_disable_rc120m();
+ break;
+
+ case OSC_ID_RCSYS:
+ /* RCSYS is always running */
+ break;
+
+ default:
+ /* unhandled_case(id); */
+ break;
+ }
+}
+
+static inline bool osc_is_ready(uint8_t id)
+{
+ switch (id) {
+#ifdef BOARD_OSC0_HZ
+ case OSC_ID_OSC0:
+ return !!(AVR32_SCIF.pclksr & (1 << AVR32_SCIF_OSC0RDY));
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case OSC_ID_OSC1:
+ return !!(AVR32_SCIF.pclksr & (1 << AVR32_SCIF_OSC1RDY));
+#endif
+
+#ifdef BOARD_OSC32_HZ
+ case OSC_ID_OSC32:
+ return !!(AVR32_SCIF.pclksr & (1 << AVR32_SCIF_OSC32RDY));
+#endif
+
+ case OSC_ID_RC8M:
+ return !!(AVR32_SCIF.pclksr & (1U << AVR32_SCIF_RCOSC8MRDY));
+
+ case OSC_ID_RC120M:
+ return !!(AVR32_SCIF.rc120mcr & (1 << AVR32_SCIF_RC120MCR_EN));
+
+ case OSC_ID_RCSYS:
+ /* RCSYS is always ready */
+ return true;
+
+ default:
+ /* unhandled_case(id); */
+ return false;
+ }
+}
+
+/**
+ * \todo RC8M may run at either 8 MHz or 1 MHz. Currently, we assume
+ * it's always running at 8 MHz.
+ */
+static inline uint32_t osc_get_rate(uint8_t id)
+{
+ switch (id) {
+#ifdef BOARD_OSC0_HZ
+ case OSC_ID_OSC0:
+ return BOARD_OSC0_HZ;
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case OSC_ID_OSC1:
+ return BOARD_OSC1_HZ;
+#endif
+
+#ifdef BOARD_OSC32_HZ
+ case OSC_ID_OSC32:
+ return BOARD_OSC32_HZ;
+#endif
+
+ case OSC_ID_RC8M:
+ return OSC_RC8M_NOMINAL_HZ;
+
+ case OSC_ID_RC120M:
+ return OSC_RC120M_NOMINAL_HZ;
+
+ case OSC_ID_RCSYS:
+ return OSC_RCSYS_NOMINAL_HZ;
+
+ default:
+ /* unhandled_case(id); */
+ return 0;
+ }
+}
+
+#endif /* !__ASSEMBLY__ */
+
+//! @}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CHIP_OSC_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.c
new file mode 100644
index 0000000..64029d4
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.c
@@ -0,0 +1,76 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific PLL implementation
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#include <avr32/io.h>
+#include <compiler.h>
+#include <pll.h>
+
+void pll_config_write(const struct pll_config *cfg, unsigned int pll_id)
+{
+ irqflags_t flags;
+
+ Assert(pll_id < NR_PLLS);
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | (AVR32_SCIF_PLL + (4 * pll_id));
+ AVR32_SCIF.pll[pll_id] = cfg->ctrl;
+ cpu_irq_restore(flags);
+}
+
+void pll_enable(const struct pll_config *cfg, unsigned int pll_id)
+{
+ irqflags_t flags;
+
+ Assert(pll_id < NR_PLLS);
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | (AVR32_SCIF_PLL + (4 * pll_id));
+ AVR32_SCIF.pll[pll_id] = cfg->ctrl | (1U << AVR32_SCIF_PLLEN);
+ cpu_irq_restore(flags);
+}
+
+void pll_disable(unsigned int pll_id)
+{
+ irqflags_t flags;
+
+ Assert(pll_id < NR_PLLS);
+
+ flags = cpu_irq_save();
+ AVR32_SCIF.unlock = 0xaa000000 | (AVR32_SCIF_PLL + (4 * pll_id));
+ AVR32_SCIF.pll[pll_id] = 0;
+ cpu_irq_restore(flags);
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.h
new file mode 100644
index 0000000..df1a5f8
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/pll.h
@@ -0,0 +1,228 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific PLL definitions
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CHIP_PLL_H_INCLUDED
+#define CHIP_PLL_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Bugzilla #11801
+#ifdef AVR32_SCIF_PLL_VCO_RANGE0_MAX_FREQ
+#undef AVR32_SCIF_PLL_VCO_RANGE0_MAX_FREQ
+#endif
+#define AVR32_SCIF_PLL_VCO_RANGE0_MAX_FREQ 240000000
+#ifdef AVR32_SCIF_PLL_VCO_RANGE0_MIN_FREQ
+#undef AVR32_SCIF_PLL_VCO_RANGE0_MIN_FREQ
+#endif
+#define AVR32_SCIF_PLL_VCO_RANGE0_MIN_FREQ 160000000
+#ifdef AVR32_SCIF_PLL_VCO_RANGE1_MAX_FREQ
+#undef AVR32_SCIF_PLL_VCO_RANGE1_MAX_FREQ
+#endif
+#define AVR32_SCIF_PLL_VCO_RANGE1_MAX_FREQ 180000000
+#ifdef AVR32_SCIF_PLL_VCO_RANGE1_MIN_FREQ
+#undef AVR32_SCIF_PLL_VCO_RANGE1_MIN_FREQ
+#endif
+#define AVR32_SCIF_PLL_VCO_RANGE1_MIN_FREQ 80000000
+/**
+ * \weakgroup pll_group
+ * @{
+ */
+
+#define PLL_MAX_STARTUP_CYCLES ((1 << AVR32_SCIF_PLL_PLLCOUNT_SIZE) - 1)
+#define NR_PLLS 2
+
+/**
+ * \brief Number of milliseconds to wait for PLL lock
+ */
+#define PLL_TIMEOUT_MS \
+ div_ceil(1000 * (PLL_MAX_STARTUP_CYCLES * 2), OSC_RCSYS_MIN_HZ)
+
+/**
+ * \note The PLL must run at twice this frequency internally, but the
+ * output frequency may be divided by two by setting the PLLOPT[1] bit.
+ */
+#define PLL_MIN_HZ 40000000
+#define PLL_MAX_HZ 240000000
+
+//! \name Chip-specific PLL options
+//@{
+//! VCO frequency range is 80-180 MHz (160-240 MHz if unset).
+#define PLL_OPT_VCO_RANGE_LOW 0
+//! Divide output frequency by two
+#define PLL_OPT_OUTPUT_DIV 1
+//! Disable wide-bandwidth mode
+#define PLL_OPT_WBM_DISABLE 2
+//! Number of PLL options
+#define PLL_NR_OPTIONS AVR32_SCIF_PLL_PLLOPT_SIZE
+//! The threshold under which to set the #PLL_OPT_VCO_RANGE_LOW option
+#define PLL_VCO_LOW_THRESHOLD ((AVR32_SCIF_PLL_VCO_RANGE0_MIN_FREQ \
+ + AVR32_SCIF_PLL_VCO_RANGE1_MAX_FREQ) / 2)
+//@}
+
+#ifndef __ASSEMBLY__
+
+#include <avr32/io.h>
+#include <osc.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+enum pll_source {
+ PLL_SRC_OSC0 = 0, //!< Oscillator 0
+ PLL_SRC_OSC1 = 1, //!< Oscillator 1
+ PLL_SRC_RC8M = 2, //!< 8MHz/1MHz RC oscillator
+ PLL_NR_SOURCES, //!< Number of PLL sources
+};
+
+struct pll_config {
+ uint32_t ctrl;
+};
+
+#define pll_get_default_rate(pll_id) \
+ ((osc_get_rate(CONFIG_PLL##pll_id##_SOURCE) \
+ * CONFIG_PLL##pll_id##_MUL) \
+ / CONFIG_PLL##pll_id##_DIV)
+
+static inline void pll_config_set_option(struct pll_config *cfg,
+ unsigned int option)
+{
+ Assert(option < PLL_NR_OPTIONS);
+
+ cfg->ctrl |= 1U << (AVR32_SCIF_PLLOPT + option);
+}
+
+static inline void pll_config_clear_option(struct pll_config *cfg,
+ unsigned int option)
+{
+ Assert(option < PLL_NR_OPTIONS);
+
+ cfg->ctrl &= ~(1U << (AVR32_SCIF_PLLOPT + option));
+}
+
+/**
+ * The PLL options #PLL_OPT_VCO_RANGE_LOW and #PLL_OPT_OUTPUT_DIV will
+ * be set automatically based on the calculated target frequency.
+ */
+static inline void pll_config_init(struct pll_config *cfg,
+ enum pll_source src, unsigned int div, unsigned int mul)
+{
+ uint32_t vco_hz;
+
+ Assert(src < PLL_NR_SOURCES);
+
+ /* Calculate internal VCO frequency */
+ vco_hz = osc_get_rate(src) * mul;
+ vco_hz /= div;
+ Assert(vco_hz >= PLL_MIN_HZ);
+ Assert(vco_hz <= PLL_MAX_HZ);
+
+ cfg->ctrl = 0;
+
+ /* Bring the internal VCO frequency up to the minimum value */
+ if ((vco_hz < PLL_MIN_HZ * 2) && (mul <= 8)) {
+ mul *= 2;
+ vco_hz *= 2;
+ pll_config_set_option(cfg, PLL_OPT_OUTPUT_DIV);
+ }
+
+ /* Set VCO frequency range according to calculated value */
+ if (vco_hz < PLL_VCO_LOW_THRESHOLD)
+ pll_config_set_option(cfg, PLL_OPT_VCO_RANGE_LOW);
+
+ Assert(mul > 2 && mul <= 16);
+ Assert(div > 0 && div <= 15);
+
+ cfg->ctrl |= ((mul - 1) << AVR32_SCIF_PLLMUL)
+ | (div << AVR32_SCIF_PLLDIV)
+ | (PLL_MAX_STARTUP_CYCLES << AVR32_SCIF_PLLCOUNT)
+ | (src << AVR32_SCIF_PLLOSC);
+}
+
+#define pll_config_defaults(cfg, pll_id) \
+ pll_config_init(cfg, \
+ CONFIG_PLL##pll_id##_SOURCE, \
+ CONFIG_PLL##pll_id##_DIV, \
+ CONFIG_PLL##pll_id##_MUL)
+
+static inline void pll_config_read(struct pll_config *cfg, unsigned int pll_id)
+{
+ Assert(pll_id < NR_PLLS);
+
+ cfg->ctrl = AVR32_SCIF.pll[pll_id];
+}
+
+extern void pll_config_write(const struct pll_config *cfg, unsigned int pll_id);
+extern void pll_enable(const struct pll_config *cfg, unsigned int pll_id);
+extern void pll_disable(unsigned int pll_id);
+
+static inline bool pll_is_locked(unsigned int pll_id)
+{
+ Assert(pll_id < NR_PLLS);
+
+ return !!(AVR32_SCIF.pclksr & (1U << (AVR32_SCIF_PLL0_LOCK + pll_id)));
+}
+
+static inline void pll_enable_source_sync(enum pll_source src)
+{
+ switch (src) {
+ case PLL_SRC_OSC0: /* Fall through */
+ case PLL_SRC_OSC1:
+ osc_enable(src);
+ osc_wait_ready(src);
+ break;
+
+ case PLL_SRC_RC8M:
+ osc_enable(OSC_ID_RC8M);
+ osc_wait_ready(OSC_ID_RC8M);
+ break;
+
+ default:
+ // unhandled_case(src);
+ break;
+ }
+}
+
+#endif /* __ASSEMBLY__ */
+
+//! @}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CHIP_PLL_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.c
new file mode 100644
index 0000000..6dc383e
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.c
@@ -0,0 +1,407 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific system clock management functions
+ *
+ * Copyright (C) 2009 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#include <avr32/io.h>
+#include <compiler.h>
+#include <stdbool.h>
+#include <sysclk.h>
+#include <flashc.h>
+
+/**
+ * \weakgroup sysclk_group
+ * @{
+ */
+
+/**
+ * \internal
+ * \defgroup sysclk_internals_group System Clock internals
+ *
+ * System clock management is fairly straightforward apart from one
+ * thing: Enabling and disabling bus bridges. When all peripherals on a
+ * given bus are disabled, the bridge to the bus may be disabled. Only
+ * the PBA, PBB and PBC busses support this, and it is not practical to
+ * disable the PBA bridge as it includes the Power Manager, so turning
+ * it off would make it impossible to turn anything back on again.
+ *
+ * @{
+ */
+
+#if ((CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBA_DIV) || \
+ (CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBB_DIV) || \
+ (CONFIG_SYSCLK_CPU_DIV > CONFIG_SYSCLK_PBC_DIV))
+# error CONFIG_SYSCLK_PBx_DIV must be equal to or more than CONFIG_SYSCLK_CPU_DIV.
+#endif
+
+/**
+ * \internal
+ * \name Initial module clock masks
+ *
+ * These are the mask values written to the xxxMASK registers during
+ * initialization if the user has overriden the default behaviour of all clocks
+ * left enabled. These values assume that:
+ * - Debugging should be possible
+ * - The program may be running from flash
+ * - The PM should be available to unmask other clocks
+ * - All on-chip RAM should be available
+ * - INTC, SCIF, PM and GPIO are made permanently available for now; this
+ * may change in the future.
+ */
+//@{
+//! \internal
+//! \brief Initial value of CPUMASK
+#define SYSCLK_INIT_MINIMAL_CPUMASK \
+ ((1 << SYSCLK_OCD) \
+ | (1 << SYSCLK_SYSTIMER))
+//! \internal
+//! \brief Initial value of HSBMASK
+#define SYSCLK_INIT_MINIMAL_HSBMASK \
+ ((1 << SYSCLK_FLASHC_DATA) \
+ | (1 << SYSCLK_PBA_BRIDGE) \
+ | (1 << SYSCLK_HSB_RAM))
+//! \internal
+//! \brief Initial value of PBAMASK
+#define SYSCLK_INIT_MINIMAL_PBAMASK \
+ ((1 << SYSCLK_INTC) \
+ | (1 << SYSCLK_GPIO) \
+ | (1 << SYSCLK_SCIF) \
+ | (1 << SYSCLK_PM))
+//! \internal
+//! \brief Initial value of PBBMASK
+#define SYSCLK_INIT_MINIMAL_PBBMASK 0
+//! \internal
+//! \brief Initial value of PBCMASK
+#define SYSCLK_INIT_MINIMAL_PBCMASK 0
+//@}
+
+#if defined(CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC)
+/**
+ * \brief boolean signaling that the sysclk_init is done.
+ */
+bool sysclk_initialized = false;
+#endif
+
+/**
+ * \internal
+ * \brief Enable a maskable module clock.
+ * \param bus_id Bus index, given by the \c AVR32_PM_CLK_GRP_xxx definitions.
+ * \param module_index Index of the module to be enabled. This is the
+ * bit number in the corresponding xxxMASK register.
+ */
+void sysclk_priv_enable_module(unsigned int bus_id, unsigned int module_index)
+{
+ irqflags_t flags;
+ uint32_t mask;
+
+ flags = cpu_irq_save();
+
+ /* Enable the clock */
+ mask = *(&AVR32_PM.cpumask + bus_id);
+ mask |= 1U << module_index;
+ AVR32_PM.unlock = 0xaa000020 + (4 * bus_id);
+ *(&AVR32_PM.cpumask + bus_id) = mask;
+
+ cpu_irq_restore(flags);
+}
+
+/**
+ * \internal
+ * \brief Disable a maskable module clock.
+ * \param bus_id Bus index, given by the \c AVR32_PM_CLK_GRP_xxx definitions.
+ * \param module_index Index of the module to be disabled. This is the
+ * bit number in the corresponding xxxMASK register.
+ */
+void sysclk_priv_disable_module(unsigned int bus_id, unsigned int module_index)
+{
+ irqflags_t flags;
+ uint32_t mask;
+
+ flags = cpu_irq_save();
+
+ /* Disable the clock */
+ mask = *(&AVR32_PM.cpumask + bus_id);
+ mask &= ~(1U << module_index);
+ AVR32_PM.unlock = 0xaa000020 + (4 * bus_id);
+ *(&AVR32_PM.cpumask + bus_id) = mask;
+
+ cpu_irq_restore(flags);
+}
+
+//! @}
+
+/**
+ * \brief Set system clock prescaler configuration
+ *
+ * This function will change the system clock prescaler configuration to
+ * match the parameters.
+ *
+ * \note The parameters to this function are device-specific.
+ *
+ * \param cpu_shift The CPU clock will be divided by \f$2^{cpu\_shift}\f$
+ * \param pba_shift The PBA clock will be divided by \f$2^{pba\_shift}\f$
+ * \param pbb_shift The PBB clock will be divided by \f$2^{pbb\_shift}\f$
+ * \param pbc_shift The PBC clock will be divided by \f$2^{pbc\_shift}\f$
+ */
+void sysclk_set_prescalers(unsigned int cpu_shift,
+ unsigned int pba_shift, unsigned int pbb_shift,
+ unsigned int pbc_shift)
+{
+ irqflags_t flags;
+ uint32_t cpu_cksel = 0;
+ uint32_t pba_cksel = 0;
+ uint32_t pbb_cksel = 0;
+ uint32_t pbc_cksel = 0;
+
+ Assert(cpu_shift <= pba_shift);
+ Assert(cpu_shift <= pbb_shift);
+
+ if (cpu_shift > 0)
+ cpu_cksel = ((cpu_shift - 1) << AVR32_PM_CPUSEL)
+ | (1U << AVR32_PM_CPUDIV);
+
+ if (pba_shift > 0)
+ pba_cksel = ((pba_shift - 1) << AVR32_PM_PBASEL)
+ | (1U << AVR32_PM_PBADIV);
+
+ if (pbb_shift > 0)
+ pbb_cksel = ((pbb_shift - 1) << AVR32_PM_PBBSEL)
+ | (1U << AVR32_PM_PBBDIV);
+
+ if (pbc_shift > 0)
+ pbc_cksel = ((pbc_shift - 1) << AVR32_PM_PBCSEL)
+ | (1U << AVR32_PM_PBCDIV);
+
+ flags = cpu_irq_save();
+ AVR32_PM.unlock = 0xaa000000 | AVR32_PM_CPUSEL;
+ AVR32_PM.cpusel = cpu_cksel;
+ AVR32_PM.unlock = 0xaa000000 | AVR32_PM_PBASEL;
+ AVR32_PM.pbasel = pba_cksel;
+ AVR32_PM.unlock = 0xaa000000 | AVR32_PM_PBBSEL;
+ AVR32_PM.pbbsel = pbb_cksel;
+ AVR32_PM.unlock = 0xaa000000 | AVR32_PM_PBCSEL;
+ AVR32_PM.pbbsel = pbc_cksel;
+ cpu_irq_restore(flags);
+}
+
+/**
+ * \brief Change the source of the main system clock.
+ *
+ * \param src The new system clock source. Must be one of the constants
+ * from the <em>System Clock Sources</em> section.
+ */
+void sysclk_set_source(uint_fast8_t src)
+{
+ irqflags_t flags;
+
+ Assert(src <= SYSCLK_SRC_RC8M);
+
+ flags = cpu_irq_save();
+ AVR32_PM.unlock = 0xaa000000 | AVR32_PM_MCCTRL;
+ AVR32_PM.mcctrl = src;
+ cpu_irq_restore(flags);
+}
+
+#if defined(CONFIG_USBCLK_SOURCE) || defined(__DOXYGEN__)
+/**
+ * \brief Enable the USB generic clock
+ *
+ * \pre The USB generick clock must be configurated to 48MHz.
+ * CONFIG_USBCLK_SOURCE and CONFIG_USBCLK_DIV must be defined with proper
+ * configuration. The selected clock source must also be configured.
+ */
+void sysclk_enable_usb(void)
+{
+ struct genclk_config gcfg;
+
+ genclk_config_defaults(&gcfg, AVR32_USBC_GCLK_NUM);
+
+ /*
+ * Switch to the system clock selected by the user.
+ */
+ switch (CONFIG_USBCLK_SOURCE) {
+#ifdef BOARD_OSC0_HZ
+ case USBCLK_SRC_OSC0:
+ osc_enable(OSC_ID_OSC0);
+ osc_wait_ready(OSC_ID_OSC0);
+ genclk_config_set_source(&gcfg, GENCLK_SRC_OSC0);
+ break;
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case USBCLK_SRC_OSC1:
+ osc_enable(OSC_ID_OSC1);
+ osc_wait_ready(OSC_ID_OSC1);
+ genclk_config_set_source(&gcfg, GENCLK_SRC_OSC1);
+ break;
+#endif
+
+#ifdef CONFIG_PLL0_SOURCE
+ case USBCLK_SRC_PLL0: {
+ struct pll_config pllcfg;
+ pll_enable_source_sync(CONFIG_PLL0_SOURCE);
+ pll_config_defaults(&pllcfg, 0);
+ pll_enable(&pllcfg, 0);
+ pll_wait_for_lock(0);
+ genclk_config_set_source(&gcfg, GENCLK_SRC_PLL0);
+ break;
+ }
+#endif
+
+#ifdef CONFIG_PLL1_SOURCE
+ case USBCLK_SRC_PLL1: {
+ struct pll_config pllcfg;
+ pll_enable_source_sync(CONFIG_PLL1_SOURCE);
+ pll_config_defaults(&pllcfg, 1);
+ pll_enable(&pllcfg, 1);
+ pll_wait_for_lock(1);
+ genclk_config_set_source(&gcfg, GENCLK_SRC_PLL1);
+ break;
+ }
+#endif
+
+ default:
+ /* unhandled_case(CONFIG_USBCLK_SOURCE); */
+ break;
+ }
+
+ genclk_config_set_divider(&gcfg, CONFIG_USBCLK_DIV);
+ genclk_enable(&gcfg, AVR32_USBC_GCLK_NUM);
+}
+
+/**
+ * \brief Disable the USB generic clock
+ */
+void sysclk_disable_usb(void)
+{
+ genclk_disable(AVR32_USBC_GCLK_NUM);
+}
+#endif // CONFIG_USBCLK_SOURCE
+
+
+void sysclk_init(void)
+{
+ /* Set up system clock dividers if different from defaults */
+ if ((CONFIG_SYSCLK_CPU_DIV > 0) || (CONFIG_SYSCLK_PBA_DIV > 0) ||
+ (CONFIG_SYSCLK_PBB_DIV > 0) || (CONFIG_SYSCLK_PBC_DIV > 0)) {
+ sysclk_set_prescalers(CONFIG_SYSCLK_CPU_DIV,
+ CONFIG_SYSCLK_PBA_DIV,
+ CONFIG_SYSCLK_PBB_DIV,
+ CONFIG_SYSCLK_PBC_DIV);
+ }
+
+ /* Switch to system clock selected by user */
+ switch (CONFIG_SYSCLK_SOURCE) {
+ case SYSCLK_SRC_RCSYS:
+ /* Already running from RCSYS */
+ break;
+
+#ifdef BOARD_OSC0_HZ
+ case SYSCLK_SRC_OSC0:
+ osc_enable(OSC_ID_OSC0);
+ osc_wait_ready(OSC_ID_OSC0);
+ sysclk_set_source(SYSCLK_SRC_OSC0);
+ break;
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case SYSCLK_SRC_OSC1:
+ osc_enable(OSC_ID_OSC1);
+ osc_wait_ready(OSC_ID_OSC1);
+ sysclk_set_source(SYSCLK_SRC_OSC1);
+ break;
+#endif
+
+#ifdef CONFIG_PLL0_SOURCE
+ case SYSCLK_SRC_PLL0: {
+ struct pll_config pllcfg;
+
+ pll_enable_source_sync(CONFIG_PLL0_SOURCE);
+ pll_config_defaults(&pllcfg, 0);
+ pll_enable(&pllcfg, 0);
+ pll_wait_for_lock(0);
+ // Set a flash wait state depending on the new cpu frequency.
+ flash_set_bus_freq(sysclk_get_main_hz());
+ sysclk_set_source(SYSCLK_SRC_PLL0);
+ break;
+ }
+#endif
+
+#ifdef CONFIG_PLL1_SOURCE
+ case SYSCLK_SRC_PLL1: {
+ struct pll_config pllcfg;
+
+ pll_enable_source_sync(CONFIG_PLL1_SOURCE);
+ pll_config_defaults(&pllcfg, 1);
+ pll_enable(&pllcfg, 1);
+ pll_wait_for_lock(1);
+ // Set a flash wait state depending on the new cpu frequency.
+ flash_set_bus_freq(sysclk_get_main_hz());
+ sysclk_set_source(SYSCLK_SRC_PLL1);
+ break;
+ }
+#endif
+
+ case SYSCLK_SRC_RC8M:
+ osc_enable(OSC_ID_RC8M);
+ osc_wait_ready(OSC_ID_RC8M);
+ sysclk_set_source(SYSCLK_SRC_RC8M);
+ break;
+ }
+
+ /* If the user has specified clock masks, enable only requested clocks */
+#if defined(CONFIG_SYSCLK_INIT_CPUMASK)
+ AVR32_PM.cpumask = SYSCLK_INIT_MINIMAL_CPUMASK | CONFIG_SYSCLK_INIT_CPUMASK;
+#endif
+#if defined(CONFIG_SYSCLK_INIT_PBAMASK)
+ AVR32_PM.pbamask = SYSCLK_INIT_MINIMAL_PBAMASK | CONFIG_SYSCLK_INIT_PBAMASK;
+#endif
+#if defined(CONFIG_SYSCLK_INIT_PBBMASK)
+ AVR32_PM.pbbmask = SYSCLK_INIT_MINIMAL_PBBMASK | CONFIG_SYSCLK_INIT_PBBMASK;
+#endif
+#if defined(CONFIG_SYSCLK_INIT_PBCMASK)
+ AVR32_PM.pbcmask = SYSCLK_INIT_MINIMAL_PBCMASK | CONFIG_SYSCLK_INIT_PBCMASK;
+#endif
+#if defined(CONFIG_SYSCLK_INIT_HSBMASK)
+ AVR32_PM.hsbmask = SYSCLK_INIT_MINIMAL_HSBMASK | CONFIG_SYSCLK_INIT_HSBMASK;
+#endif
+
+#if (defined CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC)
+ /* Signal that the internal frequencies are setup */
+ sysclk_initialized = true;
+#endif
+}
+
+//! @}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.h
new file mode 100644
index 0000000..32618b4
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/services/clock/uc3c/sysclk.h
@@ -0,0 +1,1169 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific system clock management functions
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CHIP_SYSCLK_H_INCLUDED
+#define CHIP_SYSCLK_H_INCLUDED
+
+#include <board.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Bugzilla #11808
+#ifndef AVR32_PDCA_CLK_PBC
+#define AVR32_PDCA_CLK_PBC 128
+#endif
+
+#ifndef AVR32_MDMA_CLK_PBC
+#define AVR32_MDMA_CLK_PBC 129
+#endif
+
+#ifndef AVR32_USART1_CLK_PBC
+#define AVR32_USART1_CLK_PBC 130
+#endif
+
+#ifndef AVR32_SPI0_CLK_PBC
+#define AVR32_SPI0_CLK_PBC 131
+#endif
+
+#ifndef AVR32_CANIF_CLK_PBC
+#define AVR32_CANIF_CLK_PBC 132
+#endif
+
+#ifndef AVR32_TC0_CLK_PBC
+#define AVR32_TC0_CLK_PBC 133
+#endif
+
+#ifndef AVR32_ADCIFA_CLK_PBC
+#define AVR32_ADCIFA_CLK_PBC 134
+#endif
+/**
+ * \weakgroup sysclk_group
+ * @{
+ */
+
+//! \name Configuration Symbols
+//@{
+/**
+ * \def CONFIG_SYSCLK_SOURCE
+ * \brief Initial/static main system clock source
+ *
+ * The main system clock will be configured to use this clock during
+ * initialization.
+ */
+#ifndef CONFIG_SYSCLK_SOURCE
+# define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCSYS
+#endif
+/**
+ * \def CONFIG_SYSCLK_CPU_DIV
+ * \brief Initial/static CPU/HSB/PBB clock divider (log2)
+ *
+ * The CPU, HSB and PBA clocks will run at
+ * \f[
+ * f_{cpu} = \frac{f_{sys}}{2^\mathrm{CONFIG\_SYSCLK\_CPU\_DIV}}\,\mbox{Hz}
+ * \f]
+ * after initialization.
+ */
+#ifndef CONFIG_SYSCLK_CPU_DIV
+# define CONFIG_SYSCLK_CPU_DIV 0
+#endif
+/**
+ * \def CONFIG_SYSCLK_PBA_DIV
+ * \brief Initial/static PBA clock divider (log2)
+ *
+ * The PBA clock will run at
+ * \f[
+ * f_{PBA} = \frac{f_{sys}}{2^\mathrm{CONFIG\_SYSCLK\_PBA\_DIV}}\,\mbox{Hz}
+ * \f]
+ * after initialization.
+ */
+#ifndef CONFIG_SYSCLK_PBA_DIV
+# define CONFIG_SYSCLK_PBA_DIV 0
+#endif
+/**
+ * \def CONFIG_SYSCLK_PBB_DIV
+ * \brief Initial/static PBB clock divider (log2)
+ *
+ * The PBB clock will run at
+ * \f[
+ * f_{PBB} = \frac{f_{sys}}{2^\mathrm{CONFIG\_SYSCLK\_PBB\_DIV}}\,\mbox{Hz}
+ * \f]
+ * after initialization.
+ */
+#ifndef CONFIG_SYSCLK_PBB_DIV
+# define CONFIG_SYSCLK_PBB_DIV 0
+#endif
+/**
+ * \def CONFIG_SYSCLK_PBC_DIV
+ * \brief Initial/static PBC clock divider (log2)
+ *
+ * The PBC clock will run at
+ * \f[
+ * f_{PBC} = \frac{f_{sys}}{2^\mathrm{CONFIG\_SYSCLK\_PBC\_DIV}}\,\mbox{Hz}
+ * \f]
+ * after initialization.
+ */
+#ifndef CONFIG_SYSCLK_PBC_DIV
+# define CONFIG_SYSCLK_PBC_DIV 0
+#endif
+
+/**
+ * \def CONFIG_SYSCLK_INIT_CPUMASK
+ * \brief Configuration symbol for the CPU clocks enabled at power-on after the
+ * sysclock module has been initialized. By default, all CPU clocks are left
+ * enabled, however to save power these can be automatically disabled by defining
+ * this value to a mask of \c SYSCLOCK_xxx settings.
+ *
+ * If this symbol is not defined, then all CPU clocks are left enabled.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_SYSCLK_INIT_CPUMASK
+#endif
+
+/**
+ * \def CONFIG_SYSCLK_INIT_PBAMASK
+ * \brief Configuration symbol for the PBA clocks enabled at power-on after the
+ * sysclock module has been initialized. By default, all PBA clocks are left
+ * enabled, however to save power these can be automatically disabled by defining
+ * this value to a mask of \c SYSCLOCK_xxx settings.
+ *
+ * If this symbol is not defined, then all PBA clocks are left enabled.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_SYSCLK_INIT_PBAMASK
+#endif
+
+/**
+ * \def CONFIG_SYSCLK_INIT_PBBMASK
+ * \brief Configuration symbol for the PBB clocks enabled at power-on after the
+ * sysclock module has been initialized. By default, all PBB clocks are left
+ * enabled, however to save power these can be automatically disabled by defining
+ * this value to a mask of \c SYSCLOCK_xxx settings.
+ *
+ * If this symbol is not defined, then all PBB clocks are left enabled.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_SYSCLK_INIT_PBBMASK
+#endif
+
+/**
+ * \def CONFIG_SYSCLK_INIT_PBCMASK
+ * \brief Configuration symbol for the PBC clocks enabled at power-on after the
+ * sysclock module has been initialized. By default, all PBC clocks are left
+ * enabled, however to save power these can be automatically disabled by defining
+ * this value to a mask of \c SYSCLOCK_xxx settings.
+ *
+ * If this symbol is not defined, then all PBC clocks are left enabled.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_SYSCLK_INIT_PBCMASK
+#endif
+//@}
+
+//! \name System clock source
+//@{
+#define SYSCLK_SRC_RCSYS 0 //!< System RC oscillator
+#define SYSCLK_SRC_OSC0 1 //!< Oscillator 0
+#define SYSCLK_SRC_OSC1 2 //!< Oscillator 1
+#define SYSCLK_SRC_PLL0 3 //!< Phase Locked Loop 0
+#define SYSCLK_SRC_PLL1 4 //!< Phase Locked Loop 1
+#define SYSCLK_SRC_RC8M 5 //!< 8 MHz RC oscillator
+//@}
+
+//! \name USB Clock Sources
+//@{
+#define USBCLK_SRC_OSC0 1 //!< Use OSC0
+#define USBCLK_SRC_OSC1 2 //!< Use OSC1
+#define USBCLK_SRC_PLL0 3 //!< Use PLL0
+#define USBCLK_SRC_PLL1 4 //!< Use PLL1
+//@}
+
+//! \name Clocks derived from the CPU clock
+//@{
+//! On-Chip Debug system
+#define SYSCLK_OCD AVR32_OCD_CLK_CPU
+//! COUNT/COMPARE system registers
+#define SYSCLK_SYSTIMER AVR32_CORE_CLK_CPU_COUNT
+//@}
+
+//! \name Clocks derived from the HSB clock
+//@{
+//! Secure Access Unit HSB interface
+#define SYSCLK_SAU_HSB (AVR32_SAU_CLK_HSB % 32)
+//! PDCA memory interface
+#define SYSCLK_PDCA_HSB (AVR32_PDCA_CLK_HSB % 32)
+//! MDMA memory interface
+#define SYSCLK_MDMA_HSB (AVR32_MDMA_CLK_HSB % 32)
+//! USBC DMA and FIFO interface
+#define SYSCLK_USBC_DATA (AVR32_USBC_CLK_HSB % 32)
+//! CANIF DMA interface
+#define SYSCLK_CANIF_DATA (AVR32_CANIF_CLK_HSB % 32)
+//! Flash data interface
+#define SYSCLK_FLASHC_DATA (AVR32_FLASHC_CLK_HSB % 32)
+//! HSB<->PBA bridge
+#define SYSCLK_PBA_BRIDGE (AVR32_HMATRIX_CLK_HSB_PBA_BRIDGE % 32)
+//! HSB<->PBB bridge
+#define SYSCLK_PBB_BRIDGE (AVR32_HMATRIX_CLK_HSB_PBB_BRIDGE % 32)
+//! HSB<->PBC bridge
+#define SYSCLK_PBC_BRIDGE (AVR32_HMATRIX_CLK_HSB_PBC_BRIDGE % 32)
+//! HSB RAM
+#define SYSCLK_HSB_RAM (AVR32_RAM_CLK_HSB % 32)
+//! External Bus Interface
+#define SYSCLK_EBI (AVR32_EBI_CLK_HSB % 32)
+//! Peripheral Event Controller
+#define SYSCLK_PEVC_HSB (AVR32_PEVC_CLK_HSB % 32)
+//@}
+
+//! \name Clocks derived from the PBA clock
+//@{
+//! Internal interrupt controller
+#define SYSCLK_INTC (AVR32_INTC_CLK_PBA % 32)
+//! PM/RTC/EIM configuration
+#define SYSCLK_PM (AVR32_PM_CLK_PBA % 32)
+//! System Control Interface
+#define SYSCLK_SCIF (AVR32_SCIF_CLK_PBA % 32)
+//! Asynchronous Timer
+#define SYSCLK_AST (AVR32_AST_CLK_PBA % 32)
+//! Watchdog Timer
+#define SYSCLK_WDT (AVR32_WDT_CLK_PBA % 32)
+//! External Interrupt Controller
+#define SYSCLK_EIC (AVR32_EIC_CLK_PBA % 32)
+//! Frequency Meter
+#define SYSCLK_FREQM (AVR32_FREQM_CLK_PBA % 32)
+//! General-Purpose I/O
+#define SYSCLK_GPIO (AVR32_GPIO_CLK_PBA % 32)
+//! USART 0
+#define SYSCLK_USART0 (AVR32_USART0_CLK_PBA % 32)
+//! USART 2
+#define SYSCLK_USART2 (AVR32_USART2_CLK_PBA % 32)
+//! USART 3
+#define SYSCLK_USART3 (AVR32_USART3_CLK_PBA % 32)
+//! SPI Controller 1
+#define SYSCLK_SPI1 (AVR32_SPI1_CLK_PBA % 32)
+//! TWI Master 0
+#define SYSCLK_TWIM0 (AVR32_TWIM0_CLK_PBA % 32)
+//! TWI Master 1
+#define SYSCLK_TWIM1 (AVR32_TWIM1_CLK_PBA % 32)
+//! TWI Slave 0
+#define SYSCLK_TWIS0 (AVR32_TWIS0_CLK_PBA % 32)
+//! TWI Slave 1
+#define SYSCLK_TWIS1 (AVR32_TWIS1_CLK_PBA % 32)
+//! Pulse Width Modulator
+#define SYSCLK_PWM (AVR32_PWM_CLK_PBA % 32)
+//! Quadrature Decoder 0
+#define SYSCLK_QDEC0 (AVR32_QDEC0_CLK_PBA % 32)
+//! Quadrature Decoder 1
+#define SYSCLK_QDEC1 (AVR32_QDEC1_CLK_PBA % 32)
+//! Timer/Counter 1
+#define SYSCLK_TC1 (AVR32_TC1_CLK_PBA % 32)
+//! Peripheral Event Controller
+#define SYSCLK_PEVC_REGS (AVR32_PEVC_CLK_PBA % 32)
+//! Analog Comparator 0
+#define SYSCLK_ACIFA0 (AVR32_ACIFA0_CLK_PBA % 32)
+//! Analog Comparator 1
+#define SYSCLK_ACIFA1 (AVR32_ACIFA1_CLK_PBA % 32)
+//! D/A Converter 0
+#define SYSCLK_DACIFB0 (AVR32_DACIFB0_CLK_PBA % 32)
+//! D/A Converter 1
+#define SYSCLK_DACIFB1 (AVR32_DACIFB1_CLK_PBA % 32)
+//! aWire UART
+#define SYSCLK_AW (AVR32_AW_CLK_PBA % 32)
+//@}
+
+//! \name Clocks derived from the PBB clock
+//@{
+//! Flash Controller registers
+#define SYSCLK_FLASHC_REGS (AVR32_FLASHC_CLK_PBB % 32)
+//! USBB registers
+#define SYSCLK_USBC_REGS (AVR32_USBC_CLK_PBB % 32)
+//! HSB Matrix configuration
+#define SYSCLK_HMATRIX (AVR32_HMATRIX_CLK_PBB % 32)
+//! Secure Access Unit register
+#define SYSCLK_SAU_REGS (AVR32_SAU_CLK_PBB % 32)
+//! Static Memory Controller registers
+#define SYSCLK_SMC_REGS (AVR32_SMC_CLK_PBB % 32)
+//! SDRAM Controller registers
+#define SYSCLK_SDRAMC_REGS (AVR32_SDRAMC_CLK_PBB % 32)
+//@}
+
+//! \name Clocks derived from the PBC clock
+//@{
+//! PDCA peripheral bus interface
+#define SYSCLK_PDCA_PB (AVR32_PDCA_CLK_PBC % 32)
+//! MDMA registers
+#define SYSCLK_MDMA_REGS (AVR32_MDMA_CLK_PBC % 32)
+//! USART 1
+#define SYSCLK_USART1 (AVR32_USART1_CLK_PBC % 32)
+//! SPI Controller 0
+#define SYSCLK_SPI0 (AVR32_SPI0_CLK_PBC % 32)
+//! CANIF registers
+#define SYSCLK_CANIF_REGS (AVR32_CANIF_CLK_PBC % 32)
+//! Timer/Counter 0
+#define SYSCLK_TC0 (AVR32_TC0_CLK_PBC % 32)
+//! A/D Converter
+#define SYSCLK_ADCIFA (AVR32_ADCIFA_CLK_PBC % 32)
+//@}
+
+#ifndef __ASSEMBLY__
+
+#include <avr32/io.h>
+#include <osc.h>
+#include <pll.h>
+#include <genclk.h>
+
+// Use the slow clock (RCOSC) with no prescaling if config was empty.
+#ifndef CONFIG_SYSCLK_SOURCE
+# define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_RCSYS
+#endif /* CONFIG_SYSCLK_SOURCE */
+
+/**
+ * \def CONFIG_SYSCLK_CPU_DIV
+ * \brief Configuration symbol for dividing the CPU clock frequency by
+ * \f$2^{CONFIG\_SYSCLK\_CPU\_DIV}\f$
+ *
+ * If this symbol is not defined, the CPU clock frequency is not divided.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifndef CONFIG_SYSCLK_CPU_DIV
+# define CONFIG_SYSCLK_CPU_DIV 0
+#endif /* CONFIG_SYSCLK_CPU_DIV */
+
+/**
+ * \def CONFIG_SYSCLK_INIT_HSBMASK
+ * \brief Configuration symbol for the HSB clocks enabled at power-on after the
+ * sysclock module has been initialized. By default, all HSB clocks are left
+ * enabled, however to save power these can be automatically disabled by defining
+ * this value to a mask of \c SYSCLOCK_xxx settings.
+ *
+ * If this symbol is not defined, then all HSB clocks are left enabled.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_SYSCLK_INIT_HSBMASK
+#endif
+
+/**
+ * \def CONFIG_SYSCLK_PBA_DIV
+ * \brief Configuration symbol for dividing the PBA clock frequency by
+ * \f$2^{CONFIG\_SYSCLK\_PBA\_DIV}\f$
+ *
+ * If this symbol is not defined, the PBA clock frequency is not divided.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifndef CONFIG_SYSCLK_PBA_DIV
+# define CONFIG_SYSCLK_PBA_DIV 0
+#endif /* CONFIG_SYSCLK_PBA_DIV */
+
+/**
+ * \def CONFIG_SYSCLK_PBB_DIV
+ * \brief Configuration symbol for dividing the PBB clock frequency by
+ * \f$2^{CONFIG\_SYSCLK\_PBB\_DIV}\f$
+ *
+ * If this symbol is not defined, the PBB clock frequency is not divided.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifndef CONFIG_SYSCLK_PBB_DIV
+# define CONFIG_SYSCLK_PBB_DIV 0
+#endif /* CONFIG_SYSCLK_PBB_DIV */
+
+/**
+ * \def CONFIG_SYSCLK_PBC_DIV
+ * \brief Configuration symbol for dividing the PBC clock frequency by
+ * \f$2^{CONFIG\_SYSCLK\_PBC\_DIV}\f$
+ *
+ * If this symbol is not defined, the PBC clock frequency is not divided.
+ *
+ * This symbol may be defined in \ref conf_clock.h.
+ */
+#ifndef CONFIG_SYSCLK_PBC_DIV
+# define CONFIG_SYSCLK_PBC_DIV 0
+#endif /* CONFIG_SYSCLK_PBC_DIV */
+
+/**
+ * \def CONFIG_USBCLK_SOURCE
+ * \brief Configuration symbol for the USB generic clock source
+ *
+ * Sets the clock source to use for the USB. The source must also be properly
+ * configured.
+ *
+ * Define this to one of the \c USBCLK_SRC_xxx settings. Leave it undefined if
+ * USB is not required.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_USBCLK_SOURCE
+#endif
+
+/**
+ * \def CONFIG_USBCLK_DIV
+ * \brief Configuration symbol for the USB generic clock divider setting
+ *
+ * Sets the clock division for the USB generic clock. If a USB clock source is
+ * selected with CONFIG_USBCLK_SOURCE, this configuration symbol must also be
+ * defined.
+ *
+ * Define this as any value that does not exceed \c GENCLK_DIV_MAX, and which
+ * will give a 48 MHz clock frequency from the selected source.
+ */
+#ifdef __DOXYGEN__
+# define CONFIG_USBCLK_DIV
+#endif
+
+/**
+ * \name Querying the system clock and its derived clocks
+ *
+ * The following functions may be used to query the current frequency of
+ * the system clock and the CPU and bus clocks derived from it.
+ * sysclk_get_main_hz() and sysclk_get_cpu_hz() can be assumed to be
+ * available on all platforms, although some platforms may define
+ * additional accessors for various chip-internal bus clocks. These are
+ * usually not intended to be queried directly by generic code.
+ */
+//@{
+
+/**
+ * \brief Return the current rate in Hz of the main system clock
+ *
+ * \todo This function assumes that the main clock source never changes
+ * once it's been set up, and that PLL0 always runs at the compile-time
+ * configured default rate. While this is probably the most common
+ * configuration, which we want to support as a special case for
+ * performance reasons, we will at some point need to support more
+ * dynamic setups as well.
+ */
+#if (defined CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC)
+extern bool sysclk_initialized;
+#endif
+static inline uint32_t sysclk_get_main_hz(void)
+{
+#if (defined CONFIG_SYSCLK_DEFAULT_RETURNS_SLOW_OSC)
+ if (!sysclk_initialized ) {
+ return OSC_RCSYS_NOMINAL_HZ;
+ }
+#endif
+
+ switch (CONFIG_SYSCLK_SOURCE) {
+ case SYSCLK_SRC_RCSYS:
+ return OSC_RCSYS_NOMINAL_HZ;
+
+#ifdef BOARD_OSC0_HZ
+ case SYSCLK_SRC_OSC0:
+ return BOARD_OSC0_HZ;
+#endif
+
+#ifdef BOARD_OSC1_HZ
+ case SYSCLK_SRC_OSC1:
+ return BOARD_OSC1_HZ;
+#endif
+
+#ifdef CONFIG_PLL0_SOURCE
+ case SYSCLK_SRC_PLL0:
+ return pll_get_default_rate(0);
+#endif
+
+#ifdef CONFIG_PLL1_SOURCE
+ case SYSCLK_SRC_PLL1:
+ return pll_get_default_rate(1);
+#endif
+
+ case SYSCLK_SRC_RC8M:
+ return OSC_RC8M_NOMINAL_HZ;
+
+ default:
+ /* unhandled_case(CONFIG_SYSCLK_SOURCE); */
+ return 0;
+ }
+}
+
+/**
+ * \brief Return the current rate in Hz of the CPU clock
+ *
+ * \todo This function assumes that the CPU always runs at the system
+ * clock frequency. We want to support at least two more scenarios:
+ * Fixed CPU/bus clock dividers (config symbols) and dynamic CPU/bus
+ * clock dividers (which may change at run time). Ditto for all the bus
+ * clocks.
+ *
+ * \return Frequency of the CPU clock, in Hz.
+ */
+static inline uint32_t sysclk_get_cpu_hz(void)
+{
+ return sysclk_get_main_hz() >> CONFIG_SYSCLK_CPU_DIV;
+}
+
+/**
+ * \brief Return the current rate in Hz of the High-Speed Bus clock
+ *
+ * \return Frequency of the High Speed Peripheral Bus clock, in Hz.
+ */
+static inline uint32_t sysclk_get_hsb_hz(void)
+{
+ return sysclk_get_main_hz() >> CONFIG_SYSCLK_CPU_DIV;
+}
+
+/**
+ * \brief Return the current rate in Hz of the Peripheral Bus A clock
+ *
+ * \return Frequency of the Peripheral Bus A clock, in Hz.
+ */
+static inline uint32_t sysclk_get_pba_hz(void)
+{
+ return sysclk_get_main_hz() >> CONFIG_SYSCLK_PBA_DIV;
+}
+
+/**
+ * \brief Return the current rate in Hz of the Peripheral Bus B clock
+ *
+ * \return Frequency of the Peripheral Bus B clock, in Hz.
+ */
+static inline uint32_t sysclk_get_pbb_hz(void)
+{
+ return sysclk_get_main_hz() >> CONFIG_SYSCLK_CPU_DIV;
+}
+
+/**
+ * \brief Return the current rate in Hz of the Peripheral Bus C clock
+ *
+ * \return Frequency of the Peripheral Bus C clock, in Hz.
+ */
+static inline uint32_t sysclk_get_pbc_hz(void)
+{
+ return sysclk_get_main_hz() >> CONFIG_SYSCLK_PBC_DIV;
+}
+
+/**
+ * \brief Retrieves the current rate in Hz of the Peripheral Bus clock attached
+ * to the specified peripheral.
+ *
+ * \param module Pointer to the module's base address.
+ *
+ * \return Frequency of the bus attached to the specified peripheral, in Hz.
+ */
+static inline uint32_t sysclk_get_peripheral_bus_hz(const volatile void *module)
+{
+ /* Fallthroughs intended for modules sharing the same peripheral bus. */
+ switch ((uintptr_t)module) {
+ case AVR32_INTC_ADDRESS:
+ case AVR32_PM_ADDRESS:
+ case AVR32_SCIF_ADDRESS:
+ case AVR32_AST_ADDRESS:
+ case AVR32_WDT_ADDRESS:
+ case AVR32_EIC_ADDRESS:
+ case AVR32_FREQM_ADDRESS:
+ case AVR32_GPIO_ADDRESS:
+ case AVR32_USART0_ADDRESS:
+ case AVR32_USART2_ADDRESS:
+ case AVR32_USART3_ADDRESS:
+ case AVR32_SPI1_ADDRESS:
+ case AVR32_TWIM0_ADDRESS:
+ case AVR32_TWIM1_ADDRESS:
+ case AVR32_TWIS0_ADDRESS:
+ case AVR32_TWIS1_ADDRESS:
+ case AVR32_PWM_ADDRESS:
+ case AVR32_QDEC0_ADDRESS:
+ case AVR32_QDEC1_ADDRESS:
+ case AVR32_TC1_ADDRESS:
+ case AVR32_PEVC_ADDRESS:
+ case AVR32_ACIFA0_ADDRESS:
+ case AVR32_ACIFA1_ADDRESS:
+ case AVR32_DACIFB0_ADDRESS:
+ case AVR32_DACIFB1_ADDRESS:
+ case AVR32_AW_ADDRESS:
+ return sysclk_get_pba_hz();
+
+ case AVR32_FLASHC_ADDRESS:
+ case AVR32_USBC_ADDRESS:
+ case AVR32_HMATRIXB_ADDRESS:
+ case AVR32_SAU_ADDRESS:
+#if defined(AVR32_SMC_ADDRESS)
+ case AVR32_SMC_ADDRESS:
+#endif
+#if defined(AVR32_SDRAMC_ADDRESS)
+ case AVR32_SDRAMC_ADDRESS:
+#endif
+ return sysclk_get_pbb_hz();
+
+ case AVR32_PDCA_ADDRESS:
+ case AVR32_MDMA_ADDRESS:
+ case AVR32_USART1_ADDRESS:
+ case AVR32_SPI0_ADDRESS:
+ case AVR32_CANIF_ADDRESS:
+ case AVR32_TC0_ADDRESS:
+ case AVR32_ADCIFA_ADDRESS:
+ return sysclk_get_pbc_hz();
+
+ default:
+ Assert(false);
+ return 0;
+ }
+}
+
+//@}
+
+extern void sysclk_priv_enable_module(unsigned int bus_id,
+ unsigned int module_index);
+extern void sysclk_priv_disable_module(unsigned int bus_id,
+ unsigned int module_index);
+
+//! \name Enabling and disabling synchronous clocks
+//@{
+
+/**
+ * \brief Enable a module clock derived from the CPU clock
+ * \param index Index of the module clock in the CPUMASK register
+ */
+static inline void sysclk_enable_cpu_module(unsigned int index)
+{
+ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_CPU, index);
+}
+
+/**
+ * \brief Disable a module clock derived from the CPU clock
+ * \param index Index of the module clock in the CPUMASK register
+ */
+static inline void sysclk_disable_cpu_module(unsigned int index)
+{
+ sysclk_priv_disable_module(AVR32_PM_CLK_GRP_CPU, index);
+}
+
+/**
+ * \brief Enable a module clock derived from the HSB clock
+ * \param index Index of the module clock in the HSBMASK register
+ */
+static inline void sysclk_enable_hsb_module(unsigned int index)
+{
+ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_HSB, index);
+}
+
+/**
+ * \brief Disable a module clock derived from the HSB clock
+ * \param index Index of the module clock in the HSBMASK register
+ */
+static inline void sysclk_disable_hsb_module(unsigned int index)
+{
+ sysclk_priv_disable_module(AVR32_PM_CLK_GRP_HSB, index);
+}
+
+/**
+ * \brief Enable a module clock derived from the PBA clock
+ * \param index Index of the module clock in the PBAMASK register
+ */
+static inline void sysclk_enable_pba_module(unsigned int index)
+{
+ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_PBA, index);
+}
+
+/**
+ * \brief Disable a module clock derived from the PBA clock
+ * \param index Index of the module clock in the PBAMASK register
+ */
+static inline void sysclk_disable_pba_module(unsigned int index)
+{
+ sysclk_priv_disable_module(AVR32_PM_CLK_GRP_PBA, index);
+}
+
+/**
+ * \brief Enable a module clock derived from the PBB clock
+ * \param index Index of the module clock in the PBBMASK register
+ */
+static inline void sysclk_enable_pbb_module(unsigned int index)
+{
+ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_PBB, index);
+}
+
+/**
+ * \brief Disable a module clock derived from the PBB clock
+ * \param index Index of the module clock in the PBBMASK register
+ */
+static inline void sysclk_disable_pbb_module(unsigned int index)
+{
+ sysclk_priv_disable_module(AVR32_PM_CLK_GRP_PBB, index);
+}
+
+/**
+ * \brief Enable a module clock derived from the PBC clock
+ * \param index Index of the module clock in the PBCMASK register
+ */
+static inline void sysclk_enable_pbc_module(unsigned int index)
+{
+ sysclk_priv_enable_module(AVR32_PM_CLK_GRP_PBC, index);
+}
+
+/**
+ * \brief Disable a module clock derived from the PBC clock
+ * \param index Index of the module clock in the PBCMASK register
+ */
+static inline void sysclk_disable_pbc_module(unsigned int index)
+{
+ sysclk_priv_disable_module(AVR32_PM_CLK_GRP_PBC, index);
+}
+
+/**
+ * \brief Enable a peripheral's clock from its base address.
+ *
+ * Enables the clock to a peripheral, given its base address. If the peripheral
+ * has an associated clock on the HSB bus, this will be enabled also.
+ *
+ * \param module Pointer to the module's base address.
+ */
+static inline void sysclk_enable_peripheral_clock(const volatile void *module)
+{
+ switch ((uintptr_t)module) {
+ case AVR32_INTC_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_INTC);
+ break;
+
+ case AVR32_PM_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_PM);
+ break;
+
+ case AVR32_SCIF_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_SCIF);
+ break;
+
+ case AVR32_AST_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_AST);
+ break;
+
+ case AVR32_WDT_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_WDT);
+ break;
+
+ case AVR32_EIC_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_EIC);
+ break;
+
+ case AVR32_FREQM_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_FREQM);
+ break;
+
+ case AVR32_GPIO_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_GPIO);
+ break;
+
+ case AVR32_USART0_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_USART0);
+ break;
+
+ case AVR32_USART2_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_USART2);
+ break;
+
+ case AVR32_USART3_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_USART2);
+ break;
+
+ case AVR32_SPI1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_SPI1);
+ break;
+
+ case AVR32_TWIM0_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_TWIM0);
+ break;
+
+ case AVR32_TWIM1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_TWIM1);
+ break;
+
+ case AVR32_TWIS0_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_TWIS0);
+ break;
+
+ case AVR32_TWIS1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_TWIS1);
+ break;
+
+ case AVR32_PWM_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_PWM);
+ break;
+
+ case AVR32_QDEC0_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_QDEC0);
+ break;
+
+ case AVR32_QDEC1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_QDEC1);
+ break;
+
+ case AVR32_TC1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_TC1);
+ break;
+
+ case AVR32_PEVC_ADDRESS:
+ sysclk_enable_hsb_module(SYSCLK_PEVC_HSB);
+ sysclk_enable_pba_module(SYSCLK_PEVC_REGS);
+ break;
+
+ case AVR32_ACIFA0_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_ACIFA0);
+ break;
+
+ case AVR32_ACIFA1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_ACIFA1);
+ break;
+
+ case AVR32_DACIFB0_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_DACIFB0);
+ break;
+
+ case AVR32_DACIFB1_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_DACIFB1);
+ break;
+
+ case AVR32_AW_ADDRESS:
+ sysclk_enable_pba_module(SYSCLK_AW);
+ break;
+
+ case AVR32_FLASHC_ADDRESS:
+ sysclk_enable_hsb_module(SYSCLK_FLASHC_DATA);
+ sysclk_enable_pbb_module(SYSCLK_FLASHC_REGS);
+ break;
+
+ case AVR32_USBC_ADDRESS:
+ sysclk_enable_hsb_module(SYSCLK_USBC_DATA);
+ sysclk_enable_pbb_module(SYSCLK_USBC_REGS);
+ break;
+
+ case AVR32_HMATRIXB_ADDRESS:
+ sysclk_enable_pbb_module(SYSCLK_HMATRIX);
+ break;
+
+ case AVR32_SAU_ADDRESS:
+ sysclk_enable_hsb_module(SYSCLK_SAU_HSB);
+ sysclk_enable_pbb_module(SYSCLK_SAU_REGS);
+ break;
+
+#if defined(AVR32_SMC_ADDRESS)
+ case AVR32_SMC_ADDRESS:
+ sysclk_enable_pbb_module(SYSCLK_SMC_REGS);
+ break;
+#endif
+
+#if defined(AVR32_SDRAMC_ADDRESS)
+ case AVR32_SDRAMC_ADDRESS:
+ sysclk_enable_pbb_module(SYSCLK_SDRAMC_REGS);
+ break;
+#endif
+
+ case AVR32_PDCA_ADDRESS:
+ sysclk_enable_hsb_module(SYSCLK_PDCA_HSB);
+ sysclk_enable_pbc_module(SYSCLK_PDCA_PB);
+ break;
+
+ case AVR32_MDMA_ADDRESS:
+ sysclk_enable_pbc_module(SYSCLK_MDMA_REGS);
+ break;
+
+ case AVR32_USART1_ADDRESS:
+ sysclk_enable_pbc_module(SYSCLK_USART1);
+ break;
+
+ case AVR32_SPI0_ADDRESS:
+ sysclk_enable_pbc_module(SYSCLK_SPI0);
+ break;
+
+ case AVR32_CANIF_ADDRESS:
+ sysclk_enable_hsb_module(SYSCLK_CANIF_DATA);
+ sysclk_enable_pbc_module(SYSCLK_CANIF_REGS);
+ break;
+
+ case AVR32_TC0_ADDRESS:
+ sysclk_enable_pbc_module(SYSCLK_TC0);
+ break;
+
+ case AVR32_ADCIFA_ADDRESS:
+ sysclk_enable_pbc_module(SYSCLK_ADCIFA);
+ break;
+
+ default:
+ Assert(false);
+ return;
+ }
+}
+
+/**
+ * \brief Disable a peripheral's clock from its base address.
+ *
+ * Disables the clock to a peripheral, given its base address. If the peripheral
+ * has an associated clock on the HSB bus, this will be disabled also.
+ *
+ * \param module Pointer to the module's base address.
+ */
+static inline void sysclk_disable_peripheral_clock(const volatile void *module)
+{
+ switch ((uintptr_t)module) {
+ case AVR32_INTC_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_INTC);
+ break;
+
+ case AVR32_PM_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_PM);
+ break;
+
+ case AVR32_SCIF_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_SCIF);
+ break;
+
+ case AVR32_AST_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_AST);
+ break;
+
+ case AVR32_WDT_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_WDT);
+ break;
+
+ case AVR32_EIC_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_EIC);
+ break;
+
+ case AVR32_FREQM_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_FREQM);
+ break;
+
+ case AVR32_GPIO_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_GPIO);
+ break;
+
+ case AVR32_USART0_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_USART0);
+ break;
+
+ case AVR32_USART2_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_USART2);
+ break;
+
+ case AVR32_USART3_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_USART2);
+ break;
+
+ case AVR32_SPI1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_SPI1);
+ break;
+
+ case AVR32_TWIM0_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_TWIM0);
+ break;
+
+ case AVR32_TWIM1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_TWIM1);
+ break;
+
+ case AVR32_TWIS0_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_TWIS0);
+ break;
+
+ case AVR32_TWIS1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_TWIS1);
+ break;
+
+ case AVR32_PWM_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_PWM);
+ break;
+
+ case AVR32_QDEC0_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_QDEC0);
+ break;
+
+ case AVR32_QDEC1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_QDEC1);
+ break;
+
+ case AVR32_TC1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_TC1);
+ break;
+
+ case AVR32_PEVC_ADDRESS:
+ sysclk_disable_hsb_module(SYSCLK_PEVC_HSB);
+ sysclk_disable_pba_module(SYSCLK_PEVC_REGS);
+ break;
+
+ case AVR32_ACIFA0_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_ACIFA0);
+ break;
+
+ case AVR32_ACIFA1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_ACIFA1);
+ break;
+
+ case AVR32_DACIFB0_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_DACIFB0);
+ break;
+
+ case AVR32_DACIFB1_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_DACIFB1);
+ break;
+
+ case AVR32_AW_ADDRESS:
+ sysclk_disable_pba_module(SYSCLK_AW);
+ break;
+
+ case AVR32_FLASHC_ADDRESS:
+ sysclk_disable_hsb_module(SYSCLK_FLASHC_DATA);
+ sysclk_disable_pbb_module(SYSCLK_FLASHC_REGS);
+ break;
+
+ case AVR32_USBC_ADDRESS:
+ sysclk_disable_hsb_module(SYSCLK_USBC_DATA);
+ sysclk_disable_pbb_module(SYSCLK_USBC_REGS);
+ break;
+
+ case AVR32_HMATRIXB_ADDRESS:
+ sysclk_disable_pbb_module(SYSCLK_HMATRIX);
+ break;
+
+ case AVR32_SAU_ADDRESS:
+ sysclk_disable_hsb_module(SYSCLK_SAU_HSB);
+ sysclk_disable_pbb_module(SYSCLK_SAU_REGS);
+ break;
+
+#if defined(AVR32_SMC_ADDRESS)
+ case AVR32_SMC_ADDRESS:
+ sysclk_disable_pbb_module(SYSCLK_SMC_REGS);
+ break;
+#endif
+
+#if defined(AVR32_SDRAMC_ADDRESS)
+ case AVR32_SDRAMC_ADDRESS:
+ sysclk_disable_pbb_module(SYSCLK_SDRAMC_REGS);
+ break;
+#endif
+
+ case AVR32_PDCA_ADDRESS:
+ sysclk_disable_hsb_module(SYSCLK_PDCA_HSB);
+ sysclk_disable_pbc_module(SYSCLK_PDCA_PB);
+ break;
+
+ case AVR32_MDMA_ADDRESS:
+ sysclk_disable_pbc_module(SYSCLK_MDMA_REGS);
+ break;
+
+ case AVR32_USART1_ADDRESS:
+ sysclk_disable_pbc_module(SYSCLK_USART1);
+ break;
+
+ case AVR32_SPI0_ADDRESS:
+ sysclk_disable_pbc_module(SYSCLK_SPI0);
+ break;
+
+ case AVR32_CANIF_ADDRESS:
+ sysclk_disable_hsb_module(SYSCLK_CANIF_DATA);
+ sysclk_disable_pbc_module(SYSCLK_CANIF_REGS);
+ break;
+
+ case AVR32_TC0_ADDRESS:
+ sysclk_disable_pbc_module(SYSCLK_TC0);
+ break;
+
+ case AVR32_ADCIFA_ADDRESS:
+ sysclk_disable_pbc_module(SYSCLK_ADCIFA);
+ break;
+
+ default:
+ Assert(false);
+ return;
+ }
+}
+
+//@}
+
+//! \name System Clock Source and Prescaler configuration
+//@{
+
+extern void sysclk_set_prescalers(unsigned int cpu_shift,
+ unsigned int pba_shift, unsigned int pbb_shift,
+ unsigned int pbc_shift);
+extern void sysclk_set_source(uint_fast8_t src);
+
+//@}
+
+#if defined(CONFIG_USBCLK_SOURCE) || defined(__DOXYGEN__)
+
+/**
+ * \def USBCLK_STARTUP_TIMEOUT
+ * \brief Number of us to wait for USB clock to start
+ */
+#if CONFIG_USBCLK_SOURCE==USBCLK_SRC_OSC0
+# define USBCLK_STARTUP_TIMEOUT (OSC0_STARTUP_TIMEOUT*(1000000/AVR32_SCIF_RCOSC_FREQUENCY))
+#elif CONFIG_USBCLK_SOURCE==USBCLK_SRC_OSC1
+# define USBCLK_STARTUP_TIMEOUT (OSC1_STARTUP_TIMEOUT*(1000000/AVR32_SCIF_RCOSC_FREQUENCY))
+#elif CONFIG_USBCLK_SOURCE==USBCLK_SRC_PLL0
+# if CONFIG_PLL0_SOURCE==PLL_SRC_OSC0
+# define USBCLK_STARTUP_TIMEOUT (OSC0_STARTUP_TIMEOUT*(1000000/AVR32_SCIF_RCOSC_FREQUENCY))
+# elif CONFIG_PLL0_SOURCE==PLL_SRC_OSC1
+# define USBCLK_STARTUP_TIMEOUT (OSC1_STARTUP_TIMEOUT*(1000000/AVR32_SCIF_RCOSC_FREQUENCY))
+# else
+# error Unknown value for CONFIG_PLL0_SOURCE, see conf_clock.h.
+# endif
+#elif CONFIG_USBCLK_SOURCE==USBCLK_SRC_PLL1
+# if CONFIG_PLL1_SOURCE==PLL_SRC_OSC0
+# define USBCLK_STARTUP_TIMEOUT (OSC0_STARTUP_TIMEOUT*(1000000/AVR32_SCIF_RCOSC_FREQUENCY))
+# elif CONFIG_PLL1_SOURCE==PLL_SRC_OSC1
+# define USBCLK_STARTUP_TIMEOUT (OSC1_STARTUP_TIMEOUT*(1000000/AVR32_SCIF_RCOSC_FREQUENCY))
+# else
+# error Unknown value for CONFIG_PLL1_SOURCE, see conf_clock.h.
+# endif
+#else
+# error Unknown value for CONFIG_USBCLK_SOURCE, see conf_clock.h.
+#endif
+
+extern void sysclk_enable_usb(void);
+extern void sysclk_disable_usb(void);
+#endif
+
+extern void sysclk_init(void);
+
+#endif /* !__ASSEMBLY__ */
+
+//! @}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CHIP_SYSCLK_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt.h
new file mode 100644
index 0000000..f2c8770
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt.h
@@ -0,0 +1,132 @@
+/**
+ * \file
+ *
+ * \brief Global interrupt management for 8- and 32-bit AVR
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef UTILS_INTERRUPT_H
+#define UTILS_INTERRUPT_H
+
+#include <parts.h>
+
+#if XMEGA || MEGA
+# include "interrupt/interrupt_avr8.h"
+#elif UC3
+# include "interrupt/interrupt_avr32.h"
+#else
+# error Unsupported device.
+#endif
+
+/**
+ * \defgroup interrupt_group Global interrupt management
+ *
+ * This is a driver for global enabling and disabling of interrupts.
+ *
+ * @{
+ */
+
+#if defined(__DOXYGEN__)
+/**
+ * \def CONFIG_INTERRUPT_FORCE_INTC
+ * \brief Force usage of the ASF INTC driver
+ *
+ * Predefine this symbol when preprocessing to force the use of the ASF INTC driver.
+ * This is useful to ensure compatibilty accross compilers and shall be used only when required
+ * by the application needs.
+ */
+# define CONFIG_INTERRUPT_FORCE_INTC
+#endif
+
+//! \name Global interrupt flags
+//@{
+/**
+ * \typedef irqflags_t
+ * \brief Type used for holding state of interrupt flag
+ */
+
+/**
+ * \def cpu_irq_enable
+ * \brief Enable interrupts globally
+ */
+
+/**
+ * \def cpu_irq_disable
+ * \brief Disable interrupts globally
+ */
+
+/**
+ * \fn irqflags_t cpu_irq_save(void)
+ * \brief Get and clear the global interrupt flags
+ *
+ * Use in conjunction with \ref cpu_irq_restore.
+ *
+ * \return Current state of interrupt flags.
+ *
+ * \note This function leaves interrupts disabled.
+ */
+
+/**
+ * \fn void cpu_irq_restore(irqflags_t flags)
+ * \brief Restore global interrupt flags
+ *
+ * Use in conjunction with \ref cpu_irq_save.
+ *
+ * \param flags State to set interrupt flag to.
+ */
+
+/**
+ * \fn bool cpu_irq_is_enabled_flags(irqflags_t flags)
+ * \brief Check if interrupts are globally enabled in supplied flags
+ *
+ * \param flags Currents state of interrupt flags.
+ *
+ * \return True if interrupts are enabled.
+ */
+
+/**
+ * \def cpu_irq_is_enabled
+ * \brief Check if interrupts are globally enabled
+ *
+ * \return True if interrupts are enabled.
+ */
+//@}
+
+//! @}
+
+/**
+ * \ingroup interrupt_group
+ * \defgroup interrupt_deprecated_group Deprecated interrupt definitions
+ */
+
+#endif /* UTILS_INTERRUPT_H */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt/interrupt_avr32.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt/interrupt_avr32.h
new file mode 100644
index 0000000..b94bf33
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/asf/common/utils/interrupt/interrupt_avr32.h
@@ -0,0 +1,342 @@
+/**
+ * \file
+ *
+ * \brief Global interrupt management for 32-bit AVR
+ *
+ * Copyright (C) 2010 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef UTILS_INTERRUPT_INTERRUPT_H
+#define UTILS_INTERRUPT_INTERRUPT_H
+
+#include <compiler.h>
+#include <preprocessor/tpaste.h>
+
+/**
+ * \weakgroup interrupt_group
+ *
+ * @{
+ */
+
+//! Pointer to interrupt handler.
+#if (defined __GNUC__)
+typedef void (*__int_handler)(void);
+#elif (defined __ICCAVR32__)
+typedef void (__interrupt *__int_handler)(void);
+#endif
+
+/**
+ * \name Interrupt Service Routine definition and registration
+ *
+ * @{
+ */
+#if defined(__GNUC__) || defined(__DOXYGEN__)
+
+/**
+ * \brief Define service routine
+ *
+ * With GCC, this macro only causes the function to be defined as an interrupt
+ * service routine, i.e., it does not add any initialization code. A valid
+ * function name is required for use with \ref irq_register_handler.
+ *
+ * With IAR, this macro defines the function as an interrupt service routine and
+ * causes the compiler to add initialization code for the interrupt controller
+ * (INTC). The interrupt group and level, as well as a valid function name are
+ * therefore required.\n
+ * \note If \ref CONFIG_INTERRUPT_FORCE_INTC is defined, only a valid function
+ * name is required for use with \ref irq_register_handler. The initialization
+ * code will be handled by the interrupt controller itself.
+ *
+ * Usage:
+ * \code
+ * ISR(foo_irq_handler, AVR32_xxx_IRQ_GROUP, n)
+ * {
+ * // Function definition
+ * ...
+ * }
+ * \endcode
+ *
+ * \param func Name for the function, needed by \ref irq_register_handler.
+ * \param int_grp Interrupt group to define service routine for.
+ * \param int_lvl Priority level to set for the interrupt group, in the range
+ * \c 0 to \c 3.
+ *
+ * \note The interrupt groups can be found in the device header files for the
+ * IAR toolchain (avr32/io\<part\>.h).
+ *
+ * \todo Update to use IRQ numbers when these are made available in the
+ * device header files of both IAR and GCC.
+ */
+# define ISR(func, int_grp, int_lvl) \
+ __attribute__((__interrupt__)) static void func (void)
+
+#elif defined(__ICCAVR32__)
+# define ISR0(...) _Pragma(#__VA_ARGS__)
+# define ISR(func, int_grp, int_lvl) \
+ ISR0(handler=int_grp, int_lvl) \
+ __interrupt static void func (void)
+#endif
+
+#if defined(__GNUC__) || defined(__DOXYGEN__) || defined(CONFIG_INTERRUPT_FORCE_INTC)
+# include <intc.h>
+
+/**
+ * \brief Initialize interrupt vectors
+ *
+ * With GCC, this macro adds code for initialization of the interrupt vectors
+ * with the driver for the interrupt controller (INTC).
+ *
+ * With IAR and unless \ref CONFIG_INTERRUPT_FORCE_INTC is defined this macro
+ * adds no code, since initialization of the INTC is handled by the compiler.
+ * \note Defining \ref CONFIG_INTERRUPT_FORCE_INTC will force the use of the
+ * INTC driver, replacing the compiler built-in interrupt handler.
+ *
+ * This must be called prior to \ref irq_register_handler.
+ */
+# define irq_initialize_vectors() INTC_init_interrupts()
+
+/**
+ * \brief Register handler for interrupt
+ *
+ * With GCC, this macro adds code for registering an interrupt handler with the
+ * driver for the interrupt controller (INTC).
+ *
+ * With IAR and unless \ref CONFIG_INTERRUPT_FORCE_INTC is defined this macro
+ * adds no code, since initialization of the INTC is handled by the compiler.
+ * \note Defining \ref CONFIG_INTERRUPT_FORCE_INTC will force the use of the
+ * INTC driver, replacing the compiler built-in interrupt handler.
+ *
+ * \param func Name of handler function to register for interrupt.
+ * \param int_num Number of the interrupt line to register function for.
+ * \param int_lvl Priority level to set for the interrupt's group, in the range
+ * \c 0 to \c 3.
+ *
+ * Usage:
+ * \code
+ * irq_initialize_vectors();
+ * irq_register_handler(foo_irq_handler, AVR32_xxx_IRQ, n);
+ * \endcode
+ *
+ * \note The function \a func must be defined with the \ref ISR macro.
+ * \note The interrupt line number can be found in the device header files for
+ * the GCC toolchain (avr32/\<part\>.h).
+ */
+# define irq_register_handler(func, int_num, int_lvl) \
+ INTC_register_interrupt(func, int_num, \
+ TPASTE2(AVR32_INTC_INT, int_lvl))
+
+#elif defined(__ICCAVR32__)
+# define irq_initialize_vectors() do{ } while(0)
+# define irq_register_handler(func, int_num, int_lvl) do{ } while(0)
+#endif
+
+//@}
+
+#if (defined __GNUC__)
+# define cpu_irq_enable() \
+ do { \
+ barrier(); \
+ __builtin_csrf(AVR32_SR_GM_OFFSET); \
+ } while (0)
+# define cpu_irq_disable() \
+ do { \
+ __builtin_ssrf(AVR32_SR_GM_OFFSET); \
+ barrier(); \
+ } while (0)
+#elif (defined __ICCAVR32__)
+# if (defined CONFIG_INTERRUPT_FORCE_INTC)
+# define cpu_irq_enable() \
+ do { \
+ barrier(); \
+ __clear_status_flag(AVR32_SR_GM_OFFSET); \
+ } while(0)
+# define cpu_irq_disable() \
+ do { \
+ __set_status_flag(AVR32_SR_GM_OFFSET); \
+ barrier(); \
+ } while (0)
+# else
+# define cpu_irq_enable() __enable_interrupt()
+# define cpu_irq_disable() __disable_interrupt()
+# endif
+#endif
+
+typedef uint32_t irqflags_t;
+
+static inline irqflags_t cpu_irq_save(void)
+{
+ irqflags_t flags;
+
+ flags = sysreg_read(AVR32_SR);
+ cpu_irq_disable();
+
+ return flags;
+}
+
+static inline bool cpu_irq_is_enabled_flags(irqflags_t flags)
+{
+ return !(flags & AVR32_SR_GM_MASK);
+}
+
+static inline void cpu_irq_restore(irqflags_t flags)
+{
+ barrier();
+#if defined(__ICCAVR32__)
+ // Barrier " __asm__ __volatile__ ("")"
+ // Don't work with sysreg_write(AVR32_SR, flags)
+ if( cpu_irq_is_enabled_flags(flags) ) {
+ cpu_irq_enable();
+ }
+#else
+ sysreg_write(AVR32_SR, flags);
+#endif
+ barrier();
+}
+
+#define cpu_irq_is_enabled() cpu_irq_is_enabled_flags(sysreg_read(AVR32_SR))
+
+//! \name Global interrupt levels
+//@{
+
+/**
+ * \brief Check if interrupt level is enabled in supplied flags
+ *
+ * \param flags State of interrupt flags.
+ * \param level Bit position for interrupt level.
+ *
+ * \return True if interrupt level is enabled.
+ */
+static inline bool cpu_irq_level_is_enabled_flags(irqflags_t flags,
+ uint32_t level)
+{
+ return !(flags & (1 << level));
+}
+
+/**
+ * \brief Check if interrupt level is enabled
+ *
+ * \param level Interrupt level (0 to 3).
+ *
+ * \return True if interrupt level \a level is enabled.
+ *
+ * \note The interrupt level must be known at compile time.
+ */
+#define cpu_irq_level_is_enabled(level) \
+ cpu_irq_level_is_enabled_flags(sysreg_read(AVR32_SR), \
+ TPASTE3(AVR32_SR_I, level, M_OFFSET))
+
+#if defined(__GNUC__) || defined(__DOXYGEN__)
+/**
+ * \brief Enable interrupt level
+ *
+ * \param level Interrupt level to enable (0 to 3).
+ *
+ * \note The interrupt level must be known at compile time.
+ */
+# define cpu_irq_enable_level(level) \
+ do { \
+ barrier(); \
+ __builtin_csrf(TPASTE3(AVR32_SR_I, level, M_OFFSET)); \
+ } while (0)
+
+/**
+ * \brief Disable interrupt level
+ *
+ * \param level Interrupt level to disable (0 to 3).
+ *
+ * \note The interrupt level must be known at compile time.
+ */
+# define cpu_irq_disable_level(level) \
+ do { \
+ __builtin_ssrf(TPASTE3(AVR32_SR_I, level, M_OFFSET)); \
+ barrier(); \
+ } while (0)
+
+#elif (defined __ICCAVR32__)
+# define cpu_irq_enable_level(level) \
+ do { \
+ barrier(); \
+ __clear_status_flag(TPASTE3(AVR32_SR_I, level, M_OFFSET)); \
+ } while(0)
+# define cpu_irq_disable_level(level) \
+ do { \
+ __set_status_flag(TPASTE3(AVR32_SR_I, level, M_OFFSET)); \
+ barrier(); \
+ } while (0)
+#endif
+
+//@}
+
+//@}
+
+/**
+ * \weakgroup interrupt_deprecated_group
+ * @{
+ */
+
+#define Enable_global_interrupt() cpu_irq_enable()
+#define Disable_global_interrupt() cpu_irq_disable()
+#define Is_global_interrupt_enabled() cpu_irq_is_enabled()
+
+#define Enable_interrupt_level(level) cpu_irq_enable_level(level)
+#define Disable_interrupt_level(level) cpu_irq_disable_level(level)
+#define Is_interrupt_level_enabled(level) cpu_irq_level_is_enabled(level)
+
+/**
+ * \name Interrupt protection of code sections
+ * \note Use \ref cpu_irq_save and \ref cpu_irq_restore instead of these macros.
+ * @{
+ */
+
+/**
+ * \brief Start section with code protected against interrupts
+ */
+#define AVR32_ENTER_CRITICAL_REGION() \
+ { \
+ bool global_interrupt_enabled = Is_global_interrupt_enabled(); \
+ Disable_global_interrupt();
+
+/**
+ * \brief End section with code protected against interrupts
+ *
+ * \note This macro must always be used in conjunction with
+ * \ref AVR32_ENTER_CRITICAL_REGION so that interrupts are enabled again.
+ */
+#define AVR32_LEAVE_CRITICAL_REGION() \
+ if (global_interrupt_enabled) Enable_global_interrupt(); \
+ }
+
+//@}
+
+//@}
+
+#endif /* UTILS_INTERRUPT_INTERRUPT_H */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/can1ce.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/can1ce.h
new file mode 100644
index 0000000..e076e19
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/can1ce.h
@@ -0,0 +1,141 @@
+#ifndef CAN_CE_H
+#define CAN_CE_H
+
+
+
+/*Konfiguration für CAN-Subsystem*/
+#define CAN__nPollCycle 10 /*ms*/
+
+
+#define CAN_MakeDbConfig \
+MakeTxMessages() \
+ /* dummy message 1 */ \
+ /* NAME, CAN_Ch, ID, DLC, Tx-Mode, Cycle, Pre-Tx-Callback */ \
+ MakeTxMsg( CAN_nenMsg_Dummy001, CAN_nenCh0, 0x103, 8, TxModeCyclic, 100, CAN_vNoPreTx_Cb ) \
+ /* Msg.-ID, Sig.-ID, Start-Bit, Size, Init-Timeout-Ersatz */ \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_01, 0, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_02, 8, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_03, 16, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_04, 24, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_05, 32, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_06, 40, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_07, 48, 8, 0 ) \
+ MakeSignal( CAN_nenMsg_Dummy001, CAN_nenSig_Dummy001_08, 56, 8, 0 ) \
+ MakeTxMsgEnd() \
+MakeTxMessagesEnd() \
+ \
+/*RX Messages */ \
+MakeRxMessages() \
+MakeRxMessagesEnd() \
+
+/******************************/
+/* Konfiguration CAN-Treiber */
+/******************************/
+
+#define CAN_MessageBoxConfig \
+/* Ch.-Name, Baud-Rate, Rx-Indication_Cb, Tx-Confirmation_Cb */\
+MakeCanChannel( CAN_nenCh0, 1000000, CANIF_vRxIndication, CANIF_vTxConfirmation ) \
+ /* MsgBoxId, ID-Value, ID-Mask, Rx/Tx/unused */ \
+ MakeMsgBox( CAN_enCh0MBox0, 0x000, 0, CAN__nenMbMode_Tx ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox1, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox2, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox3, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox4, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox5, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox6, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox7, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox8, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox9, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox10, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox11, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox12, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox13, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox14, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh0MBox15, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+MakeCanChannelEnd() \
+/* Ch.-Name, Baud-Rate, Rx-Indication_Cb, Tx-Confirmation_Cb */\
+MakeCanChannel( CAN_nenCh1, 1000000, CANIF_vRxIndication, CANIF_vTxConfirmation ) \
+ /* MsgBoxId, ID-Value, ID-Mask, Rx/Tx/unused */ \
+ MakeMsgBox( CAN_enCh1MBox0, 0x000, 0, CAN__nenMbMode_Tx ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox1, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox2, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox3, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox4, 0x000, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox5, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox6, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox7, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox8, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox9, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox10, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox11, 0x000, 0x000, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox12, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox13, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox14, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+ MakeMsgBox( CAN_enCh1MBox15, 0, 0, CAN__nenMbMode_NotUsed ) \
+ MakeRxMsg( CAN__nenMb_Invalid ) \
+ MakeMsgBoxEnd() \
+MakeCanChannelEnd() \
+
+#endif /*CAN_CE_H*/
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/cdef.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/cdef.h
new file mode 100644
index 0000000..b8b2670
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/cdef.h
@@ -0,0 +1,70 @@
+#ifndef CDEF_H
+#define CDEF_H
+
+#ifdef _WINECU_
+
+#ifndef __cplusplus
+
+typedef unsigned char bool;
+#define true (1==1)
+#define false (!true)
+#endif /*__cplusplus*/
+
+/** Unsigned 8-bit datatype : 0..255 */
+ typedef unsigned char uint8_t;
+
+/** Unsigned 16-bit datatype: 0..65535 */
+ typedef unsigned short int uint16_t;
+
+/** Unsigned 32-bit datatype: 0..4294967295 */
+ typedef unsigned long int uint32_t;
+
+#ifdef WIN32 /* @Ale080429 */
+ typedef unsigned __int64 uint64_t;
+#else
+ typedef unsigned long long int uint64_t;
+#endif /* WIN32 */
+
+
+/** Signed 8-bit datatype : -128...+127 */
+ typedef signed char int8_t;
+
+/** Signed 16-bit datatype : -32768..+32767 */
+ typedef signed short int int16_t;
+
+/** Signed 32-bit datatype : -2147483648..2147483647 */
+ typedef signed long int int32_t;
+
+#ifdef WIN32 /* @Ale080429 */
+ typedef signed __int64 int64_t;
+#else
+ typedef signed long long int int64_t;
+#endif
+
+#define inline __inline
+
+#endif /*_WINECU_*/
+
+/*Target*/
+#ifndef _WINECU_
+#include "avr_compiler.h"
+#endif
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+#ifndef MIN
+#define MIN( A, B ) ((A)<(B)?(A):(B))
+#endif //MIN
+
+#ifndef MAX
+#define MAX( A, B ) ((A)>(B)?(A):(B))
+#endif //MAX
+
+
+#endif /*CDEF_H*/
+
+/*Allgemein*/
+
+#define compile_time_assert(x) extern int compile_time_assert[(x) ? 1 : -1]
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/CANDCI.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/CANDCI.h
new file mode 100644
index 0000000..fcfc926
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/CANDCI.h
@@ -0,0 +1,89 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CAN driver for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CAN module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+
+
+#ifndef _CANDCI_H
+#define _CANDCI_H
+
+//_____ I N C L U D E S ________________________________________________________
+#include "avr32/io.h"
+#include "compiler.h"
+#include "can.h"
+#include "board.h"
+
+/*
+ *
+ *//*
+ * Mail Box Definition
+ */
+// -----------------------------------------------------------------
+// CAN Message Definition: Tx Message
+#if defined (__ICCAVR32__)
+can_msg_t msg_tx_sot =
+{
+ 0x000, // Identifier
+ 0x000, // Mask
+ 0x0000000000000000LL, // Data
+};
+#else
+can_msg_t msg_tx_sot =
+{
+ {
+ {
+ .id = 0x000, // Identifier
+ .id_mask = 0x000, // Mask
+ },
+ },
+ .data.u64 = 0x0000000000000000LL, // Data
+};
+#endif
+can_msg_t pcan_msg[2][16];
+// MOB Message Definition: Tx Message
+can_mob_t appli_tx_msg[2][16];
+
+#endif // _CANDCI_H
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_board.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_board.h
new file mode 100644
index 0000000..3275aab
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_board.h
@@ -0,0 +1,11 @@
+/**
+ * \file
+ *
+ * \brief User board configuration template
+ *
+ */
+
+#ifndef CONF_BOARD_H
+#define CONF_BOARD_H
+
+#endif // CONF_BOARD_H
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_can.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_can.h
new file mode 100644
index 0000000..1032fb5
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_can.h
@@ -0,0 +1,97 @@
+/*This file is prepared for Doxygen automatic documentation generation.*/
+/*! \file *********************************************************************
+ *
+ * \brief CAN Configuration File for AVR32 UC3.
+ *
+ * This file contains basic functions for the AVR32 CAN, with support for all
+ * modes, settings and clock speeds.
+ *
+ * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
+ * - Supported devices: All AVR32 devices with a CAN module can be used.
+ * - AppNote:
+ *
+ * \author Atmel Corporation: http://www.atmel.com \n
+ * Support and FAQ: http://support.atmel.no/
+ *
+ ******************************************************************************/
+
+/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an Atmel
+ * AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+ *
+ */
+#ifndef _CONF_CAN_H
+#define _CONF_CAN_H
+
+//! Define the number of MOB per channel. It is a fixed value: 16.
+#define NB_MOB_CHANNEL 16
+//! Setup the usage of Autobaud feature, here the stack does not support it
+#define CAN_AUTOBAUD false
+//! Setup the usage of CAN Under interruption
+#define CAN_LIB_UNDER_INTERRUPT
+
+#define CAN_SPEED CAN_SPEED_500//CAN_SPEED_1000
+
+#if CAN_SPEED == CAN_SPEED_1000
+/* CAN config für 1MBit/s */
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_SJW 1
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PRES 1
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PRS 2
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PHS1 1
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PHS2 1
+#elif CAN_SPEED == CAN_SPEED_500
+/* CAN config 500kBit/s */
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_SJW 1
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PRES 1
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PRS 2
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PHS1 6
+#define CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PHS2 4
+#endif
+
+#define BAUDRATE CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz
+#define BAUDRATE_SJW CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_SJW
+#define BAUDRATE_PRES CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PRES
+#define BAUDRATE_PRS CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PRS
+#define BAUDRATE_PHS1 CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PHS1
+#define BAUDRATE_PHS2 CAN_BAUDRATE_1MHZ_CANCLOCK_16MHz_PHS2
+
+#define CAN0_INT_TX_LEVEL AVR32_INTC_INT0
+#define CAN0_INT_RX_LEVEL AVR32_INTC_INT0
+#define CAN0_INT_ERR_LEVEL AVR32_INTC_INT0
+#define CAN0_INT_BOFF_LEVEL AVR32_INTC_INT0
+#define CAN0_INT_WAKE_UP_LEVEL AVR32_INTC_INT0
+
+#define CAN1_INT_TX_LEVEL AVR32_INTC_INT0
+#define CAN1_INT_RX_LEVEL AVR32_INTC_INT0
+#define CAN1_INT_ERR_LEVEL AVR32_INTC_INT0
+#define CAN1_INT_BOFF_LEVEL AVR32_INTC_INT0
+#define CAN1_INT_WAKE_UP_LEVEL AVR32_INTC_INT0
+
+#endif // _CONF_CAN_H
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_clock.h b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_clock.h
new file mode 100644
index 0000000..48ee84e
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/config/conf_clock.h
@@ -0,0 +1,55 @@
+/**
+ * \file
+ *
+ * \brief Chip-specific system clock manager configuration
+ *
+ * Copyright (C) 2011 Atmel Corporation. All rights reserved.
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel AVR product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+#ifndef CONF_CLOCK_H_INCLUDED
+#define CONF_CLOCK_H_INCLUDED
+
+#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLL0
+
+/* Fbus = Fsys / (2 ^ BUS_div) */
+#define CONFIG_SYSCLK_CPU_DIV 0
+#define CONFIG_SYSCLK_PBA_DIV 1
+#define CONFIG_SYSCLK_PBB_DIV 1
+#define CONFIG_SYSCLK_PBC_DIV 1
+
+#define CONFIG_PLL0_SOURCE PLL_SRC_OSC0
+
+/* Fpll0 = (Fclk * PLL_mul) / PLL_div */
+#define CONFIG_PLL0_MUL 4
+#define CONFIG_PLL0_DIV 1
+
+#endif /* CONF_CLOCK_H_INCLUDED */
diff --git a/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/main.c b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/main.c
new file mode 100644
index 0000000..b25906f
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/CANVerificationTool/src/main.c
@@ -0,0 +1,29 @@
+/**
+ * \file
+ *
+ * \brief Empty user application template
+ *
+ */
+
+/*
+ * Include header files for all drivers that have been imported from
+ * AVR Software Framework (ASF).
+ */
+#include <asf.h>
+#include "START1C1.h"
+
+void board_init(void)
+{
+ /* This function is meant to contain board-specific initialization code
+ * for, e.g., the I/O pins. The initialization can rely on application-
+ * specific board configuration, found in conf_board.h.
+ */
+}
+
+int main (void)
+{
+ board_init();
+
+ // Insert application code here, after the board has been initialized.
+ START_vMain();
+}
diff --git a/Master/Masterarbeit/src/CANVerificationTool/doc/Doxyfile b/Master/Masterarbeit/src/CANVerificationTool/doc/Doxyfile
new file mode 100644
index 0000000..fc94577
--- /dev/null
+++ b/Master/Masterarbeit/src/CANVerificationTool/doc/Doxyfile
@@ -0,0 +1,1813 @@
+# Doxyfile 1.7.6.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME = "Atmel CAN verification tool"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ../CANVerificationTool
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.for \
+ *.vhd \
+ *.vhdl
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */asf/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 4
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln
new file mode 100644
index 0000000..fdd2c79
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CanEasy_Xoraya_Plugin", "CanEasy_Xoraya_Plugin\CanEasy_Xoraya_Plugin.vcproj", "{BB958F41-20BA-4C41-A845-A6B07582575B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BB958F41-20BA-4C41-A845-A6B07582575B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {BB958F41-20BA-4C41-A845-A6B07582575B}.Debug|Win32.Build.0 = Debug|Win32
+ {BB958F41-20BA-4C41-A845-A6B07582575B}.Release|Win32.ActiveCfg = Release|Win32
+ {BB958F41-20BA-4C41-A845-A6B07582575B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj
new file mode 100644
index 0000000..0347d09
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj
@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="CanEasy_Xoraya_Plugin"
+ ProjectGUID="{BB958F41-20BA-4C41-A845-A6B07582575B}"
+ RootNamespace="CanEasy_Xoraya_Plugin"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ UseOfMFC="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="false"
+ ValidateParameters="false"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\common\inc;./include;C:\Programme\boost\boost_1_47_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BOOST_THREAD_DYN_LINK;DEBUG_MODE"
+ StringPooling="false"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="CanDll.lib"
+ OutputFile="./Debug/CanEasy_Xoraya_PluginD.plu"
+ AdditionalLibraryDirectories="./lib;C:\Programme\boost\boost_1_47_0\lib"
+ ModuleDefinitionFile="CanEasy_Xoraya_PluginDll.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ UseOfMFC="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories="./include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ StringPooling="true"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="0"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="CanDll.lib"
+ OutputFile="./Release/CanEasy_Xoraya_Plugin.plu"
+ AdditionalLibraryDirectories="./lib"
+ ModuleDefinitionFile="CanEasy_Xoraya_PluginDll.def"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Quellcodedateien"
+ Filter="txt"
+ >
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDlg.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDll.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDll.def"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\src\CNetworkStream.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\CodeGenerator.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\FloatSliderCtrl.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\LogImport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\src\NetworkTypes.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\NumEdit.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Signal.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\StdAfx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\XorayaAdaptor.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header-Dateien"
+ >
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDlg.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDll.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\inc\CNetworkStream.h"
+ >
+ </File>
+ <File
+ RelativePath=".\CodeGenerator.h"
+ >
+ </File>
+ <File
+ RelativePath=".\FloatSliderCtrl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\inc\global.h"
+ >
+ </File>
+ <File
+ RelativePath=".\LogImport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\inc\NetworkMessages.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\inc\NetworkTypes.h"
+ >
+ </File>
+ <File
+ RelativePath=".\NumEdit.h"
+ >
+ </File>
+ <File
+ RelativePath=".\PanelDropTarget.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\common\inc\protocol.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\Signal.h"
+ >
+ </File>
+ <File
+ RelativePath=".\StdAfx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\XorayaAdaptor.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ressourcendateien"
+ >
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDll.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\CanEasy_Xoraya_PluginDll.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\res\CanEasy_Xoraya_PluginDll.rc2"
+ >
+ </File>
+ <File
+ RelativePath=".\x2e.ico"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="CanEasy_Xoraya_PluginDll.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user
new file mode 100644
index 0000000..679acd4
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin.vcproj.SCHLEISSHEIMER.Eisenhauer.user
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+ ProjectType="Visual C++"
+ Version="8,00"
+ ShowAllFiles="false"
+ >
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ >
+ <DebugSettings
+ Command="C:\Programme\CanEasy\CanEasy.exe"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="A281"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ >
+ <DebugSettings
+ Command=""
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="A281"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ </Configurations>
+</VisualStudioUserFile>
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp
new file mode 100644
index 0000000..44d8b49
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.cpp
@@ -0,0 +1,766 @@
+// CanEasy_Xoraya_PluginDlg.cpp: Implementatoin file
+//
+
+#include "stdafx.h"
+#include "CanEasy_Xoraya_PluginDll.h"
+#include "CanEasy_Xoraya_PluginDlg.h"
+#include "XorayaAdaptor.h"
+#include "CodeGenerator.h"
+#include <protocol.h>
+#include <boost/tokenizer.hpp>
+#include <boost/lexical_cast.hpp>
+#include <sstream>
+#include "global.h"
+#include "protocol.h"
+#include "LogImport.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#define WM_UPDATE_CONTROLS (WM_USER + 5)
+
+#define OBJECT_NAME_LEN 256
+
+#define STR_CONNECTED _T("Connected")
+#define STR_DISCONNECTED _T("Disconnected")
+#define STR_MAP_SEP " -> "
+#define nSTR_INVALID_SOFILE "INVALIDSOFILE"
+typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
+
+/////////////////////////////////////////////////////////////////////////////
+// Dialog CCanEasy_Xoraya_PluginDlg
+
+/////////////////////////////////////////////////////////////////////////////
+// global pointer to the dialog
+CCanEasy_Xoraya_PluginDlg* g_pCanEasy_Xoraya_PluginDlg = NULL;
+
+
+CCanEasy_Xoraya_PluginDlg::CCanEasy_Xoraya_PluginDlg(CWnd* pParent /*=NULL*/)
+:CDialog(CCanEasy_Xoraya_PluginDlg::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CCanEasy_Xoraya_PluginDlg)
+ //m_sEdit = _T("");
+ m_sXorayaIpAddress = nDEFAULT_IP;
+ //}}AFX_DATA_INIT
+
+ // keep in mind that the LoadIcon doesn't need a following DestroyIcon-Call at Win32
+ m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
+
+ g_pCanEasy_Xoraya_PluginDlg = this;
+
+}
+
+
+void CCanEasy_Xoraya_PluginDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CCanEasy_Xoraya_PluginDlg)
+ //DDX_Control(pDX, IDC_EDIT1, m_editCtrl);
+ //DDX_Control(pDX, IDC_SLIDER1, m_sliderCtrl);
+ //DDX_Text(pDX, IDC_EDIT1, m_sEdit);
+ DDX_Control(pDX,IDC_XORAYA_IPADDRESS,m_cIpAddressCtrl);
+
+ DDX_Text(pDX,IDC_XORAYA_IPADDRESS,m_sXorayaIpAddress);
+ // HINWEIS: Der Klassen-Assistent fügt hier DDX- und DDV-Aufrufe ein
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CCanEasy_Xoraya_PluginDlg, CDialog)
+ //{{AFX_MSG_MAP(CCanEasy_Xoraya_PluginDlg)
+ ON_WM_HSCROLL()
+ ON_EN_KILLFOCUS(IDC_XORAYA_IPADDRESS, OnKillfocusIpAddress)
+ //}}AFX_MSG_MAP
+ ON_MESSAGE(WM_UPDATE_CONTROLS, OnUpdateControls)
+ ON_BN_CLICKED(IDC_BUTTON_CONNECT, &CCanEasy_Xoraya_PluginDlg::OnBnClickedConnect)
+ ON_BN_CLICKED(IDC_MAP_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedMap)
+ ON_BN_CLICKED(IDC_UNMAP_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedUnmap)
+ ON_BN_CLICKED(IDC_GETINTERFACES_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedGetinterfaces)
+ ON_BN_CLICKED(IDC_START_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedStart)
+ ON_BN_CLICKED(IDC_STOP_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedStop)
+ ON_BN_CLICKED(IDC_BUTTON_DISCONNECT, &CCanEasy_Xoraya_PluginDlg::OnBnClickedDisconnect)
+ ON_BN_CLICKED(IDC_BUTTON_SHUTDOWN, &CCanEasy_Xoraya_PluginDlg::OnBnClickedShutdown)
+ ON_BN_CLICKED(IDC_IMPORTLOG_BUTTON, &CCanEasy_Xoraya_PluginDlg::OnBnClickedImportLog)
+ ON_BN_CLICKED(IDC_BUTTON_ENUMLOGS, &CCanEasy_Xoraya_PluginDlg::OnBnClickedEnumLogs)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// message processing routines of CCanEasy_Xoraya_PluginDlg
+
+BOOL CCanEasy_Xoraya_PluginDlg::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ /* Set the icon for this Dialog. Will be processed automatically
+ if the main window of the application isn't a dialogfield. */
+ SetIcon(m_hIcon, TRUE); // use small symbol
+ SetIcon(m_hIcon, FALSE); // use big symbol
+ // register panel as a drop target
+ m_dropTarget.Register(this);
+
+ CAND_tHandle hBus;
+ char acBusName[OBJECT_NAME_LEN];
+ hBus = CAND_hGetFirstBus();
+ CComboBox* pxBusCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_BUS_COMBO));
+ while(hBus)
+ {
+ CAND_enGetName(hBus,acBusName,OBJECT_NAME_LEN);
+ pxBusCombo->AddString(acBusName);
+ hBus = CAND_hGetNextBus(hBus);
+ }
+ if(pxBusCombo->GetCount() > 0)
+ {
+ pxBusCombo->SetCurSel(0);
+ }
+ // activate all assigned controls
+ EnableControls();
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
+}
+
+// for reaction to changes of the database
+void CCanEasy_Xoraya_PluginDlg::OnDatabaseChanged()
+{
+ // Insert Code that has to be processed on changings of the database.
+}
+
+BYTE CALLBACK OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ if(g_pCanEasy_Xoraya_PluginDlg)
+ return g_pCanEasy_Xoraya_PluginDlg->OnSignalValueChanged(hSig, 0);
+
+ return 1;
+}
+
+BYTE CALLBACK OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ if(g_pCanEasy_Xoraya_PluginDlg)
+ return g_pCanEasy_Xoraya_PluginDlg->OnMsgDataChanged(hMsg,0);
+
+ return 1;
+}
+
+/*****************************************************************************
+*
+* CPluginDemoDlg::OnDragOver
+*
+* Description : Called when the user drags the object over a control.
+*
+* Parameter : pDataObject : Points to the COleDataObject being dragged
+* over the drop target.
+* dwKeyState : Contains the state of the modifier keys.
+* point : The current mouse position relative to the
+* view client area.
+*
+* Return : Called by the framework during a drag operation when the
+* mouse is moved over the drop target window.
+*
+*****************************************************************************/
+DROPEFFECT CCanEasy_Xoraya_PluginDlg::OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
+{
+ // let only pass when the simulation is halted
+ if(CAND_boIsRunning())
+ return DROPEFFECT_NONE;
+
+ // retrieve the character string the Drag&Drop-Object contains
+ HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_TEXT);
+ LPTSTR lpcString = (LPTSTR)GlobalLock(hGlobal);
+ CString sText = lpcString;
+ GlobalUnlock(hGlobal);
+
+ // Transform the Drag&Drop character string to a Handle. A NULL-Handle is returned
+ // if the object hasn't been found.
+ CAND_tHandle hObj = CAND_hTextToHandle(sText);
+ if(hObj == CAND_hNullHandle())
+ return DROPEFFECT_NONE;
+
+ // check the type of the Handle
+ CAND_tenHandleType enType;
+ if(CAND_enGetHandleType(hObj, &enType) != CAND_nERR_OK)
+ return DROPEFFECT_NONE;
+
+ // let pass signals only
+ if(enType != CAND_nSig)
+ return DROPEFFECT_NONE;
+
+ CWnd* pWndFromPoint = ChildWindowFromPoint(point);
+ if(pWndFromPoint == NULL || !IsChild(pWndFromPoint))
+ return DROPEFFECT_NONE;
+
+ // allow dragging only at the wanted controls
+ //if( (pWndFromPoint == &m_sliderCtrl) ||
+ // (pWndFromPoint == &m_editCtrl) )
+ //{
+ // return DROPEFFECT_MOVE;
+ //}
+
+ return DROPEFFECT_NONE;
+}
+
+
+/*****************************************************************************
+*
+* CPluginDemoDlg::OnDrop
+*
+* Description : Called when the user drops the object onto the control
+*
+* Parameter : pWnd: Points to the window the cursor is entering.
+* pDataObject: Points to the data object containing the data
+* that can be dropped.
+* dropEffect: Contains the effect on the data after dropping (NONE, MOVE, COPY etc.).
+* point: Contains the current location of the cursor in
+* client coordinates.
+*
+* Return : BOOL: Nonzero if the drop is successful; otherwise 0.
+*
+*****************************************************************************/
+BOOL CCanEasy_Xoraya_PluginDlg::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
+{
+ // let only pass when the simulation is halted
+ if(CAND_boIsRunning())
+ return DROPEFFECT_NONE;
+
+ // determine the window that the object has been dropped onto
+ CWnd* pWndFromPoint = ChildWindowFromPoint(point);
+ if(pWndFromPoint && IsChild(pWndFromPoint))
+ {
+ // retrieve the character string the Drag&Drop-Object contains
+ HGLOBAL hGlobal = pDataObject->GetGlobalData(CF_TEXT);
+ LPTSTR lpcString = (LPTSTR)GlobalLock(hGlobal);
+ CString sText = lpcString;
+ GlobalUnlock(hGlobal);
+
+ // Transform the Drag&Drop character string to a Handle. Returns a NULL-Handle
+ // if the object hasn't been found.
+ CAND_tHandle hObj = CAND_hTextToHandle(sText);
+ if(hObj == CAND_hNullHandle())
+ return FALSE;
+
+ // check the type of the Handle
+ CAND_tenHandleType enType;
+ if(CAND_enGetHandleType(hObj, &enType) != CAND_nERR_OK)
+ return FALSE;
+
+ // let pass signals only
+ if(enType != CAND_nSig)
+ return FALSE;
+
+ CString sName;
+ const int iLen = OBJECT_NAME_LEN;
+ VERIFY(CAND_enGetName(hObj, sName.GetBuffer(iLen), iLen) == CAND_nERR_OK);
+ sName.ReleaseBuffer();
+
+ // determine control element that the object has been dropped onto
+ int iID = pWndFromPoint->GetDlgCtrlID();
+
+ //switch(iID)
+ //{
+ //case IDC_SLIDER1:
+ //case IDC_EDIT1:
+ // m_signalEdit.Attach(hObj);
+ // break;
+ //default:
+ // return FALSE;
+ //}
+
+ EnableControls();
+ InitControls();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
+{
+ CString sTemp;
+
+ if(pScrollBar != NULL)
+ {
+ //switch(pScrollBar->GetDlgCtrlID())
+ //{
+ //case IDC_SLIDER1:
+ // {
+ // // retrieve the value of the slider an assign to the signal
+ // double dVal = m_sliderCtrl.GetPosEx();
+ // m_signalEdit = dVal;
+
+ // // update the edit field
+ // CString sText;
+ // sText.Format("%g", dVal);
+ // m_sEdit = sText;
+ // UpdateData(FALSE);
+ // }
+ // break;
+ //default:
+ // break;
+ //}
+ }
+
+ CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
+}
+
+/* Will be called by the Framework, i.e. if Enter has been pressed */
+void CCanEasy_Xoraya_PluginDlg::OnOK()
+{
+ UpdateData();
+
+ /* Here we select temporarily the next control, to provoke a KillFocus of
+ current Edit-Field. Then we set the focus back, so the content of the
+ inputfield is completely selected an can be edited immediately. */
+ NextDlgCtrl();
+ PrevDlgCtrl();
+
+ /* If we provide OnOK to the base class here, the dialog will be closed!
+ Just uncomment the following line if you want to have this behavior */
+ //CDialog::OnOK();
+}
+
+// when the user leaves the Input-Field
+void CCanEasy_Xoraya_PluginDlg::OnKillfocusIpAddress()
+{
+ UpdateData();
+ //if(m_signalEdit.IsAttached())
+ //{
+ // double dVal = atof(m_sEdit);
+ // m_signalEdit = dVal;
+ // m_sliderCtrl.SetPosEx(dVal);
+ //}
+}
+
+void CCanEasy_Xoraya_PluginDlg::InitControls()
+{
+ //if(m_signalEdit.IsAttached())
+ //{
+ // CAND_tHandle hSig = m_signalEdit;
+ // // Register callback which will be called when the signal value changes
+ // if(CAND_enRegisterCallback(::OnSignalValueChanged, CAND_enSigValueChanged, hSig, 0) == CAND_nERR_OK)
+ // {
+ // double dMin = m_signalEdit.GetMinVal();
+ // double dMax = m_signalEdit.GetMaxVal();
+ // double dFactor = m_signalEdit.GetFactor();
+ // double dVal = m_signalEdit;
+ // int iResolution = (int)((dMax - dMin) / dFactor);
+
+ // m_sliderCtrl.SetRangeEx(dMin, dMax, 0, iResolution, TRUE);
+ // m_sliderCtrl.SetPosEx(dVal);
+
+ // CString sText;
+ // sText.Format("%g", dVal);
+ // m_sEdit = sText;
+ // }
+ //}
+ PostMessage(WM_UPDATE_CONTROLS);
+}
+
+// activate all assigned controls, deactivate the others
+void CCanEasy_Xoraya_PluginDlg::EnableControls()
+{
+ //GetDlgItem(IDC_SLIDER1)->EnableWindow(m_signalEdit.IsAttached());
+ //GetDlgItem(IDC_EDIT1)->EnableWindow(m_signalEdit.IsAttached());
+ GetDlgItem(IDC_XORAYA_IPADDRESS)->EnableWindow();
+ GetDlgItem(IDC_BUS_COMBO)->EnableWindow();
+}
+
+/********************************************************************************************
+*
+* Function : OnSignalValueChanged - Callback-Function;
+*
+* Description : Will be called when a signal value has been changed.
+*
+* Parameter : hSig: Handle to the signal that has been changed.
+* dwUserData: user defined data
+*
+* Return : BYTE (always return 1 here)
+*
+********************************************************************************************/
+BYTE CCanEasy_Xoraya_PluginDlg::OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData)
+{
+ //if(hSig == m_signalEdit)
+ //{
+ // double dVal = m_signalEdit;
+ // m_sliderCtrl.SetPosEx(dVal);
+
+ // CString sText;
+ // sText.Format("%g", dVal);
+ // m_sEdit = sText;
+ // PostMessage(WM_UPDATE_CONTROLS);
+ //}
+ CAND_tHandle hMsg = CAND_hGetMessage(hSig);
+ OnMsgDataChanged(hMsg,0);
+ return 1;
+}
+
+BYTE CCanEasy_Xoraya_PluginDlg::OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData)
+{
+ if(m_pcAdaptor)
+ {
+ m_xMsgUpdMutex.lock();
+ int32_t i32Interface;
+ unsigned long ul32MsgId;
+ uint8_t au8MsgData[8];
+ CAND_enGetMsgID(hMsg,&ul32MsgId);
+ CAND_enGetMsgData(hMsg,au8MsgData);
+ CAND_tHandle hEcu = CAND_hGetEcu(hMsg);
+ CAND_tHandle hBus = CAND_hGetBus(hEcu);
+ char acBusName[OBJECT_NAME_LEN];
+ memset((void*) acBusName,0,OBJECT_NAME_LEN);
+ CAND_enGetName(hBus,acBusName,OBJECT_NAME_LEN);
+ std::string sBusName(acBusName);
+
+ tInterfaceMap::right_const_iterator it = m_xInterfaceMap.right.find(sBusName);
+ if( it != m_xInterfaceMap.right.end() )
+ {
+ i32Interface = it->second;
+ Log("sending update for msg %#x",ul32MsgId);
+ m_pcAdaptor->vChangeMsgData(i32Interface,ul32MsgId,au8MsgData);
+ }
+ m_xMsgUpdMutex.unlock();
+ }
+
+ return 1;
+}
+
+/* Will be called when the signal has been changed and the controls have to be updated */
+LRESULT CCanEasy_Xoraya_PluginDlg::OnUpdateControls(WPARAM /* wParam */, LPARAM lParam)
+{
+ UpdateData(FALSE);
+ return 0;
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedConnect()
+{
+ vConnect();
+}
+
+void CCanEasy_Xoraya_PluginDlg::vConnect()
+{
+ if(!m_pcAdaptor)
+ {
+ Log(m_sXorayaIpAddress);
+ m_pcAdaptor.reset(
+ new CXorayaAdaptor( this, std::string( (LPCTSTR) m_sXorayaIpAddress) )
+ );
+ Log("%s adaptor started",__FUNCTION__);
+ }
+}
+
+void CCanEasy_Xoraya_PluginDlg::Log(const char * format,...)
+{
+ boost::lock_guard<boost::mutex> lock(m_xLogMutex);
+ //m_xLogMutex.lock();
+ char buffer[5000];
+ memset(buffer,0,5000);
+ buffer[0] = '\r';
+ buffer[1] = '\n';
+
+ va_list ap;
+
+ va_start(ap, format);
+ vsprintf_s( (buffer+2), 4997, format, ap);
+ va_end(ap);
+
+ m_cLog = reinterpret_cast<CEdit*>(GetDlgItem(IDC_LOG));
+ CString sLog;
+ m_cLog->SetSel(
+ m_cLog->GetWindowTextLengthA(),
+ m_cLog->GetWindowTextLengthA()
+ );
+ m_cLog->ReplaceSel(CString(buffer));
+
+ //m_xLogMutex.unlock();
+}
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedMap()
+{
+ std::string sBus,sInterface;
+ CString sSelectedBusString,sSelectedInterface;
+ int32_t i32Interface;
+ CComboBox* pxBusCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_BUS_COMBO));
+ CComboBox* pxInterfaceCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_INTERFACE_COMBO));
+ int i32BusIdx = pxBusCombo->GetCurSel();
+ int i32InterfaceIdx = pxInterfaceCombo->GetCurSel();
+ if(i32BusIdx == -1 || i32InterfaceIdx == -1)
+ {
+ return;
+ }
+ pxBusCombo->GetLBText(i32BusIdx,sSelectedBusString);
+ pxInterfaceCombo->GetLBText(i32InterfaceIdx,sSelectedInterface);
+ sInterface = (LPCTSTR) sSelectedInterface;
+ i32Interface = boost::lexical_cast<int32_t>( sInterface.substr(4,1) );
+ sBus = (LPCTSTR) sSelectedBusString;
+ vAddInterfaceMapping(i32Interface,sBus);
+}
+
+void CCanEasy_Xoraya_PluginDlg::vSetInterfaces( const char* pcInterface)
+{
+ CComboBox* pxInterfaceCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_INTERFACE_COMBO));
+ pxInterfaceCombo->ResetContent();
+ char *pcTok;
+ char acBuf[508];
+ strcpy(acBuf,pcInterface);
+ pcTok = strtok( acBuf, "\n" );
+ while( pcTok != NULL)
+ {
+ pxInterfaceCombo->AddString( CString(pcTok) );
+ pcTok = strtok(NULL,"\n");
+ }
+ pxInterfaceCombo->SetCurSel(0);
+}
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedUnmap()
+{
+ int32_t i32Interface = i32GetSelectedMappedInterface();
+ vRemoveInterfaceMapping(i32Interface);
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedGetinterfaces()
+{
+ vConnect();
+ m_pcAdaptor->vEnumerateInterfaces();
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedImportLog()
+{
+ CComboBox* pxLogsCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_LOGS_COMBO));
+ int i32SelectedLogIdx = pxLogsCombo->GetCurSel();
+ if(i32SelectedLogIdx == -1)
+ {
+ return;
+ }
+ CString sSelectedLogString;
+ pxLogsCombo->GetLBText(i32SelectedLogIdx,sSelectedLogString);
+ std::string s((LPCTSTR)sSelectedLogString);
+ vConnect();
+ m_pcAdaptor->vImportLogFile(s.c_str());
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedStart()
+{
+ std::string sSelectedCanEasyBusname;
+ int32_t i32Interface = 0;
+ std::string sSharedObjectFilename(nSTR_INVALID_SOFILE);
+ i32Interface = i32GetSelectedMappedInterface();
+ bool boAutoload = false;
+ CButton* pcAutoloadCheck = reinterpret_cast<CButton *>(GetDlgItem(IDC_CHECK_AUTOLOAD));
+ int i32Autoload = pcAutoloadCheck->GetCheck();
+ boAutoload = (i32Autoload==0)?false:true;
+ vGetSelectedMappedBus(sSelectedCanEasyBusname);
+ if(sSelectedCanEasyBusname.empty())
+ {
+ this->Log("No bus selected");
+ return;
+ }
+ vConnect();
+ vStopInterface(i32Interface);
+
+ CCodeGenerator xCodeGen(i32Interface,sSelectedCanEasyBusname,sSharedObjectFilename,boAutoload);
+ if( sSharedObjectFilename.compare(nSTR_INVALID_SOFILE) == 0 )
+ {
+ this->Log("Error creating shared object");
+ return;
+ }
+ m_pcAdaptor->vStartPlugin(i32Interface,sSharedObjectFilename.c_str());
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedStop()
+{
+ int32_t i32Interface = i32GetSelectedMappedInterface();
+
+ // Unregister callbacks
+ tInterfaceMap::left_map::iterator it = m_xInterfaceMap.left.find(i32Interface);
+ if( it != m_xInterfaceMap.left.end() )
+ {
+ std::string sBusName = it->second;
+ CAND_tHandle hBus = CAND_hGetBusByName(sBusName.c_str());
+ if( CAND_boIsValidHandle(hBus) )
+ {
+ CAND_tHandle hEcu = CAND_hGetFirstEcu(hBus);
+ while( hEcu )
+ {
+ CAND_tHandle hMsg = CAND_hGetFirstMsg(hEcu);
+ while( hMsg )
+ {
+ CAND_enUnRegisterCallback(
+ ::OnMsgDataChanged,CAND_enMsgDataChanged,hMsg,0);
+
+ hMsg = CAND_hGetNextMsg(hMsg);
+ }
+ hEcu = CAND_hGetNextEcu(hEcu);
+ }
+ }
+
+ }
+ vStopInterface(i32Interface);
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedShutdown()
+{
+ vConnect();
+ m_pcAdaptor->vShutdown();
+}
+
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedDisconnect()
+{
+ vDisconnect();
+}
+void CCanEasy_Xoraya_PluginDlg::vSetConnectionState( bool boConnected )
+{
+ CStatic* pxStatusField = reinterpret_cast<CStatic*>(GetDlgItem(IDC_CONNECTION_STATUS));
+ pxStatusField->SetWindowTextA( boConnected ? STR_CONNECTED : STR_DISCONNECTED );
+}
+void CCanEasy_Xoraya_PluginDlg::vDisconnect()
+{
+ if( m_pcAdaptor )
+ {
+ m_pcAdaptor->vDisconnect();
+ m_pcAdaptor.reset();
+ }
+ vSetInterfaces("");
+ CComboBox* pxMappedBusCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_MAPPEDBUS_COMBO));
+ pxMappedBusCombo->ResetContent();
+ pxMappedBusCombo->SetCurSel(0);
+ CComboBox* pxLogsCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_LOGS_COMBO));
+ pxLogsCombo->ResetContent();
+ pxLogsCombo->SetCurSel(0);
+}
+int32_t CCanEasy_Xoraya_PluginDlg::i32GetSelectedMappedInterface()
+{
+ std::vector<std::string> asTokens;
+ vGetSelectedMappedBusTokens(asTokens);
+ if( asTokens.size() != 3 )
+ {
+ return -1;
+ }
+ return boost::lexical_cast<int32_t>(asTokens[2]);
+}
+void CCanEasy_Xoraya_PluginDlg::vGetSelectedMappedBus(std::string &sSelMappedBus)
+{
+ std::vector<std::string> asTokens;
+ vGetSelectedMappedBusTokens(asTokens);
+ if( !asTokens.empty() )
+ {
+ sSelMappedBus = asTokens[0];
+ }
+}
+void CCanEasy_Xoraya_PluginDlg::vGetSelectedMappedBusTokens(std::vector<std::string> &asTokens)
+{
+ CComboBox* pxMappedBusCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_MAPPEDBUS_COMBO));
+ int i32MappedIdx = pxMappedBusCombo->GetCurSel();
+ if(i32MappedIdx == -1)
+ {
+ return;
+ }
+ CString sMappedBusString;
+ pxMappedBusCombo->GetLBText(i32MappedIdx,sMappedBusString);
+ boost::char_separator<char> sep(STR_MAP_SEP);
+ std::string s((LPCTSTR)sMappedBusString);
+ tokenizer tok(s, sep);
+ for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it)
+ {
+ asTokens.push_back(*it);
+ }
+}
+
+void CCanEasy_Xoraya_PluginDlg::vStopInterface(int32_t i32Interface)
+{
+ vConnect();
+ m_pcAdaptor->vStopPlugin(i32Interface);
+}
+
+void CCanEasy_Xoraya_PluginDlg::vAddInterfaceMapping(int32_t i32Interface, std::string sBus)
+{
+ vRemoveInterfaceMapping(i32Interface);
+ tInterfaceMap::right_const_iterator it = m_xInterfaceMap.right.find(sBus);
+ if( it != m_xInterfaceMap.right.end() )
+ {
+ vRemoveInterfaceMapping(it->second);
+ }
+ m_xInterfaceMap.insert(tInterfaceMap::value_type(i32Interface,sBus));
+ vUpdateMappingCombo();
+}
+void CCanEasy_Xoraya_PluginDlg::vRemoveInterfaceMapping(boost::int32_t i32Interface)
+{
+ if( m_xInterfaceMap.left.find(i32Interface) != m_xInterfaceMap.left.end() )
+ {
+ vStopInterface(i32Interface);
+ m_xInterfaceMap.left.erase(i32Interface);
+ }
+ vUpdateMappingCombo();
+}
+void CCanEasy_Xoraya_PluginDlg::vUpdateMappingCombo()
+{
+ tInterfaceMap::iterator it;
+ CComboBox* pxMappedBusCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_MAPPEDBUS_COMBO));
+ pxMappedBusCombo->ResetContent();
+ for( it = m_xInterfaceMap.begin(); it != m_xInterfaceMap.end(); it++)
+ {
+ std::stringstream sstr;
+ sstr << (it->right) << STR_MAP_SEP << "CAN " << (it->left);
+ pxMappedBusCombo->AddString( CString( sstr.str().c_str() ) );
+ }
+ pxMappedBusCombo->SetCurSel(0);
+}
+
+void CCanEasy_Xoraya_PluginDlg::vGetLog(const char* pcFilename)
+{
+ std::string sLogFilename(pcFilename);
+ Log("LogFilename received: %s",sLogFilename.c_str());
+ CLogImport xLogImport(sLogFilename);
+
+ CAND_tstParam stSrcFile;
+ CAND_tstParam stDestFile;
+ CAND_tstParam stVersion;
+
+ stSrcFile.pstNext = &stDestFile;
+ stDestFile.pstNext = &stVersion;
+ stVersion.pstNext = NULL;
+
+ stSrcFile.sVal = nASC_FILE;
+ stDestFile.sVal = NULL;
+ stVersion.sVal = "memman4.dll";
+
+ CAND_boDoActionId(NULL,"ConvertLog",&stSrcFile);
+ CAND_tHandle hEnvVarRoot = CAND_hGetRootEnvVar();
+ if( CAND_enIsNullHandle(hEnvVarRoot) )
+ {
+ return;
+ }
+ CAND_tHandle hDestFileNameVar = CAND_hGetEnvVarByName(hEnvVarRoot,"ConvertedRecord");
+ if( CAND_enIsNullHandle(hDestFileNameVar) )
+ {
+ return;
+ }
+ char acDestFileName[64];
+ memset(acDestFileName,0,64);
+ if( CAND_enGetEnvVarValue(hDestFileNameVar, (void*) acDestFileName, 64) != CAND_nERR_OK )
+ {
+ return;
+ }
+ Log(acDestFileName);
+
+}
+void CCanEasy_Xoraya_PluginDlg::OnBnClickedEnumLogs()
+{
+ vConnect();
+ m_pcAdaptor->vEnumerateLogs();
+}
+void CCanEasy_Xoraya_PluginDlg::vSetLogfiles(const char *pcLogfiles)
+{
+ CComboBox* pxLogsCombo = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_LOGS_COMBO));
+ pxLogsCombo->ResetContent();
+ char *pcTok;
+ char acBuf[508];
+ strcpy(acBuf,pcLogfiles);
+ pcTok = strtok( acBuf, "\n" );
+ while( pcTok != NULL)
+ {
+ pxLogsCombo->AddString( CString(pcTok) );
+ pcTok = strtok(NULL,"\n");
+ }
+ pxLogsCombo->SetCurSel(0);
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h
new file mode 100644
index 0000000..4bf4dd4
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDlg.h
@@ -0,0 +1,133 @@
+#if !defined(AFX_CanEasy_Xoraya_PluginDLG_H__62389228_87FF_4955_888E_1C54AF2A80F8__INCLUDED_)
+#define AFX_CanEasy_Xoraya_PluginDLG_H__62389228_87FF_4955_888E_1C54AF2A80F8__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// CanEasy_Xoraya_PluginDlg.h : Header-Datei
+//
+
+#include "resource.h" // main symbols
+#include "PanelDropTarget.h"
+#include "Signal.h"
+#include "FloatSliderCtrl.h"
+#include "NumEdit.h"
+#include <boost/shared_ptr.hpp>
+#include <string>
+#include <vector>
+#include <boost/bimap.hpp>
+#include "global.h"
+#include <istream>
+#include <boost/thread.hpp>
+
+#define nREQ_BUFF_SIZE (16)
+
+typedef boost::bimap<int32_t,std::string> tInterfaceMap;
+
+class CXorayaAdaptor;
+
+/////////////////////////////////////////////////////////////////////////////
+// Dialog CCanEasy_Xoraya_PluginDlg
+
+class CCanEasy_Xoraya_PluginDlg : public CDialog
+{
+// Construction
+public:
+ CCanEasy_Xoraya_PluginDlg(CWnd* pParent = NULL); // Standard constructor
+
+ void OnDatabaseChanged();
+ BYTE OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData);
+ BYTE OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData);
+// dialog data
+ //{{AFX_DATA(CCanEasy_Xoraya_PluginDlg)
+ enum { IDD = IDD_PLUGIN_MAIN_DIALOG };
+
+ //CNumEdit m_editCtrl;
+ //CFloatSliderCtrl m_sliderCtrl;
+ //CString m_sEdit;
+ //}}AFX_DATA
+
+
+// overridings
+ //{{AFX_VIRTUAL(CCanEasy_Xoraya_PluginDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// implementation
+protected:
+ // for Drag&Drop functionality
+ friend class CPanelDropTarget<CCanEasy_Xoraya_PluginDlg>;
+ CPanelDropTarget<CCanEasy_Xoraya_PluginDlg> m_dropTarget;
+ // Drag&Drop functions
+ DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
+ BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
+
+ //CSignal m_signalEdit; // signal for the slider
+
+ // generated message assignment functions
+ //{{AFX_MSG(CCanEasy_Xoraya_PluginDlg)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
+ afx_msg void OnKillfocusIpAddress();
+ afx_msg LRESULT OnUpdateControls(WPARAM wParam, LPARAM lParam);
+ virtual void OnOK();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+private:
+ HICON m_hIcon;
+ CIPAddressCtrl m_cIpAddressCtrl;
+ CEdit* m_cLog;
+
+ CString m_sXorayaIpAddress;
+ boost::shared_ptr<CXorayaAdaptor> m_pcAdaptor;
+ boost::mutex m_xLogMutex;
+ boost::mutex m_xMsgUpdMutex;
+ tInterfaceMap m_xInterfaceMap;
+
+ void InitControls(void);
+ void EnableControls(void);
+ void vConnect();
+public:
+ void Log(const char*,...);
+ void vSetInterfaces( const char* pcInterface );
+ void vSetConnectionState( bool boConnected );
+ void vDisconnect();
+ void vGetLog(const char* pcFilename);
+ void vSetLogfiles( const char* pcLogfiles );
+
+ int32_t i32GetSelectedMappedInterface();
+ void vGetSelectedMappedBus(std::string& sSelMappedBus);
+ void vGetSelectedMappedBusTokens(std::vector< std::string >& asTokens);
+ void vStopInterface(int32_t i32Interface);
+ void vAddInterfaceMapping(int32_t i32Interface, std::string sBus);
+ void vRemoveInterfaceMapping(int32_t i32Interface);
+ void vUpdateMappingCombo();
+ const char* sGetBusnameByInterface(int32_t i32Interface) const
+ {
+ if( m_xInterfaceMap.left.find(i32Interface) != m_xInterfaceMap.left.end() )
+ {
+ return m_xInterfaceMap.left.at(i32Interface).c_str();
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+
+ afx_msg void OnBnClickedConnect();
+ afx_msg void OnBnClickedMap();
+ afx_msg void OnBnClickedUnmap();
+ afx_msg void OnBnClickedGetinterfaces();
+ afx_msg void OnBnClickedStart();
+ afx_msg void OnBnClickedStop();
+ afx_msg void OnBnClickedDisconnect();
+ afx_msg void OnBnClickedShutdown();
+ afx_msg void OnBnClickedImportLog();
+ afx_msg void OnBnClickedEnumLogs();
+};
+
+//{{AFX_INSERT_LOCATION}}
+
+#endif // AFX_CanEasy_Xoraya_PluginDLG_H__62389228_87FF_4955_888E_1C54AF2A80F8__INCLUDED_
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps
new file mode 100644
index 0000000..82bc087
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.aps
Binary files differ
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp
new file mode 100644
index 0000000..9b458db
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.cpp
@@ -0,0 +1,489 @@
+// CanEasy_Xoraya_Plugin.cpp : Determines the initilization routines for the DLL.
+//
+
+
+#include "stdafx.h"
+#include "CanEasy_Xoraya_PluginDll.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+// Export-Definitions
+#define USERDLL_API __declspec(dllexport)
+#define USERDLL_CALL __stdcall
+
+
+// Add this macro in front of every function in Ansi-C notation
+// (Sample: Callback-Functions of the CanDll, also exported functions of this DLL.)
+#define ANSI_C extern "C"
+
+/////////////////////////////////////////////////////////////////////////////
+// CCanEasy_Xoraya_PluginApp
+
+BEGIN_MESSAGE_MAP(CCanEasy_Xoraya_PluginApp, CWinApp)
+ //{{AFX_MSG_MAP(CCanEasy_Xoraya_PluginApp)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CCanEasy_Xoraya_PluginApp Konstruktion
+
+CCanEasy_Xoraya_PluginApp::CCanEasy_Xoraya_PluginApp()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// the only CCanEasy_Xoraya_PluginApp-Object
+
+CCanEasy_Xoraya_PluginApp theApp;
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// //
+// Prototypes Own local functions //
+// //
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ANSI_C void USERDLL_CALL OnDatabaseChanged(CAND_tenDBChangedReason enReason, CAND_tHandle hObject);
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// //
+// Exported Standard-Functions //
+// //
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+/********************************************************************************************
+ *
+ * Function : DLL_dwGetAPIVersion
+ *
+ * Description : This function is called after loading the DLL file and before the
+ * DLL_boInit executed and is used to verify the API functions.
+ * In case of incompatibility the DLL gets unloaded.
+ *
+ * This function belongs to the standard functions pool and it
+ * MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be
+ * loaded inside CanEasy!
+ *
+ * Parameter : void
+ *
+ * Return : CANDLL_API_VERSION
+ *
+ ********************************************************************************************/
+ANSI_C USERDLL_API DWORD USERDLL_CALL DLL_dwGetAPIVersion()
+{
+ return CANDLL_API_VERSION;
+}
+
+/********************************************************************************************
+*
+* Function : DLL_boInit
+*
+* Description : This function will be called once, when DLL is loaded,
+* and is only called one single time, when the program has started.
+*
+* This function belongs to the standard functions pool and it
+* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be
+* loaded inside CanEasy!
+*
+* Parameter : HWND handle to the CanEasy application window
+*
+* Return : Returns TRUE on success, otherwise FALSE.
+*
+********************************************************************************************/
+ANSI_C USERDLL_API BOOL USERDLL_CALL DLL_boInit(HWND hMainWnd)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+ static CWnd wnd;
+ if(!wnd.GetSafeHwnd())
+ {
+ wnd.Attach(hMainWnd);
+ AfxGetApp()->m_pMainWnd = &wnd;
+ }
+
+ // Show the dialog only now, so that it receives the correct MainWnd.
+ theApp.ShowMainPanelDlg(TRUE);
+ theApp.Init();
+
+ // Register OnDatabaseChanged.
+ if(CAND_enRegisterCallback(OnDatabaseChanged, CAND_enDBChanged, CAND_hNullHandle(), 0) == CAND_nERR_OK)
+ {
+ // Insert code that has to be processed in case of successful registration.
+ OnDatabaseChanged(CAND_nDB_CHANGED, CAND_hNullHandle());
+ }
+ return TRUE;
+}
+
+/********************************************************************************************
+*
+* Function : DLL_vDeInit
+*
+* Description : This function will be called once the DLL is unloaded,
+* and is used for the final deinitialization. (Deallocation of dynamically
+* reserved memory, etc.)
+*
+* This function belongs to the standard functions pool and it
+* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be
+* loaded inside CanEasy or WinKI!
+*
+* Parameter : void
+*
+* Return : void
+*
+********************************************************************************************/
+ANSI_C USERDLL_API void USERDLL_CALL DLL_vDeInit()
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AfxGetMainWnd()->Detach();
+
+ // Unregister OnDatabaseChanged.
+ if(CAND_enUnRegisterCallback(OnDatabaseChanged, CAND_enDBChanged, CAND_hNullHandle(), 0) == CAND_nERR_OK)
+ {
+ // Insert code that has to be processed in case of successful deregistration.
+ }
+ theApp.DeInit();
+}
+
+/********************************************************************************************
+*
+* Function : DLL_vStart
+*
+* Description : This function will be called on the startup of
+* simulation.
+*
+* This function belongs to the standard functions pool and it
+* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be
+* loaded inside CanEasy!
+*
+* Parameter : void
+*
+* Return : void
+*
+********************************************************************************************/
+ANSI_C USERDLL_API void USERDLL_CALL DLL_vStart()
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+}
+
+
+/********************************************************************************************
+*
+* Function : DLL_vStop
+*
+* Description : This function will be called on the halt of the simulation run.
+*
+* This function belongs to the standard functions pool and it
+* MUST NOT HAVE TO BE deleted. Otherwise the DLL can not be
+* loaded inside CanEasy!
+*
+* Parameter : void
+*
+* Return : void
+*
+********************************************************************************************/
+ANSI_C USERDLL_API void USERDLL_CALL DLL_vStop()
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+}
+
+/********************************************************************************************
+*
+* Function : DLL_iPreTranslateMessage
+*
+* Description : This function will be called when a window message has to be processed.
+* (relevant for applications that create own windwos)
+*
+* Parameter : MSG* lpMsg: Points to a message structure of the Windows-Message.
+*
+* Return : TRUE, if the message has been exploited by the plugin and no further
+* actions shall take place. Otherwise FALSE.
+*
+********************************************************************************************/
+ANSI_C int USERDLL_CALL DLL_iPreTranslateMessage(MSG* lpMsg)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ TRY
+ {
+ return AfxGetThread()->PreTranslateMessage(lpMsg);
+ }
+ END_TRY
+
+ return FALSE;
+}
+
+
+/********************************************************************************************
+*
+* Function : DLL_vOnIdle
+*
+* Description : This function will be called when no window messages have to be
+* processed (the Thread is idling).
+*
+* Parameter : void
+*
+* Return : void
+*
+********************************************************************************************/
+ANSI_C void USERDLL_CALL DLL_vOnIdle(void)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ TRY
+ {
+ // flush it all at once
+ long lCount = 0;
+ while (AfxGetThread()->OnIdle(lCount))
+ lCount++;
+ }
+ END_TRY
+}
+
+/********************************************************************************************
+*
+* Function : DLL_iOnEvent
+*
+* Description : This function will be called when a tree event (e.g. left click) on the plugin
+* tree entry occurs.
+*
+* Parameter : void
+*
+* Return : void
+*
+********************************************************************************************/
+ANSI_C int USERDLL_CALL DLL_iOnEvent( UINT uiEvent, DWORD dwUserData1, DWORD dwUserData2 )
+{
+ CPoint point;
+ CMenu menu;
+ CMenu* pPopup;
+ int iRet = FALSE;
+ AFX_MANAGE_STATE( AfxGetStaticModuleState() );
+
+ switch(uiEvent)
+ {
+ case CAND_nSelected:
+ iRet = TRUE;
+ break;
+ case CAND_nDblClick:
+ theApp.ShowMainPanelDlg(TRUE);
+ iRet = TRUE;
+ break;
+ case CAND_nRBClick:
+ /* context menu */
+ GetCursorPos(&point);
+ if(!menu.LoadMenu(ID_POPUP_TREE_MENU))
+ return -1;
+ pPopup = menu.GetSubMenu(0);
+
+ if(CAND_boIsRunning())
+ menu.EnableMenuItem(ID_POPUP_REMOVE, MF_GRAYED | MF_BYCOMMAND);
+
+ iRet = pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON |
+ TPM_RETURNCMD | TPM_NONOTIFY, point.x, point.y, AfxGetMainWnd());
+
+ switch(iRet)
+ {
+ case ID_POPUP_SHOW:
+ theApp.ShowMainPanelDlg(TRUE);
+ iRet = TRUE;
+ break;
+ case ID_POPUP_REMOVE:
+ iRet = CAND_nDoDelete;
+ break;
+ default:
+ iRet = TRUE;
+ break;
+ }
+
+ if(iRet == ID_POPUP_SHOW)
+ theApp.ShowMainPanelDlg(TRUE);
+
+ break;
+
+ default:
+ /* Nothing to do. iRetVal is FALSE */
+ break;
+ }
+
+ return iRet;
+}
+
+/********************************************************************************************
+ *
+ * Function : DLL_iOnLoad
+ *
+ * Description : This function will be called on loading of the workspace.
+ *
+ * Parameter : hFileModule: Handle to the module registered at the FileManager.
+ * Relevant for loading the settings.
+ * dwModulVersion: Plugin version. It can be set in DLL_iSaveStates.
+ *
+ * Return : int: CAND_nFileNoError on success
+ *
+ ********************************************************************************************/
+ANSI_C int USERDLL_CALL DLL_iOnLoad(DWORD hFileModule, DWORD dwModulVersion)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+ WINDOWPLACEMENT info;
+
+ // Load stored window placement
+ if( CAND_enReadData(hFileModule, &info, sizeof(WINDOWPLACEMENT)) != CAND_nERR_OK)
+ return CAND_nFileErrorContinue;
+
+ if( theApp.m_pMainDlg->SetWindowPlacement(&info) == 0)
+ return CAND_nFileErrorContinue;
+
+ return CAND_nFileNoError;
+}
+
+/********************************************************************************************
+ *
+ * Function : DLL_iOnSave
+ *
+ * Description : This function will be called on saving of the workspace.
+ *
+ * Parameter : hFileModule: Handle to the module registered at the FileManager.
+ * Relevant for saving of settings.
+ * pdwModulVersion: Pointer to a structure for storage the plugin version.
+ *
+ * Return : int: CAND_nFileNoError on success
+ *
+ ********************************************************************************************/
+ANSI_C int USERDLL_CALL DLL_iOnSave(DWORD hFileModule, DWORD* pdwModulVersion)
+{
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+ WINDOWPLACEMENT info;
+
+ if(theApp.m_pMainDlg->GetWindowPlacement(&info) == 0)
+ return CAND_nFileErrorContinue;
+
+ // Store current window placement
+ if(CAND_enWriteData(hFileModule, &info, sizeof(WINDOWPLACEMENT)) != CAND_nERR_OK )
+ return CAND_nFileErrorContinue;
+
+ return CAND_nFileNoError;
+}
+
+BOOL CCanEasy_Xoraya_PluginApp::InitInstance()
+{
+ return CWinApp::InitInstance();
+}
+
+int CCanEasy_Xoraya_PluginApp::ExitInstance()
+{
+ return CWinApp::ExitInstance();
+}
+
+void CCanEasy_Xoraya_PluginApp::Init()
+{
+ try
+ {
+ ASSERT(m_pMainDlg == NULL);
+ m_pMainDlg = new CCanEasy_Xoraya_PluginDlg();
+ m_pMainDlg->Create(IDD_PLUGIN_MAIN_DIALOG, NULL);
+ m_pMainDlg->ShowWindow(SW_SHOWNORMAL);
+
+ CString sDllName;
+ if(!GetDllName(sDllName))
+ ASSERT(0);
+
+ // set the dialogs capture
+ m_pMainDlg->SetWindowText(sDllName);
+ }
+ catch(...)
+ {
+ ASSERT(0);
+ }
+}
+
+void CCanEasy_Xoraya_PluginApp::DeInit()
+{
+ if(m_pMainDlg)
+ {
+ m_pMainDlg->DestroyWindow();
+ delete m_pMainDlg;
+ m_pMainDlg = NULL;
+ }
+}
+
+void CCanEasy_Xoraya_PluginApp::ShowMainPanelDlg(BOOL boShow)
+{
+ if(m_pMainDlg && m_pMainDlg->m_hWnd)
+ {
+ if(boShow)
+ {
+ m_pMainDlg->ShowWindow(SW_SHOWNORMAL);
+ m_pMainDlg->SetForegroundWindow();
+ }
+ else
+ m_pMainDlg->ShowWindow(SW_HIDE);
+ }
+}
+
+/*****************************************************************************
+*
+* Function : GetDllName
+*
+* Description : Extract the filename from the path declaration.
+* Sample: GetFilename("C:\\TEMP\\TEST.TXT", sFilename)
+* returns in sFilename TEST.TXT.
+*
+* Parameter : sName: Recieves the Name of the DLL.
+*
+* Return : BOOL: TRUE on success
+*
+*****************************************************************************/
+BOOL CCanEasy_Xoraya_PluginApp::GetDllName(CString& sName)
+{
+ int iPos, iLength;
+ CString sModuleName;
+
+ if(! GetModuleFileName(AfxGetInstanceHandle(), sModuleName.GetBuffer(MAX_PATH), MAX_PATH))
+ return FALSE;
+
+ sModuleName.ReleaseBuffer();
+
+ iLength = sModuleName.GetLength();
+ iPos = sModuleName.ReverseFind('\\');
+ if(iLength > 0)
+ {
+ if(iPos >= 0)
+ sName = sModuleName.Mid(iPos + 1, iLength - iPos);
+ else
+ sName = sModuleName;
+
+ // cut the ending
+ iPos = sName.ReverseFind('.');
+ if(iPos >= 0)
+ sName = sName.Left(iPos);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/********************************************************************************************
+*
+* Function : OnDatabaseChanged - Callback-Function
+*
+* Description : Will be called on changings of the database.
+* Example: - Database has been newly generated.
+* - Another database has been loaded.
+*
+* Parameter : enReason: The reason why the database has been changed.
+* hObject: The object that has been changed.
+* Return : void
+*
+********************************************************************************************/
+ANSI_C void USERDLL_CALL OnDatabaseChanged(CAND_tenDBChangedReason enReason, CAND_tHandle hObject)
+{
+ if(theApp.m_pMainDlg && theApp.m_pMainDlg->m_hWnd)
+ {
+ theApp.m_pMainDlg->OnDatabaseChanged();
+ }
+}
+
+
+
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def
new file mode 100644
index 0000000..adde3e8
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.def
@@ -0,0 +1,13 @@
+; CanEasy_Xoraya_PluginDll.def : Declares the module parameters for the DLL.
+
+EXPORTS
+ DLL_dwGetAPIVersion
+ DLL_boInit
+ DLL_vDeInit
+ DLL_vStart
+ DLL_vStop
+ DLL_iPreTranslateMessage
+ DLL_vOnIdle
+ DLL_iOnEvent
+ DLL_iOnLoad
+ DLL_iOnSave
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h
new file mode 100644
index 0000000..b9ebf98
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.h
@@ -0,0 +1,53 @@
+// CanEasy_Xoraya_Plugin.h : Main header file for the DLL CanEasy_Xoraya_Plugin
+//
+
+#if !defined(AFX_CanEasy_Xoraya_Plugin_H__7825E21A_0213_44FD_9B84_343D09F0721F__INCLUDED_)
+#define AFX_CanEasy_Xoraya_Plugin_H__7825E21A_0213_44FD_9B84_343D09F0721F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef __AFXWIN_H__
+ #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+#include "canduserapi.h"
+#include "CanEasy_Xoraya_PluginDlg.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CCanEasy_Xoraya_PluginApp
+// See CanEasy_Xoraya_Plugin.cpp for implementation of this class.
+//
+
+class CCanEasy_Xoraya_PluginApp : public CWinApp
+{
+public:
+ CCanEasy_Xoraya_PluginApp();
+ void ShowMainPanelDlg(BOOL boShow);
+ BOOL GetDllName(CString& sName);
+
+ CCanEasy_Xoraya_PluginDlg *m_pMainDlg;
+
+// overridings
+ //{{AFX_VIRTUAL(CCanEasy_Xoraya_PluginApp)
+ public:
+ virtual BOOL InitInstance();
+ virtual int ExitInstance();
+
+ void Init();
+ void DeInit();
+ //}}AFX_VIRTUAL
+
+ //{{AFX_MSG(CCanEasy_Xoraya_PluginApp)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+
+#endif // !defined(AFX_CanEasy_Xoraya_Plugin_H__7825E21A_0213_44FD_9B84_343D09F0721F__INCLUDED_)
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico
new file mode 100644
index 0000000..b69ad08
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.ico
Binary files differ
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc
new file mode 100644
index 0000000..94c93c8
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_PluginDll.rc
@@ -0,0 +1,256 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Deutsch (Deutschland) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)\r\n"
+ "#ifdef _WIN32\r\n"
+ "LANGUAGE 7, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#endif //_WIN32\r\n"
+ "#include ""res\\CanEasy_Xoraya_PluginDll.rc2"" // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen\r\n"
+ "#include ""l.deu\\afxres.rc"" // Standardkomponenten\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 3,4,30,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040704B0"
+ BEGIN
+ VALUE "FileDescription", "CanEasy_Xoraya_Plugin DLL"
+ VALUE "FileVersion", "1, 0, 0, 1"
+ VALUE "InternalName", "CanEasy_Xoraya_Plugin"
+ VALUE "LegalCopyright", "Copyright© 2007"
+ VALUE "OriginalFilename", "CanEasy_Xoraya_Plugin.DLL"
+ VALUE "ProductName", "CanEasy_Xoraya_Plugin Dynamic Link Library"
+ VALUE "ProductVersion", "3, 4, 30, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x407, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_PLUGIN_MAIN_DIALOG DIALOGEX 0, 0, 478, 377
+STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "XORAYA Connect"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ GROUPBOX "TCP/IP Connection",IDC_GRP_XORAYA_CONNECTION,7,7,262,77
+ LTEXT "IP address",IDC_STATIC,17,23,34,8
+ CONTROL "",IDC_XORAYA_IPADDRESS,"SysIPAddress32",WS_TABSTOP,112,19,139,12
+ LTEXT "Connection Status",IDC_STATIC,17,43,59,8
+ LTEXT "Disconnected",IDC_CONNECTION_STATUS,112,43,45,8
+ PUSHBUTTON "Connect",IDC_BUTTON_CONNECT,112,61,58,14
+ PUSHBUTTON "Disconnect",IDC_BUTTON_DISCONNECT,190,61,61,14
+ GROUPBOX "Interface Mapping",IDC_STATIC,7,92,262,83
+ LTEXT "Interface",IDC_STATIC,17,113,29,8
+ LTEXT "Bus",IDC_STATIC,17,134,13,8
+ COMBOBOX IDC_INTERFACE_COMBO,112,109,139,77,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BUS_COMBO,112,129,139,67,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Map",IDC_MAP_BUTTON,190,153,61,14
+ PUSHBUTTON "Unmap",IDC_UNMAP_BUTTON,112,343,58,14
+ GROUPBOX "Import Log to CanEasy",IDC_STATIC,7,186,262,64
+ PUSHBUTTON "Import Log",IDC_IMPORTLOG_BUTTON,190,228,61,14
+ GROUPBOX "Control",IDC_STATIC,7,265,262,101
+ LTEXT "Mapped CanEasy Bus",IDC_STATIC,17,284,71,8
+ COMBOBOX IDC_MAPPEDBUS_COMBO,112,279,139,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Start",IDC_START_BUTTON,112,318,58,14
+ PUSHBUTTON "Stop",IDC_STOP_BUTTON,190,318,61,14
+ EDITTEXT IDC_LOG,276,11,194,355,ES_MULTILINE | ES_AUTOHSCROLL | WS_VSCROLL | WS_HSCROLL
+ PUSHBUTTON "Get Interfaces",IDC_GETINTERFACES_BUTTON,112,153,58,14
+ PUSHBUTTON "Shutdown",IDC_BUTTON_SHUTDOWN,190,343,61,14
+ CONTROL "Autoload",IDC_CHECK_AUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,299,44,10
+ PUSHBUTTON "Enumerate Logs",IDC_BUTTON_ENUMLOGS,112,228,58,14
+ COMBOBOX IDC_LOGS_COMBO,112,205,139,70,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Logfiles",IDC_STATIC,17,209,25,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_PLUGIN_MAIN_DIALOG, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 471
+ VERTGUIDE, 17
+ VERTGUIDE, 112
+ VERTGUIDE, 170
+ VERTGUIDE, 190
+ VERTGUIDE, 251
+ VERTGUIDE, 269
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 366
+ HORZGUIDE, 11
+ HORZGUIDE, 31
+ HORZGUIDE, 51
+ HORZGUIDE, 61
+ HORZGUIDE, 128
+ HORZGUIDE, 149
+ HORZGUIDE, 174
+ HORZGUIDE, 217
+ HORZGUIDE, 228
+ HORZGUIDE, 250
+ HORZGUIDE, 304
+ HORZGUIDE, 311
+ HORZGUIDE, 332
+ HORZGUIDE, 366
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON1 ICON "x2e.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+ID_POPUP_TREE_MENU MENU
+BEGIN
+ POPUP "Menu", CHECKED
+ BEGIN
+ MENUITEM "&Anzeigen", ID_POPUP_SHOW
+ MENUITEM "&Entfernen", ID_POPUP_REMOVE
+ END
+END
+
+#endif // Deutsch (Deutschland) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Englisch (USA) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+ID_POPUP_TREE_MENU MENU
+BEGIN
+ POPUP "Menu", CHECKED
+ BEGIN
+ MENUITEM "&Show", ID_POPUP_SHOW
+ MENUITEM "&Remove", ID_POPUP_REMOVE
+ END
+END
+
+#endif // Englisch (USA) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE 7, 1
+#pragma code_page(1252)
+#endif //_WIN32
+#include "res\CanEasy_Xoraya_PluginDll.rc2" // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen
+#include "l.deu\afxres.rc" // Standardkomponenten
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp
new file mode 100644
index 0000000..9a2308e
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.cpp
@@ -0,0 +1,236 @@
+#include "StdAfx.h"
+#include "CodeGenerator.h"
+#include "canduserapi.h"
+#include <fstream>
+#include <string>
+#include <string.h>
+#include <iostream>
+#include <stdio.h>
+
+#define OBJECT_NAME_LEN 256
+#define FTP_CMD_FILE "c:\\temp\\ftpcmd.txt"
+
+CCodeGenerator::CCodeGenerator(uint32_t u32Interface, const std::string& sBusName, std::string& sFilename, bool boAutoload)
+:m_u32XorayaInterface(u32Interface)
+,m_u32NumOfCanTxMessages(0)
+,m_boAutoload(boAutoload)
+,m_sCanEasyBusname(sBusName)
+{
+ m_sClassName = "CXorayaPlugin_" + m_sCanEasyBusname;
+ m_sImplFilename = "C:/temp/"+m_sClassName+".cpp";
+ m_sTargetFilename = "C:/temp/"+m_sClassName+".so";
+ vWriteImpl();
+ vWriteMakefile();
+ if( nenOK != enMakeTarget() )
+ {
+ return;
+ }
+ if( nenOK != enFtpSend() )
+ {
+ return;
+ }
+ sFilename = "./"+m_sClassName+".so";
+}
+
+CCodeGenerator::~CCodeGenerator(void)
+{
+}
+
+void CCodeGenerator::vWriteImpl()
+{
+ m_xStream.clear();
+ vGenerateMessages();
+ std::string sAutoload = m_boAutoload?"true":"false";
+ m_xStream << "#include \"plugin_api.h\"\n"
+ << "#include \"global.h\"\n"
+ << "\n"
+ << "class " << m_sClassName << " : public IPlugin\n{\n"
+ << "private:\n"
+ << "\tint32_t m_i32InterfaceHandle;\n"
+ << "\tuint32_t m_u32PluginId;\n"
+ << "\ttstCanTxMessage m_axCanTxMessages[" << m_u32NumOfCanTxMessages << "];\n"
+ << "public:\n"
+ << m_sClassName << "()\n"
+ << ":m_i32InterfaceHandle(0)"
+ << ",m_u32PluginId(0)"
+ << ",m_axCanTxMessages({";
+ m_xStream << m_xCanTxMessageStream.str();
+ m_xStream << "})\n"
+ << "{\n"
+ /*<< "\tDEBUG_PRINT(\"constructor\");\n"*/;
+ m_xStream << "}\n"
+ << "virtual ~" << m_sClassName << "()\n{\n}\n"
+ << "virtual void vRun()\n{\n}\n"
+ << "virtual tpstCanTxMessage pxGetCanTxMessage( const uint32_t u32MsgIndex )\n"
+ << "{\n"
+ << "\treturn &m_axCanTxMessages[u32MsgIndex];\n"
+ << "}\n"
+ << "virtual uint32_t u32GetNumOfCanTxMessages( void )\n"
+ << "{\n"
+ << "\treturn " << m_u32NumOfCanTxMessages << ";\n"
+ << "}\n"
+ << "virtual int32_t i32GetCanInterfaceHandle( void )\n"
+ << "{\n"
+ << "\treturn m_i32InterfaceHandle;\n"
+ << "}\n"
+ << "virtual void vLogMessage(const tstLogMessage& stLogMessage)\n{\n}\n"
+ << "virtual void vInit(void* pvExecutor, void* pvIfMan, int32_t i32Interface, uint32_t u32PluginId) \n"
+ << "{\n"
+ << "\tm_i32InterfaceHandle=i32Interface;\n"
+ << "\tm_u32PluginId=u32PluginId;\n"
+ << "}\n"
+ << "virtual bool boAutoload( void)\n"
+ << "{\n"
+ << "\treturn " << sAutoload << ";\n"
+ << "}\n"
+ << "virtual bool boIsLogger( void)\n"
+ << "{\n"
+ << "\treturn false;\n"
+ << "}\n"
+ << "tenRetCodes enGetLog(const char* pcRequest, char* pcResponse) \n"
+ << "{\n"
+ << "\treturn nenERR_NOTIMPLEMENTED;\n"
+ << "}\n"
+ << "};\n"
+ << "static " << m_sClassName << " xPlugin; \n"
+ << "extern \"C\" IPlugin* pxCreatePlugin("
+ << "void* pvExecutor, void* pvIfMan, int32_t i32Interface, uint32_t u32PluginId)\n"
+ << "{\n"
+ << "\txPlugin.vInit(pvExecutor,pvIfMan,i32Interface,u32PluginId);\n"
+ << "\treturn &xPlugin;\n"
+ << "}\n"
+ << "extern \"C\" void vDestroyPlugin(IPlugin* pxPlugin)\n"
+ << "{\n"
+ << "}\n";
+ vWriteStringstreamToFile(m_sImplFilename.c_str());
+}
+
+void CCodeGenerator::vGenerateMessages()
+{
+ m_xCanTxMessageStream.clear();
+ CAND_tHandle hBus,hEcu,hMsg;
+ CAND_tenSimState enSimState;
+ uint32_t u32MsgCounter = 0;
+ unsigned long ul32MsgId;
+ unsigned short u16MsgCycleTime;
+ uint8_t u8MsgDlc;
+ uint8_t au8MsgData[8];
+ char acBusName[OBJECT_NAME_LEN];
+ hBus = CAND_hGetFirstBus();
+ while(hBus)
+ {
+ CAND_enGetName(hBus,acBusName,OBJECT_NAME_LEN);
+ if( strcmp(acBusName,m_sCanEasyBusname.c_str()) == 0 )
+ {
+ hEcu = CAND_hGetFirstEcu(hBus);
+ while(hEcu)
+ {
+ CAND_enGetEcuState(hEcu,&enSimState);
+ if( enSimState == CAND_nSimulated )
+ {
+ hMsg = CAND_hGetFirstMsg(hEcu);
+ while(hMsg)
+ {
+ CAND_enGetMsgCycleTime(hMsg,&u16MsgCycleTime);
+ if( u16MsgCycleTime > 0 )
+ {
+ CAND_enGetMsgID(hMsg,&ul32MsgId);
+ CAND_enGetMsgDLC(hMsg,&u8MsgDlc);
+ CAND_enGetMsgData(hMsg,au8MsgData);
+ m_xCanTxMessageStream << "{ " << u16MsgCycleTime
+ << ", " << 0
+ << ", " << ul32MsgId
+ << ", {";
+ for(uint8_t u8Ctr=0; u8Ctr<8; u8Ctr++)
+ {
+ if( u8Ctr != 0)
+ {
+ m_xCanTxMessageStream << ", ";
+ }
+ m_xCanTxMessageStream << static_cast<int>(au8MsgData[u8Ctr]);
+ }
+ m_xCanTxMessageStream << " }"
+ << ", " << static_cast<int>(u8MsgDlc)
+ << "}, ";
+ m_u32NumOfCanTxMessages++;
+ CAND_enRegisterCallback(
+ OnMsgDataChanged,CAND_enMsgDataChanged,hMsg,0);
+ //CAND_tHandle hSig;
+ //hSig = CAND_hGetFirstSig(hMsg);
+ //while(hSig)
+ //{
+ // CAND_enRegisterCallback(OnSignalValueChanged,CAND_enSigValueChanged, hSig, 0);
+ // hSig = CAND_hGetNextSig(hSig);
+ //}
+ }
+ hMsg = CAND_hGetNextMsg(hMsg);
+ }
+ }
+ hEcu = CAND_hGetNextEcu(hEcu);
+ }
+ break;
+ }
+ hBus = CAND_hGetNextBus(hBus);
+ }
+}
+
+void CCodeGenerator::vWriteMakefile()
+{
+ std::string sObjFilename = m_sClassName + ".o";
+ m_xStream.clear();
+ m_xStream << "LIBS := \n"
+ << "G++ := c:/programme/x2e/x2e/toolchain/bin/powerpc-linux-gnu-g++.exe\n"
+ << "all:\n"
+ << "\t@echo 'Invoking cross compiler'\n"
+ << "\t$(G++)"
+ << " -Ic:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"
+ << " -I\"c:\\Dokumente und Einstellungen\\Eisenhauer\\Eigene Dateien\\Masterarbeit\\src\\common\\inc\""
+ << " -Os -g0 -Wall -c -fno-strict-aliasing -std=c++0x -msoft-float"
+ << " -mcpu=405 -fPIC -MMD -MP -o " << sObjFilename << " "
+ << m_sImplFilename << "\n"
+ << "\t@echo 'Invoking linker'\n"
+ << "\t$(G++) -L\"c:\\Programme\\x2e\\x2e\\toolchain\\powerpc-linux-gnu\\libc\\nof\\lib\""
+ << " -msoft-float -shared -o \"" << m_sTargetFilename << "\" " << sObjFilename
+ << " $(LIBS)\n" ;
+ vWriteStringstreamToFile("c:/temp/Makefile");
+}
+
+tenRetCodes CCodeGenerator::enMakeTarget() {
+ tenRetCodes enRetCode = nenOK;
+ int i32Res = system("cmd.exe /C \"cd c:\\temp && c:\\Programme\\x2e\\x2e\\toolchain\\bin\\make.exe\"");
+ if( i32Res != 0 )
+ {
+ enRetCode = nenERR_MAKE;
+ }
+ return enRetCode;
+}
+
+void CCodeGenerator::vWriteStringstreamToFile(const char* pcFilename)
+{
+ std::ofstream ofStr;
+ ofStr.open(pcFilename);
+ ofStr << m_xStream.rdbuf();
+ ofStr.close();
+}
+void CCodeGenerator::vWriteFtpCommandFile()
+{
+ m_xStream.clear();
+ m_xStream << "open 192.168.1.214\n"
+ << "user connect x2e\n"
+ << "\n"
+ << "binary\n"
+ << "put " << m_sTargetFilename << "\n"
+ << "bye\n";
+ vWriteStringstreamToFile(FTP_CMD_FILE);
+}
+tenRetCodes CCodeGenerator::enFtpSend()
+{
+ tenRetCodes enRetCode = nenOK;
+ vWriteFtpCommandFile();
+ int i32Res = system("cmd.exe /C \"ftp -n -s:c:\\temp\\ftpcmd.txt\"");
+ if( i32Res != 0 )
+ {
+ enRetCode = nenERR_FTP;
+ }
+ return enRetCode;
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h
new file mode 100644
index 0000000..ec2feab
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/CodeGenerator.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <string>
+#include <global.h>
+#include <sstream>
+
+#include <canduserapi.h>
+extern BYTE CALLBACK OnSignalValueChanged(CAND_tHandle hSig, DWORD dwUserData);
+extern BYTE CALLBACK OnMsgDataChanged(CAND_tHandle hMsg, DWORD dwUserData);
+
+class CCodeGenerator
+{
+public:
+ CCodeGenerator(uint32_t u32Interface, const std::string& sBusName, std::string& sFilename, bool boAutoload);
+ ~CCodeGenerator(void);
+private:
+ uint32_t m_u32XorayaInterface;
+ uint32_t m_u32NumOfCanTxMessages;
+ bool m_boAutoload;
+ std::string m_sCanEasyBusname;
+ std::string m_sImplFilename;
+ std::string m_sTargetFilename;
+ std::string m_sClassName;
+ std::stringstream m_xStream;
+ std::stringstream m_xCanTxMessageStream;
+ void vWriteImpl();
+ void vWriteMakefile();
+ void vWriteStringstreamToFile(const char* pcFilename);
+ void vGenerateMessages();
+ void vWriteFtpCommandFile();
+
+ tenRetCodes enFtpSend();
+ tenRetCodes enMakeTarget();
+};
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp
new file mode 100644
index 0000000..e51f2a7
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.cpp
@@ -0,0 +1,94 @@
+// FloatSliderCtrl.cpp: Implementation file
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+
+#include "stdafx.h"
+
+#include "FloatSliderCtrl.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+BEGIN_MESSAGE_MAP(CFloatSliderCtrl, CSliderCtrl)
+ //{{AFX_MSG_MAP(CFloatSliderCtrl)
+ ON_WM_KEYDOWN()
+ ON_WM_KEYUP()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+
+
+void CFloatSliderCtrl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
+{
+ if(nChar == VK_DOWN ||
+ nChar == VK_LEFT ||
+ nChar == VK_NEXT)
+ {
+ int iPos = GetPos();
+ int iDelta = (nChar == VK_NEXT || GetKeyState(VK_SHIFT) < 0) ? GetPageSize() : GetLineSize();
+ int iMin = GetRangeMin();
+
+ // avoid overflow
+ if(iPos - iMin < iDelta)
+ SetPos(iMin);
+ else
+ SetPos(iPos - iDelta);
+
+ // notify parent of position changing
+ if(CWnd* pParent = GetParent())
+ {
+ pParent->SendMessage(WM_HSCROLL, SB_RIGHT, (LPARAM)m_hWnd);
+ pParent->SendMessage(WM_HSCROLL, SB_ENDSCROLL, (LPARAM)m_hWnd);
+ }
+ }
+ else if(nChar == VK_UP ||
+ nChar == VK_RIGHT ||
+ nChar == VK_PRIOR)
+ {
+ int iPos = GetPos();
+ int iDelta = (nChar == VK_PRIOR || GetKeyState(VK_SHIFT) < 0) ? GetPageSize() : GetLineSize();
+ int iMax = GetRangeMax();
+
+ // avoid overflow
+ if(iMax - iPos < iDelta)
+ SetPos(iMax);
+ else
+ SetPos(iPos + iDelta);
+
+ // notify parent of position changing
+ if(CWnd* pParent = GetParent())
+ {
+ pParent->SendMessage(WM_HSCROLL, SB_LEFT, (LPARAM)m_hWnd);
+ pParent->SendMessage(WM_HSCROLL, SB_ENDSCROLL, (LPARAM)m_hWnd);
+ }
+ }
+ else
+ {
+ Default();
+ }
+}
+
+
+void CFloatSliderCtrl::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
+{
+ if(nChar == VK_DOWN ||
+ nChar == VK_LEFT ||
+ nChar == VK_NEXT)
+ {
+ }
+ else if(nChar == VK_UP ||
+ nChar == VK_RIGHT ||
+ nChar == VK_PRIOR)
+ {
+ }
+ else
+ {
+ Default();
+ }
+}
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h
new file mode 100644
index 0000000..c05fb65
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/FloatSliderCtrl.h
@@ -0,0 +1,81 @@
+#if !defined(AFX_FLOATSLIDERCTRL_H__F20BCF0E_FF88_466E_927F_BA63BDAD32CC__INCLUDED_)
+#define AFX_FLOATSLIDERCTRL_H__F20BCF0E_FF88_466E_927F_BA63BDAD32CC__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// FloatSliderCtrl.h : Header-File
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+
+#include <math.h> // Für floor
+
+/////////////////////////////////////////////////////////////////////////////
+// utility class CFloatSliderCtrl
+
+// derived class for simple handling of the sliders scope
+class CFloatSliderCtrl : public CSliderCtrl
+{
+private:
+ double m_fMin;
+ double m_fMax;
+
+ int m_iMin;
+ int m_iMax;
+
+public:
+ void SetRangeEx(double fMin, double fMax, double fResolution, BOOL bRedraw = FALSE)
+ {
+ m_fMin = fMin;
+ m_fMax = fMax;
+ m_iMin = 0;
+ m_iMax = int (fabs(fMax - fMin) / fResolution);
+ SetRange(m_iMin, m_iMax, bRedraw);
+ UpdatePageSize();
+ };
+ void SetRangeEx(double dMin, double dMax, int iMin, int iMax, BOOL bRedraw = FALSE)
+ {
+ m_fMin = dMin;
+ m_fMax = dMax;
+ m_iMin = iMin;
+ m_iMax = iMax;
+ SetRange(m_iMin, m_iMax, bRedraw);
+ UpdatePageSize();
+ };
+ void SetPosEx(double fPos)
+ {
+ int iPos = (int) (m_iMin + (fPos - m_fMin) * (m_iMax - m_iMin) / (m_fMax - m_fMin));
+ SetPos(iPos);
+ };
+ double GetPosEx() const
+ {
+ int iPos = GetPos();
+ double fRetVal = m_fMin + (iPos - m_iMin) * (m_fMax - m_fMin) / (m_iMax - m_iMin);
+ return fRetVal;
+ };
+
+private:
+ void UpdatePageSize()
+ {
+ // set step range (50 steps, but at least 10 units)
+ int iPage = (m_iMax - m_iMin) / 50;
+ if(iPage < 10)
+ iPage = 10;
+ if(iPage > m_iMax)
+ iPage = m_iMax;
+ SetPageSize(iPage);
+ };
+
+ //{{AFX_MSG(CFloatSliderCtrl)
+ afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
+ afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ inserts, in front of the foregoing Line, more declarations directly.
+
+#endif // AFX_FLOATSLIDERCTRL_H__F20BCF0E_FF88_466E_927F_BA63BDAD32CC__INCLUDED_
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp
new file mode 100644
index 0000000..77479dd
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.cpp
@@ -0,0 +1,107 @@
+#include "StdAfx.h"
+#include "LogImport.h"
+#include <fstream>
+#include <sstream>
+#include <protocol.h>
+#include <intrin.h>
+#include <iomanip>
+#include <global.h>
+#include <time.h>
+
+#define nFTP_CMD_FILE "c:\\temp\\fetchlog_ftpcmd.txt"
+#define nFTP_CMD(x) "cmd.exe /C \"ftp -n -s:" ##x "\""
+#define nFTP_LOCAL_LOG_FILE "c:\\temp\\xoraya.log"
+
+CLogImport::CLogImport(std::string& sLogFilename)
+:m_sLogFilename(sLogFilename)
+{
+ enFetchLogfile();
+ enConvertLog();
+}
+
+CLogImport::~CLogImport(void)
+{
+}
+
+tenRetCodes CLogImport::enFetchLogfile()
+{
+ tenRetCodes enRetCode = nenOK;
+ std::ofstream ofStr;
+ ofStr.open(nFTP_CMD_FILE);
+ ofStr << "open 192.168.1.214\n"
+ << "user connect x2e\n"
+ << "\n"
+ << "binary\n"
+ << "get " << m_sLogFilename << " " << nFTP_LOCAL_LOG_FILE << "\n"
+ << "bye\n";
+ ofStr.close();
+ int i32Res = system(nFTP_CMD(nFTP_CMD_FILE));
+ if( i32Res != 0 )
+ {
+ enRetCode = nenERR_FTP;
+ }
+ return enRetCode;
+}
+
+tenRetCodes CLogImport::enConvertLog()
+{
+ std::ofstream os( nASC_FILE );
+ std::ifstream is( nFTP_LOCAL_LOG_FILE, std::ios::in | std::ios::binary );
+ uint32_t u32Cnt = 0;
+ unsigned __int64 u64StartTs, u64ActTs;
+ double dAbsTs = 0.0;
+ int32_t i32Time = 0;
+ time_t xEpochSeconds = 0;
+ is.read( reinterpret_cast<char *>(&i32Time), sizeof(int32_t));
+ i32Time = _byteswap_ulong(i32Time);
+ xEpochSeconds = i32Time;
+ CTime xNow(xEpochSeconds);
+ CString sDate = xNow.Format("%a %b %d %H:%M:%S %Y");
+ os << "date " << sDate.GetBuffer() << std::endl;
+ os << "base hex timestamps absolute" << std::endl;
+ os << "internal events logged" << std::endl;
+ os << "// version 7.1.0" << std::endl;
+ os << "Begin Triggerblock " << sDate.GetBuffer() << std::endl;
+ while( is.good() )
+ {
+ std::stringstream ss;
+ tstLogMessage stLogMsg;
+ char* p = reinterpret_cast<char *>(&stLogMsg);
+ is.read(p,sizeof(tstLogMessage));
+ stLogMsg.u32TsHigh = BYTE_SWAP32(uint32_t,stLogMsg.u32TsHigh);
+ stLogMsg.u32TsLow = BYTE_SWAP32(uint32_t,stLogMsg.u32TsLow);
+ if( u32Cnt == 0)
+ {
+ u64StartTs = ((unsigned __int64) stLogMsg.u32TsHigh) << 32 | stLogMsg.u32TsLow;
+ u64ActTs = u64StartTs;
+ }
+ else
+ {
+ u64ActTs = ((unsigned __int64) stLogMsg.u32TsHigh) << 32 | stLogMsg.u32TsLow;
+ }
+ dAbsTs = ((double) (u64ActTs - u64StartTs)) * 0.0000001;
+ if( dAbsTs > (24 * 60 * 60 * 7) )
+ {
+ continue;
+ }
+ stLogMsg.i32Interface = BYTE_SWAP32(int32_t,stLogMsg.i32Interface);
+ stLogMsg.u32MsgId = BYTE_SWAP32(uint32_t,stLogMsg.u32MsgId);
+ ss << std::right << std::setw(11) << std::fixed << dAbsTs << " "
+ << std::left << std::setw(2)
+ << stLogMsg.i32Interface << " " << std::setw(15)
+ << std::hex << stLogMsg.u32MsgId << " "
+ << ( (stLogMsg.u8Dir==0)?"Rx":"Tx" ) <<" d 8 ";
+ for( uint8_t u8Cnt = 0; u8Cnt < 8; u8Cnt++)
+ {
+ ss << " " << std::setfill('0') << std::setw(2) << std::right;
+ ss << static_cast<int>(stLogMsg.au8Data[u8Cnt]);
+ }
+ ss << std::endl;
+ os << ss.rdbuf() << std::flush;
+ u32Cnt++;
+ }
+ os << "End Triggerblock" << std::endl;
+ is.close();
+ os.close();
+ return nenOK;
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h
new file mode 100644
index 0000000..2c0e36e
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/LogImport.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include <string>
+#include "global.h"
+
+#define nASC_FILE "c:\\temp\\xoraya.asc"
+
+class CLogImport
+{
+public:
+ CLogImport(std::string&);
+ virtual ~CLogImport(void);
+private:
+ std::string& m_sLogFilename;
+ tenRetCodes enFetchLogfile();
+ tenRetCodes enConvertLog();
+};
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp
new file mode 100644
index 0000000..770aa7d
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.cpp
@@ -0,0 +1,32 @@
+// NumEdit.cpp: Implementation file
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+
+#include "stdafx.h"
+#include "NumEdit.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CNumEdit
+
+BEGIN_MESSAGE_MAP(CNumEdit, CEdit)
+ //{{AFX_MSG_MAP(CNumEdit)
+ ON_WM_CHAR()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// Processroutines for the Messages of CNumEdit
+
+void CNumEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
+{
+ // let pass only numbers and control characters
+ if(isdigit(nChar) || iscntrl(nChar) || ispunct(nChar))
+ CEdit::OnChar(nChar, nRepCnt, nFlags);
+}
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h
new file mode 100644
index 0000000..7025de4
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/NumEdit.h
@@ -0,0 +1,48 @@
+#if !defined(AFX_NUMEDIT_H__B5C5A09A_3CE1_499E_9138_6C184712E2A2__INCLUDED_)
+#define AFX_NUMEDIT_H__B5C5A09A_3CE1_499E_9138_6C184712E2A2__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// NumEdit.h : Header-File
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// Fenster CNumEdit
+
+class CNumEdit : public CEdit
+{
+// Konstruktion
+public:
+
+// Attribute
+public:
+
+// Operationen
+public:
+
+// Überschreibungen
+ // Overloadings of virtual Functions, which are generetad by the classassistant
+ //{{AFX_VIRTUAL(CNumEdit)
+ //}}AFX_VIRTUAL
+
+// Implementierung
+public:
+
+ // Generated Messageassignfunctions
+protected:
+ //{{AFX_MSG(CNumEdit)
+ afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
+ //}}AFX_MSG
+
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ inserts, in front of the foregoing Line, more declarations directly.
+
+#endif // AFX_NUMEDIT_H__B5C5A09A_3CE1_499E_9138_6C184712E2A2__INCLUDED_
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h
new file mode 100644
index 0000000..1c78ad8
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/PanelDropTarget.h
@@ -0,0 +1,125 @@
+// PanelDropTarget.h
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+// Generic implementation for a COleDropTarget
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_PANELDROPTARGET_H__CAD0927D_1E0D_49B2_BF15_4C2098E4155E__INCLUDED_)
+#define AFX_PANELDROPTARGET_H__CAD0927D_1E0D_49B2_BF15_4C2098E4155E__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+template<class T>
+class CPanelDropTarget : public COleDropTarget
+{
+public:
+ /*****************************************************************************
+ *
+ * CPanelDropTarget::OnDragEnter
+ *
+ * Description : Called when the user drags the object into the panel.
+ *
+ * Parameter : pWnd: Points to the window the cursor is entering
+ * pDataObject: Points to the data object containing the data
+ * that can be dropped.
+ * dwKeyState: Contains the state of the modifier keys.
+ * point: Contains the current location of the cursor in
+ * client coordinates.
+ *
+ * Return : DROPEFFECT
+ *
+ *****************************************************************************/
+ DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject,
+ DWORD dwKeyState, CPoint point)
+ {
+ DROPEFFECT dropeffectRet = DROPEFFECT_COPY;
+
+ if((dwKeyState & MK_CONTROL) != MK_CONTROL)
+ dropeffectRet = DROPEFFECT_COPY;
+
+ // Don't change anything while the simulation is running
+ if(CAND_boIsRunning())
+ return DROPEFFECT_NONE;
+
+ return dropeffectRet;
+ }
+
+ /*****************************************************************************
+ *
+ * CPanelDropTarget::OnDragOver
+ *
+ * Description : Called when the user drags the object over tree control
+ *
+ * Parameter : pWnd: Points to the window the cursor is entering
+ * pDataObject: Points to the data object containing the data
+ * that can be dropped.
+ * dwKeyState: Contains the state of the modifier keys.
+ * point: Contains the current location of the cursor in
+ * client coordinates.
+ *
+ * Return : DROPEFFECT
+ *
+ *****************************************************************************/
+ DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject,
+ DWORD dwKeyState, CPoint point)
+ {
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+ T* pDlg = static_cast<T*>(pWnd);
+
+ if(pWnd != NULL)
+ return pDlg->OnDragOver(pDataObject, dwKeyState, point);
+
+ return DROPEFFECT_NONE;
+ }
+ /*****************************************************************************
+ *
+ * CPanelDropTarget::OnDragLeave
+ *
+ * Description : Called when the user drags the object out of a panel
+ *
+ * Parameter : CWnd* pWnd -
+ *
+ * Return : void
+ *
+ *****************************************************************************/
+ void OnDragLeave(CWnd* pWnd)
+ {
+ }
+
+ /*****************************************************************************
+ *
+ * CPanelDropTarget::OnDrop
+ *
+ * Description : Called when the user drops the object to the Tree control
+ *
+ * Parameter : pWnd: Points to the window the cursor is entering
+ * pDataObject: Points to the data object containing the data
+ * that can be dropped.
+ * dropEffect: Contains the effect on the data after dropping (NONE, MOVE, COPY etc.).
+ * point: Contains the current location of the cursor in
+ * client coordinates.
+ *
+ * Return : BOOL : Nonzero if the drop is successful; otherwise 0.
+ *
+ *****************************************************************************/
+ BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
+ {
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+ T* pDlg = static_cast<T*>(pWnd);
+
+ if(pWnd != NULL)
+ return pDlg->OnDrop(pDataObject, dropEffect, point);
+
+ return FALSE;
+ }
+};
+
+
+#endif // !defined(AFX_PANELDROPTARGET_H__CAD0927D_1E0D_49B2_BF15_4C2098E4155E__INCLUDED_)
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp
new file mode 100644
index 0000000..3b57b3d
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.cpp
@@ -0,0 +1,233 @@
+// Signal.cpp: Implementation of the class CSignal.
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "Signal.h"
+
+#include <math.h>
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+#define MAX_SIGNAL_PATH_LENGTH 255
+
+// rounds the given number to the next possible multiple of fraction up/down
+double roundAdv(double a, double fraction)
+{
+ double a1 = floor(a / fraction) * fraction;
+ double a2 = (floor(a / fraction)+1) * fraction;
+ if ((a - a1) < (a2 - a))
+ return a1;
+ else
+ return a2;
+}
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CSignal::CSignal()
+{
+ m_hSignal = CAND_hNullHandle();
+}
+
+
+//////////////////////////////////////////////////////////////////////
+// Methods
+//////////////////////////////////////////////////////////////////////
+
+BOOL CSignal::Attach(CAND_tHandle hSig)
+{
+ if(!CAND_enIsNullHandle(hSig))
+ {
+ m_hSignal = hSig;
+
+ char cpPath[MAX_SIGNAL_PATH_LENGTH];
+ if(CAND_enHandleToText(hSig, cpPath, MAX_SIGNAL_PATH_LENGTH) == CAND_nERR_OK)
+ {
+ m_sSigPath = cpPath;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+BOOL CSignal::IsAttached()
+{
+ return m_hSignal != CAND_hNullHandle();
+}
+
+// with the signal path it retrieves the Handle again
+void CSignal::UpdateHandle()
+{
+ m_hSignal = CAND_hTextToHandle(m_sSigPath);
+}
+
+// assignoperator for physical values
+CSignal& CSignal::operator=(double dVal)
+{
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ double dFactor;
+ if(CAND_enGetSigFactor(m_hSignal, &dFactor) == CAND_nERR_OK)
+ {
+ dVal = roundAdv(dVal, dFactor);
+ VERIFY(CAND_enSetSigDataPhys(m_hSignal, dVal) == CAND_nERR_OK);
+ }
+ }
+
+ return *this;
+}
+
+// assignoperator for hex values
+CSignal& CSignal::operator=(DWORD dwVal)
+{
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ VERIFY(CAND_enSetSigDataHex(m_hSignal, (QWORD)dwVal) == CAND_nERR_OK);
+ }
+
+ return *this;
+}
+
+
+// assignoperator for hex values
+CSignal& CSignal::operator=(QWORD qwVal)
+{
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ VERIFY(CAND_enSetSigDataHex(m_hSignal, qwVal) == CAND_nERR_OK);
+ }
+
+ return *this;
+}
+
+
+// assignoperator für hex values
+CSignal& CSignal::operator=(int iVal)
+{
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ VERIFY(CAND_enSetSigDataHex(m_hSignal, (QWORD)iVal) == CAND_nERR_OK);
+ }
+
+ return *this;
+}
+
+CSignal::operator double() const
+{
+ double dVal = 0.;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigDataPhys(m_hSignal, &dVal);
+ }
+
+ return dVal;
+}
+
+CSignal::operator DWORD() const
+{
+ QWORD qwVal = 0;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal));
+ }
+
+ return (DWORD)qwVal;
+}
+
+CSignal::operator QWORD() const
+{
+ QWORD qwVal = 0;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal));
+ }
+
+ return qwVal;
+}
+
+CSignal::operator int() const
+{
+ QWORD qwVal = 0;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal));
+ }
+
+ return (int)qwVal;
+}
+
+CSignal::operator bool() const
+{
+ QWORD qwVal = 0;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigData(m_hSignal, &qwVal, sizeof(qwVal));
+ }
+
+ return qwVal != 0;
+}
+
+CSignal::operator CAND_tHandle() const
+{
+ return m_hSignal;
+}
+
+bool CSignal::operator==(CAND_tHandle hObj) const
+{
+ return m_hSignal == hObj;
+}
+
+
+double CSignal::GetMaxVal() const
+{
+ double dMax = 0.;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigMax(m_hSignal, &dMax);
+ }
+
+ return dMax;
+}
+
+double CSignal::GetMinVal() const
+{
+ double dMin = 0.;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigMin(m_hSignal, &dMin);
+ }
+
+ return dMin;
+}
+
+
+double CSignal::GetFactor() const
+{
+ double dFactor = 0.;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigFactor(m_hSignal, &dFactor);
+ }
+
+ return dFactor;
+}
+
+double CSignal::GetOffset() const
+{
+ double dOffset = 0.;
+ if(!CAND_enIsNullHandle(m_hSignal))
+ {
+ CAND_enGetSigOffset(m_hSignal, &dOffset);
+ }
+
+ return dOffset;
+}
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h
new file mode 100644
index 0000000..c729f81
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/Signal.h
@@ -0,0 +1,58 @@
+// Signal.h: Interface for the Class CSignal.
+//
+// Author: Stefan Rinke, Schleissheimer GmbH
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_SIGNAL_H__03D122FB_9154_4693_8E7F_0C36ECB8E816__INCLUDED_)
+#define AFX_SIGNAL_H__03D122FB_9154_4693_8E7F_0C36ECB8E816__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "CandUserApi.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// Helper class for signals
+
+class CSignal
+{
+public:
+ CSignal();
+
+public:
+ BOOL Attach(CAND_tHandle hSig); // assign a Handle to the object
+ BOOL IsAttached(); // returns TRUE on assignment of a signal
+ void UpdateHandle(); // with the signal path it retrieves the Handle again
+
+ CSignal& operator=(double dVal);
+ CSignal& operator=(DWORD dwVal);
+ CSignal& operator=(QWORD qwVal);
+ CSignal& operator=(int iVal);
+
+ operator double() const;
+
+ operator DWORD() const;
+ operator QWORD() const;
+ operator int() const;
+ operator bool() const;
+
+ operator CAND_tHandle() const;
+
+ bool operator==(CAND_tHandle hObj) const;
+
+ double GetMaxVal() const;
+ double GetMinVal() const;
+ double GetFactor() const;
+ double GetOffset() const;
+
+private:
+ CAND_tHandle m_hSignal;
+
+ // Attributes
+public:
+ CString m_sSigPath;
+};
+
+#endif // !defined(AFX_SIGNAL_H__03D122FB_9154_4693_8E7F_0C36ECB8E816__INCLUDED_)
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp
new file mode 100644
index 0000000..f251b95
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.cpp
@@ -0,0 +1,4 @@
+#include "stdafx.h"
+
+
+
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h
new file mode 100644
index 0000000..54c2d44
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/StdAfx.h
@@ -0,0 +1,41 @@
+#define _CRT_SECURE_NO_WARNINGS
+
+#if !defined(AFX_STDAFX_H__51E8D306_6C43_400B_9999_4B4FF5E89C0A__INCLUDED_)
+#define AFX_STDAFX_H__51E8D306_6C43_400B_9999_4B4FF5E89C0A__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#ifndef WINVER
+#define WINVER 0x0502
+#endif
+
+#define VC_EXTRALEAN
+
+#include <afxwin.h>
+#include <afxext.h>
+
+#ifndef _AFX_NO_OLE_SUPPORT
+#include <afxole.h>
+#include <afxodlgs.h>
+#include <afxdisp.h>
+#endif // _AFX_NO_OLE_SUPPORT
+
+
+#ifndef _AFX_NO_DB_SUPPORT
+#include <afxdb.h>
+#endif // _AFX_NO_DB_SUPPORT
+
+#ifndef _AFX_NO_DAO_SUPPORT
+#include <afxdao.h>
+#endif // _AFX_NO_DAO_SUPPORT
+
+#include <afxdtctl.h>
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+//{{AFX_INSERT_LOCATION}}
+
+#endif // !defined(AFX_STDAFX_H__51E8D306_6C43_400B_9999_4B4FF5E89C0A__INCLUDED_)
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp
new file mode 100644
index 0000000..3e11d90
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.cpp
@@ -0,0 +1,382 @@
+#include "StdAfx.h"
+#include "XorayaAdaptor.h"
+#include "CanEasy_Xoraya_PluginDlg.h"
+#include <boost/bind.hpp>
+#include <exception>
+#include <CNetworkStream.h>
+#include <NetworkTypes.h>
+#include <NetworkMessages.h>
+#include "protocol.h"
+
+CXorayaAdaptor::CXorayaAdaptor(CCanEasy_Xoraya_PluginDlg* pDlg, const std::string& sIpAddress)
+:m_pDlg(pDlg),m_work(m_io_service),m_sock(m_io_service)
+,m_xInStream(m_xRxNetworkBuffer.elems,nNETWORK_BUFFSIZE)
+,m_xOutStream(m_xTxNetworkBuffer.elems,nNETWORK_BUFFSIZE)
+,m_xNetworkMessageBuffer(8)
+,m_i32ReqUnread(0),m_i32TxMsgUnread(0),m_boTxMsgActive(false)
+{
+ if( sIpAddress.empty() )
+ {
+ return;
+ }
+ try
+ {
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string(sIpAddress),
+ nPORT
+ );
+ m_sock.async_connect(endpoint,
+ boost::bind(
+ &CXorayaAdaptor::vConnectHandler,
+ this,
+ boost::asio::placeholders::error
+ )
+ );
+ m_pThread.reset(new boost::thread(boost::bind(&boost::asio::io_service::run, &m_io_service)));
+ }
+ catch (std::exception& e)
+ {
+ m_pDlg->Log("%s caught exception: %s",__FUNCTION__,e.what());
+ }
+}
+
+CXorayaAdaptor::~CXorayaAdaptor(void)
+{
+ vDisconnect();
+ m_pDlg->Log(__FUNCTION__);
+}
+
+void CXorayaAdaptor::vReadHandler(const boost::system::error_code &ec, std::size_t bytes_transferred)
+{
+ if (!ec)
+ {
+ uint32_t u32BytesConsumed = 0;
+ uint32_t u32Len = nNETWORK_DATALENGTH;
+ uint32_t u32Pos = 0;
+ CNetworkDatacontainer::tstRespEnumerateInterfaces& stRespEnumerateInterfacesData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstRespEnumerateInterfaces*>(m_xDataContainer.pvGetVarPtr(nenRespEnumerateInterfaces)));
+ CNetworkDatacontainer::tstRespEnumerateLogs& stRespEnumerateLogsData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstRespEnumerateLogs*>(m_xDataContainer.pvGetVarPtr(nenRespEnumerateLogs)));
+ CNetworkDatacontainer::tstRespImportLog& stRespImportLogData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstRespImportLog*>(m_xDataContainer.pvGetVarPtr(nenRespImportLog)));
+ CNetworkDatacontainer::tstRxNetworkMessageMsg& stRxMsg =
+ *(reinterpret_cast<CNetworkDatacontainer::tstRxNetworkMessageMsg*>(m_xDataContainer.pvGetVarPtr(nenNumberOfNetworkMessageTypes)));
+ do
+ {
+ u32Pos = m_xInStream.u32GetByteCount();
+ sxRxMsgHeader.vRead(m_xDataContainer,m_xInStream);
+ if( !m_xInStream.boIsOK() )
+ {
+ tenStreamError enError;
+ m_xInStream.vGetError(enError);
+ ERROR_PRINT("instream error %d",enError);
+ break;
+ }
+ m_xInStream.vSetPosition(u32Pos);
+ switch( stRxMsg.stHeader.enMessageType )
+ {
+ case nenRespStopPlugin:
+ sxRespStopPluginMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->Log("nenRespStopPlugin");
+ break;
+ case nenRespStartPlugin:
+ sxRespStartPluginMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->Log("nenRespStartPlugin");
+ break;
+ case nenRespInvalidArg:
+ sxRxMsgHeader.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->Log("nenRespInvalidArg");
+ break;
+ case nenRespUnknownReq:
+ sxRespUnknownReqMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->Log("nenRespUnknownReq");
+ break;
+ case nenRespEnumerateInterfaces:
+ m_pDlg->Log("nenRespEnumerateInterfaces");
+ sxRespEnumerateInterfacesMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->vSetInterfaces(stRespEnumerateInterfacesData.acInterfaces);
+ break;
+ case nenRespImportLog:
+ m_pDlg->Log("Receiving Xoraya log");
+ sxRespImportLogMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->vGetLog(stRespImportLogData.acFilename);
+ break;
+ case nenRespChangeMsgData:
+ sxRespChangeMsgDataMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->Log("nenRespChangeMsgData");
+ break;
+ case nenRespShutdown:
+ sxRespShutdownMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->Log("nenRespShutdown");
+ m_pDlg->vDisconnect();
+ break;
+ case nenRespEnumerateLogs:
+ m_pDlg->Log("nenRespEnumerateLogs");
+ sxRespEnumarateLogsMessage.vRead(m_xDataContainer,m_xInStream);
+ m_pDlg->vSetLogfiles(stRespEnumerateLogsData.acFilenames);
+ break;
+ case nenReqUploadLogMsg:
+ sxReqUploadLogMsgMessage.vRead(m_xDataContainer,m_xInStream);
+ vHandleLogMessageUpload();
+ break;
+ default:
+ m_pDlg->Log("Received unknown message type %d",stRxMsg.stHeader.enMessageType);
+ break;
+ }
+ u32BytesConsumed = m_xInStream.u32GetByteCount();
+ }
+ while(u32BytesConsumed < bytes_transferred);
+ vWaitForData();
+ }
+ else if( ec == boost::asio::error::eof)
+ {
+ m_pDlg->Log("%s eof %s",__FUNCTION__,ec.message().c_str());
+ vDisconnect();
+ }
+ else
+ {
+ m_pDlg->Log("%s failed %s",__FUNCTION__,ec.message().c_str());
+ vDisconnect();
+ }
+}
+
+void CXorayaAdaptor::vWriteHandler(const boost::system::error_code &ec, std::size_t bytes_transferred)
+{
+ if (!ec)
+ {
+ memset(m_xTxNetworkBuffer.elems,0,nNETWORK_BUFFSIZE);
+ m_xOutStream.vSetPosition(0);
+ vSendNextMessage();
+ }
+ else
+ {
+ m_pDlg->Log("%s failed %s",__FUNCTION__,ec.message().c_str());
+ vDisconnect();
+ }
+}
+
+void CXorayaAdaptor::vConnectHandler(const boost::system::error_code &ec)
+{
+ if (!ec)
+ {
+ m_pDlg->Log("%s connected",__FUNCTION__);
+ vWaitForData();
+ m_pDlg->vSetConnectionState(true);
+ }
+ else
+ {
+ m_pDlg->Log("%s received error: %s",__FUNCTION__, ec.message().c_str());
+ m_pDlg->vSetConnectionState(false);
+ }
+}
+
+void CXorayaAdaptor::vWaitForData()
+{
+ memset(m_xRxNetworkBuffer.elems,0,nNETWORK_BUFFSIZE);
+ m_xInStream.vSetPosition(0);
+ boost::asio::async_read(m_sock
+ ,boost::asio::buffer(m_xRxNetworkBuffer)
+ ,boost::asio::transfer_at_least( sizeof(tstNetworkMessageHeader) )
+ ,boost::bind(
+ &CXorayaAdaptor::vReadHandler,
+ shared_from_this(),
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+}
+
+void CXorayaAdaptor::vDisconnect()
+{
+ try
+ {
+ m_sock.shutdown(boost::asio::ip::tcp::socket::shutdown_both);
+ m_sock.close();
+ m_io_service.stop();
+ m_pThread->interrupt();
+ //m_pThread->join();
+ m_pDlg->Log("%s disconnected",__FUNCTION__);
+ m_pDlg->vSetConnectionState(false);
+ }
+ catch (std::exception& e)
+ {
+ m_pDlg->Log("%s caught exception: %s",__FUNCTION__,e.what());
+ }
+}
+
+void CXorayaAdaptor::vHandleLogMessageUpload()
+{
+ CNetworkDatacontainer::tstReqUploadLogMsg& stReqUploadLogMsgData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstReqUploadLogMsg*>(m_xDataContainer.pvGetVarPtr(nenReqUploadLogMsg)));
+
+ vSendMessage(nenRespUploadLogMsg);
+
+ //CAND_tHandle hMsg = CAND_hNullHandle();
+ //const char* pcBusnameForInterface = m_pDlg->sGetBusnameByInterface(stReqUploadLogMsgData.stLogMessage.i32Interface);
+ //if( pcBusnameForInterface != NULL )
+ //{
+ // hMsg = CAND_hFindObject(pcBusnameForInterface,NULL,NULL,stReqUploadLogMsgData.stLogMessage.u32MsgId,NULL,CAND_hNullHandle());
+ // if( CAND_nFALSE == CAND_enIsNullHandle(hMsg) )
+ // {
+ // BYTE arData[8];
+ // CAND_enGetMsgData(hMsg,arData);
+ // arData[0] = ~arData[0];
+ // CAND_enSetMsgData(hMsg,arData);
+ // m_pDlg->Log("updating msg data %#x to %#x",stReqUploadLogMsgData.stLogMessage.u32MsgId,arData[0]);
+ // }
+ //}
+}
+
+void CXorayaAdaptor::vStartPlugin(const int32_t i32Interface, const char* pcFilename)
+{
+ m_xReqStartPluginDataMutex.lock();
+ CNetworkDatacontainer::tstReqStartPlugin& stReqStartPluginData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstReqStartPlugin*>(m_xDataContainer.pvGetVarPtr(nenReqStartPlugin)));
+ stReqStartPluginData.i32Interface = i32Interface;
+ memcpy(stReqStartPluginData.acFilename,pcFilename,nNETWORK_DATALENGTH-4);
+ m_xReqStartPluginDataMutex.unlock();
+ vSendMessage(nenReqStartPlugin);
+}
+
+void CXorayaAdaptor::vStopPlugin(const int32_t i32Interface)
+{
+ m_xReqStopPluginDataMutex.lock();
+ CNetworkDatacontainer::tstReqStopPlugin& stReqStopPluginData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstReqStopPlugin*>(m_xDataContainer.pvGetVarPtr(nenReqStopPlugin)));
+ stReqStopPluginData.i32Interface = i32Interface;
+ m_xReqStopPluginDataMutex.unlock();
+ vSendMessage(nenReqStopPlugin);
+}
+
+void CXorayaAdaptor::vChangeMsgData( const int32_t i32Interface, const uint32_t u32CanMsgId, const uint8_t* pu8Data )
+{
+
+ m_xReqChangeMsgDataDataMutex.lock();
+ CNetworkDatacontainer::tstReqChangeMsgData& stReqChangeMsgDataData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstReqChangeMsgData*>(m_xDataContainer.pvGetVarPtr(nenReqChangeMsgData)));
+ stReqChangeMsgDataData.i32Interface = i32Interface;
+ stReqChangeMsgDataData.u32CanMsgId = u32CanMsgId;
+ memcpy(stReqChangeMsgDataData.au8Data,pu8Data,8);
+ m_xReqChangeMsgDataDataMutex.unlock();
+ vSendMessage(nenReqChangeMsgData);
+}
+
+void CXorayaAdaptor::vShutdown()
+{
+ vSendMessage(nenReqShutdown);
+}
+
+void CXorayaAdaptor::vEnumerateLogs()
+{
+ vSendMessage(nenReqEnumerateLogs);
+}
+
+void CXorayaAdaptor::vEnumerateInterfaces()
+{
+ vSendMessage(nenReqEnumerateInterfaces);
+}
+
+void CXorayaAdaptor::vImportLogFile(const char* pcFilename)
+{
+ m_xReqImportLogDataMutex.lock();
+ CNetworkDatacontainer::tstReqImportLog& stReqImportLogData =
+ *(reinterpret_cast<CNetworkDatacontainer::tstReqImportLog*>(m_xDataContainer.pvGetVarPtr(nenReqImportLog)));
+ memcpy(stReqImportLogData.acFilename,pcFilename,nNETWORK_DATALENGTH);
+ m_xReqImportLogDataMutex.unlock();
+ vSendMessage(nenReqImportLog);
+}
+
+void CXorayaAdaptor::vSendMessage(const tenNetworkMessageType enMsgType)
+{
+ m_io_service.post(boost::bind(&CXorayaAdaptor::vDoSendMessage, shared_from_this(), enMsgType));
+}
+
+void CXorayaAdaptor::vSendNextMessage()
+{
+ bool boTxActive = false;
+ {
+ boost::mutex::scoped_lock lock(m_xTxMutex);
+ boTxActive = m_boTxMsgActive;
+ }
+ if( boTxActive )
+ {
+ tenNetworkMessageType enMsgType = nenNumberOfNetworkMessageTypes;
+ {
+ boost::mutex::scoped_lock lock(m_xTxMutex);
+ enMsgType = m_xNetworkMessageBuffer[--m_i32TxMsgUnread];
+ if( m_i32TxMsgUnread == 0 )
+ {
+ m_boTxMsgActive = false;
+ }
+ }
+ switch( enMsgType )
+ {
+ case nenReqStartPlugin:
+ m_xReqStartPluginDataMutex.lock();
+ sxReqStartPluginMessage.vWrite(m_xDataContainer,m_xOutStream);
+ m_xReqStartPluginDataMutex.unlock();
+ break;
+ case nenReqStopPlugin:
+ m_xReqImportLogDataMutex.lock();
+ sxReqStopPluginMessage.vWrite(m_xDataContainer,m_xOutStream);
+ m_xReqImportLogDataMutex.unlock();
+ break;
+ case nenReqShutdown:
+ sxReqShutdownMessage.vWrite(m_xDataContainer,m_xOutStream);
+ break;
+ case nenReqEnumerateInterfaces:
+ sxReqEnumerateInterfacesMessage.vWrite(m_xDataContainer,m_xOutStream);
+ break;
+ case nenReqImportLog:
+ m_xReqImportLogDataMutex.lock();
+ sxReqImportLogMessage.vWrite(m_xDataContainer,m_xOutStream);
+ m_xReqImportLogDataMutex.unlock();
+ break;
+ case nenReqEnumerateLogs:
+ sxReqEnumerateLogsMessage.vWrite(m_xDataContainer,m_xOutStream);
+ break;
+ case nenRespUploadLogMsg:
+ sxRespUploadLogMsgMessage.vWrite(m_xDataContainer,m_xOutStream);
+ break;
+ case nenReqChangeMsgData:
+ m_xReqChangeMsgDataDataMutex.lock();
+ sxReqChangeMsgDataMessage.vWrite(m_xDataContainer,m_xOutStream);
+ m_xReqChangeMsgDataDataMutex.unlock();
+ break;
+ default:
+ break;
+ }
+ if( m_xOutStream.boIsOK() )
+ {
+ boost::asio::async_write(m_sock,
+ boost::asio::buffer(m_xTxNetworkBuffer,m_xOutStream.u32GetByteCount() ),
+ boost::bind(
+ &CXorayaAdaptor::vWriteHandler,
+ shared_from_this(),
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+ }
+ else
+ {
+ tenStreamError enError;
+ m_xOutStream.vGetError(enError);
+ ERROR_PRINT("outstream error %d",enError);
+ m_xOutStream.vReset();
+ }
+ }
+}
+
+void CXorayaAdaptor::vDoSendMessage(tenNetworkMessageType enMsgType)
+{
+ boost::mutex::scoped_lock lock(m_xTxMutex);
+ m_xNetworkMessageBuffer.push_front(enMsgType);
+ ++m_i32TxMsgUnread;
+ if( !m_boTxMsgActive )
+ {
+ m_boTxMsgActive = true;
+ lock.unlock();
+ vSendNextMessage();
+ }
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h
new file mode 100644
index 0000000..0aa75bb
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/XorayaAdaptor.h
@@ -0,0 +1,72 @@
+#pragma once
+
+#if !defined(XORAYA_ADAPTOR_H_)
+#define XORAYA_ADAPTOR_H_
+
+#include <string>
+#include <boost/asio.hpp>
+#include <boost/thread.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/circular_buffer.hpp>
+#include "global.h"
+#include "protocol.h"
+#include "CNetworkStream.h"
+#include "NetworkTypes.h"
+
+class CCanEasy_Xoraya_PluginDlg;
+
+typedef boost::circular_buffer<tenNetworkMessageType> tNetworkMessageBuffer;
+
+class CXorayaAdaptor : public boost::enable_shared_from_this<CXorayaAdaptor>
+{
+public:
+ CXorayaAdaptor(CCanEasy_Xoraya_PluginDlg* pDlg, const std::string& sIpAddress);
+ virtual ~CXorayaAdaptor(void);
+private:
+ // pointer to the controlling dialog
+ CCanEasy_Xoraya_PluginDlg* m_pDlg;
+
+ boost::asio::io_service m_io_service;
+ boost::asio::io_service::work m_work;
+ boost::asio::ip::tcp::socket m_sock;
+
+ tNetworkBuffer m_xRxNetworkBuffer;
+ tNetworkBuffer m_xTxNetworkBuffer;
+ CNetworkInStream m_xInStream;
+ CNetworkOutStream m_xOutStream;
+ CNetworkDatacontainer m_xDataContainer;
+ boost::mutex m_xReqStartPluginDataMutex;
+ boost::mutex m_xReqStopPluginDataMutex;
+ boost::mutex m_xReqImportLogDataMutex;
+ boost::mutex m_xReqChangeMsgDataDataMutex;
+ tNetworkMessageBuffer m_xNetworkMessageBuffer;
+ int32_t m_i32TxMsgUnread;
+ int32_t m_i32ReqUnread;
+ bool m_boTxMsgActive;
+
+ boost::shared_ptr<boost::thread> m_pThread;
+ boost::mutex m_xTxMutex;
+ void vWaitForData();
+ void vHandleLogMessageUpload();
+
+
+public:
+ void vConnectHandler(const boost::system::error_code &ec);
+ void vReadHandler(const boost::system::error_code &ec, std::size_t bytes_transferred);
+ void vWriteHandler(const boost::system::error_code &ec, std::size_t bytes_transferred);
+ void vDisconnect();
+ void vSendMessage(const tenNetworkMessageType enMsgType);
+ void vSendNextMessage();
+ void vStartPlugin(const int32_t i32Interface, const char* pcFilename);
+ void vStopPlugin(const int32_t i32Interface);
+ void vShutdown();
+ void vEnumerateLogs();
+ void vEnumerateInterfaces();
+ void vImportLogFile(const char* pcFilename);
+ void vChangeMsgData( const int32_t i32Interface, const uint32_t u32CanMsgId, const uint8_t* pu8Data );
+ void vDoSendMessage(const tenNetworkMessageType enMsgType);
+};
+
+#endif // XORAYA_ADAPTOR_H_ \ No newline at end of file
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h
new file mode 100644
index 0000000..714207d
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/include/canduserapi.h
@@ -0,0 +1,6487 @@
+
+/*!
+ * \file
+ * CandUserAPI.H
+ *
+ * \brief
+ * This file describes all function interfaces, that can be used
+ * by plugins to communicate with CanEasy.
+ *
+ * \author
+ * Schleißheimer GmbH
+ *
+ */
+
+/* Check if information are already included */
+#ifndef CAND_USER_API_H
+#define CAND_USER_API_H
+
+#if defined(_MSC_VER) && _MSC_VER > 1000
+#pragma once
+#endif /* _MSC_VER > 1000 */
+
+/* Use standard windows header or declare needed types */
+#ifndef _WINDEF_
+typedef unsigned long DWORD;
+typedef unsigned short WORD;
+typedef unsigned char BYTE;
+typedef void* HWND;
+typedef int BOOL;
+typedef void* HANDLE;
+typedef unsigned int UINT;
+typedef const char* LPCTSTR;
+typedef void MSG;
+#endif
+
+/* Unsigned 64 Bit integer */
+#ifndef QWORD_HAS_BEEN_DEFINED
+#define QWORD_HAS_BEEN_DEFINED
+typedef unsigned __int64 QWORD; /*!< For simple using of unsigned __int64 */
+#endif /* QWORD_HAS_BEEN_DEFINED */
+
+#ifndef CANDLL_API
+#ifdef CANDLL_EXPORTS
+/* Export-Declarations */
+#define CANDLL_API __declspec(dllexport)
+#else
+/* Import-Declarations */
+#define CANDLL_API __declspec(dllimport)
+#endif
+#endif /* CANDLL_API */
+
+/*! Calling-Convention */
+#ifndef CANDLL_CALL
+#define CANDLL_CALL __stdcall
+#endif /* CANDLL_CALL */
+/*! Calling-Convention */
+#ifndef CANDLL_CALLBACK
+#define CANDLL_CALLBACK(function_name) (CANDLL_CALL *function_name)
+#endif /* CANDLL_CALLBACK */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* API version */
+/*! Major version - incremented on large changes that render every plugin incompatible */
+#define CANDLL_API_VERSION_MAJOR 3
+/*! Minor version - incremented on smaller changes. Most plugins will still work */
+#define CANDLL_API_VERSION_MINOR 10
+#define CANDLL_API_VERSION (CANDLL_API_VERSION_MAJOR << 8 | CANDLL_API_VERSION_MINOR)
+
+/*! Definition of output styles for reports */
+#define REPORT_IN_MSGBOX 0x01
+#define REPORT_IN_REPORT_WND 0x02
+
+/*!
+ * \defgroup ecu_functions Control units
+ * Control units are electrical modules in an automobile which can read, process and render information.
+ * Control units are a part of the communication matrix. They
+ * define control tasks, eg. for motor, display elements, the light system or airbags.
+ *
+ * CanEasy control units can handle messages and attributes. You can create control
+ * units only as a subtree element of a bus.
+ *
+ * \ref p_working_with_ecus
+ *
+ */
+
+/*!
+ * \defgroup callback_functions Callbacks
+ * Callback functions are a convenient way of getting informed about
+ * events that happen inside CanEasy eg. with data, messages or hardware.
+ *
+ * Use callbacks to get informed about changes in the database, events
+ * that occur on the bus or to synchronize your application with CanEasy.
+ *
+ * Use the function ::CAND_enRegisterCallback in combination with the values of ::CAND_tenCallbackType
+ * to register a callback of the specified type. You can stop getting the callback using the function
+ * ::CAND_enUnRegisterCallback. Make sure that you unregister all callbacks before closing CanEasy.
+ *
+ */
+
+/*!
+ * \defgroup attribute_functions Attributes
+ * Attributes provide additional information to CanEasy database objects.
+ * Attributes can be specified on each hierarchical level of the datbase. They
+ * are not part of the communiation matrix.
+ *
+ * There are custom attributes that can be freely defined by the user and some standard attributes that
+ * change behaviour, look and feel of CanEasy.
+ *
+ */
+
+/*!
+ * \defgroup bus_functions Bus
+ * Busses are objects in a CanEasy database. They provide the base for a simulation.
+ * The bus can be an interface to hardware and a real bus system. You can create control units
+ * beneath a bus. The bus functions allow you to create, delete or modify a bus before starting a simulation.
+ *
+ */
+
+/*!
+ * \defgroup message_functions Messages
+ * A message is a collection of information, which is transported by a control
+ * unit on a bus. A message can be transmitted cyclically and inform about a
+ * certain status e.g. temperature or it can be transmitted event driven e.g.
+ * to inform about malfunction of a light. A message is clearly defined by its
+ * unique identifier.
+ *
+ * You can only create messages as a subtree element of a control unit in CanEasy. A special
+ * type of message is the multiplexed message. This type of message can be
+ * created as a subelement of an existing normal message. A multiplexed message needs an
+ * associated multiplex value, therefore at least one signal has to be defined
+ * as multiplex signal to distinguish between different multiplexed messages.
+ * Please refer to the CanEasy help documentation for more infomration about multiplexed
+ * messages.
+ *
+ * \ref p_working_with_messages
+ *
+ */
+
+/*!
+ * \defgroup signal_functions Signals
+ * A signal is a defined information unit inside a message or a multiplex
+ * message. The signal is the smallest information unit on a bus system.
+ *
+ * You can create signals as a subtree element of a message or a multiplexed message.
+ *
+ * \ref p_working_with_signals
+ */
+
+/*!
+ * \defgroup record_functions Records
+ * A record is an internal storage buffer in CanEasy. Every message and event on the bus is
+ * recorded and stored to the record. The record gives you the opportunity to analyse bus
+ * traffic.
+ * You can disable the recording to save system ressources. With a disabled record you can not
+ * anaylse or view the messages or bus events in an analysis tool like trace or plot.
+ *
+ */
+
+/*!
+ * \defgroup ui_functions User Interface
+ *
+ * Functions in this section are needed for interaction with the user interface of
+ * CanEasy. They can be used to receive events that occur on the user interface.
+ * They can also be used to trigger the refreshing and updating of other CanEasy windows.
+ */
+
+/*!
+ * \defgroup fileio_functions File I/O
+ *
+ * This set of functions allows you to read and write data to and from the CanEasy
+ * workspace. The functions are used to load and save project specific data that
+ * is needed inside your project or plug-in within the main workspace file.
+ *
+ */
+
+/*!
+ * \defgroup action_functions Actions
+ *
+ * The action manager maintains actions that can be registered and used
+ * by plugins. Registering actions provides a way to extend the functionality of your own and other
+ * plugins. This mechanism is used to integrate your plugin into others
+ * and estabilish the interconnection.
+ *
+ * For example:
+ * You want your plugin to get notified everytime a certain
+ * key was pressed. In order to implement this your plugin would register an action and provide this
+ * action to other plugins. Then you could use the "Shortcut" plugin to build a queue of
+ * actions which will be executed when pressing a certain key. You plugin could be one of
+ * the action subscribers inside the queue.
+ *
+ * Each action can have an amount of parameters with different behaviour. For all actions an
+ * individual user interface is created that shows all created parameters for that action.
+ * So the user can manipulate the action parameters on runtime. A special parameter provides you the
+ * ability to select CanEasy database objects.
+ *
+ */
+
+/*!
+ * \defgroup env_functions Environment Variables
+ *
+ * Environment variables are CanEasy wide storage units that can be accessed by any
+ * plugin or script. With environment variables you can transfer data within different
+ * modules.
+ * The variables can be grouped in namespaces. Each namespace can contain environment
+ * variables and again namespaces, which allows you to subgroup your variables.
+ *
+ * Environment variables are automatically imported while generating a database from a dbc file.
+ */
+
+/*!
+ * \defgroup simulation_functions Simulation
+ *
+ * This set of functions allows you to control the initialization of CanEasy as well
+ * as the control of the simulation flow. The functions to retrieve the
+ * simulation time are also included here.
+ *
+ */
+
+/*!
+ * \defgroup general_functions General
+ *
+ */
+
+/*!
+ * \defgroup handle_functions Handles
+ *
+ * All CanEasy objects are referenced by their handles. The set of
+ * handle functions consists of general purpose functions for all kinds of CanEasy handles.
+ * Functions that are only usable with a certain type of handles are described
+ * in the corresponding sections of this help manual.
+ *
+ */
+
+/*!
+ * \defgroup database_functions Database
+ *
+ * The CanEasy database is the heart of the simulation. There are busses, ecus,
+ * messages, signals and attributes stored inside. The database functions allow you
+ * to adjust properties of database elements.
+ *
+ */
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Enumaration of supported EnvVar types.
+ *
+ * \see
+ * CAND_enGetEnvVarType, CAND_tstEnvVarType
+ */
+typedef enum
+{
+ CAND_EnvVarInvalid, /*!< Invalid Value */
+ CAND_EnvVarString, /*!< String Value */
+ CAND_EnvVarBool, /*!< 8-Bit unsigned char */
+ CAND_EnvVarInt, /*!< 32-Bit signed integer */
+ CAND_EnvVarDouble, /*!< 64-Bit floating point */
+ CAND_EnvVarByte, /*!< 8-Bit unsigned char */
+ CAND_EnvVarWord, /*!< 16-Bit unsigned short */
+ CAND_EnvVarDword, /*!< 32-Bit unsigned long*/
+ CAND_EnvVarQword /*!< 64-Bit unsigned long long */
+} CAND_tenEnvVarType;
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Structure used for messages and bus events.
+ *
+ * \see
+ * CAND_enGetEnvVarType
+ */
+typedef struct _CAND_tstEnvVarType
+{
+ CAND_tenEnvVarType enType; /*!< Type for the environment variable. */
+ BOOL boIsArray; /*!< Specifies whether the variable is an array. */
+} CAND_tstEnvVarType;
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Structure used to create enum attributes.
+ *
+ * \see
+ * CAND_hCreateAttribute
+ */
+typedef struct CAND_stEnum
+{
+ const char* sDesc;
+ int iVal;
+ struct CAND_stEnum* pstNext;
+} CAND_tstEnum;
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Enumeration for simulation status of control units.
+ *
+ * The ::CAND_tenSimState enum contains the possible status which a control unit can
+ * have. You can find this setting in the control unit editor.
+ *
+ * \see
+ * CAND_enGetEcuState | CAND_enSetEcuState
+ */
+typedef enum
+{
+ CAND_nReal, /*!< Specifies that the ECU is physically present at can bus. */
+ CAND_nSimulated /*!< Specifies that the ECU is simulated. */
+} CAND_tenSimState;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Enumeration with modes of message generation.
+ *
+ * The ::CAND_tenGenMsgMode enum contains the possible modes of message generation
+ * for a control unit. You can find this setting in the control unit editor.
+ *
+ * \see
+ * CAND_enSetEcuMsgMode | CAND_enGetEcuMsgMode
+ */
+typedef enum
+{
+ CAND_nGenModeOff, /*!< Off, no generation of messages */
+ CAND_nGenModeAdapt, /*!< Reduced, only RX messages of real existent control units will be displayed */
+ CAND_nGenModeFull, /*!< Full, all messages of the control unit will be sent */
+ CAND_nGenModeNone /*!< control unit is not simulated, thus no message geenration is possible */
+} CAND_tenGenMsgMode;
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Enumeration with events that can be triggered by the CanEasy tree.
+ *
+ * These are the values that can be received via the DLL_iOnEvent function
+ * of a plugin, in the "uiEvent" parameter.
+ *
+ * \see
+ * DLL_iOnEvent
+ */
+
+// ACHTUNG: in userinterfaceapi gibt es das gleiche enum noch einmal. Die Werte müssen identisch sein.
+typedef enum
+{
+ CAND_nSelected = 0, /*!< Item is selected */
+ CAND_nUnSelected, /*!< Item is unselected */
+ CAND_nDblClick, /*!< Double click */
+ CAND_nRBClick, /*!< Right button click */
+ CAND_nBeginDrag, /*!< Begin drag operation */
+ CAND_nDragOver, /*!< Item drag over */
+ CAND_nDrop, /*!< Item dropped */
+ CAND_nKeyDown, /*!< Key pressed */
+ CAND_nDoDelete, /*!< Item should be deleted */
+ CAND_nDoCreate, /*!< Item should be created */
+ CAND_nBeginLabelEdit, /*!< Item name will be edited */
+ CAND_nEndLabelEdit, /*!< Item name has been edited */
+ CAND_nEndDrag /*!< End drag operation */
+} CAND_tenTreeEvent;
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Enumeration with the send modes of a bus.
+ *
+ * Use this enumeration values to set the sending mode of a bus.
+ *
+ * \see
+ * CAND_enGetBusState | CAND_enSetBusState
+ */
+typedef enum
+{
+ CAND_nDisabled, /*!< Specifies that sending and receiving messages is disabled. */
+ CAND_nEnableTx, /*!< Specifies that only sending messages is enabled. */
+ CAND_nEnableRx, /*!< Specifies that only receiving messages is enabled. */
+ CAND_nEnableBoth /*!< Specifies that sending and receiving messages is enabled. */
+} CAND_tenBusState;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Enumeration which contains the reasons for why the database change callback has been triggerd.
+ *
+ * \see
+ * CAND_tDbChangedCb
+ */
+typedef enum
+{
+ CAND_nDB_CHANGED, /*!< The database structure has been changed */
+ CAND_nDB_NEW, /*!< A new database has been generated or loaded */
+ CAND_nDB_NEW_BUS, /*!< A new bus has been added to the database */
+ CAND_nDB_NEW_ECU, /*!< A new ECU has been added to the database */
+ CAND_nDB_NEW_MSG, /*!< A new message has been added to the database */
+ CAND_nDB_NEW_SIG, /*!< A new signal has been added to the database */
+ CAND_nDB_DEL, /*!< The database has been completely removed */
+ CAND_nDB_DEL_BUS, /*!< A bus has been deleted from database */
+ CAND_nDB_DEL_ECU, /*!< An ECU has been deleted from database */
+ CAND_nDB_DEL_MSG, /*!< A message has been deleted from database */
+ CAND_nDB_DEL_SIG, /*!< A signal has been deleted from database */
+ CAND_nDB_ATTR_CHANGE /*!< An attribute has been changed */
+} CAND_tenDBChangedReason;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Enumeration of shortcut scopes
+ *
+ * The ::CAND_tenShortCutScope enum contains scope specifiers for shortcut registrations.
+ *
+ * \see
+ * CAND_enRegisterShortcut
+ */
+typedef enum
+{
+ CAND_nAnyScope, /*!< Scope is irrelevant (internal use only) */
+ CAND_nAppScope, /*!< Application wide */
+ CAND_nSystemScope /*!< System wide */
+} CAND_tenShortCutScope;
+
+/*!
+ * \ingroup general_functions
+ *
+ * \brief
+ * Enumeration unit with standard return values of API functions.
+ *
+ */
+typedef enum
+{
+ CAND_nFALSE, /*!< Return-value means not true */
+ CAND_nTRUE, /*!< Return-value means true */
+
+ CAND_nERR_OK, /*!< Function proceeded successfully */
+ CAND_nERR_INVALID_HANDLE, /*!< Handle is invalid */
+ CAND_nERR_INVALID_PARAM, /*!< Parameter is invalid */
+ CAND_nERR_NO_MATCH, /*!< Result is undetermined */
+ CAND_nERR_TX_FAILED, /*!< Transmit failed */
+ CAND_nERR_SIM_IS_RUNNING, /*!< Error because simulation is running */
+ CAND_nERR_NOT_POSSIBLE, /*!< Operation is currently not possible */
+ CAND_nERR_FILE_READ, /*!< The specified file could not be read/found */
+ CAND_nERR_FILE_FORMAT, /*!< The specified file has the wrong format or is empty */
+} CAND_tenRetVal;
+//Es muss daran gedacht werden, dass das Makro CANDRESULTCHECK angepasst wird,
+//wenn hier neue Enum-Werte hinzugefügt werden!
+
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Enumeration with Attribute types that can be used with the database.
+ *
+ * \see
+ * CAND_enGetAttrType | CAND_hCreateAttribute
+ */
+typedef enum
+{
+ CAND_TypeInvalid = -1, /*!< Invalid Value */
+ CAND_TypeString = 0, /*!< String Value */
+ CAND_TypeInt = 1, /*!< 32-Bit signed integer */
+ CAND_TypeDouble = 2, /*!< 64-Bit floating point */
+ CAND_TypeHex = 3, /*!< 32-Bit unsigned integer */
+ CAND_TypeQword = 4, /*!< 64-Bit unsigned integer */
+ CAND_TypeBool = 5, /*!< 32-Bit unsigned integer */
+ CAND_TypeEnum = 6 /*!< 32-Bit signed integer */
+} CAND_enAttrType;
+
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Enumeration with kinds of Attributes that can be created.
+ *
+ * \see
+ * CAND_hCreateAttribute
+ */
+typedef enum
+{
+ CAND_TypeDbc = 0, /*!< Standard attribute that is used by dbc files */
+ CAND_TypeInternal = 1, /*!< Internal attribute that is normally used by CanEasy */
+ CAND_TypeTemp = 2, /*!< Runtime attribute that only exists for the current CanEasy seesion */
+} CAND_enKindOfAttr;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Enumeration with the supported byte order type of signals.
+ *
+ * \see
+ * CAND_enGetSigByteOrder
+ */
+typedef enum
+{
+ CAND_OrderIntel = 0, /*!< Use Intel byte order, LSB first */
+ CAND_OrderMotorola = 1, /*!< Use Motorola byte order, MSB first */
+} CAND_enByteOrder;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Enumeration with modifier values for shortcut keys.
+ *
+ * \see
+ * CAND_enNotifyShortcut | CAND_enShortcutRegistered
+ */
+typedef enum
+{
+ /* These are bitmasks! */
+ CAND_nenNoKey = 0x00, /*!< No key modifier */
+ CAND_nenAltKey = 0x01, /*!< Alt-Key */
+ CAND_nenCtrlKey = 0x02, /*!< Ctrl-Key */
+ CAND_nenShiftKey = 0x04, /*!< Shift-Key */
+ CAND_nenWinKey = 0x08 /*!< Windows-Key */
+} CAND_enKeyModifier;
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Enumeration with values to control the behaviour
+ * of the database browsing dialog.
+ *
+ * \see
+ * CAND_enBrowseDatabase
+ */
+typedef enum
+{
+ CAND_nenSelectBus = 0x0001, /*!< Allow selection of busses */
+ CAND_nenShowBus = 0x0002, /*!< Display busses */
+ CAND_nenSelectEcu = 0x0004, /*!< Allow selection of ECUs */
+ CAND_nenShowEcu = 0x0008, /*!< Display ECUs */
+ CAND_nenSelectMsg = 0x0010, /*!< Allow selection of messages */
+ CAND_nenShowMsg = 0x0020, /*!< Display messages */
+ CAND_nenSelectSig = 0x0040, /*!< Allow selection of signals */
+ CAND_nenShowSig = 0x0080, /*!< Display signals */
+ CAND_nenSelectAll = 0x0055, /*!< Allow selection of anything */
+ CAND_nenShowAll = 0x00AA, /*!< Display everything in the database */
+
+ /* Shortcuts to browse for a specific object type */
+ /*! Display everything in the database and to allow the user to select signals only. */
+ CAND_nenBrowseSig = CAND_nenShowBus | CAND_nenShowEcu | CAND_nenShowMsg | CAND_nenShowSig | CAND_nenSelectSig,
+ /*! Display only busses, ECUs and messages. The user is only allowed to select messages. */
+ CAND_nenBrowseMsg = CAND_nenShowBus | CAND_nenShowEcu | CAND_nenShowMsg | CAND_nenSelectMsg,
+ /*! Display only busses and ECUs. The user is only allowed to select an ECU. */
+ CAND_nenBrowseEcu = CAND_nenShowBus | CAND_nenShowEcu | CAND_nenSelectEcu,
+ /*! Display busses only. The user is only allowed to select an bus. */
+ CAND_nenBrowseBus = CAND_nenShowBus | CAND_nenSelectBus,
+} CAND_tenBrowseDbFlags;
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Possible bus states in a chip state request frame on the can bus. The chip state will be
+ * stored in the first byte of the chip state message.
+ *
+ */
+typedef enum
+{
+ CAND_nCHIPSTAT_BUSOFF = 0x01, /*!< can bus has been disconnected */
+ CAND_nCHIPSTAT_ERROR_PASSIVE = 0x02, /*!< can bus in passive mode */
+ CAND_nCHIPSTAT_ERROR_WARNING = 0x04, /*!< can bus in warning mode */
+ CAND_nCHIPSTAT_ERROR_ACTIVE = 0x08 /*!< can bus is active */
+} CAND_tenCanBusState;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Enumeration with special Id masks for message Ids.
+ *
+ * This enumeration contains message id masks that have to be used to determine if
+ * a message is a normal bus message or a special message event.
+ *
+ * \see
+ * CAND_boIsSpecialEvent
+ */
+enum
+{ /* anonymous enum */
+ CAND_nExtendedIdMask = 0x80000000, /*!< This bit is set for an extended message ID. */
+ CAND_nSpecialEventMask = 0x40000000, /*!< This bit is set for internal or special events. */
+ CAND_nRemoteFrameMask = 0x20000000, /*!< This bit is set for a remote frame. */
+ CAND_nMessageIdMask = 0x1fffffff, /*!< A message ID is up to 29 bits long. */
+ CAND_nMessageTypeMask = 0xE0000000, /*!< Bits 29 through 31 are reserved. */
+
+ CAND_nErrorFrameID = 0x40000001, /*!< ID for an error frame */
+
+ CAND_nChipStateID = 0x40000002, /*!< ID for a chip state
+ - Data[0] is the CAND_tenBusState
+ - Data[1] is the Tx error counter
+ - Data[2] is the Rx error counter */
+ CAND_nMarkerID = 0x40000003, /*!< ID for marker points (manually set by the user)
+ Markers will always be "sent" on the first CAN bus */
+ CAND_nOverrunFrameID = 0x40000004, /*!< < */
+};
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Enumeration with special Id masks for lin events.
+ */
+typedef enum
+{
+ CAND_nLinWakeUpID = 0x40000006, /*!< ID for a LIN-Wakeup event */
+ CAND_nLinSleepID = 0x40000007 /*!< ID for a LIN-Sleep event */
+} CAND_tenLinBusState;
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Enumeration with special Id masks for lin events.
+ */
+typedef enum
+{
+ CAND_nLinNoAnswerID = 0x40000005, /*!< ID for a header without Answer/Data
+ Msg-ID valid, Msg-Data not valid */
+ CAND_nLinSyncErrorID = 0x40000008, /*!< ID for a LIN-Snyc-Error event */
+ CAND_nLinErrorMsgID = 0x40000009, /*!< ID for a Error-Msg (wrong CRC, anything else wrong)
+ Msg-ID and Msg-Data not valid */
+ CAND_nLinCrcErrorID = 0x4000000A /*!< ID for a Error-Msg (wrong CRC, anything else wrong)
+ Msg-ID and Msg-Data valid */
+} CAND_tenLinBusError;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Maximum value for standard identifier.
+ */
+#define CAND_nMaxStdId 0x000007FF
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Maximum value for extended identifier.
+ */
+
+#define CAND_nMaxExtId 0x1FFFFFFF
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Determines if a message has an extended identifier (29bit).
+ *
+ * \param id
+ * Message id to check for extended id
+ *
+ * Use this macro to determine if a message id is a remote frame id.
+ */
+#define CAND_ISEXTID(id) (((id) & CAND_nExtendedIdMask) == CAND_nExtendedIdMask)
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Converts the id to an extended identifier.
+ *
+ * \param id
+ * Message id to convert.
+ *
+ * \retval - Converted extended id
+ */
+#define CAND_MAKEEXTID(id) (((id) & CAND_nMaxExtId) | CAND_nExtendedIdMask)
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Converts the id to a standard identifier.
+ *
+ * \param id
+ * Message id to convert.
+ */
+#define CAND_MAKESTDID(id) ((id) & CAND_nMaxStdId)
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Determines if a message is a remote frame.
+ *
+ * \param id
+ * Message id to check
+ *
+ * Use this macro to determine if a message id is a remote frame id.
+ */
+#define CAND_boIsRemoteFrame(id) (((id) & CAND_nRemoteFrameMask) == CAND_nRemoteFrameMask)
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Determines if a message is a special event.
+ *
+ * \param id
+ * Message id to check.
+ *
+ * Use this macro to determine if a message is a normal message or a special event. You
+ * can differ the special events with the special event mask enum.
+ *
+ */
+#define CAND_boIsSpecialEvent(id) (((id) & CAND_nSpecialEventMask) == CAND_nSpecialEventMask)
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Enumeration with handle types that are used by various interfaces.
+ *
+ * Use this function to determine the type of a given handle.
+ *
+ * \see
+ * CAND_enGetHandleType
+ */
+typedef enum
+{
+ CAND_nInvalidType, /*!< Specifies an invalid handle. */
+ CAND_nBus, /*!< Specifies that the handle is a CAN bus. */
+ CAND_nEcu, /*!< Specifies that the handle is an ECU. */
+ CAND_nMsg, /*!< Specifies that the handle is a message. */
+ CAND_nSig, /*!< Specifies that the handle is a signal. */
+ CAND_nAtt, /*!< Specifies that the handle is an attribute. */
+ CAND_nDB, /*!< Specifies that the handle is a database. */
+ CAND_nEnvVar /*!< Specifies that the handle is a enviroment variable. */
+} CAND_tenHandleType;
+
+typedef enum
+{
+ TypeBool, /*!< Specifies a boolean type. */
+ TypeEdit1, /*!< Specifies a slider with edit box */
+ TypeEdit2, /*!< Specifies an edit box */
+ TypeCombo, /*!< Specifies a combobox */
+ TypeInvalid = 0xFF /*!< Specifies a nonspecified type */
+} CAND_tenSigType;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Version of checksum calculation used by LIN messages.
+ *
+ */
+typedef enum /// ACHTUNG: dieses Enum muss Identisch mit dem Enum candb::Message::ChecksumVersion sein.
+{
+ CAND_nLinChecksumClassic = 0, /*!< Use the classic checksum calculation of LIN version 1.3 */
+ CAND_nLinChecksumEnhanced /*!< Use the enhanced checksum calculation of LIN version 2.1 */
+} CAND_tenLinChecksumVersion;
+
+
+ /*!
+ * \ingroup fileio_functions
+ *
+ * \brief
+ * Return values for the standard file access functions of a plugin.
+ *
+ */
+typedef enum
+{
+ CAND_nFileNoError, /*!< No error. Loading or saving was successful. */
+ CAND_nFileErrorAbort, /*!< General error with abort of the further serialisation. */
+ CAND_nFileErrorContinue, /*!< Gereral error with continuation of the serialisation. */
+ CAND_nFileErrorInvalidVersion, /*!< Only on Load: The given version number is not supported. */
+ CAND_nFileErrorInvalidIdent /*!< Only on Load: The read block identifier is not supported */
+} CAND_tenFileAccess;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * The ::CAND_tenCallbackPos enum contains the insert position of a transmission callback.
+ *
+ * \see CAND_enRegisterTxConfirmCallback, CAND_enRegisterRxConfirmCallback, CAND_enRegisterPreCopyCallback, CAND_enRegisterPreTransmitCallback
+ */
+typedef enum
+{
+ CAND_nPosFirst,
+ CAND_nPosNeutral,
+ CAND_nPosLast
+} CAND_tenCallbackPos;
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Compares two handles.
+ *
+ * \param handle1
+ * First handle that is compared with the second
+ *
+ * \param handle2
+ * Second handle that is compared with the first
+ *
+ * \retval - ::CAND_nTRUE Both handles are equal
+ * \retval - ::CAND_nFALSE The handels are not equal
+ *
+ * \ex CAND_boEqualHandles.cpp
+ */
+#define CAND_boEqualHandles(handle1, handle2) ((handle1).internal==(handle2).internal)
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Structure that depicts a handle to CanEasy database objects.
+ *
+ * \remarks
+ * Handle-Type for busses, ECUs, messages, signals and attributes. Handles
+ * provide faster access than access by name or ID.
+ *
+ */
+typedef struct _CAND_tHandle
+{
+ unsigned long internal; /*!< Internal data - Do not modify! */
+ CAND_tenHandleType enType; /*!< Type of handle - Do not modify! */
+
+#ifdef __cplusplus
+ /*!
+ * \brief Allow if(hObject){...} and the like
+ */
+ operator void*() { return (void*)internal; }
+
+ /*!
+ * \brief Operator for easier CAND_tHandle handling.
+ */
+ bool operator==(const _CAND_tHandle& rhs) const
+ {
+ return CAND_boEqualHandles(rhs, *this) == CAND_nTRUE;
+ }
+
+ /*!
+ * \brief Operator for easier ::CAND_tHandle handling.
+ */
+ bool operator<(const _CAND_tHandle& rhs) const
+ {
+ return internal < rhs.internal;
+ }
+
+ /*!
+ * \brief Operator for easier ::CAND_tHandle handling.
+ */
+ bool operator!=(const _CAND_tHandle& rhs) const
+ {
+ return !CAND_boEqualHandles(rhs, *this);
+ }
+
+ /*!
+ * \brief Operator for easier ::CAND_tHandle handling.
+ */
+ operator DWORD()
+ {
+ return internal;
+ }
+#endif
+} CAND_tHandle;
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * The handle type for filemanager access.
+ *
+ * \remarks
+ * Handle-Type an internal filemanager, allow to store/load data from workspace.
+ *
+ */
+typedef DWORD CAND_tFileHandle;
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Structure that contains information about the type of the filter object
+ * and its reference.
+ *
+ * \remarks
+ * Handle-Type for messages to receive information from a simulation
+ * record. Handles provide faster access than access by name or ID.
+ *
+ */
+typedef struct _CAND_tFilterHandle
+{
+ DWORD dummy; /*!< Internal data - Do not modify! */
+} *CAND_tFilterHandle;
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Handle for iterators.
+ *
+ */
+typedef struct _CAND_tIteratorHandle
+{
+ DWORD dummy; /*!< Internal data - Do not modify! */
+} *CAND_tIteratorHandle;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Scaling factors for use with timestamps.
+ *
+ * \see
+ * CAND_tstCanMessage
+ */
+enum
+{ /* anonymous enum */
+ CAND_enTicksPerSecond = 1000000, /*!< Divisor to calculate the time in seconds using a timestamp */
+ CAND_enTicksPerMilliSecond = 1000 /*!< Divisor to calculate the time in milli seconds using a timestamp */
+};
+
+#pragma pack(push, 1)
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Structure used for messages and bus events.
+ *
+ * \see
+ * CAND_tCanEventCb
+ */
+typedef struct CAND_stCanMessage
+{
+ CAND_tHandle hBus; /*!< Specifies the ::CAND_tHandle handle of message's bus. */
+ DWORD dwMessageID; /*!< Specifies the ID of the message or event. */
+ QWORD qwTimestamp; /*!< Specifies the 64-bit-timestamp when message was sent/received (use ::CAND_enTicksPerMilliSecond to get the millisecond value). */
+ BYTE bDlc; /*!< Specifies the length of the message in bytes. */
+ BYTE bRx; /*!< Specifies whether the message was received. */
+ BYTE abData[8]; /*!< Points to an array of bytes that contains the contents of the message. */
+} CAND_tstCanMessage;
+
+typedef enum
+{
+ CAND_nCanRecordEntry,
+ CAND_nLinRecordEntry,
+ CAND_nFlexrayRecordEntry,
+} CAND_tenMsgRecordEntryType;
+
+typedef enum
+{
+ CAND_nMsgRecordEntry,
+ CAND_nCanBusErrorRecordEntry,
+ CAND_nCanBusStateRecordEntry,
+ CAND_nLinBusStateRecordEntry,
+ CAND_nMarkerRecordEntry,
+ //CAND_nEnvVarRecordEntry,
+ //CAND_nXcpRecordEntry
+} CAND_tenRecordEntryType;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Structure used for bus information in the record.
+ */
+typedef struct CAND_stBusRecordEntry
+{
+ CAND_tHandle hBus; /*!< Specifies the ::CAND_tHandle handle of message's bus. */
+ BYTE u8Channel; /*!< Specifies the bus channel. */
+} CAND_tstBusRecordEntry;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Structure used for record entries.
+ */
+typedef struct CAND_stCanBusState
+{
+ BYTE u8RxErrors; /*!< Count of Rx-Errors. */
+ BYTE u8TxErrors; /*!< Count of Tx-Errors. */
+ CAND_tenCanBusState enChipstate; /*!< Specifies the can busstate. */
+} CAND_tstCanBusstate;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Structure used for CAN messages in the record.
+ */
+typedef struct CAND_stMsgRecordEntry
+{
+ CAND_tenMsgRecordEntryType enType;/*!< Specifies the message type (LIN, CAN, ...). */
+ DWORD u32MsgId; /*!< Specifies the ID of the message. */
+ BYTE u8Dlc; /*!< Specifies the length of the message in bytes. */
+ BYTE u8Rx; /*!< Specifies whether the message was received. */
+ const BYTE* pu8Data; /*!< Points to an array of bytes that contains the contents of the message. */
+} CAND_tstMsgRecordEntry;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Structure used for LIN messages in the record.
+ */
+typedef struct CAND_stLinMsgRecordEntry
+{
+ CAND_tstMsgRecordEntry stMsgRecordEntry; /*!< Specifies infomations about the message. */
+ CAND_tenLinChecksumVersion ChecksumVersion; /*!< Specifies the lin checksum version. */
+} CAND_tstLinMsgRecordEntry;
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Structure used for record entries.
+ */
+typedef struct CAND_stRecordEntry
+{
+ CAND_tenRecordEntryType enType; /*!< Specifies the type of the record entry. */
+ QWORD u64Timestamp; /*!< Specifies the 64-bit-timestamp when message was sent/received (use ::CAND_enTicksPerMilliSecond to get the millisecond value). */
+ CAND_tstBusRecordEntry stBus; /*!< Specifies bus information. */
+ union
+ {
+ CAND_tstCanBusstate stCanBusState; /*!< Specifies bus status informations. */
+ CAND_tenLinBusState enLinBusState; /*!< Specifies lin status informations. */
+ CAND_tenLinBusError enLinBusError; /*!< Specifies lin status informations. */
+ CAND_tstMsgRecordEntry stMsg; /*!< Specifies message data. */
+ CAND_tstLinMsgRecordEntry stLinMsg; /*!< Specifies lin message data. */
+ DWORD u32MarkerId; /*!< Specifies the markers id. */
+ };
+
+} CAND_tstRecordEntry;
+
+#pragma pack(pop)
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Structure for bus statistic information
+ *
+ * \see
+ * CAND_enGetBusStat
+ */
+typedef struct CAND_stBusStat
+{
+ QWORD qwRxStd; /*!< Count of received standard frames */
+ QWORD qwTxStd; /*!< Count of transmitted stadard frames */
+ QWORD qwRxXtd; /*!< Count of received extended frames */
+ QWORD qwTxXtd; /*!< Count of transmitted extended frames */
+ QWORD qwRxRem; /*!< Count of received remote frames */
+ QWORD qwTxRem; /*!< Count of transmitted remote frames */
+ QWORD qwErr; /*!< Count of error frames */
+ QWORD qwBits; /*!< Count of bits on bus since simulation start */
+ BYTE bChipState; /*!< Hardware chip state */
+}CAND_tstBusStat;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Structure which identifies a transmission callback
+ *
+ * \see CAND_enRegisterTxConfirmCallback, CAND_enRegisterRxConfirmCallback, CAND_enRegisterPreCopyCallback, CAND_enRegisterPreTransmitCallback
+ */
+typedef struct CAND_stCallbackdata
+{
+ CAND_tenCallbackPos enPos; /*!< Position were the callback should be called */
+ CAND_tHandle hItem; /*!< Handle for which the callback was registered */
+ const char* sFilter; /*!< Filter string */
+ void* pUserParam; /*!< User defined pointer */
+ const char* sId; /*!< Unique name for the callback */
+} CAND_tstCallbackdata;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Structure which contains changeable CAN frame data
+ *
+ * \see CAND_enRegisterTxConfirmCallback, CAND_enRegisterRxConfirmCallback, CAND_enRegisterPreCopyCallback, CAND_enRegisterPreTransmitCallback
+ */
+typedef struct CAND_stMessagedata
+{
+ CAND_tHandle hBus; /*!< Handle to the bus were the message belongs to */
+ CAND_tHandle hMsg; /*!< Handle to an equivalent database message */
+ DWORD u32MsgId; /*!< Identifier for the message */
+ BYTE* pu8MsgData; /*!< Pointer to the message data */
+ BYTE u8MsgLength; /*!< Message length */
+ QWORD u64Timestamp; /*!< Timestamp, when the message was received/transmitted */
+} CAND_tstMessagedata;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Structure which contains nonchangeable CAN frame data
+ *
+ */
+typedef struct CAND_stMessagedataConst
+{
+ CAND_tHandle hBus; /*!< Handle to the bus were the message belongs to */
+ CAND_tHandle hMsg; /*!< Handle to an equivalent database message */
+ DWORD u32MsgId; /*!< Identifier for the message */
+ const BYTE* pu8MsgData; /*!< Pointer to the const message data */
+ BYTE u8MsgLength; /*!< Message length */
+ QWORD u64Timestamp; /*!< Timestamp, when the message was received/transmitted */
+} CAND_tstMessagedataConst;
+
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Enumeration which contains the reasons for why a record callback has been triggered.
+ *
+ * \see
+ * CAND_tRecorderCallback
+ */
+typedef enum
+{
+ CAND_enRecordUnload, /*!< The user has unloaded the current record. */
+ CAND_enRecordLoad /*!< The user has loaded a new record */
+} CAND_tenRecorderCallbackReason;
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * The ::CAND_tenCallbackType enum contains information about the type of
+ * the callback.
+ *
+ * \see CAND_enRegisterCallback, CAND_enUnRegisterCallback
+ */
+typedef enum
+{
+ CAND_enTimer, /*!< Cyclic timer callback (in milliseconds). Use it to register a timer callback. The function should have the type ::CAND_tTimerCb. */
+
+ CAND_enMsgDataChanged, /*!< Callback occures when the message data has changed. Use it to register a callback which is called when a messaged has changed. The function should have the type ::CAND_tDataChangedCb. */
+ CAND_enSigValueChanged, /*!< Callback occures when signal's value has changed. Use it to register a callback which is called when a signal has changed. The function should have the type ::CAND_tDataChangedCb. */
+
+ CAND_enDBChanged, /*!< Callback occures when a database has changed. Use it to register a callback which is called if the database has changed. The function should have the type ::CAND_tDbChangedCb. */
+
+ CAND_enRecordChanged, /*!< Callback occures when a record has changed. Use it to register a callback which is called if the recoprd has changed. The function should have the type ::CAND_tRecorderCallback. */
+
+ CAND_enMsHandle /*!< Signals an event every 1ms. Use it to register a callback which is called every millisecond. */
+} CAND_tenCallbackType;
+
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for a PreTransmit callback
+ *
+ * The application has to provide this function pointer at the registration of a callback.
+ * The callback will be called before a message is sent.
+ *
+ * \param pData
+ * Pointer to a structure which identifies the transmission callback.
+ *
+ * \param pMsg
+ * Pointer to structure which contains the data of a can frame
+ *
+ * \see CAND_enRegisterPreTransmitCallback, CAND_enUnRegisterPreTransmitCallback
+ */
+typedef BOOL CANDLL_CALLBACK(CAND_tPreTansmit)(const CAND_tstCallbackdata* pData, CAND_tstMessagedata* pMsg);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for a PreCopy callback.
+ *
+ * The application has to provide this function pointer at registration of a callback.
+ * The callback will be called before the data of a received message is copied into the database.
+ *
+ * \param pData
+ * Pointer to a structure which identifies the transmission callback.
+ *
+ * \param pMsg
+ * Pointer to a structure which contains the data of a can frame
+ *
+ * \see CAND_enRegisterPreCopyCallback, CAND_enUnRegisterPreCopyCallback
+ */
+typedef BOOL CANDLL_CALLBACK(CAND_tPreCopy)(const CAND_tstCallbackdata* pData, CAND_tstMessagedata* pMsg);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for the TxConfirm callback
+ *
+ * The application has to provide this function pointer at the registration of a callback.
+ * The callback is called after a message has successfully been transmitted.
+ *
+ * \param pData
+ * Pointer to a structure which identifies the transmission callback.
+ *
+ * \param pMsg
+ * Pointer to a structure which contains the data for a can frame.
+ *
+ * \see CAND_enRegisterCallback, CAND_enUnRegisterCallback
+ */
+typedef void CANDLL_CALLBACK(CAND_tTxConfirm)(const CAND_tstCallbackdata* pData, CAND_tstMessagedataConst* pMsg);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for RxConfirm callbacks
+ *
+ * The application has to provide this function pointer at the registration of a callback.
+ * The callback will be called when a message is received.
+ *
+ * \param pData
+ * Pointer to a structure which identifies the transmission callback.
+ *
+ * \param pMsg
+ * Pointer to a structure which contains the data for a can frame.
+ *
+ * \see CAND_enRegisterRxConfirmCallback, CAND_enUnRegisterRxConfirmCallback
+ */
+typedef void CANDLL_CALLBACK(CAND_tRxConfirm)(const CAND_tstCallbackdata* pData, CAND_tstMessagedataConst* pMsg);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Type definition for callbacks of type: ::CAND_enTimer
+ *
+ * The application has to provide this function pointer on registering a callback.
+ * The callback will be triggered periodically each time the internal CanEasy timer
+ * achieves the predefined value of milliseconds.
+ *
+ * \param dwInterval
+ * Interval which the call has to take place in. The interval time is specified in milliseconds.
+ *
+ * \param dwUserParam
+ * User defined data that has been specified at the registration of the callback.
+ *
+ * \remark The callback types used for this callback are:
+ * - ::CAND_enTimer
+ *
+ * \ex CAND_tTimerCb.cpp
+ */
+typedef void CANDLL_CALLBACK(CAND_tTimerCb)(unsigned long dwInterval, unsigned long dwUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Type for DB change callback.
+ *
+ * The application has to provide this function pointer on registering a callback.
+ * The function will be calles each time the Can-Database has been changed.
+ *
+ * \param iReason
+ * Specifies the reason why the database has changed.
+ *
+ * \param hObject
+ * Specifies the handle to object that has changed.
+ *
+ * \param dwUserData
+ * User defined data that has been specified on registration of the callback.
+ *
+ * \remark
+ * The callback reasons for this function are specified in the enum ::CAND_tenDBChangedReason.
+ *
+ * \remark
+ * When the database has been changed, all handles are invalidated.
+ * Do not use any handle to a bus, ECU, message, signal or attribute
+ * which has been obtained before.\n
+ * Additionally, all registered callbacks for message events and signal events
+ * are going to be automatically unregistered. Do not try to unregister them,
+ * unless, of course, you registered them by yourself after the function call.
+ * Other callbacks (such as timers) are still valid.
+ *
+ * \ex CAND_tDbChangedCb.cpp
+ */
+typedef void CANDLL_CALLBACK(CAND_tDbChangedCb)(CAND_tenDBChangedReason iReason, CAND_tHandle hObject);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for data changed callbacks.
+ *
+ * The application provides this type of function pointer to register
+ * a callback that will be triggerd if the value of a signal or message
+ * has been changed inside the CanEasy database.
+ *
+ * \param hObject
+ * Handle of a database object (message or signal) whose data has been changed.
+ *
+ * \param dwUserData
+ * User defined data that has been specified at registration of the callback.
+ *
+ * \remark The callback types used for this callback are:
+ * - ::CAND_enMsgValueChanged
+ * - ::CAND_enSigValueChanged
+ *
+ * \ex CAND_tDataChangedCb.cpp
+ */
+typedef void CANDLL_CALLBACK(CAND_tDataChangedCb)(CAND_tHandle hObject, DWORD dwUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for a recorder callback.
+ *
+ * The application provides this function pointer at the registration of a recorder callback.
+ * The callback will be called when the user loads or unloads the record.
+ *
+ * \param iReason
+ * Specifies the reason why the function has been called.
+ *
+ * \param dwUserData
+ * User defined data that has been specified at the registration of the callback.
+ *
+ * \remarks
+ * If iReason is ::CAND_enRecordUnload, all iterator handles will be
+ * invalidated after this callback returns. In this case make sure you do not use
+ * iterators any longer (i.e. stop timers or threads that use iterators).
+ *
+ * \ex CAND_tRecorderCallback.cpp
+ */
+typedef void CANDLL_CALLBACK(CAND_tRecorderCallback)(CAND_tenRecorderCallbackReason iReason, DWORD dwUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Callback type definition for shortcut callbacks.
+ *
+ * This callback will be triggerd when the user pressed the registered key.
+ *
+ * \param wKey
+ * The virtual key code of the pressed key
+ *
+ * \param dwModifiers
+ * Additional pressed keys like Ctrl, Alt, Shift
+ *
+ * \param dwUserData
+ * User defined data that has been specified at the registration of the callback.
+ *
+ * \return
+ * The return value indicates if the event has been consumed.
+ *
+ * \see
+ * CAND_enRegisterShortcut | CAND_enNotifyShortcut | CAND_enKeyModifier
+ *
+ * \ex CAND_tShortCutCb.cpp
+ */
+typedef BOOL CANDLL_CALLBACK(CAND_tShortCutCb)(WORD wKey, DWORD dwModifier, DWORD dwUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief Type definition for a filter callback.
+ *
+ * The application provides this function pointer at the registration of a filter callback.
+ * Which will be called to decide whether a message should be ignored or not.
+ *
+ * \param pstMessage
+ * Specifies the message which is to be examined. Use this structure to decide whether to skip that message or not.
+ *
+ * \param dwUserData
+ * User defined data which has been specified on registration of the callback.
+ *
+ * \retval - ::CAND_nTRUE The message is filtered and should be skipped.
+ * \retval - ::CAND_nFALSE The message passes the filter and should be processed.
+ *
+ * \ex CAND_tFilterCallback.cpp
+ */
+typedef BOOL CANDLL_CALLBACK(CAND_tFilterCallback)(CAND_tstRecordEntry* pstRecordEntry, DWORD dwUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Callback type definition for status information during the database generation process.
+ *
+ * The application provides this function pointer to register a callback, that will
+ * be triggered at the generation of a database. Use this callback to show
+ * the progress of the generation.
+ *
+ * \param lProgress
+ * Specifies the percentage of the generation progress.
+ *
+ * \ex CAND_tGenerateCb.cpp
+ */
+typedef void CANDLL_CALLBACK(CAND_tGenerateCb)(long lProgress);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Callback type definition for CAN-bus-state changes.
+ *
+ * \param hBus
+ * Specifies the bus handle.
+ *
+ * \param enEvent
+ * Enum for CAN-Bus-state.
+ *
+ * \param rxCount
+ * Rx error count.
+ *
+ * \param txCount
+ * Tx error count.
+ *
+ * \param pUserData
+ * User defined parameter passed on callback registration.
+ */
+typedef void CANDLL_CALLBACK(CAND_tCanBusState)(CAND_tHandle hBus, CAND_tenCanBusState enEvent, BYTE rxCount, BYTE txCount, void* pUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Callback type definition for CAN-bus error-frames.
+ *
+ * \param hBus
+ * Specifies the bus handle.
+ *
+ * \param timestamp
+ * Hardware timestamp.
+ *
+ * \param pUserData
+ * User defined parameter passed on callback registration.
+ */
+typedef void CANDLL_CALLBACK(CAND_tCanBusError)(CAND_tHandle hBus, QWORD timestamp, void* pUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Callback type definition for LIN-bus-state changes.
+ *
+ * \param hBus
+ * Specifies the bus handle.
+ *
+ * \param enEvent
+ * Enum for LIN-Bus-state.
+ *
+ * \param pUserData
+ * User defined parameter passed on callback registration.
+ */
+typedef void CANDLL_CALLBACK(CAND_tLinBusState)(CAND_tHandle hBus, CAND_tenLinBusState enEvent, void* pUserData);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Callback type definition for LIN-bus errors.
+ *
+ * \param pstMsgData
+ * Structure which contains the CAN frame data
+ *
+ * \param enEvent
+ * Enum for LIN-Bus-error.
+ *
+ * \param pUserData
+ * User defined parameter passed on callback registration.
+ */
+typedef void CANDLL_CALLBACK(CAND_tLinBusError)(CAND_tstMessagedataConst* pstMsgData, CAND_tenLinBusError enEvent, void* pUserData);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Looks for an object that is characterized by the given parameters within CanEasy database.
+ *
+ * The first object matching the given parameters will returned.\n
+ * The parameters pcBusName, pcEcuName, pcMsgName, pcSigName can be NULL, if
+ * they are not known.\n
+ * Parameter dwMsgID has to be -1 (0xFFFFFFFF) if unknown.\n\n
+ * The Database is organized in the following way:
+ * - BusA
+ * - Ecu1
+ * - Msg1
+ * - Msg2
+ * .
+ * - Ecu2
+ * - Msg3
+ * .
+ * .
+ * - BusB
+ * - Ecu3
+ * - Msg11
+ * - Msg12
+ * .
+ * - Ecu4
+ * - Msg13
+ * - Msg14
+ * .
+ * .
+ * .
+ * \n
+ * If you pass a null handle as hBeginSearch, the complete database will be searched.
+ * If you pass a handle to an object, only objects after hBeginSearch will be returned;
+ * e.g. if you pass a handle to Msg3 and search for Ecu1, the search can never succeed
+ * since Ecu1 comes "before" Msg3.
+ *
+ * \param pcBusName
+ * Points to a null terminated string which contains the name of the bus.
+ *
+ * \param pcEcuName
+ * Points to a null terminated string which contains the name of the ECU.
+ *
+ * \param pcMsgName
+ * Points to a null terminated string which contains the name of the message.
+ *
+ * \param dwMsgID
+ * ID of message.
+ *
+ * \param pcSigName
+ * Points to a null terminated string which contains the name of the signal.
+ *
+ * \param hBeginSearch
+ * Handle to an CanEasy database object which should be used as the start for the search. The first object which the searching is started with is the one, which is right after the one selected here.
+ *
+ * \return
+ * The Function returns a valid handle to a object that fits the given parameters. If
+ * there was no match the function return a invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \remark
+ * The search is not case sensitive.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hFindObject.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hFindObject(const char* pcBusName,
+ const char* pcEcuName,
+ const char* pcMsgName,
+ unsigned long dwMsgID,
+ const char* pcSigName,
+ CAND_tHandle hBeginSearch);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Returns the name of an object as a null terminated string. The object can be a bus, a control unit, a message or a signal.
+ *
+ * \param hObject
+ * Handle to the object which name should be returned.
+ *
+ * \param pcName
+ * Pointer to a buffer that receives the name of the object. This pointer must not be NULL.
+ * A terminating NULL-character will be automatically appended.
+ *
+ * \param dwLen
+ * Maximum length of pcName in characters.\n (Including room for a termination NULL character.)
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enGetName.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetName(CAND_tHandle hObject, char* pcName, unsigned long dwLen);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Sets the name of an object. The object can be a bus, a control unit, a message or a signal.
+ *
+ * \param hObject
+ * Handle to the object thats name should be modified.
+ *
+ * \param pcName
+ * Pointer to null terminated string that contains the name to be applied.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enSetName.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetName(CAND_tHandle hObject, const char* pcName);
+
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve a handle to an attribute for the
+ * given object in the current database.
+ *
+ * \param hObject
+ * Specifies a handle to a can bus, ECU, message or signal that owns the attribute.
+ *
+ * \param pszAttrName
+ * Specifies the name of the attribute you want to retrieve.
+ *
+ * \return
+ * If the function succeeds, the return value is a valid handle to the first attribute matching the
+ * search criteria. If the function fails or the attribute does not exist, the return value
+ * is a null handle. Check the result with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetAttrByName.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetAttrByName(CAND_tHandle hObject, const char* pszAttrName);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the first handle to an attribute of
+ * the given object in current database.
+ *
+ * \param hObject
+ * Specifies a handle to a bus, ECU, message or signal that owns the attribute.
+ *
+ * \return
+ * If the function succeeds, the return value is a valid handle to the first attribute of
+ * the object. If the function fails or the attribute does not exist, the return value
+ * is a null handle. Check the result with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetFirstAttr.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstAttr(CAND_tHandle hObject);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the next handle of a attribute from
+ * the given object in the current CanEasy database.
+ *
+ * \param hAttr
+ * Specifies a handle to an attribute.
+ *
+ * \return
+ * If the function succeeds, the return value is a valid handle to the next attribute of
+ * the object. If the function fails or the attribute does not exist, the return value
+ * is a null handle. Check the result with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetNextAttr.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextAttr(CAND_tHandle hAttr);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the type of an attribute for the
+ * given object.
+ *
+ * \param hAttr
+ * Specifies a valid handle to an attribute.
+ *
+ * \param penType
+ * Points to a buffer that receives the type of the attribute. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enGetAttrType.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrType(CAND_tHandle hAttr, CAND_enAttrType* penType);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the value of an attribute.
+ *
+ * \param hAttr
+ * Specifies a handle to a valid attribute.
+ *
+ * \param pvValue
+ * Points to a buffer that receives the value of the attribute. If this value is NULL the function will only
+ * determine the needed space to store the value in pvValue. The needed size will be returned in pu32Length.
+ *
+ * \param pu32Length
+ * Specifies the length (in Byte) of pvValue.
+ * If the type is ::CAND_TypeString, the buffer has to be at least the length of
+ * the String. If the Type is not ::CAND_TypeString, this parameter has to be the
+ * exact length of the Type (i.e. 4 for 32Bit-Values).
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enGetAttrValue.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrValue(CAND_tHandle hAttr, void* pvValue, unsigned int* pu32Length);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the value of an enum attribute entry.
+ *
+ * \param hAttr
+ * Specifies a handle to a valid attribute.
+ * \param u32Entry
+ * Specifies the requested entry.
+ * \param sName
+ * Pointer where the entry name will be copied.
+ * \param u32NameSize
+ * Size of the buffer sName.
+ * \param piValue
+ * Entries value.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enGetAttrEnumEntry.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrEnumEntry(CAND_tHandle hAttr, unsigned int u32Entry, char* sName, unsigned int u32NameSize, int* piValue);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to set a new value of an attribute.
+ *
+ * \param hAttr
+ * Specifies a valid handle to an attribute.
+ *
+ * \param pvValue
+ * Points to a buffer that specifies the new value of the attribute. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK Function succeeded
+ *
+ * \ex CAND_enSetAttrValue.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetAttrValue(CAND_tHandle hAttr, const void* pvValue);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to create a new attribute.
+ *
+ * \param hObject
+ * Specifies a handle to an database item
+ *
+ * \param szName
+ * The name of the new Attribute.
+ *
+ * \param pvValue
+ * Attribute value buffer. To create an enum attribute pass a pointer to CAND_tstEnum.
+ *
+ * \param enType
+ * Type for the new attribute.
+ *
+ * \param enTypeOf
+ * Specifies whether it is an internal, dbc or runtime attribute. See ::CAND_enKindOfAttr for more information.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created attribute. Otherwise the function returns value is a NULL handle.
+ * Check the function result with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateAttribute.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hCreateAttribute(CAND_tHandle hObject, const char* szName, const void* pvValue, CAND_enAttrType enType, CAND_enKindOfAttr enTypeOf);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the owner of the attribute. The owner can
+ * be a bus, an ECU, a message or a signal.
+ *
+ * \param hAttr
+ * Specifies the handle of the attribute.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle of the attribute's
+ * owner. If the function fails the return value is a NULL handle. Check
+ * the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetAttrOwner.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetAttrOwner(CAND_tHandle hAttr);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the attribute name. The owner can be a
+ * bus, an control unit, a message or a signal.
+ *
+ * \param hAttr
+ * Specifies the handle of the attribute.
+ *
+ * \param szName
+ * Points to a buffer where the name will be inserted. If this pointer is NULL the function will only
+ * determine the required buffer length and return it in pu32Length.
+ *
+ * \param pu32Length
+ * Length of the buffer and maximum length of the name. Or if szName is NULL the function will
+ * write the requered length for the buffer into this pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetAttrName.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrName(CAND_tHandle hAttr, char* szName, unsigned int* pu32Length);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the attributes maximum value.
+ *
+ * \param hAttr
+ * Specifies the handle of the attribute.
+ *
+ * \param pMax
+ * Pointer to a double where the maximum value will be inserted.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetAttrMax.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrMax(CAND_tHandle hAttr, double* pMax);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Call this function to retrieve the attributes minimum value.
+ *
+ * \param hAttr
+ * Specifies the handle of the attribute.
+ *
+ * \param pMin
+ * Pointer to a double where the minimum value will be inserted.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetAttrMin.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetAttrMin(CAND_tHandle hAttr, double* pMin);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Sets the attribute maximum value.
+ *
+ * \param hAttr
+ * Specifies the handle of the attribute.
+ *
+ * \param dMax
+ * Maximum value for the attribute.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetAttrMax.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetAttrMax(CAND_tHandle hAttr, double dMax);
+
+/*!
+ * \ingroup attribute_functions
+ *
+ * \brief
+ * Sets the attribute minimum value.
+ *
+ * \param hAttr
+ * Specifies the handle of the attribute.
+ *
+ * \param dMin
+ * Minimum value for the attribute.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetAttrMin.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetAttrMin(CAND_tHandle hAttr, double dMin);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Retrieves the handle to the database, which is the root of the CanEasy database.
+ *
+ * \return
+ * Returns the handle for the database. Otherwise a null handle will be
+ * returned if no database exists.
+ *
+ * \ex CAND_hGetDatabase.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetDatabase(void);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Generates a new bus from a dbc- or ldf-file.
+ *
+ * \param pcName
+ * Name of the bus to be generated.
+ *
+ * \param pcPath
+ * Filepath of dbc- or ldf-file.
+ *
+ * \param pfnProgress
+ * Callback to get generation status information.
+ *
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK Function succeeded
+ * \retval - ::CAND_nERR_SIM_IS_RUNNING Simulation is running
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Generator is not available
+ *
+ * \ex CAND_enGenerateBus.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGenerateBus(const char* pcName, const char* pcPath, CAND_tGenerateCb pfnProgress);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Exports a new bus into a dbc-file or ldf-file.
+ *
+ * \param hBus
+ * Specifies a handle to a bus.
+ *
+ * \param cpFilename
+ * Filepath of the destination dbc-file or ldf-file.
+ *
+ * \retval - ::CAND_nERR_OK Function succeeded
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Export ist not allowed or the responsible module
+ * could not be found
+ * \retval - ::CAND_nERR_FILE_FORMAT Invalid fileformat for the given bus.
+ *
+ * \remark ::CAND_nERR_FILE_FORMAT will be returned if cpFilename describes a
+ * LDF file and a other Bus than a LIN bus is described by hBus.
+ *
+ * \ex CAND_enExportBus.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enExportBus(CAND_tHandle hBus, const char* cpFilename);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Imports a ecu from a ncf-file.
+ *
+ * \param hBus
+ * Specifies a handle to a bus.
+ *
+ * \param cpFilename
+ * Filepath of the source ncf-file.
+ *
+ * \retval - ::CAND_nERR_OK Function succeeded
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Import is not allowed or the responsible module
+ * could not be found
+ * \retval - ::CAND_nERR_FILE_FORMAT Invalid fileformat for the given bus.
+ *
+ * \remark ::CAND_nERR_FILE_FORMAT will be returned if cpFilename describes a
+ * NCF file and a other Bus than a LIN bus is described by hBus.
+ *
+ * \ex CAND_enGenerateEcu.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGenerateEcu( CAND_tHandle hBus, const char* cpFilename );
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Exports a ecu into a ncf-file.
+ *
+ * \param hBus
+ * Specifies a handle to a bus.
+ *
+ * \param hEcu
+ * Specifies a handle to a ecu.
+ *
+ * \param cpFilename
+ * Filepath of the destination ncf-file.
+ *
+ * \retval - ::CAND_nERR_OK Function succeeded
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Export ist not allowed or the responsible module
+ * could not be found
+ *
+ * \ex CAND_enExportEcu.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enExportEcu(CAND_tHandle hBus, CAND_tHandle hEcu, const char* cpFilename);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Determines if a database is available.
+ *
+ * \retval - ::CAND_nTRUE if a database exists.
+ * \retval - ::CAND_nFALSE if no database exists.
+ *
+ * \ex CAND_boIsDatabaseAvailable.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boIsDatabaseAvailable(void);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Adds a new bus to the database.
+ *
+ * \param lpBusName
+ * Name of a new bus.
+ *
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK Function succeeded
+ *
+ * \ex CAND_enAddNewBus.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewBus(LPCTSTR lpBusName);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Searches for a bus by its name.
+ *
+ * \param pcBusName
+ * Points to a null terminated string which contains the name of the bus. This
+ * pointer must not be NULL and the string must be terminated by a
+ * NULL-character.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the bus with
+ * the specified name. If the bus does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * Call this function to get a handle to a can bus.
+ *
+ * \ex CAND_hGetBusByName.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetBusByName(const char* pcBusName);
+
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * For the given handle of an object, this function returns the handle to its bus.
+ *
+ * \param hObject
+ * Specifies a handle to an ECU, a message or a signal, whose bus should be retrieved.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the bus. If the
+ * handle does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * Call this function with a handle to a message, signal or ECU. In
+ * all cases, ::CAND_hGetBusHandle returns a handle to the corresponding bus.
+ *
+ * \ex CAND_hGetBus.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetBus(CAND_tHandle hObject);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieves the first bus within the CanEasy database.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the first
+ * bus in the database. If the bus does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \ex CAND_hGetFirstBus.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstBus(void);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieves the next bus within the database.
+ *
+ * \param hBus
+ * Specifies a handle to a bus.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the next bus
+ * in the database. If the bus does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetNextBus.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextBus(CAND_tHandle hBus);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieves the current baudrate of the bus.
+ *
+ * \param hBus
+ * Handle to a bus.
+ *
+ * \param pdwBaudrate
+ * Pointer to an unsigned long value buffer which will receive the baudrate of the
+ * bus. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NO_MATCH Attribute 'Baudrate' was not found
+ * \retval - ::CAND_nERR_OK The function succeeded
+ *
+ * \ex CAND_enGetBaudrate.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBaudrate(CAND_tHandle hBus, unsigned long* pdwBaudrate);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Sets the baudrate of the bus.
+ *
+ * \param hBus
+ * Handle to a bus.
+ *
+ * \param dwBaudrate
+ * Baudrate of the bus.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded
+ *
+ * \ex CAND_enSetBaudrate.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBaudrate(CAND_tHandle hBus, unsigned long dwBaudrate);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Call this function to change the bit timing register of the bus.
+ *
+ * The BTR values represent the baudrate. Their combination
+ * stands for a certain baudrate.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param bBTR0
+ * Specifies the new value for BTR0.
+ *
+ * \param bBTR1
+ * Specifies the new value for BTR1.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remarks
+ * Changes which concern the hardware will be only applied after the restart of simulation.
+ *
+ * \ex CAND_enSetBTR.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBTR(CAND_tHandle hBus, unsigned char bBTR0, unsigned char bBTR1);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieve the BTR values of a bus.
+ *
+ * \param hBus
+ * Handle to a bus.
+ *
+ * \param pbBTR0
+ * Points to an unsigned char which receives the the BTR0 value. This pointer must
+ * not be NULL.
+ *
+ * \param pbBTR1
+ * Points to an unsigned char which receives the the BTR1 value. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetBTR.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBTR(CAND_tHandle hBus, unsigned char* pbBTR0, unsigned char* pbBTR1);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Sets the state of the bus. Sending and receiving can be switched on separately.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param nState
+ * Specifies whether the bus should be enabled or disabled.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetBusState.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBusState(CAND_tHandle hBus, CAND_tenBusState nState);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Determines whether the bus is allowed to send or receive messages.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param pnState
+ * Pointer to the type variable which receives the bus state. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetBusState.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBusState(CAND_tHandle hBus, CAND_tenBusState* pnState);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieves the bus status information
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param pStat
+ * Points to the type that receives bus status. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetBusStat.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBusStat(CAND_tHandle hBus, CAND_tstBusStat* pStat);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Reset the bus status information
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ * The status information of all busses will be resetted if hBus is a CAND_hNullHandle()
+ *
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enResetBusStat.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enResetBusStat(CAND_tHandle hBus);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Shows the bus statistic dialog
+ *
+ * \ex CAND_vShowBusStat.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vShowBusStat(void);
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Deletes a bus, ECU, message or signal
+ *
+ * \param hObj
+ * Specifies a valid handle to an object
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enDelete.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enDelete(CAND_tHandle hObj);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Adds a new ECU to the specified bus.
+ *
+ * \param hBus
+ * Handle to a bus.
+ *
+ * \param lpEcuName
+ * Name of the new ECU.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enAddNewECU.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewECU(CAND_tHandle hBus, LPCTSTR lpEcuName);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Retrieves the handle of the LIN Master ECU if the given bus is a LIN bus.
+ *
+ * \param hBus
+ * Handle to the LIN bus.
+ *
+ * \returns
+ * If the function succeeds, the return value is the handle to the LIN master
+ * control unit. If the bus does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * This function works only for busses of the type LIN! You can find out the bus type
+ * in the bus editor of CanEasy.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetLinMaster.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetLinMaster(CAND_tHandle hBus);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Sets the specified control unit as LIN master.
+ *
+ * \param hObj
+ * Handle to the control unit which should be the new LIN master.
+ *
+ * \returns
+ * If the function succeeds, the return value is the handle to the new LIN master
+ * control unit. If the control unit does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * This function works only for busses of the type LIN! You can find out the bus type
+ * in the bus editor of CanEasy.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hSetLinMaster.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hSetLinMaster(CAND_tHandle hObj);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Enumeration with the supported bus types of CanEasy.
+ *
+ * \remarks
+ * By default every Bus is a can bus!
+ *
+ * \see
+ * CAND_enGetBusType | CAND_enSetBusType
+ */
+typedef enum
+{
+ CAND_enBusTypeCan,
+ CAND_enBusTypeLin
+} CAND_tenBusType;
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieves the bus type using the specified bus handle.
+ *
+ * \param hBus
+ * Handle to a bus.
+ *
+ * \param penBusType
+ * Pointer to a variable which receives the bus type.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \see
+ * CAND_tenBusType
+ *
+ * \ex CAND_enGetBusType.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetBusType(CAND_tHandle hBus, CAND_tenBusType* penBusType);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Sets the type of a bus.
+ *
+ * \param hBus
+ * Handle to a bus.
+ *
+ * \param enBusType
+ * New type of the bus, that should be set.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetBusType.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetBusType(CAND_tHandle hBus, CAND_tenBusType enBusType);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Retrieves the information if the master of the given LIN-bus is real.
+ *
+ * \param hBus
+ * Handle to the LIN-bus.
+ *
+ * \param pboIsReal
+ * Buffer to recieve the information
+ *
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_INVALID_HANDLE The given bus does not exists.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Given bus is not a LIN-bus.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enLinMasterIsReal.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enLinMasterIsReal(CAND_tHandle hBus, bool* pboIsReal);
+
+/*!
+ * \ingroup bus_functions
+ *
+ * \brief
+ * Sets the state of the LIN-bus.
+ *
+ * \param hBus
+ * Handle to the LIN-bus.
+ *
+ * \param enState
+ * The state in which the LIN-bus should go.
+ *
+ * \retval - ::CAND_nERR_OK success
+ * \retval - ::CAND_nERR_INVALID_HANDLE The bus-handle is invalid.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE 1. The bus isn't a LIN-bus.
+ * 2. Bus should go into sleep, but the master-ECU isn't simulated.
+ * \retval - ::CAND_nERR_NO_MATCH Simulation isn't running.
+ *
+ * \remark
+ * May only be used while simulation is running.
+ *
+ * \remark
+ * The sleep-state can only be set if the master-ECU is simulated.
+ *
+ * \ex CAND_enSetLinBusState.cpp
+ *
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetLinBusState(CAND_tHandle hBus, CAND_tenLinBusState enState);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Retrieves the handle of an ECU using a handle of a signal or a message.
+ *
+ * \param hObject
+ * Specifies a handle to a message or a signal.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the control unit
+ * which own the given object. If the object does not exist in the database or the function
+ * fails the return value is a NULL handle. Check the return value with
+ * ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetEcu.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEcu(CAND_tHandle hObject);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Retrieves the handle of a control unit in the database, expects controls name as parameter.
+ *
+ * \param hBus
+ * Specifies a handle to a bus.
+ *
+ * \param pcEcuName
+ * Points to a null terminated string containing the name of the ECU.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the control unit
+ * with the specified name. If the control unit does not exist in the database or
+ * the function fails the return value is a NULL handle. Check the
+ * return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetEcuByName.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEcuByName(CAND_tHandle hBus, const char* pcEcuName);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Call this function to retrieve the first control unit from a bus.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the first control
+ * unit. If the control unit does not exist in the database or
+ * the function fails the return value is a NULL handle. Check the
+ * return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetFirstEcu.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstEcu(CAND_tHandle hBus);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Call this function to retrieve the next ECU on the bus.
+ *
+ * \param hEcu
+ * Specifies a handle of a control unit.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the next control
+ * unit. If the control unit does not exist in the database or
+ * the function fails the return value is a NULL handle. Check the
+ * return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetNextEcu.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextEcu(CAND_tHandle hEcu);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Call this function to set the state of an ECU.
+ *
+ * \param hEcu
+ * Specifies a handle of an ECU.
+ *
+ * \param nState
+ * Specifies the new state of the ECU. If this parameter is
+ * ::CAND_nReal the ECU is set up as a real ECU and does not simulate any
+ * messages. If the parameter is ::CAND_nSimulated, simulation of messages
+ * is enabled.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remark
+ * Call this function to set the simulation state of an ECU.
+ *
+ * \see
+ * CAND_tenSimState
+ *
+ * \ex CAND_enSetEcuState.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEcuState(CAND_tHandle hEcu, CAND_tenSimState nState);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Call this function to retrieve the state of an ECU.
+ *
+ * \param hEcu
+ * Specifies a handle to an ECU.
+ *
+ * \param pnState
+ * Pointer to a variable which will receive the state of the ECU. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetEcuState.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetEcuState(CAND_tHandle hEcu, CAND_tenSimState* pnState);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Call this function to set message mode of an ECU.
+ *
+ * \param hEcu
+ * Handle to the ECU.
+ *
+ * \param nMode
+ * Specifies the new message mode of the ECU. This option will only apply if Ecu is simulated.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetEcuMsgMode.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEcuMsgMode(CAND_tHandle hEcu, CAND_tenGenMsgMode nMode);
+
+/*!
+ * \ingroup ecu_functions
+ *
+ * \brief
+ * Call this member function to retrieve the message mode of an ECU.
+ *
+ * \param hEcu
+ * Specifies a handle to an ECU.
+ *
+ * \param pnMode
+ * Pointer to buffer which will receive the mode of the ECU. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetEcuMsgMode.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetEcuMsgMode(CAND_tHandle hEcu, CAND_tenGenMsgMode* pnMode);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Returns a signal which is currently defined as the multiplexer signal,
+ * to distinguish between multiplexed messages.
+ *
+ * \param hMsg
+ * Handle of multiplex message.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle of the multiplex signal.
+ * If the multiplex signal does not exist beneath the message or
+ * the function fails the return value is a NULL handle. Check the
+ * return value with ::CAND_enIsNullHandle.
+ *
+ * \ex CAND_hGetMultiplexSig.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMultiplexSig(CAND_tHandle hMsg);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sets the signal which is used as the multiplexer signal, to distinguish
+ * between multiplex messages.
+ *
+ * \param hMsg
+ * Handle of a message.
+ *
+ * \param hSig
+ * Handle of the signal that should be the multiplexer signal.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetMultiplexSig.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMultiplexSig(CAND_tHandle hMsg, CAND_tHandle hSig);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Adds a new message to the specified control unit or message.
+ *
+ * \param hObj
+ * Handle to the parent. Beneath this object the new message is created.
+ *
+ * \param lpMsgName
+ * Name of the new message. (null terminated string)
+ *
+ * \param dwMsgId
+ * Id of the new message. The message id must be unique within a bus. And
+ * unique on message level for a multiplexed message.
+ *
+ * \param bDlc
+ * Length of a message in bytes.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enAddNewMessage.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewMessage(CAND_tHandle hObj, LPCTSTR lpMsgName, DWORD dwMsgId, BYTE bDlc);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Retrieves the message handle from a signal or multiplexed message.
+ *
+ * \param hSig
+ * Specifies a handle to a signal or multiplexed message.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the message
+ * which this object belongs to. If the control unit does not exist in the
+ * database or the function fails the return value is a NULL handle. Check
+ * the return value with ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * Call this function to get a handle to the message. Handles provide
+ * faster access than accessing by message name or ID.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetMessage.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMessage(CAND_tHandle hSig);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Queries a message from the database. Starts searching with hObj.
+ *
+ * \param hObj
+ * Specifies a handle to a bus, ecu, or message. The function will only
+ * find objects just after this handle. To browse the whole CanEasy database
+ * just provide the handle of the database.
+ *
+ * \param pcMsgName
+ * Points to a null terminated string containing the name of the message.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the message
+ * to with the given name. If the message does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetMessageByName.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMessageByName(CAND_tHandle hObj, const char* pcMsgName);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Queries a message from the database using the bus handle and message ID.
+ *
+ * \param hBus
+ * Specifies a handle to a bus.
+ *
+ * \param dwMsgID
+ * Identifies the message whose handle is required.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the message
+ * with the given ID on the specified bus. If the message does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetMessageByID.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetMessageByID(CAND_tHandle hBus, unsigned long dwMsgID);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Retrieves the first message from a control unit or a message.
+ *
+ * \param hObject
+ * Specifies a handle to a control unit or a message.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the first message
+ * beneath the starting object. If the message does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetFirstMsg.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstMsg(CAND_tHandle hObject);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief Retrieves the next message with the same parent.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the next message
+ * after the starting object. If the message does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetNextMsg.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextMsg(CAND_tHandle hMsg);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief Call this function to retrieve the ID of a message.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \param pdwMsgID
+ * Pointer to an unsigned long variable that receives the message ID. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetMsgID.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgID(CAND_tHandle hMsg, unsigned long* pdwMsgID);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief Call this function to set the ID of a message. It is not allowed to change the
+ * message ID when simulation is running.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \param dwMsgID
+ * Message ID.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Operation currently not possible.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetMsgID.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgID(CAND_tHandle hMsg, unsigned long dwMsgID);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Retrieves the number of data bytes of a message using its handle.
+ *
+ * \param hMsg
+ * Handle of the message.
+ *
+ * \param pcMsgDLC
+ * Pointer to a char variable that receives the message length. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetMsgDLC.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgDLC(CAND_tHandle hMsg, unsigned char* pcMsgDLC);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sets the number of data bytes of a message using its handle.
+ *
+ * \param hMsg
+ * Handle of the message.
+ *
+ * \param msgDLC
+ * Message length in bytes.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Operation currently not possible.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetMsgDLC.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgDLC(CAND_tHandle hMsg, unsigned char msgDLC);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Retrieves the data bytes of a message using its handle.
+ *
+ * \param hMsg
+ * Handle to a message.
+ *
+ * \param pbMsgData
+ * Points to an array of bytes that receives the contents of the message. Make sure that
+ * the buffer is large enough. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetMsgData.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgData(CAND_tHandle hMsg, unsigned char* pbMsgData);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sets the data bytes of a message using its handle.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \param pbMsgData
+ * Points to an array of 8 bytes that specifies the contents of the message.\n This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetMsgData.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgData(CAND_tHandle hMsg, const unsigned char* pbMsgData);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Retrieves one byte of a message.
+ *
+ * \param hMsg
+ * Handle to a message.
+ *
+ * \param u32Index
+ * Index of the byte to be red.
+ *
+ * \param pu8Data
+ * Points to a byte where the message byte is copied to. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetMsgByte.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgByte(CAND_tHandle hMsg, unsigned int u32Index, unsigned char* pu8Data);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sets one byte of a message.
+ *
+ * \param hMsg
+ * Handle to a message.
+ *
+ * \param u32Index
+ * Index of the byte to be red.
+ *
+ * \param u8Data
+ * Data byte to be set.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetMsgByte.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgByte(CAND_tHandle hMsg, unsigned int u32Index, unsigned char u8Data);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sends a message from the CanEasy database to the bus.
+ *
+ * \param hObj
+ * Specifies a handle to a message or a signal.
+ *
+ * \remark
+ * The simulation must be in the run state to send a message!
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation is not running.
+ * \retval - ::CAND_nERR_TX_FAILED Could not send this message
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enSend.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSend(CAND_tHandle hObj);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sends a free message on the specified bus. A free message doesn't have to exist inside the CanEasy
+ * database. This function can only be used with CAN busses.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param dwMsgID
+ * Specifies the ID of the message.
+ *
+ * \param pbData
+ * Points to an array of bytes that specifies the contents of the message. This pointer must not be NULL.
+ *
+ * \param bDlc
+ * Number of data bytes.
+ *
+ * \param boOverwritable
+ * Specifies if the message can be overwritten if message is send again before it is on bus.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ * \retval - ::CAND_nERR_TX_FAILED Message could not be sent
+ *
+ * \remark
+ * If simulation is not in the running state, the function returns ::CAND_nERR_TX_FAILED.
+ *
+ * \ex CAND_enSendFreeCanMsg.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSendFreeCanMsg(CAND_tHandle hBus, unsigned long dwMsgID,
+ const unsigned char* pbData, unsigned char bDlc,
+ unsigned char boOverwritable);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Set the slave data of a lin message on the specified bus. This function can only be used with LIN busses.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param dwMsgID
+ * Specifies the ID of the message.
+ *
+ * \param pbData
+ * Points to an array of bytes that specifies the contents of the message. This pointer must not be NULL.
+ *
+ * \param bDlc
+ * Number of data bytes.
+ *
+ * \param checksumVersion
+ * Checksum version to be used for the lin message.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation is not running.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetLinData.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetLinData(CAND_tHandle hBus, BYTE bMsgID,
+ const BYTE* pbData, BYTE bDlc,
+ CAND_tenLinChecksumVersion checksumVersion);
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sends a lin header frame. This function can only be used with LIN busses with simulated lin master.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param dwMsgID
+ * Specifies the ID of the message.
+ *
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation is not running.
+ * \retval - ::CAND_nERR_TX_FAILED Message could not be sent
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remark
+ * If simulation is not in the running state, the function returns ::CAND_nERR_TX_FAILED.
+ *
+ * \ex CAND_enSendLinHeader.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSendLinHeader(CAND_tHandle hBus, BYTE bMsgID);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Enables a lin message. If the master is simulated only der header-frame will be send.
+ * If the master is real, the data of simulated messages are not added to teh header-frame.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param bMsgID
+ * Specifies the ID of the message.
+ *
+ * \param bEnable
+ * 0 = message will be disabled.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetLinMsgState.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetLinMsgState(CAND_tHandle hBus, BYTE bMsgID, BYTE bEnable);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Returns the lin message state.
+ *
+ * \param hBus
+ * Specifies a handle to a can bus.
+ *
+ * \param bMsgID
+ * Specifies the ID of the message.
+ *
+ * \param pbEnable
+ * 0 = message is disabled.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetLinMsgState.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetLinMsgState(CAND_tHandle hBus, BYTE bMsgID, BYTE* pbEnable);
+
+
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Returns the cycle time of a message from the CanEasy database.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \param pwValue
+ * Points to a buffer that receives the message cycle time .
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetMsgCycleTime.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgCycleTime(CAND_tHandle hMsg, unsigned short* pwValue);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Sets the cycle time of a message, which is used for the intervals of its cyclic dispatchment.
+ *
+ * \remark
+ * This value is indicated in milliseconds.
+ *
+ * \param hMsg
+ * Handle of the message.
+ *
+ * \param wCycleTime
+ * Specifies the new cycle time.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetMsgCycleTime.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgCycleTime(CAND_tHandle hMsg, unsigned short wCycleTime);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Enables or disables the sending of a cyclic message.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \param bEnable
+ * Specifies, if the message is sent or not. If 0 the message is not sent. Otherwise
+ * the message is sent cyclically.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remark
+ * This function has is only effective if the message is cyclically dispatched.
+ * Keep in mind that this function is slow, because the user interface has to be
+ * updated on each call.
+ *
+ * \ex CAND_enEnableMsg.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enEnableMsg(CAND_tHandle hMsg, unsigned char bEnable);
+
+/*!
+ * \ingroup message_functions
+ *
+ * \brief
+ * Returns the state, which says whether the cyclic generating of a message is active or not.
+ *
+ * \param hMsg
+ * Specifies a handle to a message.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nTRUE Cyclic sending is enabled.
+ * \retval - ::CAND_nFALSE Cyclic sending is disabled.
+ *
+ * \remark
+ * This function specifies if the cyclically sending of the message is enabled
+ * or not.
+ *
+ * \ex CAND_enIsMsgEnabled.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enIsMsgEnabled(CAND_tHandle hMsg);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Adds a new signal to a message.
+ *
+ * \param hMsg
+ * Handle of the message.
+ *
+ * \param pcSigName
+ * Name of the new signal.
+ *
+ * \param bStartBit
+ * Starting bit position of the new signal in the message.
+ *
+ * \param bBitCount
+ * Bitcount of the new signal.
+ *
+ * \param enByteOrder
+ * Byteorder for the signal (intel or motorola).
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Operation currently not possible.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enAddNewSignal.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddNewSignal(CAND_tHandle hMsg, const char* pcSigName,
+ BYTE bStartBit, BYTE bBitCount, CAND_enByteOrder enByteOrder);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Queries a signal from the database using the message handle.
+ *
+ * \param hMsg
+ * Handle to the message that owns the signal.
+ *
+ * \param pcSigName
+ * Points to a null terminated string containing the name of the signal.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the signal
+ * with the specified name. If the signal does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetSignalByName.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetSignalByName(CAND_tHandle hMsg,
+ const char* pcSigName);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the first signal of a message.
+ *
+ * \param hMessage
+ * Specifies a handle to a message.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the first
+ * signal beneath the given object. If the signal does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetFirstSig.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstSig(CAND_tHandle hMessage);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Retrieves the next signal of a message.
+ *
+ * \param hSig
+ * Specifies a handle to a signal.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the next
+ * signal after the given object. If the signal does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetNextSig.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextSig(CAND_tHandle hSig);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the signal value using its handle. You will
+ * receive a byte stream with the data, as if it has been sent on the bus.
+ *
+ * \param hSig
+ * Specifies the handle of a signal.
+ *
+ * \param pbData
+ * Points to a buffer that receives the data of the signal. This pointer must
+ * not be NULL.
+ *
+ * \param ulLength
+ * Specifies the number of bytes to be read.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigData.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigData(CAND_tHandle hSig, void* pbData, unsigned long ulLength);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the data bytes of a signal.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pbData
+ * Specifies the new byte value.
+ *
+ * \param iLength
+ * Specifies the number of bytes to be written.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigData.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigData(CAND_tHandle hSig, const BYTE* pbData, int iLength);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the unscaled value of a signal.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param qwData
+ * Specifies the new unscaled value.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigDataHex.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigDataHex(CAND_tHandle hSig, QWORD qwData);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the signal value by its handle. The result is the
+ * scaled (physical) value of the signal.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pdbValue
+ * Points to a buffer that receives the scaled (physical) value of the signal. This
+ * pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigDataPhys.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigDataPhys(CAND_tHandle hSig, double* pdbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the (physically) scaled value of a signal.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param dbValue
+ * Specifies the new scaled (physical) value of the signal.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Operation is currently not possible
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigDataPhys.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigDataPhys(CAND_tHandle hSig, double dbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the minimum value of a signal by its
+ * handle. The result ist the (physically) scaled value of the minimum.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pdbValue
+ * Points to a buffer that receives the scaled (physical) value of the signal-minimum.
+ * This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigMin.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigMin(CAND_tHandle hSig, double* pdbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the minimum value of a signal by its handle.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param dbValue
+ * The scaled (physical) value of the signal-minimum.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigMin.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigMin(CAND_tHandle hSig, double dbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the signal length of a signal by its handle.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param u32Value
+ * The new length of the signal.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigBitLen.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigBitLen(CAND_tHandle hSig, unsigned int u32Value);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the signal display type using its handle.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param enSigType
+ * The new signal type.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigDisplayType.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigDisplayType(CAND_tHandle hSig, CAND_tenSigType enSigType);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the maximum value of a signal handle. The result
+ * is the (physically) scaled value of the maximum.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pdbValue
+ * Points to a buffer that receives the scaled (physical) value of the
+ * signal maximum. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigMax.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigMax(CAND_tHandle hSig, double* pdbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the maximum value of a signal by its handle.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param dbValue
+ * The scaled (physical) value of the signal-maximum.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigMax.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigMax(CAND_tHandle hSig, double dbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the offset value of a signal by its
+ * handle. The result is the physical value.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pdbValue
+ * Points to a buffer that receives the scaled (physical) value of the signal-offset. This
+ * pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigOffset.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigOffset(CAND_tHandle hSig, double* pdbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the offset value of a signal by its handle.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param dbValue
+ * The scaled (physical) value of the signal-offset.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigOffset.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigOffset(CAND_tHandle hSig, double dbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the factor of a signal by its handle. The
+ * result is the physical value.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pdbValue
+ * Points to a buffer that receives the scaled (physical) value of the signal-factor. This
+ * pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigFactor.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigFactor(CAND_tHandle hSig, double* pdbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the factor of a signal using its handle.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param dbValue
+ * The scaled (physical) value of the signal-factor.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigFactor.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigFactor(CAND_tHandle hSig, double dbValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the value from the value table of a signal.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param uiIndex
+ * Specifies the index of the state.
+ *
+ * \param pdwStateVal
+ * Points to a buffer that receives the value of the state. This pointer must not be NULL.
+ *
+ * \param pcEntryBuf
+ * Points to a buffer that receives description of the signal-state. This pointer
+ * must not be NULL. A terminating NULL-character will be automatically appended.
+ *
+ * \param dwBufLen
+ * Specifies the maximum number of characters to copy to the buffer, including the
+ * NULL character. If the text exceeds this limit, it is truncated.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK Function succeeded
+ *
+ * \ex CAND_enGetSigEntry.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigEntry(CAND_tHandle hSig,
+ unsigned int uiIndex,
+ unsigned long* pdwStateVal,
+ char* pcEntryBuf,
+ unsigned long dwBufLen);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the number of signal entries from the
+ * value table of a signal.
+ *
+ * \param hSig
+ * Specifies the handle to a signal.
+ *
+ * \param pdwEntryCount
+ * Specifies the number of signalentrys.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigEntryCount.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigEntryCount(CAND_tHandle hSig,
+ unsigned long *pdwEntryCount);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the value of a signal to default.
+ *
+ * \param hObject
+ * Specifies a handle to a bus, ecu, message or signal. If the handle is from a bus
+ * all signals in the bus will be set to their default values. if the handle is from an
+ * ecu all signals of the ecu will be set to their default values etc.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetSigToDef.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetSigToDef(CAND_tHandle hObject);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the physical value of a signal.
+ *
+ * \param hSig
+ * Specifies the handle of signal.
+ *
+ * \param pData
+ * Points to a buffer that specifies the data byte of the message which contains the signal.
+ * This pointer must not be NULL.
+ *
+ * \param pValue
+ * Points to a buffer that receives the signal value of the signal. This pointer must
+ * not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetPhysValueByMsgData.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetPhysValueByMsgData(CAND_tHandle hSig,
+ const unsigned char* pData,
+ double* pValue);
+// TODO BTP #4363
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgDataByPhysVal(CAND_tHandle hSig,
+ unsigned char* pData,
+ double value);
+
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetHexValueByMsgData(CAND_tHandle hSig,
+ const unsigned char* pData,
+ QWORD* pu64Value);
+
+
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetMsgDataByHexValue(CAND_tHandle hSig,
+ unsigned char* pData,
+ QWORD u64Value);
+
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetDisplayChannel(CAND_tHandle hBus, BYTE* pu8Channel);
+
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetDisplayChannel(CAND_tHandle hBus, BYTE u8Channel);
+
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to get a copy of the message data containing the certain signal with
+ * the provided physical value. This function will not change the message data in the CanEasy
+ * database.
+ *
+ * \param hSig
+ * Specifies the handle of signal.
+ *
+ * \param pData
+ * Points to a buffer that specifies the data byte of the message which receive the signal value.
+ * This pointer must not be NULL.
+ *
+ * \param dValue
+ * Signal value to be set into message data.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetMsgDataByPhysValue.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetMsgDataByPhysValue(CAND_tHandle hSig,
+ unsigned char* pData, double dValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the length of a signal in bits.
+ *
+ * \param hSig
+ * Specifies the handle of signal.
+ *
+ * \param pValue
+ * Points to a buffer that receives the bit length of the signal. This pointer
+ * must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigBitLen.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigBitLen(CAND_tHandle hSig,
+ short* pValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve the start bit of a signal.
+ *
+ * \param hSig
+ * Specifies the handle of signal.
+ *
+ * \param pValue
+ * Points to a buffer that receives the start bit of the signal. This pointer
+ * must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigStartBit.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigStartBit(CAND_tHandle hSig, short* pValue);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to get the bit order of a signal.
+ *
+ * \param hSig
+ * Specifies the handle of signal.
+ *
+ * \param penOrder
+ * Points to the buffer that reveives the bit order of the signal.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetSigByteOrder.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetSigByteOrder(CAND_tHandle hSig, CAND_enByteOrder* penOrder);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to retrieve a textual description of an Object.
+ *
+ * \param hObj
+ * Specifies the handle to an object.
+ *
+ * \param pcBuffer
+ * Points to the buffer that receives the description of the object.
+ * This pointer must not be NULL.
+ *
+ * \param iBuffSize
+ * Size of the reserved memory for pcBuffer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enGetDescription.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetDescription(CAND_tHandle hObj, char* pcBuffer, int iBuffSize);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Call this function to set the textual description of an object.
+ *
+ * \param hSig
+ * Specifies the handle of an signal.
+ *
+ * \param szText
+ * The new text to set.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enSetDescription.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetDescription(CAND_tHandle hSig, const char* szText);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Retrieves the first receiving ECU of this signal.
+ *
+ * \param hSig
+ * Specifies a handle to a signal.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the first
+ * control unit that receives this signal. If the ECU does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetFirstReceiver.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstReceiver(CAND_tHandle hSig);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Retrieves the next receiving ECU of this signal.
+ *
+ * \param hSig
+ * Specifies a handle to a signal.
+ *
+ * \param hEcu
+ * Specifies a handle to the current receiver ECU.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the next
+ * control unit that receives this signal. If the ECU does not exist in the
+ * database or the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetNextReceiver.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextReceiver(CAND_tHandle hSig, CAND_tHandle hEcu);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Adds a control unit to the list of the receiving control units that receive this signal.
+ *
+ * \param hSig
+ * Specifies a handle to a signal.
+ *
+ * \param hEcu
+ * Specifies a handle to the current receiver ECU.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enAddReceiver.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enAddReceiver(CAND_tHandle hSig, CAND_tHandle hEcu);
+
+/*!
+ * \ingroup signal_functions
+ *
+ * \brief
+ * Removes an ECU from the receiving control unit list of this signal.
+ *
+ * \param hSig
+ * Specifies a handle to a signal.
+ *
+ * \param hEcu
+ * Specifies a handle to the current receiver control unit.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Database is currently not editable.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enRemoveReceiver.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRemoveReceiver(CAND_tHandle hSig, CAND_tHandle hEcu);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a callback-function that is called
+ * on timer-events, database-event or on errors.
+ *
+ * \param fpvFuncPtr
+ * Specifies the function-pointer to the callback-function. This pointer
+ * must not be NULL.
+ *
+ * \param enType
+ * Specifies the type of the callback.
+ *
+ * \param dwParam1
+ * Multi-used parameter, depends on enType.
+ *
+ * \param dwParam2
+ * Multi-used parameter, depends on enType.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remarks
+ * Be careful when using ::CAND_enPreTransmitFree. Sending the same message
+ * in this callback may cause an endless program loop (i.e. a stack overflow
+ * occurs).
+ *
+ * \ex CAND_enRegisterCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterCallback(void* fpvFuncPtr,
+ CAND_tenCallbackType enType,
+ unsigned long dwParam1,
+ unsigned long dwParam2);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a registered timer, database or an
+ * error callback which has been previously registered with the function ::CAND_enRegisterCallback.
+ *
+ * \param fpvFuncPtr
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param enType
+ * Specifies the type of the callback.
+ *
+ * \param dwParam1
+ * Multi-used parameter, depends on enType.
+ *
+ * \param dwParam2
+ * Multi-used parameter, depends on enType.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enUnRegisterCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterCallback(void* fpvFuncPtr,
+ CAND_tenCallbackType enType,
+ unsigned long dwParam1,
+ unsigned long dwParam2);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a callback for CAN bus state changes.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * This pointer will be passed as callback-parameter.
+ *
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enRegisterCanBusStateCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterCanBusStateCallback(CAND_tCanBusState fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a registered callback for CAN bus state changes.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * User-Parameter passed on callback registration.
+ *
+ * \retval - ::CAND_nERR_NO_MATCH Callback not found.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enUnRegisterCanBusStateCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterCanBusStateCallback(CAND_tCanBusState fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a callback for CAN bus error-frames.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * This pointer will be passed as callback-parameter.
+ *
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enRegisterCanBusErrorCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterCanBusErrorCallback(CAND_tCanBusError fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a registered callback for CAN bus error-frames.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * User-Parameter passed on callback registration.
+ *
+ * \retval - ::CAND_nERR_NO_MATCH Callback not found.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enUnRegisterCanBusErrorCCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterCanBusErrorCallback(CAND_tCanBusError fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a callback for LIN bus state changes.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * This pointer will be passed as callback-parameter.
+ *
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enRegisterLinBusStateCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterLinBusStateCallback(CAND_tLinBusState fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a registered callback for LIN bus state changes.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * User-Parameter passed on callback registration.
+ *
+ * \retval - ::CAND_nERR_NO_MATCH Callback not found.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enUnRegisterLinBusStateCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterLinBusStateCallback(CAND_tLinBusState fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a callback for LIN bus errors.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * This pointer will be passed as callback-parameter.
+ *
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Callback allready exists.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enRegisterLinBusStateCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterLinBusErrorCallback(CAND_tLinBusError fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a registered callback for LIN bus errors.
+ *
+ * \param fpCallback
+ * Specifies the callback function-pointer.
+ *
+ * \param pUserParam
+ * User-Parameter passed on callback registration.
+ *
+ * \retval - ::CAND_nERR_NO_MATCH Callback not found.
+ * \retval - ::CAND_nERR_OK The Function suceeded.
+ *
+ * \ex CAND_enUnRegisterLinBusStateCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterLinBusErrorCallback(CAND_tLinBusError fpCallback, void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a PreTransmit callback which
+ * will be called before a message is sent.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param enPos
+ * Specifies the position the callback is called.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enRegisterPreTransmitCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterPreTransmitCallback(CAND_tPreTansmit pFunc,
+ CAND_tenCallbackPos enPos,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a PreTransmit callback
+ * which has been previously registered with ::CAND_enRegisterPreTransmitCallback.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enUnRegisterPreTransmitCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterPreTransmitCallback(CAND_tPreTansmit pFunc,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a PreCopy callback which
+ * will be called before the data of a received message is copied into database.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param enPos
+ * Specifies the position the callback is called.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enRegisterPreCopyCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterPreCopyCallback(CAND_tPreCopy pFunc,
+ CAND_tenCallbackPos enPos,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a PreCopy callback
+ * which was previously registered with ::CAND_enRegisterPreCopyCallback.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enUnRegisterPreCopyCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterPreCopyCallback(CAND_tPreCopy pFunc,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a TxConfirm callback which
+ * will be called after a message was successfully transmitted.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param enPos
+ * Specifies the position the callback is called.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enRegisterTxConfirmCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterTxConfirmCallback(CAND_tTxConfirm pFunc,
+ CAND_tenCallbackPos enPos,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a TxConfirm callback
+ * which was previously registered with ::CAND_enRegisterTxConfirmCallback.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enUnRegisterTxConfirmCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterTxConfirmCallback(CAND_tTxConfirm pFunc,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a RxConfirm callback which
+ * will be called when a message was received.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param enPos
+ * Specifies the position the callback is called.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enRegisterRxConfirmCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterRxConfirmCallback(CAND_tRxConfirm pFunc,
+ CAND_tenCallbackPos enPos,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a RxConfirm callback
+ * which was previously registered with ::CAND_enRegisterRxConfirmCallback.
+ *
+ * \param pFunc
+ * Specifies the function-pointer to the callback-function.
+ *
+ * \param hItem
+ * Handle to the database item where the callback is registered.
+ *
+ * \param sFilter
+ * Filter string, e.g. "can(0) id(0-f0)".
+ *
+ * \param sId
+ * Unique name for the callback.
+ *
+ * \param pUserParam
+ * User defined pointer.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The Function succeeded.
+ *
+ * \ex CAND_enUnRegisterRxConfirmCallback.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterRxConfirmCallback(CAND_tRxConfirm pFunc,
+ CAND_tHandle hItem,
+ const char* sFilter,
+ const char* sId,
+ void* pUserParam);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to notify a shortcut.
+ *
+ * \param wKey
+ * Specifies the virtual key code
+ *
+ * \param nModifier
+ * Specifies ALT, SHIFT or CTRL key.
+ *
+ * \retval - ::CAND_nFALSE Key combination not found.
+ * \retval - ::CAND_nTRUE Key combination sucessfully signaled.
+ *
+ * \ex CAND_enNotifyShortcut.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enNotifyShortcut(WORD wKey, CAND_enKeyModifier nModifier);
+
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to check whether a shortcut is already registered
+ *
+ * \param wKey Specifies the virtual key code
+ * \param nModifier Specifies ALT, SHIFT or CTRL key
+ *
+ * \retval - ::CAND_nFALSE Key combination is available for registration
+ * \retval - ::CAND_nTRUE Key combination is already registered
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ *
+ * \ex CAND_enShortcutRegistered.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enShortcutRegistered(WORD wKey, CAND_enKeyModifier nModifier);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to register a shortcut callback.
+ *
+ * \param wKey
+ * Specifies the virtual key code.
+ *
+ * \param dwModifier
+ * Specifies modifier keys. Use elements of CAND_enKeyModifier.
+ * Multiple modifiers can be combined using the binary OR operator.
+ *
+ * \param fpShortcut
+ * Specifies the function to be called.
+ *
+ * \param dwUserData
+ * User defined data.
+ *
+ * \param enScope
+ * Scope of the shortcut.
+ * CAND_nSystemScope: system wide
+ * CAND_nAppScope: application scope (active windows)
+ *
+ * \retval - ::CAND_nFALSE Key combination allready used.
+ * \retval - ::CAND_nTRUE Callback was registered successfully.
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter.
+ *
+ * \remark
+ * Note that you cannot use this function to register keys which are already
+ * registered.
+ *
+ * \ex CAND_enRegisterShortcut.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL
+CAND_enRegisterShortcut(WORD wKey, DWORD dwModifier, CAND_tShortCutCb fpShortcut, DWORD dwUserData, CAND_tenShortCutScope enScope);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Call this function to remove a registered shortcut callback.
+ *
+ * \param wKey
+ * Specifies the virtual key code.
+ *
+ * \param dwModifier
+ * Specifies Alt, Ctrl or both keys.
+ *
+ * \retval - ::CAND_nFALSE Key combination not found
+ * \retval - ::CAND_nTRUE Callback was removed succesfully
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ *
+ * \ex CAND_enUnRegisterShortcut.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnRegisterShortcut(WORD wKey, DWORD dwModifier);
+
+/*!
+ * \ingroup callback_functions
+ *
+ * \brief
+ * Disable or enable all database callbacks.
+ *
+ * \param bAllow
+ * Specifies if the callbacks should be enabled or disabled.
+ *
+ * \ex CAND_vAllowDBCallbacks.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vAllowDBCallbacks(BOOL bAllow);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to create a marker. The marker will be recorded, so you
+ * can mark any point within the simulation.
+ *
+ * \ex CAND_vCreateMarker.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vCreateMarker(void);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to get the number of created markers in the current record.
+ *
+ * \ex CAND_uiGetMarkerCount.cpp
+ */
+CANDLL_API unsigned int CANDLL_CALL CAND_uiGetMarkerCount(void);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter that pass all messages.
+ *
+ * \remarks
+ * This filter will allow all messages. You have to call ::CAND_vDestroyFilter
+ * when you no longer need this filter.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateFilterAll.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateAllFilter();
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter. This filter lets only pass the message specified by dwMessageID.
+ *
+ * \param hBus
+ * Specifies a handle to the bus to which the filter will be applied.
+ *
+ * \param dwMessageID
+ * ID of the message that will pass the filter.
+ *
+ * \remarks
+ * This filter will only allow the single specified message. You have to call ::CAND_vDestroyFilter
+ * when you no longer need this filter.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateMsgFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateMsgFilter(CAND_tHandle hBus, DWORD dwMessageID);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter. This filter lets only pass the specific message.
+ *
+ * \param hMessage
+ * Specifies a handle to the message that will be allowed.
+ *
+ * \remarks
+ * This filter will only allow this message.You have to call ::CAND_vDestroyFilter
+ * when you no longer need this filter.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateMsgFilterByH.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateMsgFilterByH(CAND_tHandle hMessage);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter. This filter type allows the user to decide if
+ * the message should be skipped.
+ *
+ * \param pfnCallback
+ * Pointer to callback function
+ *
+ * \param dwUserData
+ * User defined data. This value will be passed to the callback function.
+ *
+ * \remark
+ * Note that a filter callback is not necessarily called in ascending
+ * order for messages; you should not rely on this function being called
+ * in any specific order.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateCallbackFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateCallbackFilter(CAND_tFilterCallback pfnCallback, DWORD dwUserData);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter using database handle.
+ *
+ * \param hObject
+ * Handle to a message for which the filter will be generated.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateItemRecordFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateItemRecordFilter(CAND_tHandle hObject);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter using record type.
+ *
+ * \param enType
+ * Type of record-entry for which the filter will be generated.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateRecordFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateRecordFilter(CAND_tenRecordEntryType enType);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter for strings.
+ *
+ * \param sFilter
+ * String (e.g. "c(0) id(0-5)") for which the filter will be generated.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hCreateStrRecordFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateStrRecordFilter(const char* sFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a filter which will only let pass the messages that
+ * match both filters.
+ *
+ * \param hFirst
+ * The first sub-filter
+ *
+ * \param hSecond
+ * The second sub-filter. If hFirst already determined that a message should be skipped,
+ * the second filter will never be called.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \remark
+ * Returns a handle to the newly created filter or null handle if an error occurs.
+ * You have to call ::CAND_vDestroyFilter when you no longer need this filter.
+ *
+ * \ex CAND_hCreateAndFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateAndFilter(CAND_tFilterHandle hFirst, CAND_tFilterHandle hSecond);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates a new filter based on both given filters. The new filter will let pass a message, if one or both
+ * given filters would allow it. The two filters are or'ed together to a new filter.
+ *
+ * \param hFirst
+ * The first sub-filter
+ *
+ * \param hSecond
+ * The second sub-filter. If hFirst already determined that a message should
+ * not be skipped, the second filter will never be called.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \remark You have to call ::CAND_vDestroyFilter when you no longer need this
+ * filter.
+ *
+ * \ex CAND_hCreateOrFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateOrFilter(CAND_tFilterHandle hFirst, CAND_tFilterHandle hSecond);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Create an inverted filter to the provided one.
+ *
+ * \param hFilter
+ * The filter which should be inverted.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created filter. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * Returns a handle to the newly created filter or a null handle if an error
+ * occurs. You have to call ::CAND_vDestroyFilter when you no longer need
+ * this filter. If hFilter allows a message, then the newly created filter will
+ * skip a message, and vice versa.
+ *
+ * \ex CAND_hCreateInvFilter.cpp
+ */
+CANDLL_API CAND_tFilterHandle CANDLL_CALL CAND_hCreateInvFilter(CAND_tFilterHandle hFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to destroy a filter you do not need any longer.
+ *
+ * \param hFilter
+ * Handle to the filter that is to be deleted.
+ *
+ * \remark
+ * Generally speaking, filters are valid from the time they were created
+ * until they are destroyed by a call to ::CAND_vDestroyFilter. However, if
+ * a filter is part of another filter (e.g. its handle has been used in a
+ * call to ::CAND_hCreateAndFilter and that filter has not been destroyed
+ * yet), the handle remains valid until its "parent filter" is destroyed.
+ *
+ * \ex CAND_vDestroyFilter.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vDestroyFilter(CAND_tFilterHandle hFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Creates an iterator that is used to iterate through a record.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the new
+ * created iterator. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * Iterators are used to iterate through a record. You can think of
+ * iterators as a pointer in an array: You can dereference
+ * iterators or you can move them around.
+ * There are two special iterators: The "begin"-iterator and "end"-iterator.
+ * The begin-iterator points to the very first message while the end-iterator
+ * points to a message "past-the-end" (the latter iterator thus cannot be
+ * dereferenced). All iterators in the sequence <b>[begin,end)</b> can be
+ * dereferenced, and for example <b>[begin,begin)</b> is an empty sequence which doesn't
+ * contain any messages.\n
+ * Initially, all iterators point to the begining of a record (which may be
+ * the end of a record as well in case no messages have been recorded).
+ * All iterator handles are valid until a record is unloaded. In this case,
+ * a ::CAND_enRecordUnload callback will be generated. All iterators will be
+ * invalidated after this callback returns. While it is not strictly necessary
+ * to manually unregister iterator handles in this special case, it is good
+ * practice to destroy iterators when you no longer need them.
+ * You should delete iterators when you
+ * no longer need them to release occupied resources.
+ *
+ * \see
+ * CAND_vDestroyIterator | CAND_enRecordUnload | CAND_vDestroyIterator | CAND_boDereferenceIterator
+ *
+ * \ex CAND_hCreateIterator.cpp
+ */
+CANDLL_API CAND_tIteratorHandle CANDLL_CALL CAND_hCreateIterator(void);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * This function clones an iterator.
+ *
+ * \param hIterator
+ * Specifies a handle to the iterator that will be cloned.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle to the copied
+ * iterator. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \remark
+ * You have to call ::CAND_vDestroyIterator when you no longer need this
+ * iterator.
+ *
+ * \ex CAND_hDuplicateIterator.cpp
+ */
+CANDLL_API CAND_tIteratorHandle CANDLL_CALL CAND_hDuplicateIterator(CAND_tIteratorHandle hIterator);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to create an iterator that points to a message
+ * that another iterator already points to.
+ *
+ * \param hDest
+ * Destination iterator
+ *
+ * \param hSource
+ * Source iterator
+ *
+ * \remark
+ * A call to this function is similar to destroying the destination
+ * iterator and cloning the source iterator.
+ *
+ * \ex CAND_vAssignIterator.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vAssignIterator(CAND_tIteratorHandle hDest, CAND_tIteratorHandle hSource);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to destroy an iterator.
+ *
+ * \param hIterator
+ * The iterator that will be destroyed.
+ *
+ * \remark
+ * You should destroy an iterator when you no longer need it to free
+ * occupied resources. All iterators are automatically destroyed when
+ * a record is unloaded.
+ *
+ * \ex CAND_vDestroyIterator.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vDestroyIterator(CAND_tIteratorHandle hIterator);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to dereference an iterator, i.e. get the message
+ * an iterator points to.
+ *
+ * \param hIterator
+ * The iterator that will be dereferenced
+ *
+ * \param pstRecordEntry
+ * Pointer to a data structure that receives the record data.
+ * This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nTRUE on success
+ * \retval - ::CAND_nFALSE on error
+ *
+ * \ex CAND_boDereferenceIterator.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boDereferenceIterator(CAND_tIteratorHandle hIterator, CAND_tstRecordEntry* pstRecordEntry);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Compares two iterators in their order.
+ *
+ * \param hLeft
+ * The first comperand
+ *
+ * \param hRight
+ * The second comperand
+ *
+ * \retval - <0 if hLeft points to a message before hRight
+ * \retval - 0 if hLeft and hRight point to the same message
+ * \retval - >0 if hLeft points to a message after hRight
+ *
+ * \ex CAND_iCompareIterators.cpp
+ */
+CANDLL_API int CANDLL_CALL CAND_iCompareIterators(CAND_tIteratorHandle hLeft, CAND_tIteratorHandle hRight);
+
+/*
+ * \ingroup record_functions
+ *
+ * \brief
+ * Calculates the number of messages between two iterators.
+ *
+ * \param hLeft
+ * The first iterator
+ *
+ * \param hRight
+ * The second iterator
+ *
+ * \retval -
+ * Number of messages between hLeft and hRight, i.e. if hLeft and
+ * hRight were pointers to elements in an array, this function would return
+ * (hRight - hLeft)
+ *
+ * \ex CAND_qwIteratorDifference.cpp
+ */
+CANDLL_API __int64 CANDLL_CALL CAND_qwIteratorDifference(CAND_tIteratorHandle hLeft, CAND_tIteratorHandle hRight);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to move an iterator to the beginning of a record.
+ *
+ * \param hIterator
+ * The iterator that will be moved
+ *
+ * \ex CAND_vMoveIteratorToBegin.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vMoveIteratorToBegin(CAND_tIteratorHandle hIterator);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to move an iterator to the end of a record.
+ *
+ * \param hIterator
+ * The iterator that will be moved.
+ *
+ * \ex CAND_vMoveIteratorToEnd.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vMoveIteratorToEnd(CAND_tIteratorHandle hIterator);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to search for the next message. Start right after the current
+ * message. This function will search messages in ascending order within the
+ * range (hStart,hStop).
+ *
+ * \param hStart
+ * Pointer to the message where to start searching. Upon return, this
+ * iterator will point to the next message or to hStop if no message was found.
+ *
+ * \param hStop
+ * This iterator points past the last message, i.e. hStop points to the
+ * first message that will not be tested. This iterator must point to a
+ * message after hStart or else the function will fail.
+ *
+ * \param hFilter
+ * To return only certain messages, you can pass a filter here. If you pass
+ * NULL, no filter will be applied.
+ *
+ * \retval - ::CAND_nTRUE if a message has been found
+ * \retval - ::CAND_nFALSE otherwise
+ *
+ * \remark
+ * This function first increments the iterator by one and then applies
+ * the filter, i.e. the message at hStart will never be tested.
+ *
+ * \ex CAND_boNextMessage.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boNextMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to search for the next message begining with the current message. This
+ * function will search messages in ascending order within the range (hStart,hStop).
+ *
+ * \param hStart
+ * Pointer to the message where to start with searching. By the returning, this iterator
+ * points to the next message or to hStop if no message was found.
+ *
+ * \param hStop
+ * This iterator points behind the last message, i.e. hStop points to the first
+ * message that will not be tested. This iterator must point to a message after
+ * hStart otherwise the function will fail.
+ *
+ * \param hFilter
+ * To return only selected messages, you can pass a filter here. If you pass NULL,
+ * no filter will be applied.
+ *
+ * \retval - ::CAND_nTRUE if a message has been found
+ * \retval - ::CAND_nFALSE otherwise
+ *
+ * \remark
+ * This function works similar to ::CAND_boNextMessage except it first
+ * tests the message pointed to by hStart and then increments it, i.e. the
+ * message at hStart is the first message that will be tested.
+ *
+ * \ex CAND_boFindNextMessage.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boFindNextMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to search for the next message. This function will search
+ * messages in descending order within the range (hStop,hStart).
+ *
+ * \param hStart
+ * Pointer to the message where to start searching. After the returning, this iterator
+ * points to the next message or to hStop if no message has been found.
+ *
+ * \param hStop
+ * This iterator points behind the last message, i.e. hStop points to the first
+ * message that will not be tested. This iterator must point to a message
+ * before hStart otherwise the function will fail.
+ *
+ * \param hFilter To return only certain messages, you can pass a filter
+ * here. If you pass NULL, no filter will be applied.
+ *
+ * \retval - ::CAND_nTRUE if a message has been found
+ * \retval - ::CAND_nFALSE otherwise
+ *
+ * \remark
+ * This function decrements the iterator by one first and then applies
+ * the filter, i.e. the message at hStart will never be tested.
+ *
+ * \ex CAND_boPrevMessage.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boPrevMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Call this function to search for the next message. This function
+ * will search messages in descending order in the range (hStop,hStart).
+ *
+ *
+ * \param hStart
+ * Pointer to the message where to start searching. After the returning, this
+ * iterator will point to the next message or to hStop if no message was found.
+ *
+ * \param hStop
+ * This iterator points behind the last message, i.e. hStop points to the first
+ * message that will not be tested. This iterator must point to a message before
+ * hStart otherwise the function will fail.
+ *
+ * \param hFilter
+ * To return only certain messages, you can pass a filter here. If you pass NULL,
+ * no filter will be applied.
+ *
+ * \retval - ::CAND_nTRUE if a message has been found
+ * \retval - ::CAND_nFALSE otherwise
+ *
+ * \remark
+ * This function works similar to ::CAND_boPrevMessage except it first tests the
+ * message pointed to by hStart and then decrements it, i.e. the message at hStart
+ * is the first message that will be tested.
+ *
+ * \ex CAND_boFindPrevMessage.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boFindPrevMessage(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tFilterHandle hFilter);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * This function will return the first message whose timestamp is not
+ * lesser than qwTimestamp.
+ *
+ * \param hStart
+ * Pointer to the message where to start searching. Upon return, this iterator
+ * will point to the next message or to hStop if no message was found.
+ *
+ * \param hStop
+ * This iterator points past the last message, i.e. hStop points to the first
+ * message that will not be tested. This iterator must point to a message after
+ * hStart or else the function will fail.
+ *
+ * \param qwTimestamp
+ * Specifies the timestamp to search for.
+ *
+ * \retval - ::CAND_nTRUE if a message has been found
+ * \retval - ::CAND_nFALSE otherwise
+ *
+ * \ex CAND_boFindMessageTimestamp.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boFindMessageTimestamp(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, QWORD qwTimestamp);
+
+/*!
+ * \ingroup record_functions
+ *
+ * \brief
+ * Finds the last occurence of a message before hStop.
+ *
+ * \param hStart
+ * Pointer to the message where to start searching. Upon return, this iterator will
+ * point to the message that was found or to hStop if no message has been found.
+ *
+ * \param hStop
+ * This iterator points past the last message that should be searched. Since
+ * ::CAND_boFindLastMessage searches in reverse order, hStop must point to a message
+ * before hStart.
+ *
+ * \param hMessage
+ * The message to search for.
+ *
+ * \param pstMessage
+ * If pstMessageData is not NULL and a message was found, then the message data will
+ * be copied into this structure. In certain situations this is faster than a
+ * call to ::CAND_boDereferenceIterator. If no message was found, this structure
+ * will not be modified.
+ *
+ * \retval - ::CAND_nTRUE if a message has been found
+ * \retval - ::CAND_nFALSE otherwise
+ *
+ * \remark
+ * Sometimes only the latest state of a message is important and a
+ * call to ::CAND_boPrevMessage can be expensive in some situations, for
+ * example you start searching at the end and the only message is at the
+ * beginning. ::CAND_boFindLastMessage searches in an internal cache and
+ * works well for large distances, whereas ::CAND_boPrevMessage checks
+ * every message between hStart and hStop, so it works better for short
+ * distances.
+ *
+ * \see
+ * CAND_boDereferenceIterator | CAND_boPrevMessage | CAND_boFindLastMessage
+ *
+ * \ex CAND_boFindLastMessageByH.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boFindLastMessageByH(CAND_tIteratorHandle hStart, CAND_tIteratorHandle hStop, CAND_tHandle hMessage, CAND_tstRecordEntry* pRecordEntry);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Call this function to open a dialog to browse the database.
+ *
+ * \param hParent
+ * The parent window of this dialog.
+ *
+ * \param phObject
+ * A pointer to a handle that will receive a handle to the
+ * user's selection. This will be NULL if the user cancelled the dialog.
+ *
+ * \param hRoot
+ * The root element in the tree. Only hRoot and elements below hRoot will be displayed. Pass
+ * a null handle to show the complete database.
+ *
+ * \param hSelection
+ * The initially selected object in the dialog. You may pass a null handle here.
+ *
+ * \param nFlags
+ * Any combination of ::CAND_tenBrowseDbFlags
+ *
+ * \param pszTitle
+ * The caption of the dialog
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE Invalid handle
+ * \retval - ::CAND_nERR_INVALID_PARAM Invalid parameter
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remark
+ * Be sure to pass meaningful parameters to this function. For example,
+ * it does not make sense to set hRoot to a message and set nFlags to ::CAND_nenBrowseEcu.
+ * In this case, the user will not be able to select anything in the database.
+ * Or, for example, if you set hRoot to a null handle and pass ::CAND_nenShowSig |
+ * ::CAND_nenSelectSig as nFlags, the user will only see signals without seeing their
+ * corresponding messages.
+ * While this is reasonable in some situations, it is better to show all levels in
+ * order to avoid confusion. In most cases, you'll simply want to pass one of
+ * the ::CAND_tenBrowseDbFlags constants.
+ *
+ * \ex CAND_enBrowseDatabase.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enBrowseDatabase(HWND hParent, CAND_tHandle* phObject,
+ CAND_tHandle hRoot, CAND_tHandle hSelection,
+ unsigned int nFlags, const char* pszTitle);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Registers a Window to the CanDLL.
+ *
+ * The Window identified by hWindow will have its position saved in the
+ * project workspace. You should unregister a window as soon as its
+ * position is no longer of any interest, e.g. if your plugin gets
+ * unloaded. Otherwise its position will be saved although it is not needed
+ * any more.
+ *
+ * \attention
+ * Only windows that have been created in the application's main
+ * thread are allowed to call this function.
+ *
+ * \param sName
+ * Internal name of the window. This name should be unique. It is used to identify a window
+ * after its position been loaded from a workspace.
+ *
+ * \param hWindow
+ * Handle to the window whose position will be saved.
+ *
+ * \param hInstance
+ * Handle of the instance
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enRegisterWindow.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enRegisterWindow(const char* sName, HWND hWindow, HANDLE hInstance);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Unregisters a window previously registered with ::CAND_enRegisterWindow.
+ *
+ * \param sName
+ * Internal name of the window. This is the same name that was passed to ::CAND_enRegisterWindow.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_OK Function succeeded
+ *
+ * \ex CAND_enUnregisterWindow.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enUnregisterWindow(const char* sName);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Registers a message hook function that will be called to process application messages.
+ *
+ * \param pfPreTranslateMessage
+ * Function pointer to the new PreTranslate function that should be registered.
+ *
+ * \retval - ::CAND_nFALSE The specified function could not be registered
+ * \retval - ::CAND_nTRUE The function succeeded.
+ *
+ * \ex CAND_boRegisterMessageHook.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boRegisterMessageHook(int (CANDLL_CALL* pfPreTranslateMessage)(MSG* lpMsg));
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Unregisters a previously registered message hook function.
+ *
+ * \param pfPreTranslateMessage
+ * Function pointer to the PreTranslate function that should be unregistered.
+ *
+ * \retval - ::CAND_nFALSE The specified function could not be unregistered
+ * \retval - ::CAND_nTRUE The function succeeded.
+ *
+ * \ex CAND_vUnregisterMessageHook.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vUnregisterMessageHook(int (CANDLL_CALL* pfPreTranslateMessage)(MSG* lpMsg));
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Registers an idle hook function that will be called on idle time.
+ *
+ * \param pfOnIdle
+ * Function pointer to the new IdleHook function that should be registered.
+ *
+ * \retval - ::CAND_nFALSE The specified function could not be registered
+ * \retval - ::CAND_nTRUE The function succeeded.
+ *
+ * \ex CAND_boRegisterIdleCallback.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boRegisterIdleCallback(void (CANDLL_CALL* pfOnIdle)(void));
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Unregisters a previously registered idle hook function.
+ *
+ * \param pfOnIdle
+ * Function pointer to the IdleHook function that should be unregistered.
+ *
+ * \retval - ::CAND_nFALSE The specified function could not be unregistered
+ * \retval - ::CAND_nTRUE The function succeeded.
+ *
+ * \ex CAND_vUnregisterIdleCallback.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vUnregisterIdleCallback(void (CANDLL_CALL* pfOnIdle)(void));
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Returns the tree window if it exists.
+ *
+ * \return
+ * Handle to the tree ctrl window.
+ *
+ * \ex CAND_hGetTreeWnd.cpp
+ */
+CANDLL_API HWND CANDLL_CALL CAND_hGetTreeWnd(void);
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Use this function to convert a handle into humanly readable format.
+ *
+ * You can then save and load this string to/from a file. You can use
+ * ::CAND_hTextToHandle to convert returned string back into a handle.
+ * Returns a string specifing the object. The object can be a bus,
+ * an ECU, a message, a signal or a attribute.
+ *
+ * \param hObject
+ * Handle to an object whose name will be returned.
+ *
+ * \param pcName
+ * Pointer to a buffer that receives the name of the object. See the remarks
+ * section for a brief description of the format. This pointer must not be
+ * NULL. A terminating NUL-character will be automatically appended.
+ *
+ * \param dwLen
+ * Length of pcName in characters. (Including room for a terminating NUL character.)
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remarks
+ * Depending on the type of the object, the string will be in one of
+ * the following formats:
+ * <table border=0>
+ * <tr><th style="background-color:silver">Type of object</th>
+ * <th style="background-color:silver">Returned string</th></tr>
+ * <tr><td style="background-color:#FFFFFF">Bus</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus</td></tr>
+ * <tr><td style="background-color:#FFFFFF">ECU</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus/Name of ECU</td></tr>
+ * <tr><td style="background-color:#FFFFFF">Message</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus/Name of ECU/Name of message-ID of message</td></tr>
+ * <tr><td style="background-color:#FFFFFF">Signal</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus/Name of ECU/Name of message-ID of message/Name of signal</td></tr>
+ * </table>
+ *
+ * \ex CAND_enHandleToText.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enHandleToText(CAND_tHandle hObject, char* pcName, unsigned long dwLen);
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Returns the handle out of the string.
+ *
+ * \param pcName
+ * Pointer to a buffer that specifies the object.
+ *
+ * \return
+ * If the function succeeds, the return value is the handle of the specified
+ * object. If the function fails the return value is a NULL handle. You
+ * must check the return value with ::CAND_enIsNullHandle.
+ *
+ * \remarks
+ * Depending on the type of the object, the string will be in one of
+ * the following formats:\n
+ * <table border=0>
+ * <tr><th style="background-color:silver">Type of object</th>
+ * <th style="background-color:silver">Returned string</th></tr>
+ * <tr><td style="background-color:#FFFFFF">Bus</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus</td></tr>
+ * <tr><td style="background-color:#FFFFFF">ECU</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus/Name of ECU</td></tr>
+ * <tr><td style="background-color:#FFFFFF">Message</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus/Name of ECU/Name of message-ID of message</td></tr>
+ * <tr><td style="background-color:#FFFFFF">Signal</td>
+ * <td style="background-color:#FFFFFF; color:maroon; font-style:italic;">/Name of bus/Name of ECU/Name of message-ID of message/Name of signal</td></tr>
+ * </table>
+ * You can access an attribute by appending a dot and the attribute name,
+ * e.g. <span style="color:maroon; font-style:italic;">/Can-B/.Manufacturer</span> returns a handle to the "Manufacturer" attribute
+ * of Can-B.
+ *
+ * \ex CAND_hTextToHandle.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hTextToHandle(const char* pcName);
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Determines the type of the object that is associated with the given handle.
+ *
+ * \param hObject
+ * Handle to the object.
+ *
+ * \param pType
+ * Pointer to a buffer that receives the type of the handle. This pointer must not be NULL.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \remark
+ * Note that the function will fail if a null handle is passed.
+ *
+ * \ex CAND_enGetHandleType.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetHandleType(CAND_tHandle hObject, CAND_tenHandleType* pType);
+
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Call this function to determine whether a handle is valid or not.
+ *
+ * \param hObject
+ * Specifies the handle that should be determined.
+ *
+ * \retval - ::CAND_nFALSE if the handle is not valid.
+ * \retval - ::CAND_nTRUE if the handle is valid.
+ *
+ * \ex CAND_boIsValidHandle.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boIsValidHandle(CAND_tHandle hObject);
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Call this function to determine whether a handle is a valid handle or a null handle.
+ *
+ * \param hObject
+ * Specified the handle that is to be examined.
+ *
+ * \retval - ::CAND_nFALSE Handle is not a null handle.
+ * \retval - ::CAND_nTRUE Handle is a null handle.
+ *
+ * \ex CAND_enIsNullHandle.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enIsNullHandle(CAND_tHandle hObject);
+
+/*!
+ * \ingroup handle_functions
+ *
+ * \brief
+ * Call this function to get a null handle.
+ *
+ * \return
+ * The function always returns an invalid null handle.
+ *
+ * \ex CAND_hNullHandle.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hNullHandle(void);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Makes a report, that will be shown in a message box.
+ *
+ * \param pcMsg
+ * Pointer to a char-string which content will be shown in the MessageBox.
+ *
+ * \param pcTitel
+ * Pointer to a char-string which is used for the message-box titel.
+ *
+ * \param type
+ * Style of the MessageBox. Look at the WinApi MessageBox documentation for further information.
+ *
+ * \return
+ * The return value depends on the style you choose. Look at the WinApi
+ * MessageBox documentation for further information.
+ *
+ * \ex CAND_iShowMessage.cpp
+ */
+CANDLL_API int CANDLL_CALL CAND_iShowMessage(const char* pcMsg, const char* pcTitel, UINT type);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Makes an asynchronous (non blocking) report, that will be shown in a message box or in the report window.
+ *
+ * \param pcMsg
+ * Pointer to a char-string which content will be shown in the MessageBox.
+ *
+ * \param pcTitel
+ * Pointer to a char-string which is used for the message-box titel.
+ *
+ * \param type
+ * Style of the MessageBox. Look at the WinApi MessageBox documentation for further information.
+ *
+ * \param dwOutputStyle
+ * Output style. There are three possibilities:
+ * -# dwOutputStyle == REPORT_IN_MSGBOX: Report shall be shown in a message box.
+ * -# dwOutputStyle == REPORT_IN_REPORT_WND: Report shall be shown in the report window.
+ * -# dwOutputStyle == (REPORT_IN_MSGBOX|REPORT_IN_REPORT_WND): Report shall be shown in both, a
+ * message box and the report window.
+ *
+ * \return
+ * The returnvalue depends on the style you choose. Look at the WinApi MessageBox documentation
+ * for further information.
+ *
+ * \ex CAND_vShowAsyncMessage.cpp
+ */
+CANDLL_API int CANDLL_CALL CAND_vShowAsyncMessage(const char* pcMsg, const char* pcTitel, UINT type, DWORD dwOutputStyle);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Makes an asynchronous (non blocking) report, that will be shown in the report window.
+ *
+ * \param sMsg
+ * Pointer to a char-string which content will be shown in the MessageBox.
+ *
+ * \param sWndName
+ * Pointer to a char-string which contains the report window name.
+ *
+ * \param type
+ * Style of the Report. Look at the WinApi MessageBox documentation for further information.
+ *
+ * \retval - ::CAND_nERR_OK Function proceeded successfully.
+ * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid.
+ * \retval - ::CAND_nERR_NO_MATCH Window not exists
+ *
+ * \ex CAND_enMakeReport.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enMakeReport(const char* sMsg, const char* sWndName, UINT type);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Creates a new report window.
+ *
+ * \param sWndName
+ * Pointer to a char-string which contains the report window name.
+ *
+ * \retval - ::CAND_nERR_OK Function proceeded successfully.
+ * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Window already exists.
+ *
+ * \ex CAND_enCreateReportWnd.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enCreateReportWnd(const char* sWndName);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Destroys a report window created with CAND_vCreateReportWnd.
+ *
+ * \param sWndName
+ * Pointer to a char-string which contains the report window name.
+ *
+ * \retval - ::CAND_nERR_OK Function proceeded successfully.
+ * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid.
+ * \retval - ::CAND_nERR_NO_MATCH Window not exists.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Window can not be destroyed.
+ *
+ * \ex CAND_enDestroyReportWnd.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enDestroyReportWnd(const char* sWndName);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Clears all reports in the report window.
+ *
+ * \param sWndName
+ * Pointer to a char-string which contains the report window name.
+ *
+ * \retval - ::CAND_nERR_OK Function proceeded successfully.
+ * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid.
+ * \retval - ::CAND_nERR_NO_MATCH Window not exists.
+ *
+ * \ex CAND_enClearReportWnd.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enClearReportWnd(const char* sWndName);
+
+
+/*!
+ * \ingroup simulation_functions
+ *
+ * \brief
+ * Determines the status of the simulation.
+ *
+ * \retval - 1 Simulation has been started.
+ * \retval - 0 Simulation has been stopped.
+ *
+ * \ex CAND_boIsRunning.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boIsRunning(void);
+
+/*!
+ * \ingroup fileio_functions
+ *
+ * \brief
+ * Writes binary data into workspace
+ *
+ * \param hFileModule
+ * Filemanager handle
+ *
+ * \param pData
+ * Data pointer (start address)
+ *
+ * \param dwBytesToWrite
+ * Size of bytes to write
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enWriteData.cpp
+ */
+CANDLL_API CAND_tenRetVal CAND_enWriteData(CAND_tFileHandle hFileModule, const void* pData, DWORD dwBytesToWrite);
+
+/*!
+ * \ingroup fileio_functions
+ *
+ * \brief
+ * Reads binary data from the workspace
+ *
+ * \param hFileModule
+ * Filemanager handle
+ *
+ * \param pData
+ * Data pointer (start address)
+ *
+ * \param dwBytesToRead
+ * Size of bytes to read
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ *
+ * \ex CAND_enReadData.cpp
+ */
+CANDLL_API CAND_tenRetVal CAND_enReadData(CAND_tFileHandle hFileModule, void* pData, DWORD dwBytesToRead);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Enables or disables all CanDll windows.
+ *
+ * Call this function when you want to display a modal dialog box and need
+ * to disable all other non-modal windows.
+ *
+ * \param bEnable
+ * Specifies whether all windows should be enabled (::CAND_nTRUE) or disabled (::CAND_nFALSE)
+ *
+ * \retval - ::CAND_nTRUE The function succeeded, the new window stats was set.
+ * \retval - ::CAND_nFALSE The fucntion failed, the new window state could not be set or was the same.
+ *
+ * \ex CAND_enEnableWindows.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enEnableWindows(BOOL bEnable);
+
+/*!
+ * \ingroup ui_functions
+ *
+ * \brief
+ * Makes a rebuild of all GUI Elements.
+ *
+ * \ex CAND_vRebuildGUI.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vRebuildGUI(void);
+
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Structure that is used to store parameters for actionmanager actions.
+ *
+ * \see
+ * CAND_boDoActionId | CAND_boDoAction | CAND_stGetBrowseParam
+ */
+typedef struct CAND_stParam
+{
+ const char* sVal; /*!< Value of the parameter */
+ const char* sPrompt; /*!< Display text for the parameter */
+ const char* sDesc; /*!< Tooltip text for this parameter */
+ void (CANDLL_CALL *fpConfig)(char* sVal, unsigned int uiSize, DWORD dwUserData); /*!< Optional callback function to set sVal */
+ BOOL (CANDLL_CALL *fpValidate)(const char* sVal); /*!< Optional callback funktion to validate sVal*/
+ struct CAND_stParam* pstNext; /*!< Pointer to the next parameter or NULL if this ist the last one */
+ DWORD dwUserData; /*!< User defined parameter for free use */
+ void* pUserData; /*!< User defined pointer for free use */
+} CAND_tstParam;
+
+/*!
+ * \ingroup database_functions
+ *
+ * \brief
+ * Loads a CanEasy database file (*.candb | *.dat).
+ *
+ * \param pcPath
+ * File name to load.
+ *
+ * \retval - ::CAND_nERR_OK The function succeeded.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Loading failed / Generator is not available
+ * \retval - ::CAND_nERR_SIM_IS_RUNNING Simulation is running, stop it first.
+ * \retval - ::CAND_nERR_INVALID_PARAM Parameter is invalid (i.e. empty filestring)
+ *
+ * \ex CAND_enLoadDatFile.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enLoadDatFile(const char* pcPath);
+
+/*!
+ * \ingroup simulation_functions
+ *
+ * \brief
+ * Initializes the CanDll.
+ *
+ * \param hMainWnd
+ * Handle to the application main window. Use NULL if you don't have
+ * a window application.
+ *
+ * \param nChildId
+ * Only neccessary if hMainWnd is not NULL. Used to create the child splitter window.
+ *
+ * \returns
+ * Returns the handle of the new created CanEasy splitter Window.
+ *
+ * \see
+ * CAND_vDeinitDLL
+ *
+ * \ex CAND_hInitDLL.cpp
+ */
+CANDLL_API HWND CANDLL_CALL CAND_hInitDLL(HWND hMainWnd, UINT nChildId);
+
+/*!
+ * \ingroup simulation_functions
+ *
+ * \brief
+ * Deinitializes the CanDll.
+ *
+ * \see
+ * CAND_hInitDLL
+ *
+ * \ex CAND_vDeinitDLL.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vDeinitDLL(void);
+
+/*!
+ * \ingroup simulation_functions
+ *
+ * \brief
+ * Initializes the CanDll functions and starts the simulation.
+ *
+ * \returns
+ * The function returns ::CAND_nTRUE if the simulation could be startet otherwise ::CAND_nFALSE.
+ *
+ * \ex CAND_boInitRun.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boInitRun(void);
+
+/*!
+ * \ingroup simulation_functions
+ *
+ * \brief
+ * Deinitializes the CanDll functions and stops the simulation.
+ *
+ * \returns
+ * The function returns ::CAND_nTRUE if the simulation could be stopped otherwise ::CAND_nFALSE.
+ *
+ * \ex CAND_boDeinitRun.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boDeinitRun(void);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Structure definition of a CanEasy action.
+ * The callback function returns a boolean value that is used to tell the
+ * action's caller that the function was successfuly called. The overall
+ * return value of the DoAction functions is TRUE only when the callback
+ * function returns TRUE. An overall result of FALSE doesn't carry the
+ * information if either the action was invalid or the callback function
+ * returned FALSE!
+ *
+ * \see
+ * CAND_boDoActionId | CAND_boDoAction | CAND_stGetBrowseParam
+ */
+typedef struct CAND_stAction
+{
+ HINSTANCE hInstance; /*!< Handle of the instance of this dll */
+ const char* sActionId; /*!< String id that must be unique inside this instance of hInstance */
+ const char* sDesc; /*!< Description of this action, also used as tooltip */
+ CAND_tstParam* pstFirstParam; /*!< Pointer to the first parameter of this action, or NULL if unused */
+ BOOL (CANDLL_CALL *fpDoActionAsync)(struct CAND_stAction*); /*!< Callback function, that is called on execution of the action */
+ BOOL (CANDLL_CALL *fpDoActionSync)(struct CAND_stAction*); /*!< Callback function, that is called on execution of the action */
+ DWORD dwUserData; /*!< User defined parameter for free use */
+ void* pUserData; /*!< User definde pointer for free use */
+ BOOL boIsThreadSafe; /*!< If this Flag ist not set, the specified functions can only be called from the Main-Thread (not thread safe) */
+
+#ifdef __cplusplus
+ /*!
+ * \brief
+ * Initialize the sturcutre to a defined state.
+ * If you are not using c++ you have to initialize
+ * the structure by your own, before you register
+ * the action!
+ */
+ CAND_stAction()
+ {
+ hInstance = NULL;
+ sActionId = NULL;
+ sDesc = NULL;
+ pstFirstParam = NULL;
+ fpDoActionAsync = NULL;
+ fpDoActionSync = NULL;
+ dwUserData = 0;
+ pUserData = NULL;
+ boIsThreadSafe = false;
+ }
+#endif
+} CAND_tstAction;
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Registers a new action in the action manager.
+ *
+ * \param pstAction
+ * Complete filled and initialized structure for the new action.
+ * This parameter (pointer) is stored in an internal data structure and must
+ * remain valid until the action is deregistered.
+ *
+ * \retval - ::CAND_nTRUE The action was successfully registered.
+ * \retval - ::CAND_nFALSE The action could not be registered.
+ *
+ * \ex CAND_boRegisterAction.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boRegisterAction(CAND_tstAction* pstAction);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Unregisters a previously registered action in the action manager.
+ *
+ * \param pstAction
+ * Pointer to the action structure that depends to the action.
+ *
+ * \retval - ::CAND_nTRUE The action was successfully unregistered.
+ * \retval - ::CAND_nFALSE The action could not be unregistered.
+ *
+ * \ex CAND_boUnRegisterAction.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boUnRegisterAction(const CAND_tstAction* pstAction);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Opens a browser dialog to choose and parametrize an action.
+ *
+ * \ex CAND_vOpenActionBrowser.cpp
+ */
+CANDLL_API void CANDLL_CALL CAND_vOpenActionBrowser(void);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Returns the action with the given index from the action manager. If hInstance
+ * is set to NULL, the function will iterate over all actions of the action manager.
+ *
+ * \param hInstance
+ * Instance to look for the action.
+ *
+ * \param uiIndex
+ * Index of the action to seek for.
+ *
+ * \return
+ * Pointer to the structure that represents the action. If the end of the action
+ * list is reached the function will return NULL.
+ *
+ * \ex CAND_pstGetAction.cpp
+ */
+CANDLL_API CAND_tstAction* CANDLL_CALL CAND_pstGetAction(HANDLE hInstance, unsigned int uiIndex);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Retrieves the action with the given name from the action manager. If hInstance
+ * is set to NULL, the function will iterate over all actions of the action manager.
+ *
+ * \param hInstance
+ * Instance to look for the action.
+ *
+ * \param sActionId
+ * Name of the action to seek for.
+ *
+ * \return
+ * Pointer to the structure that represents the action. If the end of the action
+ * list is reached the function will return NULL.
+ *
+ * \ex CAND_pstGetActionByName.cpp
+ */
+CANDLL_API CAND_tstAction* CANDLL_CALL CAND_pstGetActionByName(HANDLE hInstance, const char* sActionId);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Executes the specified action with the given set of parameters. If hInstance is set to NULL
+ * the first matching action will be executed.
+ *
+ * \param hInstance
+ * Instance of the action.
+ *
+ * \param sActionId
+ * Name of the desired action.
+ *
+ * \param pstParams
+ * Set of parameters for the action. (parameters are chained lists)
+ *
+ * \retval - ::CAND_nTRUE The action could be found and has been executed.
+ * \retval - ::CAND_nFALSE The Function did not succeed maybe the action was not found.
+ *
+ * \ex CAND_boDoActionId.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boDoActionId(HANDLE hInstance, const char* sActionId, const CAND_tstParam* pstParams);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Executes the specified action with the given set of parameters.
+ *
+ * \param pstAction
+ * Pointer of an action, that will be executed.
+ *
+ * \param pstParams
+ * Set of parameters for the action. (parameters are chained lists)
+ *
+ * \retval - ::CAND_nTRUE The action could be found and has been executed.
+ * \retval - ::CAND_nFALSE The Function did not succeed maybe the action was not found or the parameter set was wrong.
+ *
+ * \ex CAND_boDoAction.cpp
+ */
+CANDLL_API BOOL CANDLL_CALL CAND_boDoAction(CAND_tstAction* pstAction, const CAND_tstParam* pstParams);
+
+/*!
+ * \ingroup action_functions
+ *
+ * \brief
+ * Creates a single parameter that accepts a CanEasy database element as string id. The parameter
+ * has a predefined configuration function that will show the database browsing dialog.
+ *
+ * \param nFlags
+ * Parameter that describes the type of database element that the user is allowed to seek for.
+ *
+ * \return
+ * The function returns an initialized parameter that can be used with an action. The parameter has a
+ * predefined function that will show the database brwose dialog.
+ *
+ * \ex CAND_stGetBrowseParam.cpp
+ */
+CANDLL_API CAND_tstParam CANDLL_CALL CAND_stGetBrowseParam(CAND_tenBrowseDbFlags nFlags);
+
+/*!
+ * \ingroup simulation_functions
+ *
+ * \brief
+ * Returns the current timestamp of simulation.
+ *
+ * \returns
+ * Millisecs since start of simulation.
+ *
+ * The function returns the timestamp in milliseconds since stimulation start.
+ *
+ * \remarks
+ * After simulation restart the timestamp starts with 0 again.
+ *
+ * \see
+ * CAND_enRegisterCallback
+ *
+ * \ex CAND_qwGetMsTimer.cpp
+ */
+CANDLL_API QWORD CAND_qwGetMsTimer(void);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Retrieves the handle of the root environment variable which is the top most element.
+ *
+ * \return
+ * The Function returns a valid handle to the root environment variable. If
+ * there was an error the function will return a invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \see
+ * CAND_enIsNullHandle
+ *
+ * \ex CAND_hGetRootEnvVar.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetRootEnvVar(void);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Returns the the upper next environment variable element of the object handle.
+ *
+ * \param hObject
+ * Handle of an environment variable object
+ *
+ * \return
+ * The Function returns a valid handle to the upper next environment variable. If
+ * there was an error the function will return a invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \ex CAND_hGetEnvVarParent.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEnvVarParent(CAND_tHandle hObject);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Sets the name of an environment variable object.
+ *
+ * \param hObject
+ * Handle of the object whichs name should be set.
+ *
+ * \param sName
+ * null terminated string of the new name.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enSetEnvVarName.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEnvVarName(CAND_tHandle hObject, const char* sName);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Deletes an environment variable object.
+ *
+ * \param hObject
+ * Description of parameter hObject.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enDeleteEnvVar.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enDeleteEnvVar(CAND_tHandle hObject);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Creates a new environment variable.
+ *
+ * \param hObject
+ * Handle to the environment variable that should hold the new environment variable.
+ *
+ * \param sName
+ * Name if the new variable.
+ *
+ * \return
+ * The Function returns a valid handle of the new environment variable. If
+ * there was an error the function will return an invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \ex CAND_hCreateEnvVar.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hCreateEnvVar(CAND_tHandle hObject, const char* sName);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Creates an environment variable.
+ *
+ * \param hObject
+ * Handle of the environment variable.
+ *
+ * \param sName
+ * Name of the environment variable to look for.
+ *
+ * \return
+ * The Function returns a valid handle of the environment variable. If
+ * there was an error the function will return an invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \ex CAND_hGetEnvVarByName.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetEnvVarByName(CAND_tHandle hObject, const char* sName);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Returns the first environment variable.
+ *
+ * \param hObject
+ * Handle to parent environment variable.
+ *
+ * \return
+ * The Function returns a valid handle of the first environment variable. If
+ * there was an error the function will return an invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \ex CAND_hGetFirstEnvVar.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetFirstEnvVar(CAND_tHandle hObject);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Returns a handle to the next environment variable.
+ *
+ * \param hObject
+ * Handle to an existing environment variable.
+ *
+ * \return
+ * The Function returns a valid handle to the next environment variable after the given one. If
+ * there was an error the function will return an invalid handle. You must use the function
+ * ::CAND_enIsNullHandle to check the result.
+ *
+ * \ex CAND_hGetNextEnvVar.cpp
+ */
+CANDLL_API CAND_tHandle CANDLL_CALL CAND_hGetNextEnvVar(CAND_tHandle hObject);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Returns the type (int, double, string, ...) of an environment variable.
+ *
+ * \param hObject
+ * Handle to an existing environment variable.
+ *
+ * \return
+ * The Function returns a struct containing the type information.
+ *
+ * \ex CAND_enGetEnvVarValue.cpp
+ */
+CANDLL_API CAND_tstEnvVarType CANDLL_CALL CAND_stGetEnvVarType(CAND_tHandle hObject);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Sets the value of an environment variable.
+ *
+ * \param hObject
+ * Handle to an existing environment variable.
+ * \param stType
+ * Struct containing the type information to be set.
+ * \param pData
+ * Pointer to source memory data
+ * \param dwLength
+ * Size in bytes of pData.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enSetEnvVarValue.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSetEnvVarValue(CAND_tHandle hObject, CAND_tstEnvVarType stType, const void* pData, DWORD dwLength);
+
+/*!
+ * \ingroup env_functions
+ *
+ * \brief
+ * Returns the value of an environment variable.
+ *
+ * \param hObject
+ * Handle to an existing environment variable.
+ * \param pData
+ * Pointer to destination memory data.
+ * \param dwLength
+ * Size in bytes of pData.
+ *
+ * \retval - ::CAND_nERR_INVALID_HANDLE The specified Handle is not valid.
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enGetEnvVarValue.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enGetEnvVarValue(CAND_tHandle hObject, void* pData, DWORD dwLength);
+
+/*!
+ * \ingroup replay_functions
+ *
+ * \brief
+ * Starts the replay with the corresponding name.
+ *
+ * \param sName
+ * Name of the replay.
+ *
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation need to be startet.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enStartReplay.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enStartReplay(const char* sName);
+
+/*!
+ * \ingroup replay_functions
+ *
+ * \brief
+ * Stops the replay with the corresponding name.
+ *
+ * \param sName
+ * Name of the replay.
+ *
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation need to be startet.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enStopReplay.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enStopReplay(const char* sName);
+
+/*!
+ * \ingroup replay_functions
+ *
+ * \brief
+ * Suspends the replay with the corresponding name.
+ *
+ * \param sName
+ * Name of the replay.
+ *
+ * \retval - ::CAND_nERR_INVALID_PARAM Some of the specified parameters are not correct.
+ * \retval - ::CAND_nERR_NOT_POSSIBLE Simulation need to be startet.
+ * \retval - ::CAND_nERR_OK The Function succeded.
+ *
+ * \ex CAND_enSuspendReplay.cpp
+ */
+CANDLL_API CAND_tenRetVal CANDLL_CALL CAND_enSuspendReplay(const char* sName);
+
+#ifdef __cplusplus
+}
+#endif /* extern "C" */
+
+#endif /* CAND_USER_API_H */
+
+
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib
new file mode 100644
index 0000000..b674db0
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/lib/CanDll.lib
Binary files differ
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2 b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2
new file mode 100644
index 0000000..96e319e
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/res/CanEasy_Xoraya_PluginDll.rc2
@@ -0,0 +1,13 @@
+//
+// CanEasy_Xoraya_Plugin.RC2
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add here manually edited resources..
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h
new file mode 100644
index 0000000..17a050b
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/resource.h
@@ -0,0 +1,42 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by CanEasy_Xoraya_PluginDll.rc
+//
+#define ID_POPUP_TREE_MENU 1001
+#define IDD_PLUGIN_MAIN_DIALOG 6000
+#define IDC_SLIDER1 6003
+#define IDC_EDIT1 6004
+#define IDC_LOG 6004
+#define IDI_ICON1 6005
+#define IDC_GRP_XORAYA_CONNECTION 6005
+#define IDC_XORAYA_IPADDRESS 6006
+#define IDC_CONNECTION_STATUS 6007
+#define IDC_BUTTON_CONNECT 6008
+#define IDC_BUTTON_DISCONNECT 6009
+#define IDC_INTERFACE_COMBO 6011
+#define IDC_BUS_COMBO 6012
+#define IDC_MAP_BUTTON 6013
+#define IDC_UNMAP_BUTTON 6014
+#define IDC_IMPORTLOG_BUTTON 6016
+#define IDC_MAPPEDBUS_COMBO 6017
+#define IDC_START_BUTTON 6018
+#define IDC_STOP_BUTTON 6019
+#define IDC_GETINTERFACES_BUTTON 6021
+#define IDC_BUTTON_SHUTDOWN 6022
+#define IDC_CHECK_AUTOLOAD 6023
+#define IDC_BUTTON_ENUMLOGS 6024
+#define IDC_COMBO1 6025
+#define IDC_LOGS_COMBO 6025
+#define ID_POPUP_REMOVE 50000
+#define ID_POPUP_SHOW 50001
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 6006
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 6026
+#define _APS_NEXT_SYMED_VALUE 6000
+#endif
+#endif
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico
new file mode 100644
index 0000000..c8922bd
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/CanEasy_Xoraya_Plugin/x2e.ico
Binary files differ
diff --git a/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile
new file mode 100644
index 0000000..fcdda13
--- /dev/null
+++ b/Master/Masterarbeit/src/CanEasyPlugin/CanEasy_Xoraya_Plugin/doc/Doxyfile
@@ -0,0 +1,1604 @@
+# Doxyfile 1.6.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "CanEasy Xoraya Plugin"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses.
+# With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this tag.
+# The format is ext=language, where ext is a file extension, and language is one of
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C. Note that for custom extensions you also need to set
+# FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ../CanEasy_Xoraya_Plugin
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.vhd \
+ *.vhdl
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */.svn/* \
+ *.svn* \
+ */\.svn/* \
+ *\.svn* \
+ */asf/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
+# For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = YES
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/.cproject b/Master/Masterarbeit/src/XorayaLogPlugin/.cproject
new file mode 100644
index 0000000..1aab972
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaLogPlugin/.cproject
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.so.debug.1440678666">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.so.debug.1440678666" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/xoraya_log_plugin"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_log_plugin"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/xoraya_log_plugin/Debug"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="xoraya_log_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.so.debug.1440678666" name="Debug" parent="cdt.managedbuild.config.gnu.cross.so.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.so.debug.1440678666." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.so.debug.1334892821" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.so.debug">
+ <option id="cdt.managedbuild.option.gnu.cross.prefix.1825319692" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="powerpc-linux-gnu-" valueType="string"/>
+ <option id="cdt.managedbuild.option.gnu.cross.path.903451939" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path" value="." valueType="string"/>
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.838117896" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/xoraya_log_plugin/Debug}" id="cdt.managedbuild.builder.gnu.cross.1103204078" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1964869006" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1806479127" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.512296956" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1057710420" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1532516773" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.829461870" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.986966737" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.include.paths.2030051339" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ <listOptionValue builtIn="false" value="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <listOptionValue builtIn="false" value="&quot;../..\common\inc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;C:\Programme\x2e\x2e\toolchain\powerpc-linux-gnu\libc\usr\include&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_log_plugin}&quot;"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.1488418347" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="DEBUG_MODE"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.other.pic.939471243" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" value="true" valueType="boolean"/>
+ <option id="gnu.cpp.compiler.option.other.other.1841479318" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1076103191" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1580930413" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
+ <option defaultValue="true" id="gnu.c.link.option.shared.231404349" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.807306555" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <option defaultValue="true" id="gnu.cpp.link.option.shared.1346177270" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.paths.850797018" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;C:\Programme\x2e\x2e\toolchain\powerpc-linux-gnu\libc\nof\lib&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.libs.1136745265" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" value="x2e"/>
+ </option>
+ <option id="gnu.cpp.link.option.flags.449138110" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-msoft-float" valueType="string"/>
+ <option id="gnu.cpp.link.option.userobjs.1736747997" name="Other objects" superClass="gnu.cpp.link.option.userobjs"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.221679302" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.so.release.961487379">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.so.release.961487379" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/xoraya_log_plugin"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/xoraya_log_plugin/Release"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="xoraya_log_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.so.release.961487379" name="Release" parent="cdt.managedbuild.config.gnu.cross.so.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.so.release.961487379." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.so.release.807211199" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.so.release">
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1026799051" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/xoraya_log_plugin/Release}" id="cdt.managedbuild.builder.gnu.cross.1504150012" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.2009912836" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1774717247" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.635283542" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.115580903" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1064278665" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.1069078447" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1647677157" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1629629801" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.698911481" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
+ <option defaultValue="true" id="gnu.c.link.option.shared.812653675" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.31086412" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <option defaultValue="true" id="gnu.cpp.link.option.shared.1851425286" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.150140250" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="xoraya_log_plugin.cdt.managedbuild.target.gnu.cross.so.823134091" name="Shared Library" projectType="cdt.managedbuild.target.gnu.cross.so"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.release.961487379;cdt.managedbuild.config.gnu.cross.so.release.961487379.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1064278665;cdt.managedbuild.tool.gnu.cpp.compiler.input.1629629801">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.1440678666;cdt.managedbuild.config.gnu.cross.so.debug.1440678666.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1532516773;cdt.managedbuild.tool.gnu.cpp.compiler.input.1076103191">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.release.961487379;cdt.managedbuild.config.gnu.cross.so.release.961487379.;cdt.managedbuild.tool.gnu.cross.c.compiler.2009912836;cdt.managedbuild.tool.gnu.c.compiler.input.115580903">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.1440678666;cdt.managedbuild.config.gnu.cross.so.debug.1440678666.;cdt.managedbuild.tool.gnu.cross.c.compiler.1964869006;cdt.managedbuild.tool.gnu.c.compiler.input.1057710420">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="refreshScope" versionNumber="1">
+ <resource resourceType="PROJECT" workspacePath="/xoraya_log_plugin"/>
+ </storageModule>
+</cproject>
diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/.project b/Master/Masterarbeit/src/XorayaLogPlugin/.project
new file mode 100644
index 0000000..b67e485
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaLogPlugin/.project
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>xoraya_log_plugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/xoraya_log_plugin/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.cpp b/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.cpp
new file mode 100644
index 0000000..26ce260
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.cpp
@@ -0,0 +1,309 @@
+/*
+ * CXorayaLogPlugin.cpp
+ *
+ * Created on: 25.10.2011
+ * Author: Eisenhauer
+ */
+
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <x2e/x2e.hpp>
+#include "interface_manager.h"
+#include "CXorayaLogPlugin.h"
+#include "global.h"
+#include "plugin_api.h"
+#include "IPluginExecutor.h"
+
+#define nSTR_LOGFILE_PATH "../data/current.log"
+
+CXorayaLogPlugin::CXorayaLogPlugin()
+:m_u32PluginId(0)
+,m_boStopIOThread(false)
+,m_iFd(0)
+,m_u32LogMsgBufferCounter(0)
+,m_xLogMsgBuffer(nLOG_MSG_BUFFER_SIZE)
+,m_fctThreadProc(boost::bind(&CXorayaLogPlugin::vIoThreadProc,boost::ref(*this)))
+,m_xIoThread(m_fctThreadProc)
+{
+ int res = 0;
+ int schedulerPolicy = SCHED_RR;
+ sched_param sp;
+ sp.sched_priority = tenPrio::nenLOW;
+ if( (res = pthread_setschedparam(m_xIoThread.native_handle(), schedulerPolicy, &sp)) != 0 )
+ {
+ ERROR_PRINT("pthread_setschedparam failed: %d errno: %d",res,errno);
+ }
+ if( (res = pthread_getschedparam(m_xIoThread.native_handle(),&schedulerPolicy,&sp)) != 0 )
+ {
+ ERROR_PRINT("pthread_getschedparam failed: %d errno: %d",res,errno);
+ }
+ else
+ {
+ DEBUG_PRINT("disc IO thread prio: %d scheduler: %s"
+ ,sp.sched_priority
+ ,(schedulerPolicy==SCHED_OTHER)?"SCHED_OTHER":
+ (schedulerPolicy==SCHED_FIFO)?"SCHED_FIFO":
+ (schedulerPolicy==SCHED_RR)?"SCHED_RR":"other");
+ }
+ enRotateLogfile();
+}
+
+CXorayaLogPlugin::~CXorayaLogPlugin()
+{
+ DEBUG_PRINT("entry");
+ DEBUG_PRINT("exit");
+}
+
+void CXorayaLogPlugin::vRun()
+{
+ x2e::status_t enRes;
+ x2e::Log::queueFillLevel stRxFillLvl;
+ x2e::Log::messageDescription stMsgDesc;
+ x2e::Log::framePayload stFrmPl;
+
+// DEBUG_PRINT("entry");
+
+ enRes = m_pxIfMan->enGetQueueFillLevel(stRxFillLvl);
+ if( x2e::OK != enRes )
+ {
+ DEBUG_PRINT("abnormal exit");
+ return;
+ }
+
+ do
+ {
+ enRes = m_pxIfMan->enPeekMessage(stRxFillLvl,&stMsgDesc,&stFrmPl);
+ if( enRes == x2e::OK )
+ {
+ tstLogMessage stLogMessage;
+ stLogMessage.u32TsLow = stMsgDesc.timestamp.getLow();
+ stLogMessage.u32TsHigh = stMsgDesc.timestamp.getHigh();
+ if( stFrmPl.frame.CAN.m_Identifier.isExtendedIdentifier() )
+ {
+ stLogMessage.u32MsgId = stFrmPl.frame.CAN.m_Identifier.getExtendedIdentifier();
+ }
+ else
+ {
+ stLogMessage.u32MsgId = stFrmPl.frame.CAN.m_Identifier.getStandardIdentifier();
+ }
+ stLogMessage.i32Interface = stMsgDesc.trailer.getInterfaceID();
+ stLogMessage.u8Dir = static_cast<uint8_t>(::nenRx);
+ memcpy( (void*) stLogMessage.au8Data, (const void*) stFrmPl.frame.CAN.m_Payload.uint8, 8 );
+ vLogMessage(stLogMessage);
+ }
+ }
+ while( enRes == x2e::OK );
+// DEBUG_PRINT("normal exit");
+}
+
+void CXorayaLogPlugin::vLogMessage(const tstLogMessage& stLogMessage)
+{
+ m_xLogMsgBuffer.push_front(stLogMessage);
+}
+
+int32_t CXorayaLogPlugin::i32GetCanInterfaceHandle( void )
+{
+ return 0;
+}
+
+void CXorayaLogPlugin::vStopIOThread( void )
+{
+ DEBUG_PRINT("entry");
+ {
+ boost::lock_guard<x2e::Mutex> xStopLock(m_xStopIOFlagMutex);
+ m_boStopIOThread = true;
+ }
+ tstLogMessage stLogMessage;
+ stLogMessage.u32MsgId = ~0x0;
+ m_xLogMsgBuffer.push_front(stLogMessage);
+ DEBUG_PRINT("exit");
+}
+
+void CXorayaLogPlugin::vIoThreadProc()
+{
+ bool boStop = false;
+ while( !boStop )
+ {
+// DEBUG_PRINT("running");
+ tstLogMessage stLogMessage;
+ m_xLogMsgBuffer.pop_back(&stLogMessage);
+// DEBUG_PRINT("Popped %s msg with id %#x from bounded buffer",(stLogMessage.u8Dir==0)?"RX":"TX",stLogMessage.u32MsgId);
+ if( stLogMessage.u8Dir == 0 )
+ {
+ stLogMessage.i32Interface = m_pxIfMan->i32GetInterfaceByLogIfId(stLogMessage.i32Interface);
+ }
+// DEBUG_PRINT("Logging message with ID 0x%X",pstLogMessage->u32Id);
+ if( (stLogMessage.u32MsgId != ~0x0U) && (stLogMessage.i32Interface != -1) )
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xLogBufferMutex);
+ if( (sizeof(tstLogMessage)*(m_u32LogMsgBufferCounter+1)) > nINT_BUFF_SIZE )
+ {
+ // write log file
+ if( m_iFd > 0 )
+ {
+ write( m_iFd, reinterpret_cast<const void*>(m_acLogBuffer), sizeof(tstLogMessage)*m_u32LogMsgBufferCounter );
+ }
+ m_u32LogMsgBufferCounter = 0;
+ }
+ m_pxExec->vUploadLogMessage(stLogMessage);
+ memcpy( (void*) (m_acLogBuffer+(sizeof(tstLogMessage)*m_u32LogMsgBufferCounter)),(void*)&stLogMessage,sizeof(stLogMessage));
+ m_u32LogMsgBufferCounter++;
+ }
+// DEBUG_PRINT("sleeping");
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xStopIOFlagMutex);
+ boStop = m_boStopIOThread;
+ }
+ }
+ if( m_iFd > 0 )
+ {
+ close(m_iFd);
+ }
+ DEBUG_PRINT("exit");
+}
+
+void CXorayaLogPlugin::vStop()
+{
+ DEBUG_PRINT("entry");
+ vStopIOThread();
+ m_xIoThread.join();
+ DEBUG_PRINT("exit");
+}
+
+tenRetCodes CXorayaLogPlugin::enGetLog(const char* pcReqFilename, char* pcRespFilename)
+{
+ tenRetCodes enRetCode = nenOK;
+ if( strcmp( pcReqFilename, nSTR_LOGFILE_PATH ) == 0)
+ {
+ enRetCode = enRotateLogfile();
+ strcpy(pcRespFilename,m_acLogfileName);
+ }
+ else
+ {
+ strcpy(pcRespFilename,pcReqFilename);
+ }
+ return enRetCode;
+}
+
+void CXorayaLogPlugin::vInit(void* pvExecutor, void* pvIfMan, int32_t i32Interface,uint32_t u32PluginId)
+{
+ DEBUG_PRINT("entry");
+ if(!pvExecutor)
+ {
+ ERROR_PRINT("no main application provided");
+ return;
+ }
+ if(!pvIfMan)
+ {
+ ERROR_PRINT("no interface manager provided");
+ return;
+ }
+ m_pxExec = reinterpret_cast<IPluginExecutor*>(pvExecutor);
+ m_pxIfMan = reinterpret_cast<IInterfaceManager*>(pvIfMan);
+ m_u32PluginId = u32PluginId;
+ DEBUG_PRINT("exit");
+}
+
+void CXorayaLogPlugin::vInitLogfile()
+{
+ time_t xEpochSeconds;
+ xEpochSeconds = time(NULL);
+ size_t xBytesWritten = 0;
+ int iFlags = O_WRONLY | O_CREAT | O_TRUNC;
+ mode_t xMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+ m_iFd = open( nSTR_LOGFILE_PATH, iFlags, xMode );
+ if( m_iFd < 0 )
+ {
+ ERROR_PRINT("Error opening file %s. Errno: %d",nSTR_LOGFILE_PATH,errno);
+ return;
+ }
+ DEBUG_PRINT("Opened file %s",nSTR_LOGFILE_PATH);
+ xBytesWritten = write( m_iFd, reinterpret_cast<const void*>(&xEpochSeconds), sizeof(time_t) );
+ if( xBytesWritten != sizeof(time_t) )
+ {
+ ERROR_PRINT("Error writing to file %s",nSTR_LOGFILE_PATH);
+ }
+ else
+ {
+ DEBUG_PRINT("Wrote timestamp to file %s",nSTR_LOGFILE_PATH);
+ }
+}
+
+tenRetCodes CXorayaLogPlugin::enRotateLogfile()
+{
+ tenRetCodes enRetCode = nenOK;
+ time_t xTime;
+ struct tm *pstTime = NULL;
+ const char* pcLogFilenameFormat = "../data/x%Y%m%d_%H%M%S.log";
+
+ xTime = time(NULL);
+ pstTime = localtime(&xTime);
+ if( pstTime == NULL )
+ {
+ perror("localtime");
+ enRetCode = nenERR_MOVELOG;
+ return enRetCode;
+ }
+
+ if( strftime( m_acLogfileName, sizeof(m_acLogfileName), pcLogFilenameFormat, pstTime ) == 0 )
+ {
+ ERROR_PRINT("Error creating new filename");
+ enRetCode = nenERR_MOVELOG;
+ return enRetCode;
+ }
+
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xLogBufferMutex);
+ if( m_iFd > 0 )
+ {
+ write( m_iFd, reinterpret_cast<const void*>(m_acLogBuffer), sizeof(tstLogMessage)*m_u32LogMsgBufferCounter );
+ close(m_iFd);
+ }
+ m_u32LogMsgBufferCounter = 0;
+ if( rename(nSTR_LOGFILE_PATH,m_acLogfileName) )
+ {
+ ERROR_PRINT("Error renaming current log to %s",m_acLogfileName);
+ enRetCode = nenERR_MOVELOG;
+ return enRetCode;
+ }
+ vInitLogfile();
+ }
+ return enRetCode;
+}
+
+static CXorayaLogPlugin g_sxLogPlugin;
+
+IPlugin* pxCreatePlugin(void* pvExecutor, void* pvIfMan,
+ int32_t i32Interface,
+ uint32_t u32PluginId)
+{
+ DEBUG_PRINT("entry");
+ if( !pvIfMan )
+ {
+ ERROR_PRINT("no interface manager provided");
+ return NULL;
+ }
+ if( !pvExecutor )
+ {
+ ERROR_PRINT("no main application provided");
+ return NULL;
+ }
+ g_sxLogPlugin.vInit(pvExecutor, pvIfMan, i32Interface, u32PluginId);
+ return &g_sxLogPlugin;
+}
+
+void vDestroyPlugin(IPlugin* pxPlugin)
+{
+ DEBUG_PRINT("destroy log plugin entry");
+ if( pxPlugin )
+ {
+ DEBUG_PRINT("destroy log plugin deleting instance");
+ reinterpret_cast<CXorayaLogPlugin*>(pxPlugin)->vStop();
+ }
+ DEBUG_PRINT("destroy log plugin exit");
+}
+
diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h b/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h
new file mode 100644
index 0000000..da97fd1
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h
@@ -0,0 +1,67 @@
+/*
+ * CXorayaLogPlugin.h
+ *
+ * Created on: 25.10.2011
+ * Author: Eisenhauer
+ */
+
+#ifndef CXORAYALOGPLUGIN_H_
+#define CXORAYALOGPLUGIN_H_
+
+#include <boost/thread.hpp>
+#include <x2e/sys/Mutex.hpp>
+#include "bounded_buffer.hpp"
+#include "global.h"
+#include "plugin_api.h"
+
+#define nLOG_MSG_BUFFER_SIZE 8192
+#define nINT_BUFF_SIZE 4096
+#define nLOGFILENAME_LENGTH 256
+
+class IInterfaceManager;
+class IPluginExecutor;
+
+class CXorayaLogPlugin: public IPlugin {
+public:
+ CXorayaLogPlugin();
+ virtual ~CXorayaLogPlugin();
+ virtual void vRun();
+ virtual tpstCanTxMessage pxGetCanTxMessage( const uint32_t u32MsgIndex )
+ {
+ return NULL;
+ }
+ virtual uint32_t u32GetNumOfCanTxMessages( void )
+ {
+ return 0;
+ }
+ virtual bool boIsLogger( void ) { return true; }
+ virtual bool boAutoload( void ) { return true; }
+ virtual int32_t i32GetCanInterfaceHandle( void );
+ virtual tenRetCodes enGetLog(const char*, char*);
+ virtual void vInit(void* pvExecutor, void* pvIfMan, int32_t i32Interface,uint32_t u32PluginId);
+ void vStopIOThread();
+ void vStop();
+ virtual void vLogMessage(const tstLogMessage& stLogMessage);
+
+private:
+ IInterfaceManager* m_pxIfMan;
+ IPluginExecutor* m_pxExec;
+ uint32_t m_u32PluginId;
+ bool m_boStopIOThread;
+ x2e::Mutex m_xStopIOFlagMutex;
+ x2e::Mutex m_xLogBufferMutex;
+ int m_iFd;
+ char m_acLogBuffer[nINT_BUFF_SIZE];
+ char m_acLogfileName[nLOGFILENAME_LENGTH];
+ uint32_t m_u32LogMsgBufferCounter;
+
+ bounded_buffer<tstLogMessage> m_xLogMsgBuffer;
+ boost::function<void()> m_fctThreadProc;
+ boost::thread m_xIoThread;
+
+ void vIoThreadProc();
+ void vInitLogfile();
+ tenRetCodes enRotateLogfile();
+};
+
+#endif /* CXORAYALOGPLUGIN_H_ */
diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/bounded_buffer.hpp b/Master/Masterarbeit/src/XorayaLogPlugin/bounded_buffer.hpp
new file mode 100644
index 0000000..09181c7
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaLogPlugin/bounded_buffer.hpp
@@ -0,0 +1,87 @@
+/*
+ * bounded_buffer.hpp
+ *
+ * Created on: 25.11.2011
+ * Author: Eisenhauer
+ */
+
+#ifndef BOUNDED_BUFFER_HPP_
+#define BOUNDED_BUFFER_HPP_
+
+
+#include <boost/circular_buffer.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/call_traits.hpp>
+#include <boost/progress.hpp>
+#include <boost/bind.hpp>
+#include <pthread.h>
+#include "global.h"
+
+template <class T>
+class bounded_buffer {
+public:
+
+ typedef boost::circular_buffer<T> container_type;
+ typedef typename container_type::size_type size_type;
+ typedef typename container_type::value_type value_type;
+ typedef typename boost::call_traits<value_type>::param_type param_type;
+
+ explicit bounded_buffer(size_type capacity) : m_unread(0), m_container(capacity)
+ {
+ if(pthread_mutexattr_init(&m_xMutexAttr))
+ {
+ ERROR_PRINT("pthread_mutexattr_init failed");
+ }
+ if(pthread_mutexattr_setprotocol(&m_xMutexAttr, PTHREAD_PRIO_INHERIT))
+ {
+ ERROR_PRINT("pthread_mutexattr_setprotocol PTHREAD_PRIO_INHERIT failed");
+ }
+ if(pthread_mutexattr_settype(&m_xMutexAttr, PTHREAD_MUTEX_RECURSIVE))
+ {
+ ERROR_PRINT("pthread_mutexattr_settype PTHREAD_MUTEX_RECURSIVE failed");
+ }
+ if(pthread_mutex_init(m_mutex.native_handle(), &m_xMutexAttr))
+ {
+ ERROR_PRINT("pthread_mutex_init failed");
+ }
+ }
+
+ void push_front(/*boost::call_traits<value_type>::*/param_type item)
+ {
+ // param_type represents the "best" way to pass a parameter of type value_type to a method
+ boost::mutex::scoped_lock lock(m_mutex);
+ m_not_full.wait(lock, boost::bind(&bounded_buffer<value_type>::is_not_full, this));
+ m_container.push_front(item);
+ ++m_unread;
+ lock.unlock();
+ m_not_empty.notify_one();
+ }
+
+ void pop_back(value_type* pItem)
+ {
+ boost::mutex::scoped_lock lock(m_mutex);
+ m_not_empty.wait(lock, boost::bind(&bounded_buffer<value_type>::is_not_empty, this));
+ *pItem = m_container[--m_unread];
+ lock.unlock();
+ m_not_full.notify_one();
+ }
+
+private:
+ bounded_buffer(const bounded_buffer&); // Disabled copy constructor
+ bounded_buffer& operator = (const bounded_buffer&); // Disabled assign operator
+
+ bool is_not_empty() const { return m_unread > 0; }
+ bool is_not_full() const { return m_unread < m_container.capacity(); }
+
+ size_type m_unread;
+ container_type m_container;
+ boost::mutex m_mutex;
+ pthread_mutexattr_t m_xMutexAttr;
+ boost::condition m_not_empty;
+ boost::condition m_not_full;
+};
+
+
+#endif /* BOUNDED_BUFFER_HPP_ */
diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/doc/Doxyfile b/Master/Masterarbeit/src/XorayaLogPlugin/doc/Doxyfile
new file mode 100644
index 0000000..bb30dee
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaLogPlugin/doc/Doxyfile
@@ -0,0 +1,1814 @@
+# Doxyfile 1.7.6.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME = "XORAYA Log Plugin"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = .. \
+ ../../common/inc/
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.for \
+ *.vhd \
+ *.vhdl
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE = ../../common/inc/plugin_api_heap.h
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */asf/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 4
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/.cproject b/Master/Masterarbeit/src/XorayaPluginExecutor/.cproject
new file mode 100644
index 0000000..2f0ae88
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/.cproject
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1237470940">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1237470940" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_plugin_executor"/>
+ <entry flags="BUILTIN|READONLY|RESOLVED" kind="includePath" name="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <entry flags="RESOLVED" kind="includePath" name="C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_log_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.debug.1237470940" name="Debug" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1237470940." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.380632348" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
+ <option id="cdt.managedbuild.option.gnu.cross.prefix.1379978722" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="powerpc-linux-gnu-" valueType="string"/>
+ <option id="cdt.managedbuild.option.gnu.cross.path.1759484722" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path" value="." valueType="string"/>
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1086953535" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/xoraya_plugin_executor/Debug}" id="cdt.managedbuild.builder.gnu.cross.1088089363" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1021947689" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.525143268" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1812027065" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.misc.other.1977318639" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.c.compiler.option.preprocessor.nostdinc.971411741" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc" value="false" valueType="boolean"/>
+ <option id="gnu.c.compiler.option.include.paths.41188834" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.901450505" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1217413449" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.1540661548" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1770773337" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.other.other.659696681" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.cpp.compiler.option.preprocessor.nostdinc.1278885393" name="Do not search system directories (-nostdinc)" superClass="gnu.cpp.compiler.option.preprocessor.nostdinc" value="false" valueType="boolean"/>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.962705631" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="DEBUG_MODE"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.include.paths.343058515" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;../..\common\inc&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.742715354" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1126025175" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1347261944" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <option id="gnu.cpp.link.option.libs.1740658713" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" value="rt"/>
+ <listOptionValue builtIn="false" value="pthread"/>
+ <listOptionValue builtIn="false" value="x2e"/>
+ <listOptionValue builtIn="false" value="boost_system"/>
+ <listOptionValue builtIn="false" value="boost_filesystem"/>
+ <listOptionValue builtIn="false" value="boost_program_options"/>
+ <listOptionValue builtIn="false" value="boost_thread"/>
+ <listOptionValue builtIn="false" value="dl"/>
+ </option>
+ <option id="gnu.cpp.link.option.flags.1217859129" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-msoft-float" valueType="string"/>
+ <option id="gnu.cpp.link.option.paths.1055214967" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;C:\Programme\x2e\x2e\toolchain\powerpc-linux-gnu\libc\nof\lib&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.userobjs.1874286427" name="Other objects" superClass="gnu.cpp.link.option.userobjs"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1478442951" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="src" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.1535439753">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.release.1535439753" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.release.1535439753" name="Release" parent="cdt.managedbuild.config.gnu.cross.exe.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.exe.release.1535439753." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.release.760540983" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.release">
+ <option id="cdt.managedbuild.option.gnu.cross.prefix.182490123" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="powerpc-linux-gnu-" valueType="string"/>
+ <option id="cdt.managedbuild.option.gnu.cross.path.1256843160" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path" value="." valueType="string"/>
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.502131394" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/xoraya_plugin_executor/Release}" id="cdt.managedbuild.builder.gnu.cross.1504988245" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1602738917" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.2004361733" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.2005308068" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.misc.other.419628710" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.c.compiler.option.include.paths.1564682802" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1615602709" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.648340174" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.1692514080" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.1246230289" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.other.other.322790524" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.cpp.compiler.option.include.paths.426177848" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;../..\common\inc&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.605759073" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.568771198" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.130392748" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <option id="gnu.cpp.link.option.libs.147670748" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" value="rt"/>
+ <listOptionValue builtIn="false" value="pthread"/>
+ <listOptionValue builtIn="false" value="x2e"/>
+ <listOptionValue builtIn="false" value="boost_system"/>
+ <listOptionValue builtIn="false" value="boost_filesystem"/>
+ <listOptionValue builtIn="false" value="boost_program_options"/>
+ <listOptionValue builtIn="false" value="boost_thread"/>
+ <listOptionValue builtIn="false" value="dl"/>
+ </option>
+ <option id="gnu.cpp.link.option.flags.1055747126" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-msoft-float" valueType="string"/>
+ <option id="gnu.cpp.link.option.paths.2051369331" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;C:\Programme\x2e\x2e\toolchain\powerpc-linux-gnu\libc\nof\lib&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.967659329" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="xoraya_plugin_executor.cdt.managedbuild.target.gnu.cross.exe.238743738" name="Executable" projectType="cdt.managedbuild.target.gnu.cross.exe"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1237470940;cdt.managedbuild.config.gnu.cross.exe.debug.1237470940.;cdt.managedbuild.tool.gnu.cross.c.compiler.1021947689;cdt.managedbuild.tool.gnu.c.compiler.input.901450505">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="powerpc-linux-gnu-gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.1535439753;cdt.managedbuild.config.gnu.cross.exe.release.1535439753.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.648340174;cdt.managedbuild.tool.gnu.cpp.compiler.input.605759073">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="powerpc-linux-gnu-g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.1535439753;cdt.managedbuild.config.gnu.cross.exe.release.1535439753.;cdt.managedbuild.tool.gnu.cross.c.compiler.1602738917;cdt.managedbuild.tool.gnu.c.compiler.input.1615602709">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="powerpc-linux-gnu-gcc" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1237470940;cdt.managedbuild.config.gnu.cross.exe.debug.1237470940.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1217413449;cdt.managedbuild.tool.gnu.cpp.compiler.input.742715354">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+ <buildOutputProvider>
+ <openAction enabled="true" filePath=""/>
+ <parser enabled="true"/>
+ </buildOutputProvider>
+ <scannerInfoProvider id="specsFile">
+ <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="powerpc-linux-gnu-g++" useDefault="true"/>
+ <parser enabled="true"/>
+ </scannerInfoProvider>
+ </profile>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="refreshScope" versionNumber="1">
+ <resource resourceType="PROJECT" workspacePath="/xoraya_plugin_executor"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cproject>
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/.project.default b/Master/Masterarbeit/src/XorayaPluginExecutor/.project.default
new file mode 100644
index 0000000..b78548b
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/.project.default
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>xoraya_plugin_executor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/xoraya_plugin_executor/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>src</name>
+ <type>2</type>
+ <location>C:/Dokumente und Einstellungen/Eisenhauer/Eigene Dateien/Masterarbeit/src/common/src</location>
+ </link>
+ </linkedResources>
+</projectDescription>
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.cpp b/Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.cpp
new file mode 100644
index 0000000..eb196c4
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.cpp
@@ -0,0 +1,271 @@
+/*!
+ * \file CInterfaceManager.cpp
+ * \author S. Eisenhauer
+ * \date 25.10.2011
+ * \brief Implementation of CInterfaceManager
+ */
+#include "CInterfaceManager.h"
+#include "x2e/CAN.hpp"
+#include <stdlib.h>
+
+CInterfaceManager::CInterfaceManager()
+:m_pxDrv( x2e::System::OpenDriver() )
+,m_enTimer(x2e::System::Timer::TIMER_2)
+{
+ x2e::status_t enRetCode;
+ if( !m_pxDrv)
+ {
+ ERROR_PRINT("Error getting Driver! Exiting...");
+ exit(1);
+ }
+ enRetCode = x2e::System::Timer::Configure(m_pxDrv, m_enTimer, nTIMER_INTERVAL_US, true, true);
+ if( enRetCode != x2e::OK )
+ {
+ ERROR_PRINT("Error configuring timer %d: %d", m_enTimer, enRetCode);
+ exit(1);
+ }
+ x2e::System::SetLEDState(m_pxDrv,x2e::System::LED_AUX,x2e::System::LED_ON);
+ enEnableAllInterfaces();
+}
+
+CInterfaceManager::~CInterfaceManager()
+{
+ DEBUG_PRINT("entry");
+ DEBUG_PRINT("exit");
+}
+
+x2e::status_t CInterfaceManager::enWriteCanMessage(
+ int32_t i32InterfaceHandle,
+ uint32_t u32MsgId,
+ bool boIsExtended,
+ bool boIsRtrFrame,
+ const uint8_t* pu8Data,
+ uint32_t u32DataLength)
+{
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ return x2e::CAN::WriteMessage(
+ m_pxDrv,
+ i32InterfaceHandle,
+ u32MsgId,
+ boIsExtended,
+ boIsRtrFrame,
+ pu8Data,
+ u32DataLength);
+}
+
+x2e::status_t CInterfaceManager::enGetQueueFillLevel(x2e::Log::queueFillLevel& stFillLevel)
+{
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ return x2e::Log::RetrieveFillLevel(m_pxDrv,stFillLevel);
+}
+
+x2e::status_t CInterfaceManager::enPeekMessage(
+ x2e::Log::queueFillLevel& stFillLevel,
+ x2e::Log::messageDescription* pstMsgDescr,
+ x2e::Log::framePayload* pstMsgPayload)
+{
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ return x2e::Log::PeekNextMessage(m_pxDrv,stFillLevel,pstMsgDescr,pstMsgPayload);
+}
+
+x2e::status_t CInterfaceManager::enEnableInterface(int32_t i32RequestedInterface)
+{
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ int32_t i32Handle = i32RequestedInterface;
+ bool boSendAbility = true;
+ x2e::CAN::transceiver enTransceiver= x2e::CAN::TRANSCEIVER_HIGHSPEED;
+ x2e::Log::InterfaceId::ifid_t tLogIf;
+ x2e::status_t enRes;
+ uint32_t u32BaudRate = x2e::CAN::BAUDRATE_1000K;
+ //uint32_t u32BaudRate = x2e::CAN::BAUDRATE_500K;
+ m_tenState enInterfaceState = nenOn;
+ uint32_t u32Slot = 0;
+ uint32_t u32SlotPos = 0;
+ uint32_t u32AttrSize = 0;
+
+ enRes = x2e::CAN::GetInterface(m_pxDrv,&i32Handle,&enTransceiver,&boSendAbility, &tLogIf);
+ if( x2e::OK != enRes)
+ {
+ ERROR_PRINT("Error getting interface %d: %d",i32Handle,enRes);
+ exit(1);
+ }
+ if( i32Handle != i32RequestedInterface )
+ {
+ ERROR_PRINT("Request interface %d, got %d. Exiting",i32RequestedInterface,i32Handle);
+ exit(1);
+ }
+
+ DEBUG_PRINT("Got interface %d",i32Handle);
+
+ if( !boSendAbility )
+ {
+ ERROR_PRINT("Interface %d is not able to send",i32Handle);
+ exit(1);
+ }
+ DEBUG_PRINT("Interface %d can send",i32Handle);
+
+ enRes = x2e::CAN::SetAttribute(m_pxDrv, i32Handle, x2e::CAN::ATTR_BAUDRATE, &u32BaudRate, sizeof(u32BaudRate));
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error setting baudrate for interface %d",i32Handle);
+ exit(1);
+ }
+// u32AttrSize = sizeof(uint32_t);
+// enRes = x2e::CAN::GetAttribute(m_pxDrv, i32Handle, x2e::CAN::ATTR_BAUDRATE,(void*) &u32BaudRate, &u32AttrSize);
+// if( enRes != x2e::OK )
+// {
+// ERROR_PRINT("Error getting baudrate for interface %d: %d",i32Handle,enRes);
+// exit(1);
+// }
+// if( u32BaudRate == x2e::CAN::BAUDRATE_1000K )
+// {
+// DEBUG_PRINT("set baudrate to 1MBit/s on interface %d",i32Handle);
+// }
+// else
+// {
+// DEBUG_PRINT("baudrate interface %d is %d",i32Handle, u32BaudRate);
+// }
+
+ enRes = SetAttribute(m_pxDrv, i32Handle, x2e::CAN::ATTR_INTERFACE_STATUS, &enInterfaceState, sizeof(m_tenState));
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("error enabling CAN interface %d: %d",i32Handle,enRes);
+ exit(1);
+ }
+ DEBUG_PRINT("enabled interface %d",i32Handle);
+ u32AttrSize = sizeof(uint32_t);
+ enRes = x2e::CAN::GetAttribute(m_pxDrv, i32Handle, x2e::CAN::ATTR_SLOT,(void*) &u32Slot, &u32AttrSize);
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error getting Slot for interface %d: %d",i32Handle,enRes);
+ exit(1);
+ }
+ u32AttrSize = sizeof(uint32_t);
+ enRes = x2e::CAN::GetAttribute(m_pxDrv, i32Handle, x2e::CAN::ATTR_POSITION_ON_SLOT,(void*) &u32SlotPos, &u32AttrSize);
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error getting position on Slot for interface %d: %d",i32Handle,enRes);
+ exit(1);
+ }
+ DEBUG_PRINT("Interface %d is on Slot %d pos %d",i32Handle,u32Slot,u32SlotPos);
+ return x2e::OK;
+}
+
+x2e::status_t CInterfaceManager::enEnableAllInterfaces()
+{
+ x2e::status_t enRes;
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ for( uint32_t u32ActInterface = static_cast<uint32_t>(x2e::CAN::INTERFACE_1);
+ u32ActInterface < static_cast<uint32_t>(x2e::CAN::INTERFACE_7);
+ u32ActInterface++)
+ {
+ enRes = this->enEnableInterface(static_cast<int32_t>(u32ActInterface));
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error enabling interface %d: %d"
+ , static_cast<int32_t>(u32ActInterface),enRes);
+ return enRes;
+ }
+ }
+ return enRes;
+}
+
+x2e::status_t CInterfaceManager::enGetTimestamp( uint32_t* pu32TsHigh, uint32_t* pu32TsLow )
+{
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ return x2e::System::GetCentralTimeStamp(m_pxDrv,pu32TsHigh,pu32TsLow);
+}
+
+x2e::status_t CInterfaceManager::enWait()
+{
+ if( !m_pxDrv )
+ {
+ return x2e::ERR_NOT_INITIALIZED;
+ }
+ return x2e::System::Timer::Wait(m_pxDrv, m_enTimer);
+}
+
+void CInterfaceManager::vDeinit()
+{
+ if( !m_pxDrv )
+ {
+ return;
+ }
+ x2e::status_t enRes;
+ DEBUG_PRINT("entry");
+ for( int32_t i32ActInterface = x2e::CAN::INTERFACE_1;
+ i32ActInterface < x2e::CAN::INTERFACE_7;
+ i32ActInterface++)
+ {
+ enRes = enDisableInterface( i32ActInterface );
+ }
+ x2e::System::SetLEDState(m_pxDrv,x2e::System::LED_AUX,x2e::System::LED_OFF);
+ x2e::System::CloseDriver(m_pxDrv);
+ m_pxDrv = NULL;
+ DEBUG_PRINT("exit");
+}
+
+x2e::status_t CInterfaceManager::enDisableInterface(int32_t i32Interface)
+{
+ x2e::status_t enRes = x2e::OK;
+ m_tenState enInterfaceState = nenOff;
+
+ DEBUG_PRINT("disabling interface %d",i32Interface);
+
+ enRes = SetAttribute(
+ m_pxDrv,
+ i32Interface,
+ x2e::CAN::ATTR_INTERFACE_STATUS,
+ &enInterfaceState,
+ sizeof(m_tenState)
+ );
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error disabling interface %d: %d"
+ , i32Interface,enRes);
+ }
+ enRes = SetAttribute(
+ m_pxDrv,
+ i32Interface,
+ x2e::CAN::ATTR_TRANSCEIVER_STATUS,
+ &enInterfaceState,
+ sizeof(m_tenState)
+ );
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error switching tranceiver %d off: %d"
+ , i32Interface,enRes);
+ }
+ enRes = SetAttribute(
+ m_pxDrv,
+ i32Interface,
+ x2e::CAN::ATTR_LED_STATUS,
+ &enInterfaceState,
+ sizeof(m_tenState)
+ );
+ if( enRes != x2e::OK )
+ {
+ ERROR_PRINT("Error switching led %d off: %d"
+ , i32Interface,enRes);
+ }
+
+ return enRes;
+}
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.h b/Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.h
new file mode 100644
index 0000000..34cff19
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/CInterfaceManager.h
@@ -0,0 +1,68 @@
+/*!
+ * \file CInterfaceManager.h
+ * \author S. Eisenhauer
+ * \date 25.10.2011
+ * \brief Header of CInterfaceManager
+ */
+#ifndef CINTERFACEMANAGER_H_
+#define CINTERFACEMANAGER_H_
+
+#include "interface_manager.h"
+#include <x2e/Timer.hpp>
+
+/// number of CAN interfaces on the used XORAYA
+#define nNUMBER_OF_CAN_INTERFACES 8
+
+/// identifier meaning all interfaces
+#define nALL_CAN_INTERFACES 0
+
+/// Implementation of IInterfaceManager
+class CInterfaceManager : public IInterfaceManager
+{
+public:
+ CInterfaceManager();
+ virtual ~CInterfaceManager();
+ virtual x2e::status_t enWriteCanMessage(
+ int32_t i32InterfaceHandle,
+ uint32_t u32MsgId,
+ bool boIsExtended,
+ bool boIsRtrFrame,
+ const uint8_t* pu8Data,
+ uint32_t u32DataLength);
+
+ virtual x2e::status_t enGetQueueFillLevel(x2e::Log::queueFillLevel& stFillLevel);
+
+ virtual x2e::status_t enPeekMessage(
+ x2e::Log::queueFillLevel& stFillLevel,
+ x2e::Log::messageDescription* pstMsgDescr,
+ x2e::Log::framePayload* pstMsgPayload);
+
+ virtual x2e::status_t enEnableInterface(int32_t i32RequestedInterface);
+ virtual x2e::status_t enDisableInterface(int32_t i32RequestedInterface);
+
+ virtual x2e::status_t enEnableAllInterfaces();
+
+ virtual x2e::status_t enGetTimestamp( uint32_t* pu32TsHigh, uint32_t* pu32TsLow );
+
+ virtual x2e::status_t enWait();
+
+ void vDeinit();
+
+
+ virtual int32_t i32GetInterfaceByLogIfId(x2e::Log::InterfaceId::ifid_t u16LogIfId)
+ {
+ return x2e::Log::InterfaceId::getGlobalIfInstanceNumber(u16LogIfId);
+ }
+
+private:
+
+ x2e::System::Driver* m_pxDrv;
+ x2e::System::Timer::hardwareTimer m_enTimer;
+
+ enum m_tenState
+ {
+ nenOff = 0, nenOn = 1
+ };
+};
+
+#endif /* CINTERFACEMANAGER_H_ */
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.cpp b/Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.cpp
new file mode 100644
index 0000000..4697aef
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.cpp
@@ -0,0 +1,577 @@
+/*!
+ * \file CPluginExecutor.cpp
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Implementation of CPluginExecutor
+ */
+#include "CPluginExecutor.h"
+#include <dlfcn.h>
+#include <boost/bind.hpp>
+#include "global.h"
+#include <x2e/CAN.hpp>
+#include <string.h>
+#include <sched.h>
+#include <errno.h>
+#include <dirent.h>
+#include "protocol.h"
+
+#define nAUTOLOAD_FILENAME "autoload_plugins"
+#define nSEPARATOR ","
+
+static tstPluginConfig g_astPluginConfigList[nNUMBER_OF_CAN_INTERFACES];
+
+CPluginExecutor::CPluginExecutor( )
+:m_u8PluginCounter(0)
+,m_xTcpServer(this,g_xIoService,nPORT)
+,m_xConnector(this,m_xTcpServer)
+,m_xConnectorThread(m_xConnector)
+,m_pxLogPlugin(NULL)
+{
+ int res = 0;
+ int schedulerPolicy = SCHED_RR;
+ sched_param sp;
+ sp.sched_priority = tenPrio::nenNORMAL; // rt priority
+
+ tenRetCodes enRetVal = enAutoLoadPlugins();
+ if( enRetVal != nenOK )
+ {
+ ERROR_PRINT("error auto loading plugins: %d",enRetVal);
+ exit(1);
+ }
+
+ if( (res = pthread_setschedparam(m_xConnectorThread.native_handle(), schedulerPolicy, &sp)) != 0 )
+ {
+ ERROR_PRINT("pthread_setschedparam failed: %d errno: %d",res,errno);
+ }
+ if( (res = pthread_getschedparam(m_xConnectorThread.native_handle(),&schedulerPolicy,&sp)) != 0 )
+ {
+ ERROR_PRINT("pthread_getschedparam failed: %d errno: %d",res,errno);
+ }
+ else
+ {
+ DEBUG_PRINT("network IO thread prio: %d scheduler: %s"
+ ,sp.sched_priority
+ ,(schedulerPolicy==SCHED_OTHER)?"SCHED_OTHER":
+ (schedulerPolicy==SCHED_FIFO)?"SCHED_FIFO":
+ (schedulerPolicy==SCHED_RR)?"SCHED_RR":"other");
+ }
+}
+
+CPluginExecutor::~CPluginExecutor()
+{
+ DEBUG_PRINT("entry");
+ DEBUG_PRINT("exit");
+}
+
+tenRetCodes CPluginExecutor::enAddPlugin( const char* pcSoFilename, const int32_t i32Interface, uint8_t& u8PluginId )
+{
+ tenRetCodes enRetCode = nenOK;
+ if( i32Interface != nALL_CAN_INTERFACES )
+ {
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xPluginListMutex);
+ if( findPluginByInterface(i32Interface) != m_astPluginConfig.end() )
+ {
+ enRetCode = enRemovePlugin(i32Interface);
+ if( enRetCode != nenOK )
+ {
+ return enRetCode;
+ }
+ }
+ }
+ }
+ tpstPluginConfig pstNewPluginConfig = NULL;
+ for(uint8_t u8Cnt = 0; u8Cnt<nNUMBER_OF_CAN_INTERFACES; u8Cnt++)
+ {
+ pstNewPluginConfig = &g_astPluginConfigList[u8Cnt];
+ if(pstNewPluginConfig->pvPluginHandle == NULL)
+ {
+// DEBUG_PRINT("using memory %d [%#X] for plugin %s",u8Cnt,(int)pstNewPluginConfig,pcSoFilename);
+ break;
+ }
+ else
+ {
+ pstNewPluginConfig = NULL;
+ }
+ }
+ if( !pstNewPluginConfig )
+ {
+ ERROR_PRINT("could not find free memory for plugin");
+ return nenERR_MAX_PLUGINS_REACHED;
+ }
+ strncpy(pstNewPluginConfig->acPluginFilename,pcSoFilename,nMAX_FILENAME_LENGTH);
+ enRetCode = this->enInitPlugin(pstNewPluginConfig,i32Interface);
+ if( enRetCode != nenOK )
+ {
+ return enRetCode;
+ }
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xPluginListMutex);
+ m_astPluginConfig.push_back(*pstNewPluginConfig);
+ m_u8PluginCounter++;
+ u8PluginId = m_u8PluginCounter;
+ }
+ return nenOK;
+}
+
+tenRetCodes CPluginExecutor::enRemovePlugin( const int32_t i32Interface, bool boLock )
+{
+ tenRetCodes enRetCode = nenOK;
+ if( boLock )
+ {
+ m_xPluginListMutex.lock();
+ }
+ tPluginIter it = findPluginByInterface(i32Interface);
+ if( it != m_astPluginConfig.end() )
+ {
+ tpstPluginConfig pstPlugin = &(*it);
+ this->enDeinitPlugin(pstPlugin);
+ if( boLock )
+ {
+ m_astPluginConfig.erase(it);
+ }
+ m_u8PluginCounter--;
+ }
+ if( boLock )
+ {
+ m_xPluginListMutex.unlock();
+ }
+ return enRetCode;
+}
+
+tenRetCodes CPluginExecutor::enLoadSoFile( const char* pcSoFilename, void** ppvSoHandle )
+{
+ char* pcError = NULL;
+ *ppvSoHandle = dlopen(pcSoFilename,RTLD_NOW|RTLD_GLOBAL|RTLD_DEEPBIND);
+ if( !(*ppvSoHandle) )
+ {
+ pcError = dlerror();
+ ERROR_PRINT("Could not open shared object %s: [%s]"
+ ,pcSoFilename,(pcError)?pcError:"dlopen gave no error");
+ return nenERR_SOFILE;
+ }
+ return nenOK;
+}
+
+void CPluginExecutor::vStop()
+{
+ DEBUG_PRINT("entry");
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xStopFlagMutex);
+ m_boDoStop = true;
+ }
+ m_xConnector.vStop();
+ DEBUG_PRINT("exit");
+}
+tenRetCodes CPluginExecutor::enLoadSymbol( const char* pcSymbolName, void* pvSoHandle, void** ppvHandle )
+{
+ char* pcError = NULL;
+ *ppvHandle = dlsym(pvSoHandle,pcSymbolName);
+ if( (pcError = dlerror()) != NULL)
+ {
+ ERROR_PRINT("Error finding symbol %s: [%s]",pcSymbolName,pcError);
+ return nenERR_SYMBOL;
+ }
+ return nenOK;
+}
+
+tenRetCodes CPluginExecutor::enInitPlugin( tpstPluginConfig& pstPluginConfig, const int32_t i32Interface )
+{
+ const char* pcPluginFactoryName = "pxCreatePlugin";
+ const char* pcPluginDestructionName = "vDestroyPlugin";
+ void* pvFunctionHandle = NULL;
+ tenRetCodes enRetCode;
+ enRetCode = this->enLoadSoFile(pstPluginConfig->acPluginFilename,
+ &(pstPluginConfig->pvPluginHandle));
+ if( enRetCode != nenOK )
+ {
+ return enRetCode;
+ }
+ enRetCode = this->enLoadSymbol(pcPluginFactoryName,
+ pstPluginConfig->pvPluginHandle,
+ &pvFunctionHandle);
+ if( enRetCode != nenOK )
+ {
+ return enRetCode;
+ }
+ pstPluginConfig->pfctPluginFactory = reinterpret_cast<tpfctCreatePlugin>(pvFunctionHandle);
+
+ enRetCode = this->enLoadSymbol(pcPluginDestructionName,
+ pstPluginConfig->pvPluginHandle,
+ &pvFunctionHandle);
+ if( enRetCode != nenOK )
+ {
+ return enRetCode;
+ }
+ pstPluginConfig->pfctPluginDestruction = reinterpret_cast<tpfctDestroyPlugin> (pvFunctionHandle);
+
+ pstPluginConfig->pxPlugin = pstPluginConfig->pfctPluginFactory(
+ reinterpret_cast<void*>(this),
+ reinterpret_cast<void*>(&m_xInterfaceManager),
+ i32Interface,
+ m_u8PluginCounter
+ );
+ if( pstPluginConfig->pxPlugin->boIsLogger() )
+ {
+ m_pxLogPlugin = pstPluginConfig->pxPlugin;
+ }
+ return nenOK;
+}
+
+void CPluginExecutor::vSendCanTxMessages()
+{
+ x2e::status_t enRes;
+ tCanTxMessageSet::iterator xTxMsgIt = m_xTxMsgList.begin();
+ int32_t i32TxInterface = 0;
+ for( ; xTxMsgIt != m_xTxMsgList.end(); ++xTxMsgIt )
+ {
+ tpstCanTxMessage pxCanTxMsg = (*xTxMsgIt).m_pstCanTxMsg;
+ i32TxInterface = (*xTxMsgIt).i32Interface;
+// DEBUG_PRINT("Sending CAN msg with ID %#x on interface %d"
+// ,pxCanTxMsg->u32CanId,i32TxInterface);
+ enRes = m_xInterfaceManager.enWriteCanMessage(
+ i32TxInterface,
+ pxCanTxMsg->u32CanId,
+ false,
+ false,
+ pxCanTxMsg->au8Data,
+ pxCanTxMsg->u8Dlc
+ );
+ if( enRes != x2e::OK)
+ {
+ ERROR_PRINT("Error sending msg 0x%X on Interface %d. Error: %d",
+ pxCanTxMsg->u32CanId, i32TxInterface, enRes);
+ enRes = m_xInterfaceManager.enDisableInterface(i32TxInterface);
+ enRes = m_xInterfaceManager.enEnableInterface(i32TxInterface);
+ if( enRes != x2e::OK )
+ {
+ break;
+ }
+ }
+ else
+ {
+ if( m_pxLogPlugin )
+ {
+ tstLogMessage stLogMessage;
+ m_xInterfaceManager.enGetTimestamp(&stLogMessage.u32TsHigh,&stLogMessage.u32TsLow);
+ stLogMessage.u32MsgId = pxCanTxMsg->u32CanId;
+ stLogMessage.i32Interface = i32TxInterface;
+ stLogMessage.u8Dir = static_cast<uint8_t>(::nenTx);
+ memcpy( (void*) stLogMessage.au8Data, (const void*) pxCanTxMsg->au8Data, pxCanTxMsg->u8Dlc );
+ m_pxLogPlugin->vLogMessage(stLogMessage);
+ }
+ }
+ }
+ m_xTxMsgList.clear();
+}
+
+void CPluginExecutor::vRun()
+{
+ static tstCanTxMsgWrapper astCanTxMessageWrappers[nMAX_CAN_TX_MESSAGES];
+
+ tPluginIter xPluginIter;
+ bool boDoStop = false;
+
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xStopFlagMutex);
+ boDoStop = m_boDoStop;
+ }
+
+ while( !m_boDoStop )
+ {
+ m_xInterfaceManager.enWait();
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xPluginListMutex);
+ for( xPluginIter = m_astPluginConfig.begin(); xPluginIter != m_astPluginConfig.end(); xPluginIter++ )
+ {
+ tpstPluginConfig pstActPlugin = &(*xPluginIter);
+ IPlugin* pxPlugin = pstActPlugin->pxPlugin;
+ if( !pxPlugin )
+ {
+ ERROR_PRINT("Plugin for file %s is NULL",pstActPlugin->acPluginFilename);
+ continue;
+ }
+ pxPlugin->vRun();
+ uint32_t u32NumOfCanTxMsg = pxPlugin->u32GetNumOfCanTxMessages();
+ int32_t i32TxInterface = pxPlugin->i32GetCanInterfaceHandle();
+ if( (i32TxInterface != 0) && (u32NumOfCanTxMsg > 0) )
+ {
+// DEBUG_PRINT("Scheduling CAN TX messages for plugin %s",pstActPlugin->acPluginFilename);
+ for( uint32_t u32CanTxMsgCount = 0; u32CanTxMsgCount < u32NumOfCanTxMsg; u32CanTxMsgCount++ )
+ {
+ if( m_xTxMsgList.size() >= nMAX_CAN_TX_MESSAGES )
+ {
+ DEBUG_PRINT("too much tx messages in plugin %s"
+ ,pstActPlugin->acPluginFilename);
+ vSendCanTxMessages();
+ }
+ tpstCanTxMessage pxCanTxMessage = pxPlugin->pxGetCanTxMessage(u32CanTxMsgCount);
+ tstCanTxMsgWrapper* pxCanMsgWrapper = &astCanTxMessageWrappers[m_xTxMsgList.size()];
+ pxCanMsgWrapper->i32Interface = i32TxInterface;
+ pxCanMsgWrapper->m_pstCanTxMsg = pxCanTxMessage;
+ pxCanTxMessage->u32MillisecondCounter++;
+ if( pxCanTxMessage->u32MillisecondCounter > pxCanTxMessage->u32TxCycleMilliseconds )
+ {
+ ERROR_PRINT("Missed TX cycle of %d msec for CAN message 0x%x"
+ ,pxCanTxMessage->u32MillisecondCounter,pxCanTxMessage->u32CanId);
+ }
+ if( pxCanTxMessage->u32MillisecondCounter >= pxCanTxMessage->u32TxCycleMilliseconds )
+ {
+ pxCanTxMessage->u32MillisecondCounter = 0;
+ m_xTxMsgList.insert(*pxCanMsgWrapper);
+ }
+ }
+ }
+ }
+ }
+ vSendCanTxMessages();
+ }
+ vDeinit();
+ DEBUG_PRINT("exit");
+}
+
+tenRetCodes CPluginExecutor::enDeinitPlugin(tpstPluginConfig& pstPluginConfig)
+{
+ tenRetCodes enRetCode = nenOK;
+ int32_t i32Res = 0;
+ if( pstPluginConfig->pxPlugin )
+ {
+ if( pstPluginConfig->pxPlugin->boIsLogger() )
+ {
+ m_pxLogPlugin = NULL;
+ }
+ pstPluginConfig->pfctPluginDestruction(pstPluginConfig->pxPlugin);
+ }
+ if( pstPluginConfig->pvPluginHandle )
+ {
+ i32Res = dlclose(pstPluginConfig->pvPluginHandle);
+ pstPluginConfig->pvPluginHandle = NULL;
+ }
+ return enRetCode;
+}
+
+tenRetCodes CPluginExecutor::enDeinitAllPlugins()
+{
+ tPluginIter xPluginIter;
+ tenRetCodes enRetCode = nenOK;
+ FILE* pxFp;
+ pxFp = fopen(nAUTOLOAD_FILENAME,"w");
+ {
+ boost::lock_guard<x2e::Mutex> lock(m_xPluginListMutex);
+ for( xPluginIter = m_astPluginConfig.begin(); xPluginIter != m_astPluginConfig.end(); xPluginIter++ )
+ {
+ tpstPluginConfig pstPluginconfig = &(*xPluginIter);
+ if( pstPluginconfig )
+ {
+ tstPluginConfig& stPluginconfig = *pstPluginconfig;
+ IPlugin* pxPlugin = stPluginconfig.pxPlugin;
+ if( pxPlugin )
+ {
+ bool boAutoload = pxPlugin->boAutoload();
+ int32_t i32Interface = pxPlugin->i32GetCanInterfaceHandle();
+ if(boAutoload)
+ {
+ const char* p = stPluginconfig.acPluginFilename;
+ char acLine[nMAX_LINE_LENGTH];
+ snprintf(acLine,nMAX_LINE_LENGTH,"%s%s%d\n",p,nSEPARATOR,i32Interface);
+ fputs(acLine,pxFp);
+ }
+ enRetCode = this->enRemovePlugin(i32Interface, false);
+ }
+ }
+ }
+ m_astPluginConfig.clear();
+ }
+ fclose(pxFp);
+ return enRetCode;
+}
+
+void CPluginExecutor::vGetInterfaces(char* pcResponse, uint32_t& u32Length)
+{
+ for( uint8_t u8IfCtr = 1; u8IfCtr < nNUMBER_OF_CAN_INTERFACES; u8IfCtr++ )
+ {
+ sprintf(&pcResponse[strlen(pcResponse)],"CAN %d\n",u8IfCtr);
+ }
+ u32Length = strlen(pcResponse);
+ return;
+}
+
+uint8_t CPluginExecutor::u8GetPluginCount()
+{
+ return m_u8PluginCounter;
+}
+
+void CPluginExecutor::vDeinit()
+{
+ m_xConnectorThread.join();
+ DEBUG_PRINT("Connector thread stopped");
+ enDeinitAllPlugins();
+ m_xInterfaceManager.vDeinit();
+}
+
+tenRetCodes CPluginExecutor::enAutoLoadPlugins()
+{
+ tenRetCodes enRetCode = nenOK;
+ char acActLine[nMAX_LINE_LENGTH];
+ int iFd = -1;
+ ssize_t xReadRes = -1;
+ int iCtr = 0;
+ memset(acActLine,0,nMAX_LINE_LENGTH);
+ iFd = open(nAUTOLOAD_FILENAME,O_RDONLY);
+ if( iFd < 0)
+ {
+ ERROR_PRINT("Error opening file %s: %d",nAUTOLOAD_FILENAME,errno);
+ }
+ while( ( xReadRes = read(iFd, (void*) &acActLine[iCtr], 1) ) > 0 )
+ {
+ if(acActLine[iCtr] == '\n')
+ {
+ char *pcFilename, *pcInterface;
+ int32_t i32Interface = -1;
+ uint8_t u8PluginId;
+ pcFilename = strtok(acActLine,nSEPARATOR);
+ pcInterface = strtok(NULL,nSEPARATOR);
+ if( (pcFilename != NULL) && (pcInterface != NULL) )
+ {
+ i32Interface = atoi(pcInterface);
+ enRetCode = enAddPlugin(pcFilename,i32Interface,u8PluginId);
+ if( enRetCode == nenOK )
+ {
+ DEBUG_PRINT("auto loaded plugin [%s] on interface [%d]",pcFilename,i32Interface);
+ }
+ else
+ {
+ ERROR_PRINT("error autoloading plugin [%s]: %d",pcFilename,enRetCode);
+ }
+ }
+ memset(acActLine,0,nMAX_LINE_LENGTH);
+ iCtr = 0;
+ }
+ else
+ {
+ iCtr++;
+ }
+ }
+ if( xReadRes == -1 )
+ {
+ ERROR_PRINT("Error reading file %s: %d",nAUTOLOAD_FILENAME,errno);
+ enRetCode = nenERR_SOFILE;
+ return enRetCode;
+ }
+ close(iFd);
+ return enRetCode;
+}
+
+tenRetCodes CPluginExecutor::enGetLog(const char* pcRequestFilename, char* pcResponseFilename, uint32_t& u32Length)
+{
+ tenRetCodes enRetCode = nenOK;
+ if( m_pxLogPlugin )
+ {
+ enRetCode = m_pxLogPlugin->enGetLog(pcRequestFilename,pcResponseFilename);
+ if( enRetCode != nenOK)
+ {
+ return enRetCode;
+ }
+ DEBUG_PRINT("logfile name: %s",pcResponseFilename);
+ u32Length = strlen(pcResponseFilename);
+ }
+ return enRetCode;
+}
+
+void CPluginExecutor::vStartPlugin(const int32_t i32Interface, const char* pcSoFilename)
+{
+ uint8_t u8PluginId;
+ tenRetCodes enRetVal = enAddPlugin(pcSoFilename,i32Interface,u8PluginId);
+ if( enRetVal == nenOK)
+ {
+ DEBUG_PRINT("Started plugin %d on interface %d from file %s"
+ ,u8PluginId,i32Interface,pcSoFilename);
+ }
+ else
+ {
+ ERROR_PRINT("Error starting plugin %s on interface %d: %d",
+ pcSoFilename,i32Interface,enRetVal);
+ }
+}
+
+void CPluginExecutor::vStopPlugin(int32_t i32Interface)
+{
+ enRemovePlugin(i32Interface,true);
+ DEBUG_PRINT("Stopped plugin on interface %d", i32Interface);
+}
+
+void CPluginExecutor::vChangeMsgData(const int32_t i32Interface, const uint32_t u32CanId, const uint8_t* pu8Data)
+{
+ tPluginIter xPluginIter;
+ boost::lock_guard<x2e::Mutex> lock(m_xPluginListMutex);
+ {
+ for( xPluginIter = m_astPluginConfig.begin(); xPluginIter != m_astPluginConfig.end(); xPluginIter++ )
+ {
+ tpstPluginConfig pstActPlugin = &(*xPluginIter);
+ if( !pstActPlugin )
+ {
+ continue;
+ }
+ IPlugin* pxPlugin = pstActPlugin->pxPlugin;
+ if( !pxPlugin )
+ {
+ continue;
+ }
+ if( pxPlugin->i32GetCanInterfaceHandle() != i32Interface )
+ {
+ continue;
+ }
+ uint32_t u32NumOfCanTxMsg = pxPlugin->u32GetNumOfCanTxMessages();
+ if( u32NumOfCanTxMsg > 0 )
+ {
+ for( uint32_t u32CanTxMsgCount = 0; u32CanTxMsgCount < u32NumOfCanTxMsg; u32CanTxMsgCount++ )
+ {
+ tpstCanTxMessage pxCanTxMessage = pxPlugin->pxGetCanTxMessage(u32CanTxMsgCount);
+ if( pxCanTxMessage->u32CanId == u32CanId )
+ {
+ memcpy( (void*)pxCanTxMessage->au8Data, pu8Data, pxCanTxMessage->u8Dlc );
+ return;
+ }
+ }
+ }
+ }
+ }
+}
+
+tenRetCodes CPluginExecutor::enEnumerateLogs(char* pcLogfiles, uint32_t& u32Length)
+{
+ tenRetCodes enRes = nenOK;
+ struct dirent* pstDirEnt;
+ const char* pcLogPath = "../data/";
+ const char* pcLogFileExtension = ".log";
+ const char* pcFormat="%s%s\n";
+ DIR* pDir = opendir(pcLogPath);
+ uint32_t u32StrLen = 0;
+ uint32_t u32ActFilenameLen = 0;
+
+ while( (pstDirEnt=readdir(pDir)) != NULL )
+ {
+ u32ActFilenameLen = strlen(pcLogPath) + strlen(pstDirEnt->d_name);
+ u32StrLen = strlen(pcLogfiles) + u32ActFilenameLen + 1;
+ if( strstr(pstDirEnt->d_name,pcLogFileExtension) != NULL )
+ {
+ if( u32StrLen < u32Length )
+ {
+ sprintf(&pcLogfiles[strlen(pcLogfiles)],pcFormat,pcLogPath,pstDirEnt->d_name);
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ closedir(pDir);
+ u32Length = strlen(pcLogfiles);
+ return enRes;
+}
+
+void CPluginExecutor::vUploadLogMessage(const tstLogMessage& stLogMsg)
+{
+ m_xConnector.vUploadLogMessage(stLogMsg);
+}
+
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.h b/Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.h
new file mode 100644
index 0000000..1fd5790
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/CPluginExecutor.h
@@ -0,0 +1,176 @@
+/*!
+ * \file CPluginExecutor.h
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Header of CPluginExecutor
+ */
+#ifndef CPLUGINEXECUTOR_H_
+#define CPLUGINEXECUTOR_H_
+
+#include <boost/thread.hpp>
+#include <x2e/sys/Mutex.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/list.hpp>
+#include "TcpServer.h"
+#include "IPluginExecutor.h"
+#include "XorayaConnector.h"
+#include "CInterfaceManager.h"
+#include "plugin_api.h"
+
+/// maximum number of can tx messages in all plugins
+#define nMAX_CAN_TX_MESSAGES 1024
+
+/// maximum length of a shared object file name
+#define nMAX_FILENAME_LENGTH 256
+#define nMAX_LINE_LENGTH nMAX_FILENAME_LENGTH+2
+
+/// structure for target plugins
+struct tstPluginConfig : public boost::intrusive::list_base_hook<>
+{
+ char acPluginFilename[nMAX_FILENAME_LENGTH]; //!< filename of the shared object
+ void* pvPluginHandle; //!< Handle of the plugin
+ tpfctCreatePlugin pfctPluginFactory; //!< function pointer for the factory of this plugin
+ tpfctDestroyPlugin pfctPluginDestruction; //!< function pointer for the destruction function of this plugin
+ IPlugin* pxPlugin; //!< interface pointer for the plugin implementation
+};
+/// type definition for target plugin pointer
+typedef tstPluginConfig* tpstPluginConfig;
+
+/// type definition for target plugin container
+typedef boost::intrusive::list<tstPluginConfig> tPluginList;
+
+/// type definition for target plugin container iterator
+typedef tPluginList::iterator tPluginIter;
+
+/// wrapper for storing CAN-Tx-Messages in an intrusive set
+struct tstCanTxMsgWrapper : public boost::intrusive::set_base_hook<>
+{
+ tpstCanTxMessage m_pstCanTxMsg; //!< pointer to the CAN TX message
+ int32_t i32Interface; //!< interface for sending the message
+
+ /// operator less, needed for sorting messages by id in the intrusive set
+ friend bool operator< (const tstCanTxMsgWrapper& a, const tstCanTxMsgWrapper& b)
+ {
+ return a.m_pstCanTxMsg->u32CanId < b.m_pstCanTxMsg->u32CanId;
+ }
+};
+/// type definition for CAN TX message container
+typedef boost::intrusive::multiset<tstCanTxMsgWrapper> tCanTxMessageSet;
+
+/// target main application
+class CPluginExecutor : IPluginExecutor {
+public:
+ CPluginExecutor();
+ virtual ~CPluginExecutor();
+ /// add a plugin
+ /// \param[in] pcSoFilename filename of the shared object to load as plugin
+ /// \param[in] i32Interface interface for sending messages in the plugin
+ /// \param[out] u8PluginId id of the plugin
+ /// \return error code
+ tenRetCodes enAddPlugin( const char* pcSoFilename, const int32_t i32Interface, uint8_t& u8PluginId );
+
+ /// remove a plugin
+ /// \param[in] i32Interface interface from which to remove the according plugin
+ /// \param[in] boLock lock the plugin container during removal, default yes
+ /// \return error code
+ tenRetCodes enRemovePlugin( const int32_t i32Interface, bool boLock = true );
+
+ /// cyclic function, this is the RT-prio task function
+ void vRun();
+
+ /// deinitialize all plugins
+ /// \return error code
+ tenRetCodes enDeinitAllPlugins();
+
+ /// stop the application
+ void vStop();
+
+ /// deinitialize the application
+ void vDeinit();
+
+ /// get the number of loaded plugins
+ /// \return number loaded plugins
+ uint8_t u8GetPluginCount();
+
+ /// load all plugins with autoload flag active
+ /// \return error code
+ tenRetCodes enAutoLoadPlugins();
+
+ /// get a specified log file, rotates log file if current log is requested
+ /// \param[in] pcRequestFilename requested file
+ /// \param[out] pcResponseFilename name of the file that contains the requested log
+ /// \param[out] u32Length Length of pcResponseFilename
+ /// \return error code
+ tenRetCodes enGetLog(const char* pcRequestFilename, char* pcResponseFilename, uint32_t& u32Length);
+
+ /// get names of available logfiles
+ /// \param[out] pcLogfiles available logfiles, separate by newline character
+ /// \param[out] u32Length Length of pcLogfiles
+ /// \return error code
+ tenRetCodes enEnumerateLogs(char* pcLogfiles, uint32_t& u32Length);
+
+ /// get hardware interfaces
+ /// \param[out] pcResponse interfaces, separate by newline character
+ /// \param[out] u32Length Length of pcResponse
+ /// \return error code
+ void vGetInterfaces(char* pcResponse, uint32_t& u32Length);
+
+ /// start a plugin on given interface
+ /// \param[in] i32Interface the interface
+ /// \param[in] pcSoFilename file name of the shared object
+ void vStartPlugin(const int32_t i32Interface, const char* pcSoFilename);
+
+ /// stop the plugin running on given interface
+ /// \param[in] i32Interface the interface
+ void vStopPlugin(const int32_t i32Interface);
+
+ /// change data of a can message
+ /// \param[in] i32Interface the interface of the message
+ /// \param[in] u32CanId identifier of the message
+ /// \param[in] pu8Data pointer to new message data
+ void vChangeMsgData(const int32_t i32Interface, const uint32_t u32CanId, const uint8_t* pu8Data);
+
+ virtual void vUploadLogMessage(const tstLogMessage& stLogMsg);
+private:
+ bool m_boDoStop;
+ CInterfaceManager m_xInterfaceManager;
+ tPluginList m_astPluginConfig;
+ uint8_t m_u8PluginCounter;
+ CTcpServer m_xTcpServer;
+ CXorayaConnector m_xConnector;
+ boost::thread m_xConnectorThread;
+ tCanTxMessageSet m_xTxMsgList;
+ x2e::Mutex m_xPluginListMutex;
+ x2e::Mutex m_xStopFlagMutex;
+ IPlugin* m_pxLogPlugin;
+
+ tenRetCodes enLoadSoFile( const char* pcSoFilename, void** ppvSoHandle );
+ tenRetCodes enLoadSymbol( const char* pcSymbolName, void* pvSoHandle, void** ppvHandle );
+ tenRetCodes enInitPlugin( tpstPluginConfig& pstPluginConfig, const int32_t i32Interface);
+ tenRetCodes enDeinitPlugin(tpstPluginConfig& pstPluginConfig);
+ void vSendCanTxMessages();
+
+ tPluginIter findPluginByInterface(const int32_t i32Interface)
+ {
+ tPluginIter it = m_astPluginConfig.begin();
+ for(; it!= m_astPluginConfig.end(); ++it)
+ {
+ tpstPluginConfig pstPluginConfig = &(*it);
+ if( pstPluginConfig && pstPluginConfig->pvPluginHandle )
+ {
+ IPlugin* pxPlugin = pstPluginConfig->pxPlugin;
+ if( pxPlugin )
+ {
+ if( pxPlugin->i32GetCanInterfaceHandle() == i32Interface )
+ {
+ DEBUG_PRINT("found memory for plugin on interface %d",i32Interface);
+ return it;
+ }
+ }
+ }
+ }
+ return it;
+ }
+};
+
+#endif /* CPLUGINEXECUTOR_H_ */
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.cpp b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.cpp
new file mode 100644
index 0000000..0439d23
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.cpp
@@ -0,0 +1,378 @@
+/*!
+ * \file TcpConnection.cpp
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Implementation of CTcpConnection
+ */
+#include <boost/bind.hpp>
+#include <string.h>
+#include <new>
+#include <NetworkMessages.h>
+#include "TcpConnection.h"
+#include "CPluginExecutor.h"
+#include "protocol.h"
+#include "global.h"
+
+/// static memory for connection objects
+static char g_acConnections[nMAX_CONNECTIONS * sizeof(CTcpConnection)];
+
+/// global connection container
+tConnectionSet g_astActiveConnections;
+
+/*! constructor
+* \param[in] io_service reference to the io_service object
+* \param[in] pxExecutor pointer to the main application
+* \param[in] u8ConNum number of the connection
+*/
+CTcpConnection::CTcpConnection
+(boost::asio::io_service& io_service , CPluginExecutor* pxExecutor , uint8_t u8ConNum)
+:m_xInStream(m_xRxBuff.elems,nNETWORK_BUFFSIZE)
+,m_xOutStream(m_xTxBuff.elems,nNETWORK_BUFFSIZE)
+,m_xSocket(io_service),m_pxExecutor(pxExecutor)
+,m_u8ConNum(u8ConNum),m_boActive(false),m_xUploadBuffer(nUPLOAD_BUFFERSIZE)
+,m_i32UploadBufferUnread(0),m_boUploadActive(false)
+{
+ DEBUG_PRINT("entry %d",m_u8ConNum);
+ DEBUG_PRINT("exit %d",m_u8ConNum);
+}
+
+/// destructor
+CTcpConnection::~CTcpConnection(void)
+{
+ DEBUG_PRINT("entry %d",m_u8ConNum);
+ DEBUG_PRINT("exit %d",m_u8ConNum);
+}
+
+/// static factory method for connections
+/// \param[in] xIoService io_service object
+/// \param[in] pxExecutor pointer to the main application
+/// \return pointer to connection object or NULL pointer
+/// \warning check returned pointer
+CTcpConnection::tConnectionPtr CTcpConnection::pxCreate(boost::asio::io_service& xIoService, CPluginExecutor* pxExecutor)
+{
+ DEBUG_PRINT("created new tcp connection");
+ uint8_t u8ConCount = 0;
+ char* pcFreeMemorySlot = &g_acConnections[ u8ConCount * sizeof(CTcpConnection) ];
+ tConIter xConIter(g_astActiveConnections.begin());
+ tConnectionPtr pstNewConnection = NULL;
+
+ // find free memory for a new connection
+ for(; xConIter != g_astActiveConnections.end(); ++xConIter)
+ {
+ if( reinterpret_cast<char*>( &(*xConIter) ) != pcFreeMemorySlot )
+ {
+ break;
+ }
+ u8ConCount++;
+ pcFreeMemorySlot = &g_acConnections[ u8ConCount * sizeof(CTcpConnection) ];
+ }
+
+ // if no memory is available for a new connection
+ if( u8ConCount >= nMAX_CONNECTIONS)
+ {
+ // return null pointer
+ return pstNewConnection;
+ }
+ DEBUG_PRINT("using connection %d at %#x",u8ConCount,(int) pcFreeMemorySlot);
+
+ // place a new connection object at the found address
+ pstNewConnection = new(pcFreeMemorySlot) CTcpConnection(xIoService,pxExecutor,u8ConCount);
+
+ // place the new connection in the container
+ g_astActiveConnections.insert(*pstNewConnection);
+
+ // return a pointer to the new connection object
+ return pstNewConnection;
+}
+
+/// return network socket
+boost::asio::ip::tcp::socket& CTcpConnection::xGetSocket()
+{
+ return m_xSocket;
+}
+
+/// async wait for a new request from the client
+void CTcpConnection::vWaitForClientRequest()
+{
+ // initialize receive buffer
+ memset(m_xRxBuff.elems,0,nNETWORK_BUFFSIZE);
+ // reset instream
+ m_xInStream.vReset();
+ // async wait, register read handler
+ boost::asio::async_read(
+ m_xSocket,
+ boost::asio::buffer(m_xRxBuff),
+ boost::asio::transfer_at_least( sizeof(tstNetworkMessageHeader) ),
+ boost::bind(&CTcpConnection::vReadHandler, this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+}
+
+/// handle data written event
+/// \param[in] err error code of the transmission
+/// \param[in] bytesTransferred number of bytes transferred
+void CTcpConnection::vWriteHandler(const boost::system::error_code& err, size_t bytesTransferred)
+{
+ if(!err)
+ {
+// DEBUG_PRINT("Transferred %d bytes",bytesTransferred);
+ // initialize transmit buffer
+ memset(m_xTxBuff.elems,0,nNETWORK_BUFFSIZE);
+ //reset outstream
+ m_xOutStream.vReset();
+ vUploadNextMessage();
+ }
+ else
+ {
+ DEBUG_PRINT("error: [%s]",err.message().c_str());
+ DEBUG_PRINT("removing from connection list %d",m_u8ConNum);
+ // in case of an error, remove this object from the container
+ g_astActiveConnections.erase(*this);
+ vSetActive(false);
+ }
+}
+
+/// handle data read event
+/// \param[in] err error code of the transmission
+/// \param[in] bytesTransferred number of bytes transferred
+void CTcpConnection::vReadHandler(const boost::system::error_code& err, size_t bytesTransferred)
+{
+ if(!err)
+ {
+ bool boSendResponse = true;
+ uint32_t u32TxMsgLen = sizeof(tstNetworkMessageHeader);
+ uint32_t u32Tmp;
+ const CNetworkDatacontainer::tstRxNetworkMessageMsg& stRxMsg
+ = *(reinterpret_cast<CNetworkDatacontainer::tstRxNetworkMessageMsg*>(m_xNetworkDatacontainer.pvGetVarPtr(nenNumberOfNetworkMessageTypes)));
+ const CNetworkDatacontainer::tstReqStartPlugin& stReqStartPlugin
+ = *(reinterpret_cast<CNetworkDatacontainer::tstReqStartPlugin*>(m_xNetworkDatacontainer.pvGetVarPtr(nenReqStartPlugin)));
+ const CNetworkDatacontainer::tstReqStopPlugin& stReqStopPlugin
+ = *(reinterpret_cast<CNetworkDatacontainer::tstReqStopPlugin*>(m_xNetworkDatacontainer.pvGetVarPtr(nenReqStopPlugin)));
+ const CNetworkDatacontainer::tstReqImportLog& stReqImportLog
+ = *(reinterpret_cast<CNetworkDatacontainer::tstReqImportLog*>(m_xNetworkDatacontainer.pvGetVarPtr(nenReqImportLog)));
+ CNetworkDatacontainer::tstRespImportLog& stRespImportLog
+ = *(reinterpret_cast<CNetworkDatacontainer::tstRespImportLog*>(m_xNetworkDatacontainer.pvGetVarPtr(nenRespImportLog)));
+ const CNetworkDatacontainer::tstReqChangeMsgData& stReqChangeMsgData
+ = *(reinterpret_cast<CNetworkDatacontainer::tstReqChangeMsgData*>(m_xNetworkDatacontainer.pvGetVarPtr(nenReqChangeMsgData)));
+ CNetworkDatacontainer::tstRespEnumerateLogs& stRespEnumerateLogs
+ = *(reinterpret_cast<CNetworkDatacontainer::tstRespEnumerateLogs*>(m_xNetworkDatacontainer.pvGetVarPtr(nenRespEnumerateLogs)));
+ CNetworkDatacontainer::tstRespEnumerateInterfaces& stRespEnumerateInterfaces
+ = *(reinterpret_cast<CNetworkDatacontainer::tstRespEnumerateInterfaces*>(m_xNetworkDatacontainer.pvGetVarPtr(nenRespEnumerateInterfaces)));
+
+ do
+ {
+ uint32_t u32Offset = m_xInStream.u32GetByteCount();
+ sxRxMsgHeader.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( !m_xInStream.boIsOK() )
+ {
+ tenStreamError enError;
+ m_xInStream.vGetError(enError);
+ ERROR_PRINT("network instream has error %d",enError);
+ break;
+ }
+ m_xInStream.vSetPosition(u32Offset);
+ // DEBUG_PRINT("Received %u bytes", bytesTransferred);
+
+ switch( stRxMsg.stHeader.enMessageType )
+ {
+ case nenReqEnumerateInterfaces:
+ DEBUG_PRINT("Received command nenReqEnumerateInterfaces");
+ u32Tmp = nNETWORK_DATALENGTH;
+ sxReqEnumerateInterfacesMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ memset(stRespEnumerateInterfaces.acInterfaces,0,nNETWORK_DATALENGTH);
+ m_pxExecutor->vGetInterfaces(
+ stRespEnumerateInterfaces.acInterfaces
+ ,u32Tmp);
+ u32TxMsgLen += u32Tmp;
+ sxRespEnumerateInterfacesMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenReqShutdown:
+ DEBUG_PRINT("Received command nenReqShutdown");
+ sxReqShutdownMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ m_pxExecutor->vStop();
+ sxRespShutdownMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenReqStartPlugin:
+ DEBUG_PRINT("Received command nenReqStartPlugin");
+ sxReqStartPluginMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ m_pxExecutor->vStartPlugin(stReqStartPlugin.i32Interface
+ ,stReqStartPlugin.acFilename);
+ sxRespStartPluginMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenReqStopPlugin:
+ DEBUG_PRINT("Received command nenReqStopPlugin");
+ sxReqStopPluginMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ m_pxExecutor->vStopPlugin(stReqStopPlugin.i32Interface);
+ sxRespStopPluginMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenReqImportLog:
+ DEBUG_PRINT("Received command nenReqImportLog");
+ // number of data bytes in transmit buffer available for string
+ u32Tmp = nNETWORK_DATALENGTH;
+ sxReqImportLogMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ memset(stRespImportLog.acFilename,0,nNETWORK_DATALENGTH);
+ m_pxExecutor->enGetLog(
+ stReqImportLog.acFilename
+ ,stRespImportLog.acFilename
+ ,u32Tmp);
+ u32TxMsgLen += u32Tmp;
+ sxRespImportLogMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenReqChangeMsgData:
+ sxReqChangeMsgDataMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ m_pxExecutor->vChangeMsgData(stReqChangeMsgData.i32Interface
+ ,stReqChangeMsgData.u32CanMsgId
+ ,stReqChangeMsgData.au8Data);
+ sxRespChangeMsgDataMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenReqEnumerateLogs:
+ DEBUG_PRINT("Received command nenReqEnumerateLogs");
+ sxReqEnumerateLogsMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ // number of data bytes in transmit buffer available for string
+ u32Tmp = nNETWORK_DATALENGTH;
+ memset(stRespEnumerateLogs.acFilenames,0,nNETWORK_DATALENGTH);
+ m_pxExecutor->enEnumerateLogs(stRespEnumerateLogs.acFilenames,u32Tmp);
+ u32TxMsgLen += u32Tmp;
+ sxRespEnumarateLogsMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ case nenRespUploadLogMsg:
+// DEBUG_PRINT("Received nenRespUploadLog");
+ sxRespUploadLogMsgMessage.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ vUploadNextMessage();
+ boSendResponse = false;
+ }
+ break;
+ default:
+ DEBUG_PRINT("Received unknown message type");
+ sxRxMsgHeader.vRead(m_xNetworkDatacontainer,m_xInStream);
+ if( m_xInStream.boIsOK() )
+ {
+ sxRespUnknownReqMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ }
+ break;
+ }
+ if( !m_xInStream.boIsOK() )
+ {
+ tenStreamError enError;
+ m_xInStream.vGetError(enError);
+ ERROR_PRINT("network instream has error %d",enError);
+ }
+ if( boSendResponse )
+ {
+ if( m_xOutStream.boIsOK() )
+ {
+ boost::asio::async_write(
+ m_xSocket,
+ boost::asio::buffer(m_xTxBuff,m_xOutStream.u32GetByteCount()),
+ boost::bind(
+ &CTcpConnection::vWriteHandler,
+ this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+ }
+ else
+ {
+ tenStreamError enError;
+ m_xOutStream.vGetError(enError);
+ ERROR_PRINT("network outstream has error %d",enError);
+ m_xOutStream.vReset();
+ }
+ }
+ } while ( m_xInStream.u32GetByteCount() < bytesTransferred );
+ vWaitForClientRequest();
+ }
+ else
+ {
+ ERROR_PRINT("error: [%s]",err.message().c_str());
+ DEBUG_PRINT("removing from connection list %d",m_u8ConNum);
+ // in case of an error, remove this object from the container
+ vSetActive(false);
+ g_astActiveConnections.erase(*this);
+ }
+}
+
+/*!
+ * \brief send the next message in the buffer over the network
+ */
+void CTcpConnection::vUploadNextMessage()
+{
+ boost::lock_guard<x2e::Mutex> lock(m_xUploadBufferMutex);
+ if( m_boUploadActive )
+ {
+ CNetworkDatacontainer::tstReqUploadLogMsg& stReqUploadLogMsg
+ = *(reinterpret_cast<CNetworkDatacontainer::tstReqUploadLogMsg*>(m_xNetworkDatacontainer.pvGetVarPtr(nenReqUploadLogMsg)));
+ stReqUploadLogMsg.stLogMessage = m_xUploadBuffer[--m_i32UploadBufferUnread];
+ if( m_i32UploadBufferUnread == 0 )
+ {
+ m_boUploadActive = false;
+ }
+// DEBUG_PRINT("%u %x %d",stLogMsg.u32MsgId,stLogMsg.au8Data[0],m_i32UploadBufferUnread);
+
+ sxReqUploadLogMsgMessage.vWrite(m_xNetworkDatacontainer,m_xOutStream);
+ if( m_xOutStream.boIsOK() )
+ {
+ boost::asio::async_write(
+ m_xSocket,
+ boost::asio::buffer(m_xTxBuff,m_xOutStream.u32GetByteCount()),
+ boost::bind(
+ &CTcpConnection::vWriteHandler,
+ this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+ }
+ else
+ {
+ tenStreamError enError;
+ m_xOutStream.vGetError(enError);
+ ERROR_PRINT("network outstream has error %d",enError);
+ m_xOutStream.vReset();
+ }
+ }
+}
+/**
+ * \brief adds a logged message to the upload buffer and triggers start of upload
+ * \param[in] stLogMsg message to upload
+ * \warning should run in network task
+ */
+void CTcpConnection::vUploadLogMessage(const tstLogMessage& stLogMsg)
+{
+// DEBUG_PRINT("entry");
+ boost::lock_guard<x2e::Mutex> lock(m_xUploadBufferMutex);
+ m_xUploadBuffer.push_front(stLogMsg);
+ ++m_i32UploadBufferUnread;
+ if( !m_boUploadActive )
+ {
+ m_boUploadActive = true;
+ vUploadNextMessage();
+ }
+// DEBUG_PRINT("exit");
+}
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.h b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.h
new file mode 100644
index 0000000..731cd98
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpConnection.h
@@ -0,0 +1,101 @@
+/*!
+ * \file TcpConnection.h
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Header of CTcpConnection
+ */
+#ifndef CTCPCONNECTION_H_
+#define CTCPCONNECTION_H_
+
+#include <boost/asio.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/circular_buffer.hpp>
+#include <x2e/sys/Mutex.hpp>
+#include <CNetworkStream.h>
+#include <NetworkTypes.h>
+#include "protocol.h"
+
+/// maximum number of network connections
+#define nMAX_CONNECTIONS (16)
+
+/// size of buffer for logged message to upload over network
+#define nUPLOAD_BUFFERSIZE (16)
+
+/// forward declaration of main application type
+class CPluginExecutor;
+
+/// type definition for buffer of logged messages to upload
+typedef boost::circular_buffer<tstLogMessage> tUploadBuffer;
+
+/// network communication
+class CTcpConnection :
+ public boost::intrusive::set_base_hook<>
+{
+public:
+ /// type definition for object pointer
+ typedef CTcpConnection* tConnectionPtr;
+
+ static tConnectionPtr pxCreate(boost::asio::io_service& xIoService, CPluginExecutor* pxExecutor);
+ void vUploadLogMessage(const tstLogMessage& stLogMsg);
+
+ boost::asio::ip::tcp::socket& xGetSocket();
+ void vWaitForClientRequest();
+ /*!
+ * \brief set the activation state of tcp connection object
+ * \param[in] boActive activation state
+ */
+ void vSetActive(bool boActive)
+ {
+ m_boActive = boActive;
+ }
+ /*!
+ * \brief get the activation state of a tcp sonnection
+ * \return TRUE if connection is active, FALSE if not.
+ */
+ bool boIsActive()
+ {
+ return m_boActive;
+ }
+
+ /// operator less for connection objects, needed for ordering in the container
+ friend bool operator<(const CTcpConnection& a, const CTcpConnection& b)
+ {
+ return &a < &b;
+ }
+
+ /// destructor
+ ~CTcpConnection(void);
+
+private:
+ tNetworkBuffer m_xRxBuff; //!< request buffer
+ tNetworkBuffer m_xTxBuff; //!< response buffer
+ CNetworkInStream m_xInStream; //!< instream for receive buffer
+ CNetworkOutStream m_xOutStream; //!< outstream for transmit buffer
+ CNetworkDatacontainer m_xNetworkDatacontainer; //!< datacontainer for data from and to network
+ boost::asio::ip::tcp::socket m_xSocket; //!< socket of this connection
+ CPluginExecutor* m_pxExecutor; //!< pointer to main application
+ uint8_t m_u8ConNum; //!< number of this connection
+ bool m_boActive; //!< activation state of this object
+ tUploadBuffer m_xUploadBuffer; //!< buffer for logged messages, that should be uploaded over this conenction
+ x2e::Mutex m_xUploadBufferMutex; //!< mutex to protect upload buffer from concurrent access
+ int32_t m_i32UploadBufferUnread; //!< number of elements in upload buffer
+ bool m_boUploadActive; //!< is an upload of logged messages active yet
+
+ /// constructor
+ CTcpConnection(boost::asio::io_service& io_service, CPluginExecutor* pxExecutor, uint8_t u8ConNum);
+ void vWriteHandler(const boost::system::error_code& err, size_t bytesTransferred);
+ void vReadHandler(const boost::system::error_code& err, size_t bytesTransferred);
+
+ void vUploadNextMessage();
+};
+
+/// type definition for connection container
+typedef boost::intrusive::set<CTcpConnection> tConnectionSet;
+
+/// type definition for connection container iterator
+typedef boost::intrusive::set<CTcpConnection>::iterator tConIter;
+
+/// global connection container
+extern tConnectionSet g_astActiveConnections;
+
+#endif /*CTCPCONNECTION_H_*/
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.cpp b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.cpp
new file mode 100644
index 0000000..3ba91fd
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.cpp
@@ -0,0 +1,90 @@
+/*!
+ * \file TcpServer.cpp
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Implementation of CTcpServer
+ */
+#include <boost/bind.hpp>
+#include "CPluginExecutor.h"
+#include "global.h"
+#include "TcpServer.h"
+
+CTcpServer::CTcpServer(CPluginExecutor* pxExecutor
+ ,boost::asio::io_service& xIoService
+ ,int32_t i32Port)
+:m_xAcceptor(
+ xIoService,
+ boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(),i32Port)
+ )
+ ,m_pxExecutor(pxExecutor)
+ ,m_xIoService(xIoService)
+{
+ DEBUG_PRINT("entry");
+ vStartAccept();
+ DEBUG_PRINT("exit");
+}
+
+CTcpServer::~CTcpServer(void)
+{
+ DEBUG_PRINT("entry");
+ vStop();
+ DEBUG_PRINT("exit");
+}
+
+void CTcpServer::vStartAccept()
+{
+ CTcpConnection::tConnectionPtr pNewCon
+ = CTcpConnection::pxCreate(xGetIoService(),m_pxExecutor);
+ if(pNewCon)
+ {
+ DEBUG_PRINT("new accept");
+ }
+ else
+ {
+ ERROR_PRINT("could not get new connection object");
+ return;
+ }
+
+ m_xAcceptor.async_accept(pNewCon->xGetSocket(),
+ boost::bind(
+ &CTcpServer::vAcceptHandler,
+ this,
+ pNewCon,
+ boost::asio::placeholders::error
+ )
+ );
+}
+
+void CTcpServer::vAcceptHandler(CTcpConnection::tConnectionPtr pNewCon, const boost::system::error_code& error)
+{
+ if(!error)
+ {
+ pNewCon->vSetActive(true);
+ pNewCon->vWaitForClientRequest();
+ vStartAccept();
+ }
+}
+void CTcpServer::vStop()
+{
+ DEBUG_PRINT("entry");
+ xGetIoService().stop();
+ DEBUG_PRINT("exit");
+}
+
+void CTcpServer::vUploadLogMessage(const tstLogMessage& stLogMsg)
+{
+// DEBUG_PRINT("entry");
+
+ tConIter xConIter(g_astActiveConnections.begin());
+
+ // find free memory for a new connection
+ for(; xConIter != g_astActiveConnections.end(); ++xConIter)
+ {
+ CTcpConnection::tConnectionPtr pxCon = &(*xConIter);
+ if(pxCon->boIsActive())
+ {
+ xGetIoService().post(boost::bind(&CTcpConnection::vUploadLogMessage, pxCon, stLogMsg));
+ }
+ }
+// DEBUG_PRINT("exit");
+}
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h
new file mode 100644
index 0000000..d62a480
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/TcpServer.h
@@ -0,0 +1,48 @@
+/*!
+ * \file TcpServer.h
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Header of CTcpServer
+ */
+#ifndef CTCPSERVER_H_
+#define CTCPSERVER_H_
+
+#include <boost/asio.hpp>
+#include "TcpConnection.h"
+
+class CPluginExecutor;
+
+/// tcp server on target
+class CTcpServer
+{
+public:
+ /// constructor
+ /// \param[in] pxExecutor pointer to main application
+ /// \param[in] io_service reference to io_service
+ /// \param[in] port TCP port to listen on
+ CTcpServer(CPluginExecutor* pxExecutor,boost::asio::io_service& io_service, int32_t port);
+
+ /// destructor
+ ~CTcpServer(void);
+
+ /// handle accept on a connection
+ /// \param[in] pNewCon Pointer to new connection object
+ /// \param[in] error error code on the connection
+ void vAcceptHandler(CTcpConnection::tConnectionPtr pNewCon, const boost::system::error_code& error);
+
+ /// stop the server
+ void vStop();
+
+ /// get the io_service
+ boost::asio::io_service& xGetIoService()
+ {
+ return m_xIoService;
+ }
+ void vUploadLogMessage(const tstLogMessage& stLogMsg);
+private:
+ boost::asio::ip::tcp::acceptor m_xAcceptor;
+ CPluginExecutor* m_pxExecutor;
+ boost::asio::io_service& m_xIoService;
+ void vStartAccept();
+};
+#endif /*CTCPSERVER_H_*/
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.cpp b/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.cpp
new file mode 100644
index 0000000..522ba1d
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.cpp
@@ -0,0 +1,62 @@
+/*!
+ * \file XorayaConnector.cpp
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Implementation of CXorayaConnector
+ */
+
+#include <exception>
+#include <boost/thread.hpp>
+#include <boost/asio.hpp>
+#include "TcpServer.h"
+#include "protocol.h"
+#include "XorayaConnector.h"
+#include "CPluginExecutor.h"
+#include "global.h"
+
+boost::asio::io_service g_xIoService;
+
+CXorayaConnector::CXorayaConnector(const CXorayaConnector& other)
+:m_pxExecutor(other.m_pxExecutor),m_xTcpServer(other.m_xTcpServer)
+{
+ DEBUG_PRINT("entry");
+ DEBUG_PRINT("exit");
+}
+
+CXorayaConnector::CXorayaConnector(CPluginExecutor* pxExecutor,CTcpServer& xTcpServer)
+:m_pxExecutor(pxExecutor),m_xTcpServer(xTcpServer)
+{
+ DEBUG_PRINT("entry");
+ DEBUG_PRINT("exit");
+}
+
+CXorayaConnector::~CXorayaConnector(void)
+{
+ DEBUG_PRINT("entry");
+ DEBUG_PRINT("exit");
+}
+
+void CXorayaConnector::operator()()
+{
+ try
+ {
+ g_xIoService.run();
+ DEBUG_PRINT(" io service returned ");
+ }
+ catch(std::exception& e)
+ {
+ ERROR_PRINT("%s",e.what());
+ }
+ return;
+}
+void CXorayaConnector::vStop()
+{
+ g_xIoService.stop();
+}
+void CXorayaConnector::vUploadLogMessage(const tstLogMessage& stLogMsg)
+{
+// DEBUG_PRINT("entry");
+ m_xTcpServer.vUploadLogMessage(stLogMsg);
+// DEBUG_PRINT("exit");
+}
+
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.h b/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.h
new file mode 100644
index 0000000..b0ac99f
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.h
@@ -0,0 +1,51 @@
+/*!
+ * \file XorayaConnector.h
+ * \author S. Eisenhauer
+ * \date 27.10.2011
+ * \brief Header of CXorayaConnector
+ */
+#ifndef XORAYACONNECTOR_H_
+#define XORAYACONNECTOR_H_
+
+#include <boost/asio.hpp>
+#include "TcpServer.h"
+
+class CPluginExecutor;
+
+extern boost::asio::io_service g_xIoService;
+
+/// network adaptor on target
+class CXorayaConnector
+{
+public:
+ /// constructor
+ /// \param[in] pxExecutor pointer to the main application
+ /// \param[in] xTcpServer reference to the tcp server object to use
+ CXorayaConnector(CPluginExecutor* pxExecutor, CTcpServer& xTcpServer);
+ /*!
+ * \brief copy constructor
+ * \param[in] other reference to other object to construct copy from
+ */
+ CXorayaConnector(const CXorayaConnector& other);
+ /// destructor
+ virtual ~CXorayaConnector(void);
+
+ /// function of the network task. Async IO runs in this thread
+ void operator()();
+
+ /// stop network task
+ void vStop();
+
+ /*!
+ * \brief upload a logged message to CanEasy
+ * \param[in] stLogMsg the logged message to upload
+ */
+ void vUploadLogMessage(const tstLogMessage& stLogMsg);
+
+private:
+ CPluginExecutor* m_pxExecutor;
+ CTcpServer& m_xTcpServer;
+
+};
+
+#endif /* XORAYACONNECTOR_H_ */
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/doc/Doxyfile b/Master/Masterarbeit/src/XorayaPluginExecutor/doc/Doxyfile
new file mode 100644
index 0000000..393fa53
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/doc/Doxyfile
@@ -0,0 +1,1814 @@
+# Doxyfile 1.7.6.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME = "XORAYA Plugin Executor"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = .. \
+ ../../common/inc/
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.for \
+ *.vhd \
+ *.vhdl
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE = ../../common/inc/plugin_api_heap.h
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */asf/*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 4
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/Master/Masterarbeit/src/XorayaPluginExecutor/main.cpp b/Master/Masterarbeit/src/XorayaPluginExecutor/main.cpp
new file mode 100644
index 0000000..c2e131c
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaPluginExecutor/main.cpp
@@ -0,0 +1,108 @@
+/*!
+ * \file main.cpp
+ * \author S. Eisenhauer
+ * \date 31.08.2011
+ * \brief Application startup
+ */
+
+/*!
+ * \mainpage XORAYA Plugin executor
+ * This is the main application running on the XORAYA connect to integrate with CanEasy.
+*/
+
+#include <errno.h>
+#include <sys/mman.h>
+#include <string.h>
+#include <boost/thread.hpp>
+#include <boost/bind.hpp>
+
+#include "CPluginExecutor.h"
+#include "global.h"
+
+/*!
+* \brief Allocates a safe stack
+*/
+void prefault_stack()
+{
+ unsigned char aucDummy[nMAX_SAFE_STACK];
+
+ memset(aucDummy, 0, nMAX_SAFE_STACK);
+ return;
+}
+
+/*!
+* \brief Prevents memory of this process to be swapped to disc
+* \warning process needs root privileges for this to work correctly
+*/
+void lockmem()
+{
+ int res = 0;
+ if( (res = mlockall(MCL_CURRENT|MCL_FUTURE)) != 0)
+ {
+ ERROR_PRINT("mlockall failed: %d errno: %d",res,errno);
+ //exit(-2);
+ }
+}
+
+/*!
+* \brief initialization code
+*/
+void init()
+{
+ lockmem();
+ prefault_stack();
+}
+
+/*!
+* \brief application starts here
+* \param[in] argc number of arguments passed to process
+* \param[in] argv the arguments
+* \return exit code, 0 on success
+*/
+int main(int argc, char* argv[])
+{
+ int res = 0;
+ int schedulerPolicy;
+ sched_param sp;
+
+ init();
+
+ static CPluginExecutor xPluginExec;
+ boost::thread xExecThread(
+ boost::function<void()>(
+ boost::bind(&CPluginExecutor::vRun,boost::ref(xPluginExec))
+ )
+ );
+
+ if( argc == 2)
+ {
+ if( strcmp(argv[1],"RT") == 0 )
+ {
+ schedulerPolicy = SCHED_FIFO;
+ sp.sched_priority = tenPrio::nenRT ; // rt priority
+ if(pthread_setschedparam(xExecThread.native_handle(), schedulerPolicy, &sp))
+ {
+ ERROR_PRINT("pthread_setschedparam failed. Errno: %d",errno);
+ }
+ }
+ }
+
+ if( (res = pthread_getschedparam(xExecThread.native_handle(),&schedulerPolicy,&sp)) != 0 )
+ {
+ ERROR_PRINT("pthread_getschedparam failed: %d errno: %d",res,errno);
+ }
+ else
+ {
+ DEBUG_PRINT("executor thread prio: %d scheduler: %s"
+ ,sp.sched_priority
+ ,(schedulerPolicy==SCHED_OTHER)?"SCHED_OTHER":
+ (schedulerPolicy==SCHED_FIFO)?"SCHED_FIFO":
+ (schedulerPolicy==SCHED_RR)?"SCHED_RR":"other");
+ }
+
+ xExecThread.join();
+ DEBUG_PRINT("exiting");
+ return 0;
+}
+
+
diff --git a/Master/Masterarbeit/src/XorayaTestPlugin/.cproject b/Master/Masterarbeit/src/XorayaTestPlugin/.cproject
new file mode 100644
index 0000000..2a4f6a3
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaTestPlugin/.cproject
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.so.debug.550735325">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.so.debug.550735325" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/xoraya_test_plugin"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/xoraya_test_plugin/Debug"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="xoraya_test_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.so.debug.550735325" name="Debug" parent="cdt.managedbuild.config.gnu.cross.so.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.so.debug.550735325." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.so.debug.1638605499" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.so.debug">
+ <option id="cdt.managedbuild.option.gnu.cross.prefix.771947037" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="powerpc-linux-gnu-" valueType="string"/>
+ <option id="cdt.managedbuild.option.gnu.cross.path.756127230" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path" value="." valueType="string"/>
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1656053330" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/xoraya_test_plugin/Debug}" id="cdt.managedbuild.builder.gnu.cross.826157007" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1533075336" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.40175236" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.1157425192" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.misc.other.1029263262" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.c.compiler.option.include.paths.2079094693" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ <listOptionValue builtIn="false" value="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <listOptionValue builtIn="false" value="&quot;C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_log_plugin}&quot;"/>
+ </option>
+ <option id="gnu.c.compiler.option.misc.pic.1323285182" name="Position Independent Code (-fPIC)" superClass="gnu.c.compiler.option.misc.pic" value="false" valueType="boolean"/>
+ <option id="gnu.c.compiler.option.preprocessor.def.symbols.140116737" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="DEBUG_MODE=1"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.547252267" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.318829541" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.122985392" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.682947412" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.other.other.462076528" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.cpp.compiler.option.include.paths.376220475" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ <listOptionValue builtIn="false" value="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <listOptionValue builtIn="false" value="&quot;C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_log_plugin}&quot;"/>
+ <listOptionValue builtIn="false" value="../../common/inc"/>
+ </option>
+ <option id="gnu.cpp.compiler.option.other.pic.556695806" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" value="true" valueType="boolean"/>
+ <option id="gnu.cpp.compiler.option.preprocessor.def.1591816243" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="DEBUG_MODE"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1542281452" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1855366727" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
+ <option defaultValue="true" id="gnu.c.link.option.shared.952050907" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1201863527" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <option defaultValue="true" id="gnu.cpp.link.option.shared.657865092" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.flags.1869738328" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-msoft-float" valueType="string"/>
+ <option id="gnu.cpp.link.option.libs.699184344" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" value="rt"/>
+ <listOptionValue builtIn="false" value="pthread"/>
+ <listOptionValue builtIn="false" value="x2e"/>
+ </option>
+ <option id="gnu.cpp.link.option.implname.56733627" name="Import Library name (-Wl,--out-implib=)" superClass="gnu.cpp.link.option.implname" value="" valueType="string"/>
+ <option id="gnu.cpp.link.option.paths.111529698" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="&quot;C:\Programme\x2e\x2e\toolchain\powerpc-linux-gnu\libc\nof\lib&quot;"/>
+ </option>
+ <option id="gnu.cpp.link.option.nostart.384791411" name="Do not use standard start files (-nostartfiles)" superClass="gnu.cpp.link.option.nostart" value="false" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.nodeflibs.208078696" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.cpp.link.option.nodeflibs" value="false" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.nostdlibs.2080620867" name="No startup or default libs (-nostdlib)" superClass="gnu.cpp.link.option.nostdlibs" value="false" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.userobjs.1448235783" name="Other objects" superClass="gnu.cpp.link.option.userobjs"/>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1484672118" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry excluding="xoraya_plugin_executor" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="xoraya_plugin_executor;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_plugin_executor"/>
+ <entry flags="BUILTIN|READONLY|RESOLVED" kind="includePath" name="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <entry flags="RESOLVED" kind="includePath" name="C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_log_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.cross.so.release.841520622">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.so.release.841520622" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings>
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/xoraya_test_plugin"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/xoraya_test_plugin/Release"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="xoraya_test_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.so.release.841520622" name="Release" parent="cdt.managedbuild.config.gnu.cross.so.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.cross.so.release.841520622." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.cross.so.release.1146140364" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.so.release">
+ <option id="cdt.managedbuild.option.gnu.cross.prefix.1220642225" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="powerpc-linux-gnu-" valueType="string"/>
+ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.605580014" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
+ <builder buildPath="${workspace_loc:/xoraya_test_plugin/Release}" id="cdt.managedbuild.builder.gnu.cross.1646969176" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.564549750" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1902965272" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.debugging.level.577058886" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.c.compiler.option.misc.other.838012851" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.c.compiler.option.include.paths.1529012918" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ <listOptionValue builtIn="false" value="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <listOptionValue builtIn="false" value="&quot;C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_log_plugin}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1747273061" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.475473125" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.418017735" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.debugging.level.364741694" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.option.other.other.923176949" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fno-strict-aliasing -std=c++0x -msoft-float -mcpu=405" valueType="string"/>
+ <option id="gnu.cpp.compiler.option.include.paths.1148253703" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_plugin_executor}&quot;"/>
+ <listOptionValue builtIn="false" value="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <listOptionValue builtIn="false" value="&quot;C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/xoraya_log_plugin}&quot;"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2102628057" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1989457595" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
+ <option defaultValue="true" id="gnu.c.link.option.shared.970904545" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.718408146" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
+ <option defaultValue="true" id="gnu.cpp.link.option.shared.1870403900" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
+ <option id="gnu.cpp.link.option.flags.1307374428" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-msoft-float" valueType="string"/>
+ <option id="gnu.cpp.link.option.libs.684390311" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" value="rt"/>
+ <listOptionValue builtIn="false" value="pthread"/>
+ <listOptionValue builtIn="false" value="x2e"/>
+ <listOptionValue builtIn="false" value="boost_system"/>
+ <listOptionValue builtIn="false" value="boost_filesystem"/>
+ <listOptionValue builtIn="false" value="boost_program_options"/>
+ <listOptionValue builtIn="false" value="boost_thread"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1021083992" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings">
+ <externalSettings containerId="xoraya_plugin_executor;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_plugin_executor"/>
+ <entry flags="BUILTIN|READONLY|RESOLVED" kind="includePath" name="c:/programme/x2e/x2e/toolchain/powerpc-linux-gnu/libc/usr/include"/>
+ <entry flags="RESOLVED" kind="includePath" name="C:\Dokumente und Einstellungen\Eisenhauer\Eigene Dateien\Masterarbeit\src\common\inc"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/xoraya_log_plugin"/>
+ </externalSetting>
+ </externalSettings>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="xoraya_test_plugin.cdt.managedbuild.target.gnu.cross.so.902670704" name="Shared Library" projectType="cdt.managedbuild.target.gnu.cross.so"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.550735325;cdt.managedbuild.config.gnu.cross.so.debug.550735325.;cdt.managedbuild.tool.gnu.cross.c.compiler.1533075336;cdt.managedbuild.tool.gnu.c.compiler.input.547252267">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.550735325;cdt.managedbuild.config.gnu.cross.so.debug.550735325.1776542442;cdt.managedbuild.tool.gnu.cross.cpp.compiler.13537144;cdt.managedbuild.tool.gnu.cpp.compiler.input.156538660">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.release.841520622;cdt.managedbuild.config.gnu.cross.so.release.841520622.;cdt.managedbuild.tool.gnu.cross.c.compiler.564549750;cdt.managedbuild.tool.gnu.c.compiler.input.1747273061">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.release.841520622;cdt.managedbuild.config.gnu.cross.so.release.841520622.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.475473125;cdt.managedbuild.tool.gnu.cpp.compiler.input.2102628057">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.550735325;cdt.managedbuild.config.gnu.cross.so.debug.550735325.1776542442;cdt.managedbuild.tool.gnu.cross.c.compiler.491071819;cdt.managedbuild.tool.gnu.c.compiler.input.1171949691">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.550735325;cdt.managedbuild.config.gnu.cross.so.debug.550735325.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.318829541;cdt.managedbuild.tool.gnu.cpp.compiler.input.1542281452">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="refreshScope" versionNumber="1">
+ <resource resourceType="PROJECT" workspacePath="/xoraya_test_plugin"/>
+ </storageModule>
+</cproject>
diff --git a/Master/Masterarbeit/src/XorayaTestPlugin/.project b/Master/Masterarbeit/src/XorayaTestPlugin/.project
new file mode 100644
index 0000000..645a4e1
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaTestPlugin/.project
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>xoraya_test_plugin</name>
+ <comment></comment>
+ <projects>
+ <project>xoraya_plugin_executor</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/xoraya_test_plugin/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp b/Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp
new file mode 100644
index 0000000..c2b0165
--- /dev/null
+++ b/Master/Masterarbeit/src/XorayaTestPlugin/xoraya_test_plugin.cpp
@@ -0,0 +1,127 @@
+/*
+ * xoraya_test_plugin.cpp
+ *
+ * Created on: 31.08.2011
+ * Author: Eisenhauer
+ */
+
+#include "plugin_api.h"
+#include "global.h"
+#include "interface_manager.h"
+
+class XorayaTestPlugin : public IPlugin
+{
+private:
+ IInterfaceManager& m_xInterfaceManager;
+ int32_t m_i32InterfaceHandle;
+ uint32_t m_u32TxMsgId;
+ tCanTxMessageList m_axCanTxMessages;
+ uint32_t m_u32PluginId;
+ uint32_t m_u32Loopcounter;
+
+ static uint32_t su32InstanceCount;
+
+public:
+
+ XorayaTestPlugin( IInterfaceManager& xIfMan,
+ int32_t i32Interface,
+ uint32_t u32PluginId
+ )
+ :m_xInterfaceManager( xIfMan ),
+ m_i32InterfaceHandle( i32Interface ),
+ m_u32TxMsgId(0x100*(1+XorayaTestPlugin::su32InstanceCount)),
+ m_u32PluginId(u32PluginId),
+ m_u32Loopcounter(0)
+ {
+ DEBUG_PRINT("constructor");
+ boost::shared_ptr<tstCanTxMessage> pstCanMsg1(new tstCanTxMessage);
+ pstCanMsg1->u32CanId = m_u32TxMsgId+2;
+ pstCanMsg1->u8Dlc = 5;
+ pstCanMsg1->u32TxCycleMilliseconds = 500;
+ pstCanMsg1->u32MillisecondCounter = 0;
+ pstCanMsg1->au8Data = {0,0,0,0,0,0,0,0};
+ m_axCanTxMessages.push_back(pstCanMsg1);
+ boost::shared_ptr<tstCanTxMessage> pstCanMsg2(new tstCanTxMessage);
+ pstCanMsg2->u32CanId = m_u32TxMsgId+1;
+ pstCanMsg2->u8Dlc = 5;
+ pstCanMsg2->u32TxCycleMilliseconds = 1000;
+ pstCanMsg2->u32MillisecondCounter = 0;
+ pstCanMsg2->au8Data = {0,0,0,0,0,0,0,0};
+ m_axCanTxMessages.push_back(pstCanMsg2);
+ boost::shared_ptr<tstCanTxMessage> pstCanMsg3(new tstCanTxMessage);
+ pstCanMsg3->u32CanId = m_u32TxMsgId;
+ pstCanMsg3->u8Dlc = 5;
+ pstCanMsg3->u32TxCycleMilliseconds = 500;
+ pstCanMsg3->u32MillisecondCounter = 0;
+ pstCanMsg3->au8Data = {0,0,0,0,0,0,0,0};
+ m_axCanTxMessages.push_back(pstCanMsg3);
+ DEBUG_PRINT("Plg Id: %d msg 1: 0x%X", m_u32PluginId, (uint32_t) pstCanMsg1.get());
+ DEBUG_PRINT("Plg Id: %d msg 2: 0x%X", m_u32PluginId, (uint32_t) pstCanMsg2.get());
+ DEBUG_PRINT("Plg Id: %d msg 3: 0x%X", m_u32PluginId, (uint32_t) pstCanMsg3.get());
+ XorayaTestPlugin::su32InstanceCount++;
+ }
+
+ virtual ~XorayaTestPlugin()
+ {
+ DEBUG_PRINT("destructor");
+ XorayaTestPlugin::su32InstanceCount--;
+ }
+
+
+
+ virtual void vRun( void )
+ {
+// DEBUG_PRINT("entry");
+ m_u32Loopcounter++;
+ tCanTxMessageList::iterator xMsgIter;
+ for( xMsgIter = m_axCanTxMessages.begin(); xMsgIter != m_axCanTxMessages.end(); xMsgIter++ )
+ {
+ tpstCanTxMessage pxMsg = *xMsgIter;
+ pxMsg->au8Data[0] = m_u32PluginId;
+ if( xMsgIter == m_axCanTxMessages.begin() )
+ {
+ pxMsg->au8Data[4] = (uint8_t) (m_u32Loopcounter>>24);
+ pxMsg->au8Data[3] = (uint8_t) (m_u32Loopcounter>>16);
+ pxMsg->au8Data[2] = (uint8_t) (m_u32Loopcounter>>8);
+ pxMsg->au8Data[1] = (uint8_t) m_u32Loopcounter;
+ }
+ else
+ {
+ pxMsg->au8Data[1] = (uint8_t) (m_u32Loopcounter>>24);
+ pxMsg->au8Data[2] = (uint8_t) (m_u32Loopcounter>>16);
+ pxMsg->au8Data[3] = (uint8_t) (m_u32Loopcounter>>8);
+ pxMsg->au8Data[4] = (uint8_t) m_u32Loopcounter;
+ }
+ }
+// DEBUG_PRINT("exit");
+ }
+
+ virtual tCanTxMessageList& xGetCanTxMessages( void )
+ {
+ return m_axCanTxMessages;
+ }
+
+ virtual int32_t i32GetCanInterfaceHandle( void )
+ {
+ return m_i32InterfaceHandle;
+ }
+};
+
+uint32_t XorayaTestPlugin::su32InstanceCount = 0;
+
+extern "C" IPlugin* pxCreatePlugin(
+ IInterfaceManager& xIfMan,
+ int32_t i32Interface,
+ uint32_t u32PluginId
+ )
+{
+ DEBUG_PRINT("entry");
+ return new XorayaTestPlugin(xIfMan, i32Interface, u32PluginId);
+}
+
+extern "C" void vDestroyPlugin(IPlugin* pxPlugin)
+{
+ DEBUG_PRINT("entry");
+ delete pxPlugin;
+ DEBUG_PRINT("exit");
+}
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.sln b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.sln
new file mode 100644
index 0000000..063337e
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Xoraya_Stub", "Xoraya_Stub\Xoraya_Stub.vcproj", "{AB15B858-E9A1-4EA8-B6BE-B002A4F61AB0}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AB15B858-E9A1-4EA8-B6BE-B002A4F61AB0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AB15B858-E9A1-4EA8-B6BE-B002A4F61AB0}.Debug|Win32.Build.0 = Debug|Win32
+ {AB15B858-E9A1-4EA8-B6BE-B002A4F61AB0}.Release|Win32.ActiveCfg = Release|Win32
+ {AB15B858-E9A1-4EA8-B6BE-B002A4F61AB0}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.suo b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.suo
new file mode 100644
index 0000000..3b2ea80
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub.suo
Binary files differ
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/ReadMe.txt b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/ReadMe.txt
new file mode 100644
index 0000000..5a0769a
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/ReadMe.txt
@@ -0,0 +1,36 @@
+========================================================================
+ KONSOLENANWENDUNG: Xoraya_Stub-Projektübersicht
+========================================================================
+
+Diese Xoraya_Stub-Anwendung wurde vom Anwendungs-Assistenten
+für Sie erstellt.
+
+Diese Datei bietet eine Übersicht über den Inhalt der einzelnen Dateien,
+aus denen Ihre Xoraya_Stub–Anwendung besteht.
+
+
+Xoraya_Stub.vcproj
+ Dies ist die Hauptprojektdatei für VC++-Projekte, die mit dem Anwendungs-
+ Assistenten generiert werden.
+ Sie enthält Informationen über die Version von Visual C++, mit der die
+ Datei generiert wurde, sowie über die Plattformen, Konfigurationen und
+ Projektfeatures, die im Anwendungs-Assistenten ausgewählt wurden.
+
+Xoraya_Stub.cpp
+ Dies ist die Hauptquelldatei der Anwendung.
+
+/////////////////////////////////////////////////////////////////////////////
+Weitere Standarddateien:
+
+StdAfx.h, StdAfx.cpp
+ Mit diesen Dateien werden eine vorkompilierte Header (PCH)-Datei
+ mit dem Namen "Xoraya_Stub.pch" und eine
+ vorkompilierte Typendatei mit dem Namen "StdAfx.obj" erstellt.
+
+/////////////////////////////////////////////////////////////////////////////
+Weitere Hinweise:
+
+Der Anwendungs-Assistent weist Sie mit "TODO:"-Kommentaren auf Teile des
+Quellcodes hin, die Sie ergänzen oder anpassen sollten.
+
+///////////////////////////////////////////////////////////////////////////// \ No newline at end of file
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.cpp b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.cpp
new file mode 100644
index 0000000..88a57d9
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.cpp
@@ -0,0 +1,89 @@
+#include "StdAfx.h"
+#include "TcpConnection.h"
+#include <iostream>
+#include <boost/bind.hpp>
+#include "XorayaExecutor.h"
+#include <vector>
+#include <string>
+
+CTcpConnection::CTcpConnection(boost::asio::io_service& io_service, boost::shared_ptr<CXorayaExecutor> pxExecutor)
+:m_xSocket(io_service),m_pxExecutor(pxExecutor)
+{
+}
+
+CTcpConnection::~CTcpConnection(void)
+{
+}
+
+CTcpConnection::tConnectionPtr CTcpConnection::pxCreate(boost::asio::io_service& xIoService, boost::shared_ptr<CXorayaExecutor> pxExecutor)
+{
+ std::cout << __FUNCTION__ << " created new tcp connection " << std::endl;
+ return tConnectionPtr(new CTcpConnection(xIoService,pxExecutor));
+}
+
+boost::asio::ip::tcp::socket& CTcpConnection::xGetSocket()
+{
+ return m_xSocket;
+}
+
+void CTcpConnection::vStart()
+{
+ boost::asio::async_read(
+ m_xSocket,
+ boost::asio::buffer(m_RxBuffer),
+ boost::asio::transfer_at_least(2),
+ boost::bind(&CTcpConnection::vReadHandler, shared_from_this(),
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+}
+void CTcpConnection::vWriteHandler(const boost::system::error_code& err, size_t bytesTransferred)
+{
+ if(!err)
+ {
+ std::cout << __FUNCTION__ << " transferred " << bytesTransferred << " bytes" << std::endl;
+ }
+ else
+ {
+ std::cout << __FUNCTION__ << " error: " << err.message() << std::endl;
+ }
+}
+void CTcpConnection::vReadHandler(const boost::system::error_code& err, size_t bytesTransferred)
+{
+ if(!err)
+ {
+ std::string sCmd(m_RxBuffer.data(),bytesTransferred);
+ std::cout << __FUNCTION__ << " received command " << sCmd << std::endl;
+ if( sCmd.compare("GETINTERFACES") == 0 )
+ {
+ std::string sResponse;
+ m_pxExecutor->vGetInterfaces(sResponse);
+ sResponse = "INTERFACES\r\n" + sResponse;
+ boost::asio::async_write(
+ m_xSocket,
+ boost::asio::buffer(sResponse.c_str(),sResponse.length()),
+ boost::bind(
+ &CTcpConnection::vWriteHandler,
+ this,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+ }
+
+ boost::asio::async_read(
+ m_xSocket,
+ boost::asio::buffer(m_RxBuffer),
+ boost::asio::transfer_at_least(2),
+ boost::bind(&CTcpConnection::vReadHandler, shared_from_this(),
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred
+ )
+ );
+ }
+ else
+ {
+ std::cout << __FUNCTION__ << " error: " << err.message() << std::endl;
+ }
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.h b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.h
new file mode 100644
index 0000000..f2b14d0
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpConnection.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/asio.hpp>
+#include <boost/shared_ptr.hpp>
+#include <string>
+
+#define BUFF_SIZE 4096
+
+class CXorayaExecutor;
+
+class CTcpConnection : public boost::enable_shared_from_this<CTcpConnection>
+{
+public:
+ typedef boost::shared_ptr<CTcpConnection> tConnectionPtr;
+
+ static tConnectionPtr pxCreate(boost::asio::io_service& xIoService, boost::shared_ptr<CXorayaExecutor> pxExecutor);
+
+ boost::asio::ip::tcp::socket& xGetSocket();
+ void vStart();
+
+ CTcpConnection(void);
+ ~CTcpConnection(void);
+
+private:
+ boost::array<char, BUFF_SIZE> m_RxBuffer;
+ boost::array<char, BUFF_SIZE> m_TxBuffer;
+ boost::asio::ip::tcp::socket m_xSocket;
+ boost::shared_ptr<CXorayaExecutor> m_pxExecutor;
+ CTcpConnection(boost::asio::io_service& io_service, boost::shared_ptr<CXorayaExecutor> pxExecutor);
+ void vWriteHandler(const boost::system::error_code& err, size_t bytesTransferred);
+ void vReadHandler(const boost::system::error_code& err, size_t bytesTransferred);
+};
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.cpp b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.cpp
new file mode 100644
index 0000000..a0509d5
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.cpp
@@ -0,0 +1,47 @@
+#include "StdAfx.h"
+#include "TcpServer.h"
+#include <boost/bind.hpp>
+#include "XorayaExecutor.h"
+
+CTcpServer::CTcpServer(boost::shared_ptr<CXorayaExecutor> pxExecutor
+ ,boost::asio::io_service& io_service
+ , int i32Port)
+:m_xAcceptor(
+ io_service,
+ boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(),i32Port)
+ )
+ ,m_pxExecutor(pxExecutor)
+ ,m_io_service(io_service)
+{
+ vStartAccept();
+}
+
+CTcpServer::~CTcpServer(void)
+{
+}
+
+void CTcpServer::vStartAccept()
+{
+ CTcpConnection::tConnectionPtr pNewCon
+ = CTcpConnection::pxCreate(m_io_service,m_pxExecutor);
+
+ std::cout << __FUNCTION__ << " new accept " << std::endl;
+
+ m_xAcceptor.async_accept(pNewCon->xGetSocket(),
+ boost::bind(
+ &CTcpServer::vAcceptHandler,
+ this,
+ pNewCon,
+ boost::asio::placeholders::error
+ )
+ );
+}
+
+void CTcpServer::vAcceptHandler(CTcpConnection::tConnectionPtr pNewCon, const boost::system::error_code& error)
+{
+ if(!error)
+ {
+ pNewCon->vStart();
+ vStartAccept();
+ }
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.h b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.h
new file mode 100644
index 0000000..e560cc0
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/TcpServer.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <boost/asio.hpp>
+#include <boost/shared_ptr.hpp>
+#include "TcpConnection.h"
+
+class CXorayaExecutor;
+
+class CTcpServer
+{
+public:
+ CTcpServer(boost::shared_ptr<CXorayaExecutor>pxExecutor, boost::asio::io_service& io_service, int port);
+ ~CTcpServer(void);
+ void vAcceptHandler(CTcpConnection::tConnectionPtr pNewCon, const boost::system::error_code& error);
+private:
+ boost::asio::ip::tcp::acceptor m_xAcceptor;
+ boost::shared_ptr<CXorayaExecutor> m_pxExecutor;
+ void vStartAccept();
+ boost::asio::io_service& m_io_service;
+};
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.cpp b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.cpp
new file mode 100644
index 0000000..9a3b52b
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.cpp
@@ -0,0 +1,34 @@
+#include "StdAfx.h"
+#include "XorayaConnector.h"
+#include "XorayaExecutor.h"
+#include <iostream>
+#include <exception>
+#include <boost/thread.hpp>
+#include <boost/asio.hpp>
+#include "TcpServer.h"
+
+CXorayaConnector::CXorayaConnector(boost::shared_ptr<CXorayaExecutor> pxExecutor)
+:m_pxExecutor(pxExecutor)
+{
+}
+
+CXorayaConnector::~CXorayaConnector(void)
+{
+ std::cout << __FUNCTION__ << std::endl;
+}
+
+void CXorayaConnector::operator()()
+{
+ try
+ {
+ boost::asio::io_service io_service;
+ CTcpServer tcpServer(m_pxExecutor,io_service,CONNECTOR_PORT);
+ io_service.run();
+ std::cout << __FUNCTION__ << " io service returned " << std::endl;
+ }
+ catch(std::exception& e)
+ {
+ std::cerr << __FUNCTION__ << ": " << e.what() << std::endl;
+ }
+ return;
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.h b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.h
new file mode 100644
index 0000000..6823139
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaConnector.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+
+#define CONNECTOR_PORT 7010
+
+class CXorayaExecutor;
+
+class CXorayaConnector
+{
+public:
+ CXorayaConnector(boost::shared_ptr<CXorayaExecutor> pxExecutor);
+ virtual ~CXorayaConnector(void);
+ void operator()();
+private:
+ boost::shared_ptr<CXorayaExecutor> m_pxExecutor;
+};
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.cpp b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.cpp
new file mode 100644
index 0000000..a2c67d2
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.cpp
@@ -0,0 +1,37 @@
+#include "StdAfx.h"
+#include "XorayaExecutor.h"
+#include "XorayaConnector.h"
+#include <iostream>
+
+CXorayaExecutor::CXorayaExecutor(void)
+{
+ m_pxConnector.reset(new CXorayaConnector(boost::shared_ptr<CXorayaExecutor>(this)));
+ m_pxConnectorThread.reset(
+ new boost::thread(*m_pxConnector)
+ );
+}
+
+CXorayaExecutor::~CXorayaExecutor(void)
+{
+ m_pxConnectorThread->interrupt();
+ std::cout << __FUNCTION__ << std::endl;
+}
+
+void CXorayaExecutor::vGetInterfaces(std::string& sInterfaces)
+{
+ sInterfaces += "CAN 1\r\n";
+ sInterfaces += "CAN 2\r\n";
+ sInterfaces += "CAN 3\r\n";
+ sInterfaces += "CAN 4\r\n";
+ sInterfaces += "CAN 5\r\n";
+ sInterfaces += "CAN 6\r\n";
+ sInterfaces += "CAN 7\r\n";
+ sInterfaces += "CAN 8\r\n";
+ return;
+}
+
+void CXorayaExecutor::vRun()
+{
+ m_pxConnectorThread->join();
+ std::cout << __FUNCTION__ << " connector thread returned " << std::endl;
+} \ No newline at end of file
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.h b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.h
new file mode 100644
index 0000000..3be37f6
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/XorayaExecutor.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <string>
+#include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
+
+class CXorayaConnector;
+
+class CXorayaExecutor
+{
+public:
+ CXorayaExecutor(void);
+ virtual ~CXorayaExecutor(void);
+ void vGetInterfaces(std::string&);
+ void vRun();
+private:
+ boost::shared_ptr<CXorayaConnector> m_pxConnector;
+ boost::scoped_ptr<boost::thread> m_pxConnectorThread;
+};
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.cpp b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.cpp
new file mode 100644
index 0000000..53f6eb7
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.cpp
@@ -0,0 +1,14 @@
+// Xoraya_Stub.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
+//
+
+#include "stdafx.h"
+#include "XorayaExecutor.h"
+
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ CXorayaExecutor cExecutor;
+ cExecutor.vRun();
+ return 0;
+}
+
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj
new file mode 100644
index 0000000..99ad5a8
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="Xoraya_Stub"
+ ProjectGUID="{AB15B858-E9A1-4EA8-B6BE-B002A4F61AB0}"
+ RootNamespace="Xoraya_Stub"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="C:\Programme\boost\boost_1_47_0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="C:\Programme\boost\boost_1_47_0\lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Quelldateien"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\TcpConnection.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\TcpServer.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Xoraya_Stub.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\XorayaConnector.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\XorayaExecutor.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Headerdateien"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\TcpConnection.h"
+ >
+ </File>
+ <File
+ RelativePath=".\TcpServer.h"
+ >
+ </File>
+ <File
+ RelativePath=".\XorayaConnector.h"
+ >
+ </File>
+ <File
+ RelativePath=".\XorayaExecutor.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Ressourcendateien"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj.SCHLEISSHEIMER.Eisenhauer.user b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj.SCHLEISSHEIMER.Eisenhauer.user
new file mode 100644
index 0000000..c44b7fd
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/Xoraya_Stub.vcproj.SCHLEISSHEIMER.Eisenhauer.user
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+ ProjectType="Visual C++"
+ Version="8,00"
+ ShowAllFiles="false"
+ >
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ >
+ <DebugSettings
+ Command="$(TargetPath)"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="A281"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ >
+ <DebugSettings
+ Command="$(TargetPath)"
+ WorkingDirectory=""
+ CommandArguments=""
+ Attach="false"
+ DebuggerType="3"
+ Remote="1"
+ RemoteMachine="A281"
+ RemoteCommand=""
+ HttpUrl=""
+ PDBPath=""
+ SQLDebugging=""
+ Environment=""
+ EnvironmentMerge="true"
+ DebuggerFlavor=""
+ MPIRunCommand=""
+ MPIRunArguments=""
+ MPIRunWorkingDirectory=""
+ ApplicationCommand=""
+ ApplicationArguments=""
+ ShimCommand=""
+ MPIAcceptMode=""
+ MPIAcceptFilter=""
+ />
+ </Configuration>
+ </Configurations>
+</VisualStudioUserFile>
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.cpp b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.cpp
new file mode 100644
index 0000000..4bb84b6
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.
+// Xoraya_Stub.pch ist der vorkompilierte Header.
+// stdafx.obj enthält die vorkompilierten Typinformationen.
+
+#include "stdafx.h"
+
+// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H
+// und nicht in dieser Datei erforderlich sind.
diff --git a/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.h b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.h
new file mode 100644
index 0000000..9d7f336
--- /dev/null
+++ b/Master/Masterarbeit/src/Xoraya_Stub/Xoraya_Stub/stdafx.h
@@ -0,0 +1,17 @@
+// stdafx.h : Includedatei für Standardsystem-Includedateien
+// oder häufig verwendete projektspezifische Includedateien,
+// die nur in unregelmäßigen Abständen geändert werden.
+//
+
+#pragma once
+
+#ifndef _WIN32_WINNT // Lassen Sie die Verwendung spezifischer Features von Windows XP oder später zu.
+#define _WIN32_WINNT 0x0501 // Ändern Sie dies in den geeigneten Wert für andere Versionen von Windows.
+#endif
+
+#include <stdio.h>
+#include <tchar.h>
+
+
+
+// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
diff --git a/Master/Masterarbeit/src/common/cpu_load.sh b/Master/Masterarbeit/src/common/cpu_load.sh
new file mode 100644
index 0000000..7ab284a
--- /dev/null
+++ b/Master/Masterarbeit/src/common/cpu_load.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+#
+# file: cpu_load.sh
+# date: 20.12.2011
+# author: S. Eisenhauer
+# purpose: Generate CPU load by generating random numbers and IO load by writing to a file at high priority
+#
+# warning: Must be called with root privileges for negative nice values (-20 means highest priority)
+#
+nice -n -20 dd if=/dev/urandom of=../data/urandom
diff --git a/Master/Masterarbeit/src/common/inc/CNetworkStream.h b/Master/Masterarbeit/src/common/inc/CNetworkStream.h
new file mode 100644
index 0000000..2b94e71
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/CNetworkStream.h
@@ -0,0 +1,189 @@
+/*!
+ * \file CNetworkStream.h
+ * \author S. Eisenhauer
+ * \date 12.01.2012
+ * \brief Stream access to network data buffers
+ *
+ * This file defines classes for accessing the data stored in networked buffers as streams
+ *
+ */
+#ifndef CNETWORKSTREAM_H_
+#define CNETWORKSTREAM_H_
+
+#include "global.h"
+#include "protocol.h"
+
+/// enumeration of stream errors
+enum tenStreamError
+{
+ nenStreamOK = 0, //!< stream is ok
+ nenErrorValueOutOfRange = -1, //!< a value in the stream is out of the configured min. max. range
+ nenErrorStreamToShort = -2 //!< no bytes left in stream for reading or writing
+};
+
+/*!
+ * \brief class for read access to a data buffer as stream
+ */
+class CNetworkInStream
+{
+public:
+ /*!
+ * \brief constructor
+ * \param[in] pu8Buffer Pointer to the buffer which is handled by the stream
+ * \param[in] u32BufferSize Size of the buffer in bytes
+ */
+ CNetworkInStream(uint8_t* pu8Buffer, uint32_t u32BufferSize);
+ /*!
+ * \brief read a signed 8 bit integer from the stream
+ * \param[out] i8Val Reference to storage for the value
+ */
+ void vReadInt8(int8_t& i8Val);
+ /*!
+ * \brief read a unsigned 8 bit integer from the stream
+ * \param[out] u8Val Reference to storage for the value
+ */
+ void vReadUint8(uint8_t& u8Val);
+ /*!
+ * \brief read a signed 32 bit integer from the stream
+ * \param[out] i32Val Reference to storage for the value
+ */
+ void vReadInt32(int32_t& i32Val);
+ /*!
+ * \brief read a unsigned 32 bit integer from the stream
+ * \param[out] u32Val Reference to storage for the value
+ */
+ void vReadUint32(uint32_t& u32Val);
+ /*!
+ * \brief read a string from the stream
+ * \param[out] pcVal Reference to storage for the value
+ * \param[in] u32Length Length of the expected string
+ */
+ void vReadString(char* pcVal, const uint32_t u32Length);
+ /*!
+ * \brief get number of bytes used in stream
+ * \return number of bytes used in stream
+ */
+ uint32_t u32GetByteCount() const;
+ /*!
+ * \brief set stream to a position
+ * \param[in] u32Offset position to set stream to as offset from start position (=0)
+ */
+ void vSetPosition(const uint32_t u32Offset);
+ /*!
+ * \brief check if stream is OK
+ * \return TRUE if no error is set for stream, FALSE otherwise
+ */
+ bool boIsOK() const;
+ /*!
+ * \brief get error of stream
+ * \param[out] enError stream error code
+ */
+ void vGetError(tenStreamError& enError) const;
+ /*!
+ * \brief set error code of stream
+ * \param[in] enError error to set for stream
+ */
+ void vSetError(tenStreamError enError);
+ /*!
+ * \brief reset stream. Set position to start and error to nenStreamOK
+ */
+ void vReset();
+private:
+ CNetworkInStream(const CNetworkInStream& rxOther);
+ CNetworkInStream& operator= (const CNetworkInStream& rxOther);
+ /*!
+ * \brief checks that a sufficient number of bytes is left in the stream
+ * \param[in] u32Length number of bytes to check the stream for
+ */
+ bool boCheck(const uint32_t u32Length);
+
+ const uint8_t* m_pu8CurrentPtr;
+ const uint8_t* const m_pru8StartPtr;
+ const uint8_t* const m_pru8EndPtr;
+ tenStreamError m_enError;
+};
+
+/*!
+ * \brief class for write access to a data buffer as stream
+ */
+class CNetworkOutStream
+{
+public:
+ /*!
+ * \brief constructor
+ * \param[in] pu8Buffer Pointer to the buffer which is handled by the stream
+ * \param[in] u32BufferSize Size of the buffer in bytes
+ */
+ CNetworkOutStream(uint8_t* pu8Buffer, uint32_t u32BufferSize);
+ /*!
+ * \brief write a signed 8 bit integer to the stream
+ * \param[in] i8Val Reference to the value to write to the stream
+ */
+ void vWriteInt8(const int8_t i8Val);
+ /*!
+ * \brief write a unsigned 8 bit integer to the stream
+ * \param[in] u8Val Reference to the value to write to the stream
+ */
+ void vWriteUint8(const uint8_t u8Val);
+ /*!
+ * \brief write a signed 32 bit integer to the stream
+ * \param[in] i32Val Reference to the value to write to the stream
+ */
+ void vWriteInt32(const int32_t i32Val);
+ /*!
+ * \brief write a unsigned 32 bit integer to the stream
+ * \param[in] u32Val Reference to the value to write to the stream
+ */
+ void vWriteUint32(const uint32_t u32Val);
+ /*!
+ * \brief write a string to the stream
+ * \param[in] pcVal string to write to the stream
+ * \param[in] u32Length Length of the string
+ */
+ void vWriteString(const char* pcVal, const uint32_t u32Length);
+ /*!
+ * \brief get number of bytes used in stream
+ * \return number of bytes used in stream
+ */
+ uint32_t u32GetByteCount() const;
+ /*!
+ * \brief set stream to a position
+ * \param[in] u32Offset position to set stream to as offset from start position (=0)
+ */
+ void vSetPosition(const uint32_t u32Offset);
+ /*!
+ * \brief check if stream is OK
+ * \return TRUE if no error is set for stream, FALSE otherwise
+ */
+ bool boIsOK() const;
+ /*!
+ * \brief get error of stream
+ * \param[out] enError stream error code
+ */
+ void vGetError(tenStreamError& enError) const;
+ /*!
+ * \brief set error code of stream
+ * \param[in] enError error to set for stream
+ */
+ void vSetError(tenStreamError enError);
+ /*!
+ * \brief reset stream. Set position to start and error to nenStreamOK
+ */
+ void vReset();
+private:
+ CNetworkOutStream(const CNetworkOutStream& rxOther);
+ CNetworkOutStream& operator= (const CNetworkOutStream& rxOther);
+
+ /*!
+ * \brief checks that a sufficient number of bytes is left in the stream
+ * \param[in] u32Length number of bytes to check the stream for
+ */
+ bool boCheck(const uint32_t u32Length);
+
+ uint8_t* m_pu8CurrentPtr;
+ const uint8_t* const m_pru8StartPtr;
+ const uint8_t* const m_pru8EndPtr;
+ tenStreamError m_enError;
+};
+
+#endif /*CNETWORKSTREAM_H_*/
diff --git a/Master/Masterarbeit/src/common/inc/IPluginExecutor.h b/Master/Masterarbeit/src/common/inc/IPluginExecutor.h
new file mode 100644
index 0000000..2a862ac
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/IPluginExecutor.h
@@ -0,0 +1,26 @@
+/*!
+ * \file IPluginExecutor.h
+ * \author S. Eisenhauer
+ * \date 10.01.2012
+ * \brief public interface of target main appilcation to be used by target plugins
+ *
+ * This file defines the interface of the target main application
+ * to be used by target plugins
+ */
+#ifndef IPLUGIN_EXECUTOR_H
+#define IPLUGIN_EXECUTOR_H
+
+#include "global.h"
+
+/// pure virtual interface of the target main application
+class IPluginExecutor
+{
+public:
+ /*!
+ * \brief transmit a log buffer to CanEasy
+ * \param[in] stLogMsg reference to logged message
+ */
+ virtual void vUploadLogMessage(const tstLogMessage& stLogMsg) = 0;
+};
+
+#endif /*IPLUGIN_EXECUTOR_H*/
diff --git a/Master/Masterarbeit/src/common/inc/NetworkMessages.h b/Master/Masterarbeit/src/common/inc/NetworkMessages.h
new file mode 100644
index 0000000..359bb85
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/NetworkMessages.h
@@ -0,0 +1,282 @@
+/*!
+ * \file NetworkMessages.h
+ * \author S. Eisenhauer
+ * \date 15.01.2012
+ * \brief Defintion of network messages and constant decoding objects
+ */
+#ifndef NETWORKMESSAGES_H_
+#define NETWORKMESSAGES_H_
+
+#include <NetworkTypes.h>
+#include "protocol.h"
+
+/// definition for received message type
+static CONST_NETWORK_ENUM(senRxMsgType
+ ,static_cast<int32_t>(nenReqStartPlugin)
+ ,static_cast<int32_t>(nenNumberOfNetworkMessageTypes-1));
+/// definition for received message length
+static CONST_NETWORK_UINT32(su32RxMsgMessageLength,8,512);
+static const tstTypeInfo* sapstRxMsgInfoArray[] =
+{
+ &senRxMsgType
+ ,&su32RxMsgMessageLength
+};
+/// decoding object for network message header
+static CONST_NETWORK_RECORD_PROP(sxRxMsgHeader,nenNumberOfNetworkMessageTypes,2,sapstRxMsgInfoArray);
+
+static CONST_NETWORK_ENUM(senReqStartPluginMsgType
+ ,static_cast<int32_t>(nenReqStartPlugin)
+ ,static_cast<int32_t>(nenReqStartPlugin));
+static CONST_NETWORK_UINT32(su32ReqStartPluginMessageLength,8,512);
+static CONST_NETWORK_INT32(si32ReqStartPluginInterface,-1,7);
+static CONST_NETWORK_STRING(ssReqStartPluginFilename,nNETWORK_DATALENGTH-4);
+static const tstTypeInfo* sapstReqStartPluginInfoArray[] =
+{
+ &senReqStartPluginMsgType
+ ,&su32ReqStartPluginMessageLength
+ ,&si32ReqStartPluginInterface
+ ,&ssReqStartPluginFilename
+};
+/// decoding object for start plugin request
+static CONST_NETWORK_RECORD_PROP(sxReqStartPluginMessage,nenReqStartPlugin,4,sapstReqStartPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senRespStartPluginMessageType
+ ,static_cast<int32_t>(nenRespStartPlugin)
+ ,static_cast<int32_t>(nenRespStartPlugin));
+static CONST_NETWORK_UINT32(su32RespStartPluginMessageLength,8,8);
+static const tstTypeInfo* sapstRespStartPluginInfoArray[] =
+{
+ &senRespStartPluginMessageType
+ ,&su32RespStartPluginMessageLength
+};
+/// decoding object for start plugin response
+static CONST_NETWORK_RECORD_PROP(sxRespStartPluginMessage,nenRespStartPlugin,2,sapstRespStartPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senReqShutdownMessageType
+ ,static_cast<int32_t>(nenReqShutdown)
+ ,static_cast<int32_t>(nenReqShutdown));
+static CONST_NETWORK_UINT32(su32ReqShutdownMessageLength,8,8);
+static const tstTypeInfo* sapstReqShutdownInfoArray[] =
+{
+ &senReqShutdownMessageType
+ ,&su32ReqShutdownMessageLength
+};
+/// decoding object for shutdown response
+static CONST_NETWORK_RECORD_PROP(sxReqShutdownMessage,nenReqShutdown,2,sapstReqShutdownInfoArray);
+
+static CONST_NETWORK_ENUM(senRespShutdownMessageType
+ ,static_cast<int32_t>(nenRespShutdown)
+ ,static_cast<int32_t>(nenRespShutdown));
+static CONST_NETWORK_UINT32(su32RespShutdownMessageLength,8,8);
+static const tstTypeInfo* sapstRespShutdownInfoArray[] =
+{
+ &senRespShutdownMessageType
+ ,&su32RespShutdownMessageLength
+};
+/// decoding object for shutdown response
+static CONST_NETWORK_RECORD_PROP(sxRespShutdownMessage,nenRespShutdown,2,sapstRespShutdownInfoArray);
+
+static CONST_NETWORK_ENUM(senReqStopPluginMessageType
+ ,static_cast<int32_t>(nenReqStopPlugin)
+ ,static_cast<int32_t>(nenReqStopPlugin));
+static CONST_NETWORK_UINT32(su32ReqStopPluginMessageLength,12,12);
+static CONST_NETWORK_INT32(si32ReqStopPluginInterface,1,7);
+static const tstTypeInfo* sapstReqStopPluginInfoArray[] =
+{
+ &senReqStopPluginMessageType
+ ,&su32ReqStopPluginMessageLength
+ ,&si32ReqStopPluginInterface
+};
+/// decoding object for stop plugin request
+static CONST_NETWORK_RECORD_PROP(sxReqStopPluginMessage,nenReqStopPlugin,3,sapstReqStopPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senRespStopPluginMessageType
+ ,static_cast<int32_t>(nenRespStopPlugin)
+ ,static_cast<int32_t>(nenRespStopPlugin));
+static CONST_NETWORK_UINT32(su32RespStopPluginMessageLength,8,8);
+static const tstTypeInfo* sapstRespStopPluginInfoArray[] =
+{
+ &senRespStopPluginMessageType
+ ,&su32RespStopPluginMessageLength
+};
+/// decoding object for stop plugin response
+static CONST_NETWORK_RECORD_PROP(sxRespStopPluginMessage,nenRespStopPlugin,2,sapstRespStopPluginInfoArray);
+
+static CONST_NETWORK_ENUM(senRespUploadLogMsgMessageType
+ ,static_cast<int32_t>(nenRespUploadLogMsg)
+ ,static_cast<int32_t>(nenRespUploadLogMsg));
+static CONST_NETWORK_UINT32(su32RespUploadLogMsgMessageLength,8,8);
+static const tstTypeInfo* sapstRespUploadLogMsgInfoArray[] =
+{
+ &senRespUploadLogMsgMessageType
+ ,&su32RespUploadLogMsgMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxRespUploadLogMsgMessage,nenRespUploadLogMsg,2,sapstRespUploadLogMsgInfoArray);
+
+static CONST_NETWORK_ENUM(senRespChangeMsgDataMessageType
+ ,static_cast<int32_t>(nenRespChangeMsgData)
+ ,static_cast<int32_t>(nenRespChangeMsgData));
+static CONST_NETWORK_UINT32(su32RespChangeMsgDataMessageLength,8,8);
+static const tstTypeInfo* sapstRespChangeMsgDataInfoArray[] =
+{
+ &senRespChangeMsgDataMessageType
+ ,&su32RespChangeMsgDataMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxRespChangeMsgDataMessage,nenRespChangeMsgData,2,sapstRespChangeMsgDataInfoArray);
+
+static CONST_NETWORK_ENUM(senRespUnknownReqMessageType
+ ,static_cast<int32_t>(nenRespUnknownReq)
+ ,static_cast<int32_t>(nenRespUnknownReq));
+static CONST_NETWORK_UINT32(su32RespUnknownReqMessageLength,8,8);
+static const tstTypeInfo* sapstRespUnknownReqInfoArray[] =
+{
+ &senRespUnknownReqMessageType
+ ,&su32RespUnknownReqMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxRespUnknownReqMessage,nenRespUnknownReq,2,sapstRespUnknownReqInfoArray);
+
+static CONST_NETWORK_ENUM(senReqEnumerateInterfacesMessageType
+ ,static_cast<int32_t>(nenReqEnumerateInterfaces)
+ ,static_cast<int32_t>(nenReqEnumerateInterfaces));
+static CONST_NETWORK_UINT32(su32ReqEnumerateInterfacesMessageLength,8,8);
+static CONST_NETWORK_STRING(ssReqEnumerateInterfacesNames,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstReqEnumerateInterfacesInfoArray[] =
+{
+ &senReqEnumerateInterfacesMessageType
+ ,&su32ReqEnumerateInterfacesMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxReqEnumerateInterfacesMessage,nenReqEnumerateInterfaces,2,sapstReqEnumerateInterfacesInfoArray);
+
+static CONST_NETWORK_ENUM(senRespEnumerateInterfacesMessageType
+ ,static_cast<int32_t>(nenRespEnumerateInterfaces)
+ ,static_cast<int32_t>(nenRespEnumerateInterfaces));
+static CONST_NETWORK_UINT32(su32RespEnumerateInterfacesMessageLength,512,512);
+static CONST_NETWORK_STRING(ssRespEnumerateInterfacesNames,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstRespEnumerateInterfacesInfoArray[] =
+{
+ &senRespEnumerateInterfacesMessageType
+ ,&su32RespEnumerateInterfacesMessageLength
+ ,&ssRespEnumerateInterfacesNames
+};
+static CONST_NETWORK_RECORD_PROP(sxRespEnumerateInterfacesMessage,nenRespEnumerateInterfaces,3,sapstRespEnumerateInterfacesInfoArray);
+
+static CONST_NETWORK_ENUM(senReqImportLogMessageType
+ ,static_cast<int32_t>(nenReqImportLog)
+ ,static_cast<int32_t>(nenReqImportLog));
+static CONST_NETWORK_UINT32(su32ReqImportLogMessageLength,512,512);
+static CONST_NETWORK_STRING(ssReqImportLogFilename,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstReqImportLogInfoArray[] =
+{
+ &senReqImportLogMessageType
+ ,&su32ReqImportLogMessageLength
+ ,&ssReqImportLogFilename
+};
+static CONST_NETWORK_RECORD_PROP(sxReqImportLogMessage,nenReqImportLog,3,sapstReqImportLogInfoArray);
+
+static CONST_NETWORK_ENUM(senRespImportLogMessageType
+ ,static_cast<int32_t>(nenRespImportLog)
+ ,static_cast<int32_t>(nenRespImportLog));
+static CONST_NETWORK_UINT32(su32RespImportLogMessageLength,512,512);
+static CONST_NETWORK_STRING(ssRespImportLogFilename,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstRespImportLogInfoArray[] =
+{
+ &senRespImportLogMessageType
+ ,&su32RespImportLogMessageLength
+ ,&ssRespImportLogFilename
+};
+static CONST_NETWORK_RECORD_PROP(sxRespImportLogMessage,nenRespImportLog,3,sapstRespImportLogInfoArray);
+
+static CONST_NETWORK_ENUM(senReqChangeMsgDataMessageType
+ ,static_cast<int32_t>(nenReqChangeMsgData)
+ ,static_cast<int32_t>(nenReqChangeMsgData));
+static CONST_NETWORK_UINT32(su32ReqChangeMsgDataMessageLength,24,24);
+static CONST_NETWORK_INT32(si32ReqChangeMsgDataInterface,1,7);
+static CONST_NETWORK_UINT32(su32ReqChangeMsgDataCanMsgId,0,0x7FFFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData0,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData1,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData2,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData3,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData4,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData5,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData6,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqChangeMsgDataData7,0,0xFF);
+static const tstTypeInfo* sapstReqChangeMsgDataInfoArray[] =
+{
+ &senReqChangeMsgDataMessageType
+ ,&su32ReqChangeMsgDataMessageLength
+ ,&si32ReqChangeMsgDataInterface
+ ,&su32ReqChangeMsgDataCanMsgId
+ ,&su8ReqChangeMsgDataData0
+ ,&su8ReqChangeMsgDataData1
+ ,&su8ReqChangeMsgDataData2
+ ,&su8ReqChangeMsgDataData3
+ ,&su8ReqChangeMsgDataData4
+ ,&su8ReqChangeMsgDataData5
+ ,&su8ReqChangeMsgDataData6
+ ,&su8ReqChangeMsgDataData7
+};
+static CONST_NETWORK_RECORD_PROP(sxReqChangeMsgDataMessage
+ ,nenReqChangeMsgData,12,sapstReqChangeMsgDataInfoArray);
+
+static CONST_NETWORK_ENUM(senReqEnumerateLogsMessageType
+ ,static_cast<int32_t>(nenReqEnumerateLogs)
+ ,static_cast<int32_t>(nenReqEnumerateLogs));
+static CONST_NETWORK_UINT32(su32ReqEnumerateLogsMessageLength,8,8);
+static const tstTypeInfo* sapstReqEnumerateLogsInfoArray[] =
+{
+ &senReqEnumerateLogsMessageType
+ ,&su32ReqEnumerateLogsMessageLength
+};
+static CONST_NETWORK_RECORD_PROP(sxReqEnumerateLogsMessage,nenReqEnumerateLogs,2,sapstReqEnumerateLogsInfoArray);
+
+static CONST_NETWORK_ENUM(senRespEnumerateLogsMessageType
+ ,static_cast<int32_t>(nenRespEnumerateLogs)
+ ,static_cast<int32_t>(nenRespEnumerateLogs));
+static CONST_NETWORK_UINT32(su32RespEnumerateLogsMessageLength,512,512);
+static CONST_NETWORK_STRING(ssRespEnumerateLogsFilenames,nNETWORK_DATALENGTH);
+static const tstTypeInfo* sapstRespEnumerateLogsInfoArray[] =
+{
+ &senRespEnumerateLogsMessageType
+ ,&su32RespEnumerateLogsMessageLength
+ ,&ssRespEnumerateLogsFilenames
+};
+static CONST_NETWORK_RECORD_PROP(sxRespEnumarateLogsMessage,nenRespEnumerateLogs,3,sapstRespEnumerateLogsInfoArray);
+
+static CONST_NETWORK_ENUM(senReqUploadLogMsgMessageType
+ ,static_cast<int32_t>(nenReqUploadLogMsg)
+ ,static_cast<int32_t>(nenReqUploadLogMsg));
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgMessageLength,0,512);
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgTimestampHigh,0,0xFFFFFFFF);
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgTimestampLow,0,0xFFFFFFFF);
+static CONST_NETWORK_INT32(si32ReqUploadLogMsgInterface,1,7);
+static CONST_NETWORK_UINT32(su32ReqUploadLogMsgCanMsgId,0,0x7FFFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData0,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData1,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData2,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData3,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData4,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData5,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData6,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgData7,0,0xFF);
+static CONST_NETWORK_UINT8(su8ReqUploadLogMsgDirection,0,1);
+static const tstTypeInfo* sapstReqUploadLogMsgInfoArray[] =
+{
+ &senReqUploadLogMsgMessageType
+ ,&su32ReqUploadLogMsgMessageLength
+ ,&su32ReqUploadLogMsgTimestampHigh
+ ,&su32ReqUploadLogMsgTimestampLow
+ ,&si32ReqUploadLogMsgInterface
+ ,&su32ReqUploadLogMsgCanMsgId
+ ,&su8ReqUploadLogMsgData0
+ ,&su8ReqUploadLogMsgData1
+ ,&su8ReqUploadLogMsgData2
+ ,&su8ReqUploadLogMsgData3
+ ,&su8ReqUploadLogMsgData4
+ ,&su8ReqUploadLogMsgData5
+ ,&su8ReqUploadLogMsgData6
+ ,&su8ReqUploadLogMsgData7
+ ,&su8ReqUploadLogMsgDirection
+};
+static CONST_NETWORK_RECORD_PROP(sxReqUploadLogMsgMessage,nenReqUploadLogMsg,15,sapstReqUploadLogMsgInfoArray);
+
+#endif /*NETWORKMESSAGES_H_*/
diff --git a/Master/Masterarbeit/src/common/inc/NetworkTypes.h b/Master/Masterarbeit/src/common/inc/NetworkTypes.h
new file mode 100644
index 0000000..5da2f64
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/NetworkTypes.h
@@ -0,0 +1,467 @@
+/*!
+ * \file NetworkTypes.h
+ * \author S. Eisenhauer
+ * \date 15.01.2012
+ * \brief Defintion of elementary data types used in network messages and classes for reading and writing them
+ */
+#ifndef NETWORK_TYPES_H_
+#define NETWORK_TYPES_H_
+
+#include "global.h"
+#include "CNetworkStream.h"
+#include "protocol.h"
+
+/*!
+ * \brief Container class for data from and to network. Allows structured access to network message data.
+ */
+class CNetworkDatacontainer
+{
+public:
+ /// constructor
+ CNetworkDatacontainer();
+ /*!
+ * \brief get the pointer to the memory of the data for specified message type
+ * \param[in] enMsgIdx Enumerator of the message type
+ */
+ void* pvGetVarPtr(tenNetworkMessageType enMsgIdx);
+ /*!
+ * \brief get the pointer to the memory of a data element for specified message type
+ * \param[in] enMsgIdx Enumerator of the message type
+ * \param[in] u8ElemIdx Index of the element in message data structure
+ */
+ void* pvGetVarPtr(tenNetworkMessageType enMsgIdx, uint8_t u8ElemIdx);
+ /// type definition for structure of Start Plugin request
+ struct tstReqStartPlugin {
+ tstNetworkMessageHeader stHeader; //!< header
+ int32_t i32Interface; //!< number of the interface
+ char acFilename[nNETWORK_DATALENGTH-4]; //!< shared object path
+ };
+ /// type definition for structure of Stop Plugin request
+ struct tstReqStopPlugin {
+ tstNetworkMessageHeader stHeader;//!< header
+ int32_t i32Interface; //!< number of the interface
+ };
+ /// type definition for structure of Enumerate Interfaces request
+ struct tstReqEnumerateInterfaces {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Enumerate Logfiles request
+ struct tstReqEnumerateLogs {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Import Logfile request
+ struct tstReqImportLog {
+ tstNetworkMessageHeader stHeader;//!< header
+ char acFilename[nNETWORK_DATALENGTH]; //!< log file path
+ };
+ /// type definition for structure of Change Message Data request
+ struct tstReqChangeMsgData {
+ tstNetworkMessageHeader stHeader;//!< header
+ int32_t i32Interface; //!< number of the interface
+ uint32_t u32CanMsgId; //!< CAN ID of the message
+ uint8_t au8Data[8]; //!< data bytes of the CAN message
+ };
+ /// type definition for structure of Upload Logged Message request
+ struct tstReqUploadLogMsg {
+ tstNetworkMessageHeader stHeader;//!< header
+ tstLogMessage stLogMessage; //!< the logged message
+ };
+ /// type definition for structure of Start Plugin response
+ struct tstRespStartPlugin {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Stop Plugin response
+ struct tstRespStopPlugin {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Shutdown response
+ struct tstRespShutdown {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Shutdown request
+ struct tstReqShutdown {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Import Logfile response
+ struct tstRespImportLog {
+ tstNetworkMessageHeader stHeader;//!< header
+ char acFilename[nNETWORK_DATALENGTH]; //!< logfile path
+ };
+ /// type definition for structure of Enumerate Logfiles response
+ struct tstRespEnumerateLogs {
+ tstNetworkMessageHeader stHeader;//!< header
+ char acFilenames[nNETWORK_DATALENGTH]; //!< paths of the available logfiles
+ };
+ /// type definition for structure of Enumerate Interfaces response
+ struct tstRespEnumerateInterfaces {
+ tstNetworkMessageHeader stHeader;//!< header
+ char acInterfaces[nNETWORK_DATALENGTH]; //!< interfaces
+ };
+ /// type definition for structure of Upload Logged Message response
+ struct tstRespUploadLogMsg {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Change Message Data response
+ struct tstRespChangeMsgData {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Unknown Request response
+ struct tstRespUnknownReq {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of Invalid Argument response
+ struct tstRespInvalidArg {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+ /// type definition for structure of header of received message
+ struct tstRxNetworkMessageMsg {
+ tstNetworkMessageHeader stHeader;//!< header
+ };
+private:
+ tstReqStartPlugin m_stReqStartPlugin;
+ tstReqStopPlugin m_stReqStopPlugin;
+ tstReqEnumerateInterfaces m_stReqEnumerateInterfaces;
+ tstReqEnumerateLogs m_stReqEnumerateLogs;
+ tstReqChangeMsgData m_stReqChangeMsgData;
+ tstReqUploadLogMsg m_stReqUploadLogMsg;
+ tstReqImportLog m_stReqImportLog;
+ tstReqShutdown m_stReqShutdown;
+ tstRespStartPlugin m_stRespStartPlugin;
+ tstRespStopPlugin m_stRespStopPlugin;
+ tstRespShutdown m_stRespShutdown;
+ tstRespImportLog m_stRespImportLog;
+ tstRespEnumerateLogs m_stRespEnumerateLogs;
+ tstRespEnumerateInterfaces m_stRespEnumerateInterfaces;
+ tstRespChangeMsgData m_stRespChangeMsgData;
+ tstRespUploadLogMsg m_stRespUploadLogMsg;
+ tstRespUnknownReq m_stRespUnknownReq;
+ tstRespInvalidArg m_stRespInvalidArg;
+ tstRxNetworkMessageMsg m_stRxMsg;
+};
+
+/// enumeration of elementary datatypes in netowrk messages
+enum tenNetworkElementarTypes
+{
+ nenNetworkEnum //!< enum datatype
+ ,nenNetworkInt8 //!< 8 bit signed integer datatype
+ ,nenNetworkUint8 //!< 8 bit unsigned integer datatype
+ ,nenNetworkInt32 //!< 32 bit signed integer datatype
+ ,nenNetworkUint32 //!< 32 bit unsigned integer datatype
+ ,nenNetworkString //!< string datatype
+};
+
+/// structure describing a datum
+struct tstTypeInfo
+{
+ tenNetworkElementarTypes m_enType; //!< type of the datum
+};
+
+/// structure describing a network record property
+struct tstNetworkModelInfo
+{
+ tenNetworkMessageType m_enMsgType; //!< type of the message
+ uint8_t m_u8NumOfFields; //!< number of datum fields in the message
+ const tstTypeInfo* const* m_apstFieldInfoPtrArray; //!< array of pointers of datum descriptions
+};
+
+/// class for handling a network record property
+class CNetworkRecordProp : public tstNetworkModelInfo
+{
+public:
+ /*!
+ * \brief read a network message from a stream and store it in a destination
+ * \param[in] xDatacontainer reference to datacontainer for message
+ * \param[in] xStream stream containing the message
+ */
+ void vRead(CNetworkDatacontainer& xDatacontainer, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write a network message to a stream
+ * \param[in] xDatacontainer reference to datacontainer with message
+ * \param[in] xStream stream to which the message is written
+ */
+ void vWrite(CNetworkDatacontainer& xDatacontainer, CNetworkOutStream& xStream) const;
+// uint8_t m_u8NumOfFields; //!< number of datum fields in the message
+// const tstTypeInfo* const* m_apstFieldInfoPtrArray; //!< array of pointers of datum descriptions
+};
+
+/// class for handling a enumeration datum
+class CNetworkEnum : public tstTypeInfo
+{
+public:
+ /*!
+ * \brief read elementary enum type from stream and verify it implicitly
+ * \param[in] pvDest pointer to memory where the value will be stored
+ * \param[in] xStream input stream from which to read the value
+ */
+ void vRead(void* pvDest, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write elementary enum type to stream and verify it implicitly
+ * \param[in] pvSrc pointer to memory where the value is stored
+ * \param[in] xStream output stream to which to write the value
+ */
+ void vWrite(void* pvSrc, CNetworkOutStream& xStream) const;
+ /*!
+ * \brief validate datum
+ * \param[in] i32Value datum to validate
+ * \return TRUE if datum is valid, FALSE otherwise
+ */
+ bool boIsValid(const int32_t i32Value) const;
+ int32_t m_i32Min; //!< valid minimum of the datum
+ int32_t m_i32Max; //!< valid maximum of the datum
+};
+
+/// class for handling a 8 bit signed integer datum
+class CNetworkUint8 : public tstTypeInfo
+{
+public:
+ /*!
+ * \brief read elementary 8-bit unsigned integer type from stream and verify it implicitly
+ * \param[in] pvDest pointer to memory where the value will be stored
+ * \param[in] xStream input stream from which to read the value
+ */
+ void vRead(void* pvDest, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write elementary 8-bit unsigned integer type to stream and verify it implicitly
+ * \param[in] pvSrc pointer to memory where the value is stored
+ * \param[in] xStream output stream to which to write the value
+ */
+ void vWrite(void* pvSrc, CNetworkOutStream& xStream) const;
+ /*!
+ * \brief validate datum
+ * \param[in] u8Value datum to validate
+ * \return TRUE if datum is valid, FALSE otherwise
+ */
+ bool boIsValid(const uint8_t u8Value) const;
+ uint8_t m_u8Min; //!< valid minimum of the datum
+ uint8_t m_u8Max; //!< valid maximum of the datum
+};
+
+/// class for handling a 8 bit unsigned integer datum
+class CNetworkInt8 : public tstTypeInfo
+{
+public:
+ /*!
+ * \brief read elementary 8-bit signed integer type from stream and verify it implicitly
+ * \param[in] pvDest pointer to memory where the value will be stored
+ * \param[in] xStream input stream from which to read the value
+ */
+ void vRead(void* pvDest, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write elementary 8-bit signed integer type to stream and verify it implicitly
+ * \param[in] pvSrc pointer to memory where the value is stored
+ * \param[in] xStream output stream to which to write the value
+ */
+ void vWrite(void* pvSrc, CNetworkOutStream& xStream) const;
+ /*!
+ * \brief validate datum
+ * \param[in] i8Value datum to validate
+ * \return TRUE if datum is valid, FALSE otherwise
+ */
+ bool boIsValid(const int8_t i8Value) const;
+ int8_t m_i8Min; //!< valid minimum of the datum
+ int8_t m_i8Max; //!< valid maximum of the datum
+};
+
+/// class for handling a 32 bit signed integer datum
+class CNetworkUint32 : public tstTypeInfo
+{
+public:
+ /*!
+ * \brief read elementary 32-bit unsigned integer type from stream and verify it implicitly
+ * \param[in] pvDest pointer to memory where the value will be stored
+ * \param[in] xStream input stream from which to read the value
+ */
+ void vRead(void* pvDest, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write elementary 32-bit unsigned integer type to stream and verify it implicitly
+ * \param[in] pvSrc pointer to memory where the value is stored
+ * \param[in] xStream output stream to which to write the value
+ */
+ void vWrite(void* pvSrc, CNetworkOutStream& xStream) const;
+ /*!
+ * \brief validate datum
+ * \param[in] u32Value datum to validate
+ * \return TRUE if datum is valid, FALSE otherwise
+ */
+ bool boIsValid(const uint32_t u32Value) const;
+ uint32_t m_u32Min; //!< valid minimum of the datum
+ uint32_t m_u32Max; //!< valid maximum of the datum
+};
+
+/// class for handling a 32 bit unsigned integer datum
+class CNetworkInt32 : public tstTypeInfo
+{
+public:
+ /*!
+ * \brief read elementary 32-bit signed integer type from stream and verify it implicitly
+ * \param[in] pvDest pointer to memory where the value will be stored
+ * \param[in] xStream input stream from which to read the value
+ */
+ void vRead(void* pvDest, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write elementary 32-bit signed integer type to stream and verify it implicitly
+ * \param[in] pvSrc pointer to memory where the value is stored
+ * \param[in] xStream output stream to which to write the value
+ */
+ void vWrite(void* pvSrc, CNetworkOutStream& xStream) const;
+ /*!
+ * \brief validate datum
+ * \param[in] i32Value datum to validate
+ * \return TRUE if datum is valid, FALSE otherwise
+ */
+ bool boIsValid(const int32_t i32Value) const;
+ int32_t m_i32Min; //!< valid minimum of the datum
+ int32_t m_i32Max; //!< valid maximum of the datum
+};
+
+/// class for handling a string datum
+class CNetworkString : public tstTypeInfo
+{
+public:
+ /*!
+ * \brief read elementary string type from stream
+ * \param[in] pvDest pointer to memory where the value will be stored
+ * \param[in] xStream input stream from which to read the value
+ */
+ void vRead(void* pvDest, CNetworkInStream& xStream) const;
+ /*!
+ * \brief write elementary string type to stream and verify it implicitly
+ * \param[in] pvSrc pointer to memory where the value is stored
+ * \param[in] xStream output stream to which to write the value
+ */
+ void vWrite(void* pvSrc, CNetworkOutStream& xStream) const;
+ uint32_t m_u32Length; //!< maximum length of the string
+};
+
+//struct tstNetworkRecordProp
+//{
+// uint8_t m_u8NumOfFields;
+// const tstTypeInfo* const* m_apstFieldInfoPtrArray;
+//};
+/*!
+ * \brief macro for generating a network record property object, which represents a network message
+ * \param[in] name name of the object
+ * \param[in] msgType message type enumerator
+ * \param[in] numOfFields number of elements of the record
+ * \param[in] infoPtrArray pointer to array of pointers with datatype informations definitions
+ */
+#define CONST_NETWORK_RECORD_PROP(name,msgType,numOfFields,infoPtrArray)\
+const tstNetworkModelInfo name##_={msgType,numOfFields,infoPtrArray}; \
+const CNetworkRecordProp& name = reinterpret_cast<const CNetworkRecordProp&>(name##_);
+
+/// structure defining a network enum type
+struct tstNetworkEnumType
+{
+ tenNetworkElementarTypes m_enType; //!< elementary datatype
+ int32_t m_i32Min; //!< valid minimum of the datum
+ int32_t m_i32Max; //!< valid maximum of the datum
+};
+/*!
+ * \brief macro for generating a object coding a enumeration
+ * \param[in] name object name
+ * \param[in] min minimum valid value
+ * \param[in] max maximum valid value
+ */
+#define CONST_NETWORK_ENUM(name,min,max) \
+const tstNetworkEnumType name##_ = {nenNetworkEnum,min,max}; \
+const CNetworkEnum& name = reinterpret_cast<const CNetworkEnum&>(name##_);
+
+/// structure defining a network unsigned 8-bit integer type
+struct tstNetworkUint8Type
+{
+ tenNetworkElementarTypes m_enType; //!< elementary datatype
+ uint8_t m_u8Min; //!< valid minimum of the datum
+ uint8_t m_u8Max; //!< valid maximum of the datum
+};
+/*!
+ * \brief macro for generating a object coding a 8-bit unsigned integer
+ * \param[in] name object name
+ * \param[in] min minimum valid value
+ * \param[in] max maximum valid value
+ */
+#define CONST_NETWORK_UINT8(name,min,max) \
+const tstNetworkUint8Type name##_ = {nenNetworkUint8,min,max}; \
+const CNetworkUint8& name = reinterpret_cast<const CNetworkUint8&>(name##_);
+
+/// structure defining a network signed 8-bit integer type
+struct tstNetworkInt8Type
+{
+ tenNetworkElementarTypes m_enType; //!< elementary datatype
+ int8_t m_i8Min; //!< valid minimum of the datum
+ int8_t m_i8Max; //!< valid maximum of the datum
+};
+/*!
+ * \brief macro for generating a object coding a 8-bit signed integer
+ * \param[in] name object name
+ * \param[in] min minimum valid value
+ * \param[in] max maximum valid value
+ */
+#define CONST_NETWORK_INT8(name,min,max) \
+const tstNetworkInt8Type name##_ = {nenNetworkInt8,min,max}; \
+const CNetworkInt8& name = reinterpret_cast<const CNetworkInt8&>(name##_);
+
+/// structure defining a network unsigned 32-bit integer type
+struct tstNetworkUint32Type
+{
+ tenNetworkElementarTypes m_enType; //!< elementary datatype
+ uint32_t m_u32Min; //!< valid minimum of the datum
+ uint32_t m_u32Max; //!< valid maximum of the datum
+};
+/*!
+ * \brief macro for generating a object coding a 32-bit unsigned integer
+ * \param[in] name object name
+ * \param[in] min minimum valid value
+ * \param[in] max maximum valid value
+ */
+#define CONST_NETWORK_UINT32(name,min,max) \
+const tstNetworkUint32Type name##_ = {nenNetworkUint32,min,max}; \
+const CNetworkUint32& name = reinterpret_cast<const CNetworkUint32&>(name##_);
+
+/// structure defining a network signed 32-bit integer type
+struct tstNetworkInt32Type
+{
+ tenNetworkElementarTypes m_enType; //!< elementary datatype
+ int32_t m_i32Min; //!< valid minimum of the datum
+ int32_t m_i32Max; //!< valid maximum of the datum
+};
+/*!
+ * \brief macro for generating a object coding a 32-bit signed integer
+ * \param[in] name object name
+ * \param[in] min minimum valid value
+ * \param[in] max maximum valid value
+ */
+#define CONST_NETWORK_INT32(name,min,max) \
+const tstNetworkInt32Type name##_ = {nenNetworkInt32,min,max}; \
+const CNetworkInt32& name = reinterpret_cast<const CNetworkInt32&>(name##_);
+
+/// structure defining a network string type
+struct tstNetworkStringType
+{
+ tenNetworkElementarTypes m_enType; //!< elementary datatype
+ uint32_t u32Length; //!< valid maximum length of the string
+};
+/*!
+ * \brief macro for generating a string coding object
+ * \param[in] name object name
+ * \param[in] length length of the string
+ */
+#define CONST_NETWORK_STRING(name,length) \
+const tstNetworkStringType name##_ = {nenNetworkString,length}; \
+const CNetworkString& name = reinterpret_cast<const CNetworkString&>(name##_);
+
+/*!
+ * \brief function for compile time polymorphism to call right read method depending on datatype
+ * \param[in] pstObjPtr pointer to datatype definition
+ * \param[in] pvDst pointer to memory where the read value should be stored
+ * \param[in] xStream stream to read value from
+ */
+void vInvokeRead(const tstTypeInfo* pstObjPtr, void* pvDst, CNetworkInStream& xStream);
+/*!
+ * \brief function for compile time polymorphism to call right write method depending on datatype
+ * \param[in] pstObjPtr pointer to datatype definition
+ * \param[in] pvSrc pointer to memory where the value is stored that should be written
+ * \param[in] xStream stream to write value to
+ */
+void vInvokeWrite(const tstTypeInfo* pstObjPtr, void* pvSrc, CNetworkOutStream& xStream);
+
+#endif /*NETWORK_TYPES_H_*/
diff --git a/Master/Masterarbeit/src/common/inc/global.h b/Master/Masterarbeit/src/common/inc/global.h
new file mode 100644
index 0000000..df3d812
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/global.h
@@ -0,0 +1,162 @@
+/*!
+ * \file global.h
+ * \author S. Eisenhauer
+ * \date 31.08.2011
+ * \brief Global include file
+ *
+ * This file is used in all other components
+ * It defines
+ * \li common datatypes
+ * \li a macro for printing error messages to STDERR
+ * \li a macro for printing debug messages to STDOUT when compiled with -DDEBUG_MODE
+ *
+ */
+
+#ifndef GLOBAL_H_
+#define GLOBAL_H_
+
+#include <stdio.h>
+
+#ifdef _MSC_VER
+
+#define nLITTLE_ENDIAN_HOST
+
+#include <boost/cstdint.hpp>
+using boost::uint32_t;
+using boost::int32_t;
+using boost::uint8_t;
+using boost::int8_t;
+
+#ifdef DEBUG_MODE
+
+#define DEBUG_PRINT(format, ...) \
+ { \
+ static char message[512]; \
+ sprintf_s(message,512,format, __VA_ARGS__); \
+ fprintf(stdout, "[%s] line %d : %s\n", __FUNCTION__,__LINE__, message); \
+ fflush(stdout); \
+ }
+
+#else /* !DEBUG_MODE */
+
+#define DEBUG_PRINT(format, ...)
+
+#endif /* !DEBUG_MODE */
+
+#define ERROR_PRINT(format, ...) \
+ { \
+ static char message[512]; \
+ sprintf_s(message,512,format, __VA_ARGS__); \
+ fprintf(stderr, "[%s] line %d : %s\n", __FUNCTION__,__LINE__, message); \
+ fflush(stderr); \
+ }
+
+#else /* x2e embedded SDK*/
+
+#include <stdint.h>
+#ifdef DEBUG_MODE
+
+#define DEBUG_PRINT(format, args...) \
+ { \
+ static char message[512]; \
+ snprintf(message,512,format, ##args); \
+ fprintf(stdout, "[%s] line %d : %s\n", __PRETTY_FUNCTION__,__LINE__, message); \
+ fflush(stdout); \
+ }
+
+#else /* !DEBUG_MODE */
+
+#define DEBUG_PRINT(format, args...)
+
+#endif /* !DEBUG_MODE */
+
+#define ERROR_PRINT(format, args...) \
+ { \
+ static char message[512]; \
+ snprintf(message,512,format, ##args); \
+ fprintf(stderr, "[%s] line %d : %s\n", __PRETTY_FUNCTION__,__LINE__, message); \
+ fflush(stderr); \
+ }
+#endif /* _MSC_VER */
+
+#ifdef nLITTLE_ENDIAN_HOST /* little endian macros, convert to big endian byte order */
+#define BYTE_SWAP16(type,value) \
+ ( (type) ((0xff00 & val) >> 8) | ((0xff & val) << 8) )
+
+#define BYTE_SWAP32(type,value) \
+ ( (type) ((0xff000000 & value) >> 24) | \
+ ((0x00ff0000 & value) >> 8) | \
+ ((0x0000ff00 & value) << 8) | \
+ ((0x000000ff & value) << 24) )
+
+#define MAKE_INT32(a,b,c,d) int32_t( ( ( (uint32_t) d ) << 24 ) | ( ( (uint32_t) c ) << 16 ) | ( ( (uint32_t) b ) << 8 ) | uint8_t(a) )
+#define MAKE_UINT32(a,b,c,d) uint32_t( ( ( (uint32_t) d ) << 24 ) | ( ( (uint32_t) c ) << 16 ) | ( ( (uint32_t) b ) << 8 ) | uint8_t(a) )
+#define HIGH_BYTE(w) uint8_t( w >> 8 )
+#define LOW_BYTE(w) uint8_t( w & 0xff )
+#define HIGH_WORD(dw) uint16_t( dw >> 16 )
+#define LOW_WORD(dw) uint16_t( dw & 0xffff )
+
+#else /* big endian macros, keep byte order*/
+#define BYTE_SWAP16(type,value) \
+ ( (type) value )
+
+#define BYTE_SWAP32(type,value) \
+ ( (type) value )
+
+#define MAKE_INT32(a,b,c,d) int32_t( ( ( (uint32_t) a ) << 24 ) | ( ( (uint32_t) b ) << 16 ) | ( ( (uint32_t) c ) << 8 ) | uint8_t(d) )
+#define MAKE_UINT32(a,b,c,d) uint32_t( ( ( (uint32_t) a ) << 24 ) | ( ( (uint32_t) b ) << 16 ) | ( ( (uint32_t) c ) << 8 ) | uint8_t(d) )
+#define HIGH_BYTE(w) uint8_t( w & 0xff )
+#define LOW_BYTE(w) uint8_t( w >> 8 )
+#define HIGH_WORD(dw) uint16_t( dw & 0xffff )
+#define LOW_WORD(dw) uint16_t( dw >> 16 )
+
+#endif /* nLITTLE_ENDIAN_HOST endianess macros */
+
+#define nTIMER_INTERVAL_US (1000) //timer interval in mircoseconds
+#define nMAX_SAFE_STACK (4*1024)
+
+/*!
+ * \brief Enumeration of used priotities
+ */
+enum tenPrio
+{
+ nenRT=80, //!< real-time priority, above interrupts
+ nenNORMAL=20, //!< normal priority
+ nenLOW=10 //!< low priority
+};
+
+/*!
+ * \brief Enumeration for error codes
+ */
+enum tenRetCodes
+{
+ nenOK, //!< no error
+ nenERR_SOFILE, //!< shared object file could not be opened
+ nenERR_SYMBOL, //!< symbol could not be found in shared object
+ nenERR_MAKE, //!< Executing the generated Makefile resulted in error state
+ nenERR_FTP, //!< An error occured in FTP operation
+ nenERR_NOTIMPLEMENTED, //!< invoking an unimplemented method
+ nenERR_MOVELOG, //!< error in log rotation
+ nenERR_MAX_PLUGINS_REACHED //!< Maximum number of active plugins reached
+};
+/*!
+ * \brief Enumeration for message direction
+ */
+enum tenMsgDirection
+{
+ nenRx = 0, //!< received message
+ nenTx = 1 //!< sent message
+};
+/*!
+* \brief Definition of a received message
+*/
+struct tstLogMessage
+{
+ uint32_t u32TsHigh; //!< Upper 32 Bit of the 64 Bit 100 ns Timestamp
+ uint32_t u32TsLow; //!< Lower 32 Bit of the 64 Bit 100 ns Timestamp
+ int32_t i32Interface; //!< Interface-Handle on which the message was received
+ uint32_t u32MsgId; //!< ID of the received message
+ uint8_t au8Data[8]; //!< Data of the received message
+ uint8_t u8Dir; //!< direction of message
+};
+#endif /* GLOBAL_H_ */
diff --git a/Master/Masterarbeit/src/common/inc/interface_manager.h b/Master/Masterarbeit/src/common/inc/interface_manager.h
new file mode 100644
index 0000000..be910d4
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/interface_manager.h
@@ -0,0 +1,99 @@
+/*!
+ * \file interface_manager.h
+ *
+ * \author S. Eisenhauer
+ *
+ * \date 31.08.2011
+ *
+ * \brief Interface for accessing XORAYA hardware
+ *
+ * This file defines the interface for accessing XORAYA Connect hardware interfaces
+ *
+ */
+
+#ifndef INTERFACE_MANAGER_H_
+#define INTERFACE_MANAGER_H_
+
+#include "global.h"
+#include "x2e/ReceiveQueue.hpp"
+
+/*!
+* \brief Pure virtual interface used by other components and plugins to access XORAYA hardware
+*/
+class IInterfaceManager
+{
+public:
+ /*!
+ * Sends a mesage on a hardware interface
+ * \param[in] i32InterfaceHandle Interface handle
+ * \param[in] u32MsgId ID of the message
+ * \param[in] boIsExtended TRUE indicates an extended ID (29 bit long), FALSE a standard ID (11 bit long)
+ * \param[in] boIsRtrFrame is this an RTR frame
+ * \param[in] pu8Data pointer to the buffer for the message payload
+ * \param[in] u32DataLength Length of message payload in byte (DLC)
+ * \return status code
+ */
+ virtual x2e::status_t enWriteCanMessage(
+ int32_t i32InterfaceHandle,
+ uint32_t u32MsgId,
+ bool boIsExtended,
+ bool boIsRtrFrame,
+ const uint8_t* pu8Data,
+ uint32_t u32DataLength) = 0;
+
+ /*!
+ * Retrieve the fill level of the receive queue
+ * \param[out] stFillLevel Reference to a queueFillLevel object
+ * \return status code
+ */
+ virtual x2e::status_t enGetQueueFillLevel(x2e::Log::queueFillLevel& stFillLevel) = 0;
+
+ /*!
+ * Get a message from the receive queue
+ * \param[out] stFillLevel Reference to a queueFillLevel object
+ * \param[out] pstMsgDescr Pointer to a message description object
+ * \param[out] pstMsgPayload Pointer to framePayload object as buffer for the message content
+ * \return status code
+ */
+ virtual x2e::status_t enPeekMessage(
+ x2e::Log::queueFillLevel& stFillLevel,
+ x2e::Log::messageDescription* pstMsgDescr,
+ x2e::Log::framePayload* pstMsgPayload) = 0;
+
+ /*!
+ * Enable an Hardware interface
+ * \param[in] i32RequestedIntereface Interface handle
+ * \return status code
+ */
+ virtual x2e::status_t enEnableInterface( int32_t i32RequestedIntereface ) = 0;
+
+ /*!
+ * Enable all Hardware interface
+ * \return status code
+ */
+ virtual x2e::status_t enEnableAllInterfaces( void ) = 0;
+
+ /*!
+ * Gets the current 100 nanosecond timestamp of the system
+ * \param[out] pu32TsHigh Upper 32 bit of the timestamp
+ * \param[out] pu32TsLow Lower 32 bit of the timestamp
+ * \return status code
+ */
+ virtual x2e::status_t enGetTimestamp( uint32_t* pu32TsHigh, uint32_t* pu32TsLow ) = 0;
+
+ /*!
+ * wait on the internal hardware timer
+ * \return status code
+ */
+ virtual x2e::status_t enWait() = 0;
+
+ /*!
+ * get interface handle by a log interface id
+ * \param[in] u16LogIfId log interface id
+ * \return interface handle
+ */
+ virtual int32_t i32GetInterfaceByLogIfId(x2e::Log::InterfaceId::ifid_t u16LogIfId) = 0;
+};
+
+
+#endif /* INTERFACE_MANAGER_H_ */
diff --git a/Master/Masterarbeit/src/common/inc/plugin_api.h b/Master/Masterarbeit/src/common/inc/plugin_api.h
new file mode 100644
index 0000000..a0c9e48
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/plugin_api.h
@@ -0,0 +1,138 @@
+/*!
+ * \file plugin_api.h
+ *
+ * \author S. Eisenhauer
+ *
+ * \date 31.08.2011
+ *
+ * \brief Interface of a plugin used by \ref CPluginExecutor
+ *
+ * This file defines the interface which must be provided by a plugin to \ref CPluginExecutor
+ *
+ */
+
+#ifndef PLUGIN_API_H_
+#define PLUGIN_API_H_
+
+#include "global.h"
+
+/*!
+* \brief Definition of a message to be sent on the CAN bus
+*/
+struct tstCanTxMessage
+{
+ uint32_t u32TxCycleMilliseconds; //!< Interval for sending cyclic message in milliseconds
+ uint32_t u32MillisecondCounter; //!< Incremented every millisecond, resetted to zero when message is sent
+ uint32_t u32CanId; //!< CAN ID of the message
+ uint8_t au8Data[8]; //!< data content of the message
+ uint8_t u8Dlc; //!< Data Length Code of the message: bytes of au8Data used by the message
+};
+/*!
+* \brief Type for pointer to a tstCanTxMessage
+*/
+typedef tstCanTxMessage* tpstCanTxMessage;
+
+/*!
+ * \brief Pure virtual interface of a plugin.
+ *
+ * Must be implemented by concrete plugin
+ */
+class IPlugin
+{
+public:
+ /*!
+ * executed every millisecond
+ * \warning Keep this method implementation short. It is executed with Real-Time priority.
+ */
+ virtual void vRun( void ) = 0;
+ /*!
+ * Get a message to be send on CAN bus from plugin
+ * \param[in] u32MsgIndex Index of the message. Call u32GetNumOfCanTxMessages before to get the number of available messages
+ * \return Pointer to the message
+ */
+ virtual tpstCanTxMessage pxGetCanTxMessage( const uint32_t u32MsgIndex ) = 0;
+ /*!
+ * Get the number of CAN TX messages defined in the plugin
+ * \return the number of messages
+ */
+ virtual uint32_t u32GetNumOfCanTxMessages( void ) = 0;
+ /*!
+ * Get the number of the used CAN interface
+ * \return the number of the used CAN interface
+ */
+ virtual int32_t i32GetCanInterfaceHandle( void ) = 0;
+ /*!
+ * Should this plugin be automatically loaded when CPluginExecutor starts up
+ * \return TRUE is the plugin should be autoloaded, FALSE otherwise
+ */
+ virtual bool boAutoload( void ) = 0;
+ /*!
+ * Is this plugin the instance of the Log Plugin
+ * \return TRUE if it is the log plugin, FALSE otherwise
+ */
+ virtual bool boIsLogger( void ) = 0;
+ /*!
+ * get a log file
+ * \param[in] pcRequest pointer to a memory buffer containing the filename of the request
+ * \param[out] pcResponse pointer to a memory buffer where the filename will be stored
+ * \return status
+ */
+ virtual tenRetCodes enGetLog(const char* pcRequest, char* pcResponse) = 0;
+ /*!
+ * initialize the plugin
+ *
+ * \param[in] pvExecutor Pointer to target main application
+ * \param[in] pvIfMan Pointer to an interface manager object
+ * \param[in] i32Interface Number of the interface ti be used by the plugin
+ * \param[in] u32PluginId ID of the Plugin
+ */
+ virtual void vInit(void* pvExecutor, void* pvIfMan, int32_t i32Interface, uint32_t u32PluginId) = 0;
+ /*!
+ * Add a message to the log
+ *
+ * \param[in] stLogMessage the message to log
+ */
+ virtual void vLogMessage(const tstLogMessage& stLogMessage) = 0;
+};
+extern "C"
+{
+ /*!
+ * \brief type for factory function
+ * \param[in] pvExecutor Pointer to target main application
+ * \param[in] pvIfMan Pointer to an interface manager object
+ * \param[in] i32Interface Number of the interface to be used by the plugin
+ * \param[in] u32PluginId ID of the Plugin
+ * \return Pointer to the Plugin object
+ */
+ typedef IPlugin* tfctCreatePlugin(
+ void* pvExecutor,
+ void* pvIfMan,
+ int32_t i32Interface,
+ uint32_t u32PluginId
+ );
+ /*!
+ * \brief type for factory function pointer
+ */
+ typedef tfctCreatePlugin *tpfctCreatePlugin;
+ /*!
+ * \brief type for deinitialization function
+ *
+ * \param[in] pxPlugin Pointer to the plugin to be deinitialized
+ */
+ typedef void tfctDestroyPlugin(IPlugin* pxPlugin);
+ /*!
+ * \brief type for deinitialization function pointer
+ *
+ * \param[in] pxPlugin Pointer to the plugin to be deinitialized
+ */
+ typedef tfctDestroyPlugin *tpfctDestroyPlugin;
+ /*!
+ * C interface for the factory
+ */
+ tfctCreatePlugin pxCreatePlugin;
+ /*!
+ * C interface for the deinitialization
+ */
+ tfctDestroyPlugin vDestroyPlugin;
+}
+#endif /* PLUGIN_API_H_ */
diff --git a/Master/Masterarbeit/src/common/inc/plugin_api_heap.h b/Master/Masterarbeit/src/common/inc/plugin_api_heap.h
new file mode 100644
index 0000000..5772a96
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/plugin_api_heap.h
@@ -0,0 +1,53 @@
+/*!
+ * \file plugin_api_heap.h
+ * \author S. Eisenhauer
+ * \date 31.08.2011
+ * \brief STL-based interface of a plugin used by \ref CPluginExecutor
+ *
+ * This file defines a interface for plugins to \ref CPluginExecutor.
+ * This interface is based on the STL which uses heap for internal allocations
+ *
+ */
+
+#ifndef PLUGIN_API_H_
+#define PLUGIN_API_H_
+
+#include "global.h"
+#include "interface_manager.h"
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <boost/array.hpp>
+
+struct tstCanTxMessage
+{
+ uint32_t u32TxCycleMilliseconds;
+ uint32_t u32MillisecondCounter;
+ uint32_t u32CanId;
+ uint8_t au8Data[8];
+ uint8_t u8Dlc;
+};
+typedef boost::shared_ptr< tstCanTxMessage > tpstCanTxMessage;
+typedef std::vector< tpstCanTxMessage > tCanTxMessageList;
+
+class IPlugin
+{
+public:
+ virtual void vRun( void ) = 0;
+ virtual tCanTxMessageList& xGetCanTxMessages( void ) = 0;
+ virtual int32_t i32GetCanInterfaceHandle( void ) = 0;
+};
+
+typedef IPlugin* tpxCreatePlugin(
+ IInterfaceManager& xIfMan,
+ int32_t i32Interface,
+ uint32_t u32PluginId
+ );
+typedef void tvDestroyPlugin(IPlugin*);
+
+extern "C"
+{
+ tpxCreatePlugin pxCreatePlugin;
+ tvDestroyPlugin vDestroyPlugin;
+}
+
+#endif /* PLUGIN_API_H_ */
diff --git a/Master/Masterarbeit/src/common/inc/protocol.h b/Master/Masterarbeit/src/common/inc/protocol.h
new file mode 100644
index 0000000..e3e21ef
--- /dev/null
+++ b/Master/Masterarbeit/src/common/inc/protocol.h
@@ -0,0 +1,70 @@
+/*!
+ * \file protocol.h
+ * \author S. Eisenhauer
+ * \date 31.08.2011
+ * \brief Network protocol definition
+ *
+ * This file defines the network protocol used between XORAYA Connect and CanEasy
+ *
+ */
+#ifndef PROTOCOL_H_SEI
+#define PROTOCOL_H_SEI
+
+#include <boost/array.hpp>
+#include "global.h"
+
+/// default IP of the XORAYA connect
+#define nDEFAULT_IP _T("192.168.1.214")
+
+/// network port for communication
+#define nPORT (7010)
+
+/// size of network buffers in bytes
+#define nNETWORK_BUFFSIZE (512)
+
+/*!
+ * \brief type definition for network data buffer
+ */
+typedef boost::array<uint8_t,nNETWORK_BUFFSIZE> tNetworkBuffer;
+
+/*!
+ * \brief Enumeration of Network message types
+ */
+enum tenNetworkMessageType
+{
+ nenReqStartPlugin //!< Request for starting a target plugin
+ ,nenReqStopPlugin //!< Request for stopping a target plugin
+ ,nenReqShutdown //!< Request for shutting down all target components
+ ,nenReqImportLog //!< Request for importing a log file
+ ,nenReqEnumerateLogs //!< Request for enumerating available log files
+ ,nenReqEnumerateInterfaces //!< Request for enumerating hardware interfaces
+ ,nenReqChangeMsgData //!< Request for changing the data of a CAN TX message
+ ,nenReqUploadLogMsg //!< Request with log data
+ ,nenRespStartPlugin //!< Response for a start plugin request
+ ,nenRespStopPlugin //!< Response for a stop plugin request
+ ,nenRespShutdown //!< Response for a shutdown request
+ ,nenRespImportLog //!< Response for a import log request
+ ,nenRespEnumerateLogs //!< Response for a enumerate logs request
+ ,nenRespEnumerateInterfaces //!< Response for a enumerate interfaces request
+ ,nenRespChangeMsgData //!< Response for a change message data request
+ ,nenRespUploadLogMsg //!< Response for a upload log request
+ ,nenRespUnknownReq //!< Response for a unknown request
+ ,nenRespInvalidArg //!< Response for a request with invalid arguments
+ ,nenNumberOfNetworkMessageTypes //!< must be last
+};
+
+/*!
+ * \brief structure of network message header
+ */
+struct tstNetworkMessageHeader
+{
+ tenNetworkMessageType enMessageType; //!< type of the message
+ uint32_t u32MessageLength; //!< total length of network message. less or equal nNETWORK_BUFFSIZE
+};
+
+/// maximum length of the data part in a network message
+/// data size = message size - header size
+#define nNETWORK_DATALENGTH (nNETWORK_BUFFSIZE - sizeof(tstNetworkMessageHeader))
+
+
+#endif /* PROTOCOL_H_SEI */
diff --git a/Master/Masterarbeit/src/common/src/CNetworkStream.cpp b/Master/Masterarbeit/src/common/src/CNetworkStream.cpp
new file mode 100644
index 0000000..98f204d
--- /dev/null
+++ b/Master/Masterarbeit/src/common/src/CNetworkStream.cpp
@@ -0,0 +1,203 @@
+#ifndef CNETWORKSTREAM_H_
+#include <CNetworkStream.h>
+#endif
+
+#include <string.h>
+
+CNetworkInStream::CNetworkInStream(uint8_t* pu8Buffer, uint32_t u32BufferSize)
+:m_pu8CurrentPtr(pu8Buffer),m_pru8StartPtr(pu8Buffer),m_pru8EndPtr(m_pru8StartPtr+u32BufferSize)
+,m_enError(nenStreamOK)
+{
+}
+
+bool CNetworkInStream::boCheck(const uint32_t u32Length)
+{
+ if( m_pu8CurrentPtr+u32Length <= m_pru8EndPtr )
+ {
+ return true;
+ }
+ else
+ {
+ vSetError(nenErrorStreamToShort);
+ return false;
+ }
+}
+
+void CNetworkInStream::vReadInt8(int8_t& i8Val)
+{
+ uint8_t u8Val;
+ vReadUint8(u8Val);
+ i8Val = static_cast<int8_t>(u8Val);
+}
+
+void CNetworkInStream::vReadUint8(uint8_t& u8Val)
+{
+ if( boCheck(1) )
+ {
+ u8Val = *m_pu8CurrentPtr;
+ m_pu8CurrentPtr++;
+ }
+}
+
+void CNetworkInStream::vReadInt32(int32_t& i32Val)
+{
+ uint32_t u32Val;
+ vReadUint32(u32Val);
+ i32Val = static_cast<int32_t>(u32Val);
+}
+
+void CNetworkInStream::vReadUint32(uint32_t& u32Val)
+{
+ uint32_t u32Tmp;
+ uint8_t* pu8Ptr = reinterpret_cast<uint8_t*>(&u32Tmp);
+ vReadUint8(*pu8Ptr);
+ pu8Ptr++;
+ vReadUint8(*pu8Ptr);
+ pu8Ptr++;
+ vReadUint8(*pu8Ptr);
+ pu8Ptr++;
+ vReadUint8(*pu8Ptr);
+ pu8Ptr++;
+ u32Val = BYTE_SWAP32(uint32_t,u32Tmp);
+}
+
+void CNetworkInStream::vReadString(char* pcVal, uint32_t u32Length)
+{
+ if( boCheck(u32Length) )
+ {
+ memcpy(pcVal,m_pu8CurrentPtr,u32Length);
+ m_pu8CurrentPtr += u32Length;
+ }
+}
+
+uint32_t CNetworkInStream::u32GetByteCount() const
+{
+ return static_cast<uint32_t>(m_pu8CurrentPtr-m_pru8StartPtr);
+}
+
+void CNetworkInStream::vSetPosition(const uint32_t u32Offset)
+{
+ if( (m_pru8StartPtr <= (m_pu8CurrentPtr+u32Offset) )
+ && ( (m_pu8CurrentPtr+u32Offset) <= m_pru8EndPtr) )
+ {
+ m_pu8CurrentPtr = m_pru8StartPtr+u32Offset;
+ }
+}
+
+void CNetworkInStream::vSetError(tenStreamError enError)
+{
+ m_enError = enError;
+}
+
+void CNetworkInStream::vGetError(tenStreamError& enError) const
+{
+ enError = m_enError;
+}
+
+bool CNetworkInStream::boIsOK() const
+{
+ return ( m_enError == nenStreamOK );
+}
+
+void CNetworkInStream::vReset()
+{
+ vSetPosition(0);
+ vSetError(nenStreamOK);
+}
+
+CNetworkOutStream::CNetworkOutStream(uint8_t* pu8Buffer, uint32_t u32BufferSize)
+:m_pu8CurrentPtr(pu8Buffer),m_pru8StartPtr(m_pu8CurrentPtr),m_pru8EndPtr(m_pru8StartPtr+u32BufferSize)
+,m_enError(nenStreamOK)
+{
+}
+
+bool CNetworkOutStream::boCheck(const uint32_t u32Length)
+{
+ if( m_pu8CurrentPtr+u32Length <= m_pru8EndPtr )
+ {
+ return true;
+ }
+ else
+ {
+ vSetError(nenErrorStreamToShort);
+ return false;
+ }
+}
+
+void CNetworkOutStream::vWriteInt8(const int8_t i8Val)
+{
+ uint8_t u8Val = static_cast<uint8_t>(i8Val);
+ vWriteUint8(u8Val);
+}
+
+void CNetworkOutStream::vWriteUint8(const uint8_t u8Val)
+{
+ if( boCheck(1) )
+ {
+ *m_pu8CurrentPtr = u8Val;
+ m_pu8CurrentPtr++;
+ }
+}
+
+void CNetworkOutStream::vWriteInt32(const int32_t i32Val)
+{
+ uint32_t u32Val = static_cast<uint32_t>(i32Val);
+ vWriteUint32(u32Val);
+}
+
+void CNetworkOutStream::vWriteUint32(const uint32_t u32Val)
+{
+ uint32_t u32Tmp = BYTE_SWAP32(uint32_t,u32Val);
+ uint8_t* pu8Ptr = reinterpret_cast<uint8_t*>(&u32Tmp);
+ vWriteUint8(*pu8Ptr);
+ pu8Ptr++;
+ vWriteUint8(*pu8Ptr);
+ pu8Ptr++;
+ vWriteUint8(*pu8Ptr);
+ pu8Ptr++;
+ vWriteUint8(*pu8Ptr);
+ pu8Ptr++;
+}
+
+void CNetworkOutStream::vWriteString(const char* pcVal, const uint32_t u32Length)
+{
+ if( boCheck(u32Length) )
+ {
+ memcpy(m_pu8CurrentPtr,pcVal,u32Length);
+ m_pu8CurrentPtr += u32Length;
+ }
+}
+
+uint32_t CNetworkOutStream::u32GetByteCount() const
+{
+ uint32_t u32ByteCount = static_cast<uint32_t>(m_pu8CurrentPtr-m_pru8StartPtr);
+ return u32ByteCount;
+}
+void CNetworkOutStream::vSetPosition(const uint32_t u32Offset)
+{
+ if( (m_pru8StartPtr <= (m_pu8CurrentPtr+u32Offset) )
+ && ( (m_pu8CurrentPtr+u32Offset) <= m_pru8EndPtr) )
+ {
+ m_pu8CurrentPtr = const_cast<uint8_t*>(m_pru8StartPtr)+u32Offset;
+ }
+}
+void CNetworkOutStream::vSetError(tenStreamError enError)
+{
+ m_enError = enError;
+}
+
+void CNetworkOutStream::vGetError(tenStreamError& enError) const
+{
+ enError = m_enError;
+}
+
+bool CNetworkOutStream::boIsOK() const
+{
+ return ( m_enError == nenStreamOK );
+}
+
+void CNetworkOutStream::vReset()
+{
+ vSetPosition(0);
+ vSetError(nenStreamOK);
+}
diff --git a/Master/Masterarbeit/src/common/src/NetworkTypes.cpp b/Master/Masterarbeit/src/common/src/NetworkTypes.cpp
new file mode 100644
index 0000000..da398ad
--- /dev/null
+++ b/Master/Masterarbeit/src/common/src/NetworkTypes.cpp
@@ -0,0 +1,540 @@
+#include <string.h>
+#include <NetworkTypes.h>
+#include <global.h>
+
+CNetworkDatacontainer::CNetworkDatacontainer()
+#ifndef _MSC_VER
+/// target compiler supports initialization of member structs
+:m_stReqUploadLogMsg({{nenReqUploadLogMsg,sizeof(tstNetworkMessageHeader)+sizeof(tstLogMessage)}})
+,m_stRespStartPlugin({{nenRespStartPlugin,8}})
+,m_stRespStopPlugin({{nenRespStopPlugin,8}})
+,m_stRespShutdown({{nenRespShutdown,8}})
+,m_stRespImportLog({{nenRespImportLog,512}})
+,m_stRespEnumerateLogs({{nenRespEnumerateLogs,512}})
+,m_stRespEnumerateInterfaces({{nenRespEnumerateInterfaces,512}})
+,m_stRespChangeMsgData({{nenRespChangeMsgData,8}})
+,m_stRespUnknownReq({{nenRespUnknownReq,8}})
+,m_stRespInvalidArg({{nenRespInvalidArg,8}})
+{}
+#else
+/// host compiler does not support initialization of member structs
+{
+ m_stReqUploadLogMsg.stHeader.enMessageType = nenReqUploadLogMsg;
+ m_stReqUploadLogMsg.stHeader.u32MessageLength = sizeof(tstNetworkMessageHeader)+sizeof(tstLogMessage);
+ m_stRespUploadLogMsg.stHeader.enMessageType = nenRespUploadLogMsg;
+ m_stRespUploadLogMsg.stHeader.u32MessageLength = 8;
+ m_stReqStartPlugin.stHeader.enMessageType = nenReqStartPlugin;
+ m_stReqStartPlugin.stHeader.u32MessageLength = 512;
+ m_stReqStopPlugin.stHeader.enMessageType = nenReqStopPlugin;
+ m_stReqStopPlugin.stHeader.u32MessageLength = 12;
+ m_stReqShutdown.stHeader.enMessageType = nenReqShutdown;
+ m_stReqShutdown.stHeader.u32MessageLength = 8;
+ m_stReqImportLog.stHeader.enMessageType = nenReqImportLog;
+ m_stReqImportLog.stHeader.u32MessageLength = 512;
+ m_stReqEnumerateLogs.stHeader.enMessageType = nenReqEnumerateLogs;
+ m_stReqEnumerateLogs.stHeader.u32MessageLength = 8;
+ m_stReqEnumerateInterfaces.stHeader.enMessageType = nenReqEnumerateInterfaces;
+ m_stReqEnumerateInterfaces.stHeader.u32MessageLength = 8;
+ m_stReqChangeMsgData.stHeader.enMessageType = nenReqChangeMsgData;
+ m_stReqChangeMsgData.stHeader.u32MessageLength = 24;
+ m_stRespUnknownReq.stHeader.enMessageType = nenRespUnknownReq;
+ m_stRespUnknownReq.stHeader.u32MessageLength = 8;
+ m_stRespInvalidArg.stHeader.enMessageType = nenRespInvalidArg;
+ m_stRespInvalidArg.stHeader.u32MessageLength = 8;
+}
+#endif
+void* CNetworkDatacontainer::pvGetVarPtr( tenNetworkMessageType enMsgIdx)
+{
+ switch(enMsgIdx)
+ {
+ case nenReqStartPlugin:
+ return &m_stReqStartPlugin;
+ case nenReqStopPlugin:
+ return &m_stReqStopPlugin;
+ case nenReqEnumerateInterfaces:
+ return &m_stReqEnumerateInterfaces;
+ case nenReqEnumerateLogs:
+ return &m_stReqEnumerateLogs;
+ case nenReqShutdown:
+ return &m_stReqShutdown;
+ case nenReqChangeMsgData:
+ return &m_stReqChangeMsgData;
+ case nenReqUploadLogMsg:
+ return &m_stReqUploadLogMsg;
+ case nenReqImportLog:
+ return &m_stReqImportLog;
+ case nenRespStartPlugin:
+ return &m_stRespStartPlugin;
+ case nenRespStopPlugin:
+ return &m_stRespStopPlugin;
+ case nenRespShutdown:
+ return &m_stRespShutdown;
+ case nenRespImportLog:
+ return &m_stRespImportLog;
+ case nenRespEnumerateLogs:
+ return &m_stRespEnumerateLogs;
+ case nenRespEnumerateInterfaces:
+ return &m_stRespEnumerateInterfaces;
+ case nenRespChangeMsgData:
+ return &m_stRespChangeMsgData;
+ case nenRespUploadLogMsg:
+ return &m_stRespUploadLogMsg;
+ case nenRespUnknownReq:
+ return &m_stRespUnknownReq;
+ case nenRespInvalidArg:
+ return &m_stRespInvalidArg;
+ case nenNumberOfNetworkMessageTypes:
+ return &m_stRxMsg;
+ default:
+ return NULL;
+ };
+ return NULL;
+}
+
+void* CNetworkDatacontainer::pvGetVarPtr(tenNetworkMessageType enMsgIdx, uint8_t u8ElemIdx)
+{
+ switch(enMsgIdx)
+ {
+ case nenReqStartPlugin:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqStartPlugin.stHeader.enMessageType;
+ case 1: return &m_stReqStartPlugin.stHeader.u32MessageLength;
+ case 2: return &m_stReqStartPlugin.i32Interface;
+ case 3: return &m_stReqStartPlugin.acFilename;
+ default: return NULL;
+ }
+ break;
+ case nenReqStopPlugin:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqStopPlugin.stHeader.enMessageType;
+ case 1: return &m_stReqStopPlugin.stHeader.u32MessageLength;
+ case 2: return &m_stReqStopPlugin.i32Interface;
+ default: return NULL;
+ }
+ break;
+ case nenReqEnumerateInterfaces:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqEnumerateInterfaces.stHeader.enMessageType;
+ case 1: return &m_stReqEnumerateInterfaces.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenReqEnumerateLogs:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqEnumerateLogs.stHeader.enMessageType;
+ case 1: return &m_stReqEnumerateLogs.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenReqShutdown:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqShutdown.stHeader.enMessageType;
+ case 1: return &m_stReqShutdown.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenReqImportLog:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqImportLog.stHeader.enMessageType;
+ case 1: return &m_stReqImportLog.stHeader.u32MessageLength;
+ case 2: return &m_stReqImportLog.acFilename;
+ default: return NULL;
+ }
+ break;
+ case nenReqChangeMsgData:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqChangeMsgData.stHeader.enMessageType;
+ case 1: return &m_stReqChangeMsgData.stHeader.u32MessageLength;
+ case 2: return &m_stReqChangeMsgData.i32Interface;
+ case 3: return &m_stReqChangeMsgData.u32CanMsgId;
+ case 4: return &m_stReqChangeMsgData.au8Data[0];
+ case 5: return &m_stReqChangeMsgData.au8Data[1];
+ case 6: return &m_stReqChangeMsgData.au8Data[2];
+ case 7: return &m_stReqChangeMsgData.au8Data[3];
+ case 8: return &m_stReqChangeMsgData.au8Data[4];
+ case 9: return &m_stReqChangeMsgData.au8Data[5];
+ case 10: return &m_stReqChangeMsgData.au8Data[6];
+ case 11: return &m_stReqChangeMsgData.au8Data[7];
+ default: return NULL;
+ }
+ break;
+ case nenReqUploadLogMsg:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stReqUploadLogMsg.stHeader.enMessageType;
+ case 1: return &m_stReqUploadLogMsg.stHeader.u32MessageLength;
+ case 2: return &m_stReqUploadLogMsg.stLogMessage.u32TsHigh;
+ case 3: return &m_stReqUploadLogMsg.stLogMessage.u32TsLow;
+ case 4: return &m_stReqUploadLogMsg.stLogMessage.i32Interface;
+ case 5: return &m_stReqUploadLogMsg.stLogMessage.u32MsgId;
+ case 6: return &m_stReqUploadLogMsg.stLogMessage.au8Data[0];
+ case 7: return &m_stReqUploadLogMsg.stLogMessage.au8Data[1];
+ case 8: return &m_stReqUploadLogMsg.stLogMessage.au8Data[2];
+ case 9: return &m_stReqUploadLogMsg.stLogMessage.au8Data[3];
+ case 10: return &m_stReqUploadLogMsg.stLogMessage.au8Data[4];
+ case 11: return &m_stReqUploadLogMsg.stLogMessage.au8Data[5];
+ case 12: return &m_stReqUploadLogMsg.stLogMessage.au8Data[6];
+ case 13: return &m_stReqUploadLogMsg.stLogMessage.au8Data[7];
+ case 14: return &m_stReqUploadLogMsg.stLogMessage.u8Dir;
+ default: return NULL;
+ }
+ break;
+ case nenRespStartPlugin:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespStartPlugin.stHeader.enMessageType;
+ case 1: return &m_stRespStartPlugin.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenRespStopPlugin:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespStopPlugin.stHeader.enMessageType;
+ case 1: return &m_stRespStopPlugin.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenRespShutdown:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespShutdown.stHeader.enMessageType;
+ case 1: return &m_stRespShutdown.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenRespImportLog:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespImportLog.stHeader.enMessageType;
+ case 1: return &m_stRespImportLog.stHeader.u32MessageLength;
+ case 2: return &m_stRespImportLog.acFilename;
+ default: return NULL;
+ }
+ break;
+ case nenRespEnumerateLogs:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespEnumerateLogs.stHeader.enMessageType;
+ case 1: return &m_stRespEnumerateLogs.stHeader.u32MessageLength;
+ case 2: return &m_stRespEnumerateLogs.acFilenames;
+ default: return NULL;
+ }
+ break;
+ case nenRespEnumerateInterfaces:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespEnumerateInterfaces.stHeader.enMessageType;
+ case 1: return &m_stRespEnumerateInterfaces.stHeader.u32MessageLength;
+ case 2: return &m_stRespEnumerateInterfaces.acInterfaces;
+ default: return NULL;
+ }
+ break;
+ case nenRespChangeMsgData:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespChangeMsgData.stHeader.enMessageType;
+ case 1: return &m_stRespChangeMsgData.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenRespUploadLogMsg:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespUploadLogMsg.stHeader.enMessageType;
+ case 1: return &m_stRespUploadLogMsg.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenRespUnknownReq:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespUnknownReq.stHeader.enMessageType;
+ case 1: return &m_stRespUnknownReq.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenRespInvalidArg:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRespInvalidArg.stHeader.enMessageType;
+ case 1: return &m_stRespInvalidArg.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ case nenNumberOfNetworkMessageTypes:
+ switch(u8ElemIdx)
+ {
+ case 0: return &m_stRxMsg.stHeader.enMessageType;
+ case 1: return &m_stRxMsg.stHeader.u32MessageLength;
+ default: return NULL;
+ }
+ break;
+ default:
+ return NULL;
+ };
+ return NULL;
+}
+
+void CNetworkEnum::vRead(void* pvDest, CNetworkInStream& xStream) const
+{
+ int32_t& i32ActVal = *(reinterpret_cast<int32_t*>(pvDest));
+ xStream.vReadInt32(i32ActVal);
+ if( !boIsValid(i32ActVal) )
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+void CNetworkEnum::vWrite(void* pvSrc, CNetworkOutStream& xStream) const
+{
+ int32_t& i32ActVal = *(reinterpret_cast<int32_t*>(pvSrc));
+ if( boIsValid(i32ActVal) )
+ {
+ xStream.vWriteInt32(i32ActVal);
+ }
+ else
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+bool CNetworkEnum::boIsValid(const int32_t i32Value) const
+{
+ bool boValid = false;
+ if( ( m_i32Min <= i32Value ) && (m_i32Max >= i32Value) )
+ {
+ boValid = true;
+ }
+ return boValid;
+}
+
+void CNetworkUint32::vRead(void* pvDest, CNetworkInStream& xStream) const
+{
+ uint32_t& u32ActVal = *(reinterpret_cast<uint32_t*>(pvDest));
+ xStream.vReadUint32(u32ActVal);
+ if( !boIsValid(u32ActVal) )
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+void CNetworkUint32::vWrite(void* pvSrc, CNetworkOutStream& xStream) const
+{
+ uint32_t& u32ActVal = *(reinterpret_cast<uint32_t*>(pvSrc));
+ if( boIsValid(u32ActVal) )
+ {
+ xStream.vWriteUint32(u32ActVal);
+ }
+ else
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+bool CNetworkUint32::boIsValid(const uint32_t u32Value) const
+{
+ bool boValid = false;
+ if( ( m_u32Min <= u32Value ) && (m_u32Max >= u32Value) )
+ {
+ boValid = true;
+ }
+ return boValid;
+}
+
+void CNetworkInt32::vRead(void* pvDest, CNetworkInStream& xStream) const
+{
+ int32_t& i32ActVal = *(reinterpret_cast<int32_t*>(pvDest));
+ xStream.vReadInt32(i32ActVal);
+ if( !boIsValid(i32ActVal) )
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+void CNetworkInt32::vWrite(void* pvSrc, CNetworkOutStream& xStream) const
+{
+ int32_t& i32ActVal = *(reinterpret_cast<int32_t*>(pvSrc));
+ if( boIsValid(i32ActVal) )
+ {
+ xStream.vWriteInt32(i32ActVal);
+ }
+ else
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+bool CNetworkInt32::boIsValid(const int32_t i32Value) const
+{
+ bool boValid = false;
+ if( ( m_i32Min <= i32Value ) && (m_i32Max >= i32Value) )
+ {
+ boValid = true;
+ }
+ return boValid;
+}
+
+void CNetworkUint8::vRead(void* pvDest, CNetworkInStream& xStream) const
+{
+ uint8_t& u8ActVal = *(reinterpret_cast<uint8_t*>(pvDest));
+ xStream.vReadUint8(u8ActVal);
+ if( !boIsValid(u8ActVal) )
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+void CNetworkUint8::vWrite(void* pvSrc, CNetworkOutStream& xStream) const
+{
+ uint8_t& u8ActVal = *(reinterpret_cast<uint8_t*>(pvSrc));
+ if( boIsValid(u8ActVal) )
+ {
+ xStream.vWriteUint8(u8ActVal);
+ }
+ else
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+bool CNetworkUint8::boIsValid(const uint8_t u8Value) const
+{
+ bool boValid = false;
+ if( ( m_u8Min <= u8Value ) && (m_u8Max >= u8Value) )
+ {
+ boValid = true;
+ }
+ return boValid;
+}
+
+void CNetworkInt8::vRead(void* pvDest, CNetworkInStream& xStream) const
+{
+ int8_t& i8ActVal = *(reinterpret_cast<int8_t*>(pvDest));
+ xStream.vReadInt8(i8ActVal);
+ if( !boIsValid(i8ActVal) )
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+void CNetworkInt8::vWrite(void* pvSrc, CNetworkOutStream& xStream) const
+{
+ int8_t& i8ActVal = *(reinterpret_cast<int8_t*>(pvSrc));
+ if( boIsValid(i8ActVal) )
+ {
+ xStream.vWriteInt8(i8ActVal);
+ }
+ else
+ {
+ xStream.vSetError(nenErrorValueOutOfRange);
+ }
+}
+
+bool CNetworkInt8::boIsValid(const int8_t i8Value) const
+{
+ bool boValid = false;
+ if( ( m_i8Min <= i8Value ) && (m_i8Max >= i8Value) )
+ {
+ boValid = true;
+ }
+ return boValid;
+}
+
+void CNetworkString::vRead(void* pvDest, CNetworkInStream& xStream) const
+{
+ memset(pvDest,0,m_u32Length);
+ xStream.vReadString(reinterpret_cast<char*>(pvDest),m_u32Length);
+}
+
+void CNetworkString::vWrite(void* pvSrc, CNetworkOutStream& xStream) const
+{
+ xStream.vWriteString(reinterpret_cast<char*>(pvSrc),m_u32Length);
+}
+
+void CNetworkRecordProp::vRead(CNetworkDatacontainer& xDatacontainer, CNetworkInStream& xStream) const
+{
+ void* pvSrc;
+ for(uint8_t u8Field = 0; u8Field < m_u8NumOfFields; u8Field++)
+ {
+ const tstTypeInfo* pstTypeInfo = m_apstFieldInfoPtrArray[u8Field];
+ pvSrc = xDatacontainer.pvGetVarPtr(m_enMsgType,u8Field);
+ if(pvSrc) {
+ vInvokeRead(pstTypeInfo,pvSrc,xStream);
+ }
+ }
+}
+
+void CNetworkRecordProp::vWrite(CNetworkDatacontainer& xDatacontainer, CNetworkOutStream& xStream) const
+{
+ void* pvDst;
+ for(uint8_t u8Field = 0; u8Field < m_u8NumOfFields; u8Field++)
+ {
+ const tstTypeInfo* pstTypeInfo = m_apstFieldInfoPtrArray[u8Field];
+ pvDst = xDatacontainer.pvGetVarPtr(m_enMsgType,u8Field);
+ if(pvDst) {
+ vInvokeWrite(pstTypeInfo,pvDst,xStream);
+ }
+ }
+}
+
+void vInvokeRead(const tstTypeInfo* pstObjPtr, void* pvDst, CNetworkInStream& xStream)
+{
+ switch(pstObjPtr->m_enType)
+ {
+ case nenNetworkEnum:
+ (static_cast<const CNetworkEnum*>(pstObjPtr))->vRead(pvDst,xStream);
+ break;
+ case nenNetworkInt8:
+ (static_cast<const CNetworkInt8*>(pstObjPtr))->vRead(pvDst,xStream);
+ break;
+ case nenNetworkUint8:
+ (static_cast<const CNetworkUint8*>(pstObjPtr))->vRead(pvDst,xStream);
+ break;
+ case nenNetworkInt32:
+ (static_cast<const CNetworkInt32*>(pstObjPtr))->vRead(pvDst,xStream);
+ break;
+ case nenNetworkUint32:
+ (static_cast<const CNetworkUint32*>(pstObjPtr))->vRead(pvDst,xStream);
+ break;
+ case nenNetworkString:
+ (static_cast<const CNetworkString*>(pstObjPtr))->vRead(pvDst,xStream);
+ break;
+ default:
+ break;
+ }
+}
+
+void vInvokeWrite(const tstTypeInfo* pstObjPtr, void* pvSrc, CNetworkOutStream& xStream)
+{
+ switch(pstObjPtr->m_enType)
+ {
+ case nenNetworkEnum:
+ (static_cast<const CNetworkEnum*>(pstObjPtr))->vWrite(pvSrc,xStream);
+ break;
+ case nenNetworkInt8:
+ (static_cast<const CNetworkInt8*>(pstObjPtr))->vWrite(pvSrc,xStream);
+ break;
+ case nenNetworkUint8:
+ (static_cast<const CNetworkUint8*>(pstObjPtr))->vWrite(pvSrc,xStream);
+ break;
+ case nenNetworkInt32:
+ (static_cast<const CNetworkInt32*>(pstObjPtr))->vWrite(pvSrc,xStream);
+ break;
+ case nenNetworkUint32:
+ (static_cast<const CNetworkUint32*>(pstObjPtr))->vWrite(pvSrc,xStream);
+ break;
+ case nenNetworkString:
+ (static_cast<const CNetworkString*>(pstObjPtr))->vWrite(pvSrc,xStream);
+ break;
+ default:
+ break;
+ }
+}